All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Vectorization.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_SYSTEM_VECTORIZATION_H_
23 #define _BLAZE_SYSTEM_VECTORIZATION_H_
24 
25 //*************************************************************************************************
26 // Includes
27 //*************************************************************************************************
28 
31 
32 
33 
34 
35 //=================================================================================================
36 //
37 // SSE/AVX/MIC MODE CONFIGURATION
38 //
39 //=================================================================================================
40 
41 //*************************************************************************************************
50 #if BLAZE_USE_VECTORIZATION && ( defined(__SSE__) || ( _M_IX86_FP > 0 ) )
51 # define BLAZE_SSE_MODE 1
52 #else
53 # define BLAZE_SSE_MODE 0
54 #endif
55 //*************************************************************************************************
56 
57 
58 //*************************************************************************************************
67 #if BLAZE_USE_VECTORIZATION && ( defined(__SSE2__) || ( _M_IX86_FP > 1 ) )
68 # define BLAZE_SSE2_MODE 1
69 #else
70 # define BLAZE_SSE2_MODE 0
71 #endif
72 //*************************************************************************************************
73 
74 
75 //*************************************************************************************************
84 #if BLAZE_USE_VECTORIZATION && defined(__SSE3__)
85 # define BLAZE_SSE3_MODE 1
86 #else
87 # define BLAZE_SSE3_MODE 0
88 #endif
89 //*************************************************************************************************
90 
91 
92 //*************************************************************************************************
101 #if BLAZE_USE_VECTORIZATION && defined(__SSSE3__)
102 # define BLAZE_SSSE3_MODE 1
103 #else
104 # define BLAZE_SSSE3_MODE 0
105 #endif
106 //*************************************************************************************************
107 
108 
109 //*************************************************************************************************
118 #if BLAZE_USE_VECTORIZATION && ( defined(__SSE4_2__) || defined(__SSE4_1__) )
119 # define BLAZE_SSE4_MODE 1
120 #else
121 # define BLAZE_SSE4_MODE 0
122 #endif
123 //*************************************************************************************************
124 
125 
126 //*************************************************************************************************
135 #if BLAZE_USE_VECTORIZATION && defined(__AVX__)
136 # define BLAZE_AVX_MODE 1
137 #else
138 # define BLAZE_AVX_MODE 0
139 #endif
140 //*************************************************************************************************
141 
142 
143 //*************************************************************************************************
152 #if BLAZE_USE_VECTORIZATION && defined(__AVX2__)
153 # define BLAZE_AVX2_MODE 1
154 #else
155 # define BLAZE_AVX2_MODE 0
156 #endif
157 //*************************************************************************************************
158 
159 
160 //*************************************************************************************************
169 #if BLAZE_USE_VECTORIZATION && defined(__MIC__)
170 # define BLAZE_MIC_MODE 1
171 #else
172 # define BLAZE_MIC_MODE 0
173 #endif
174 //*************************************************************************************************
175 
176 
177 
178 
179 //=================================================================================================
180 //
181 // COMPILE TIME CONSTRAINTS
182 //
183 //=================================================================================================
184 
185 //*************************************************************************************************
187 namespace {
188 
195 
196 }
198 //*************************************************************************************************
199 
200 
201 
202 
203 //=================================================================================================
204 //
205 // SSE/AVX/MIC INCLUDE FILE CONFIGURATION
206 //
207 //=================================================================================================
208 
209 #if BLAZE_MIC_MODE || BLAZE_AVX_MODE || BLAZE_AVX2_MODE
210 # include <immintrin.h>
211 #elif BLAZE_SSE4_MODE
212 # include <smmintrin.h>
213 #elif BLAZE_SSSE3_MODE
214 # include <tmmintrin.h>
215 #elif BLAZE_SSE3_MODE
216 # include <pmmintrin.h>
217 #elif BLAZE_SSE2_MODE
218 # include <emmintrin.h>
219 #elif BLAZE_SSE_MODE
220 # include <xmmintrin.h>
221 #endif
222 
223 #endif