Go to the documentation of this file.
10 #ifndef vtk_m_internal_Configure_h
11 #define vtk_m_internal_Configure_h
20 #define VTKM_CUDA_DEVICE_PASS
33 #elif defined(__INTEL_COMPILER)
43 #elif defined(__ibmxl__)
47 #elif defined(__clang__)
52 #elif defined(__MINGW32__)
57 #elif defined(__GNUC__)
64 #if defined(unix) || defined(__unix) || defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
66 # ifdef _POSIX_VERSION
67 # define VTKM_POSIX _POSIX_VERSION
75 #if !defined(VTKM_NO_ASSERT)
79 #if !defined(VTKM_NO_ASSERT_CUDA)
80 #define VTKM_NO_ASSERT_CUDA
83 #if !defined(VTKM_NO_ASSERT_HIP)
84 #define VTKM_NO_ASSERT_HIP
87 #if !defined(VTKM_USE_DOUBLE_PRECISION) && !defined(VTKM_NO_DOUBLE_PRECISION)
91 #if defined(VTKM_USE_DOUBLE_PRECISION) && defined(VTKM_NO_DOUBLE_PRECISION)
92 # error Both VTKM_USE_DOUBLE_PRECISION and VTKM_NO_DOUBLE_PRECISION defined. Do not know what to do.
95 #if !defined(VTKM_USE_64BIT_IDS) && !defined(VTKM_NO_64BIT_IDS)
96 #define VTKM_USE_64BIT_IDS
99 #if defined(VTKM_USE_64BIT_IDS) && defined(VTKM_NO_64BIT_IDS)
100 # error Both VTKM_USE_64BIT_IDS and VTKM_NO_64BIT_IDS defined. Do not know what to do.
103 #define VTKM_SIZE_LONG 8
104 #define VTKM_SIZE_LONG_LONG 8
107 #ifndef VTKM_ALLOCATION_ALIGNMENT
108 #define VTKM_ALLOCATION_ALIGNMENT 64
115 #if (defined(VTKM_GCC) || defined(VTKM_CLANG))
117 #define VTK_M_THIRDPARTY_GENERAL_WARNING_PRAGMAS \
118 _Pragma("GCC diagnostic ignored \"-Wconversion\"") \
119 _Pragma("GCC diagnostic ignored \"-Wshadow\"") \
120 _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"")
123 #if defined(VTKM_GCC)
124 #define VTK_M_THIRDPARTY_GCC_WARNING_PRAGMAS \
125 _Pragma("GCC diagnostic ignored \"-Wunused-but-set-variable\"") \
126 _Pragma("GCC diagnostic ignored \"-Wunused-variable\"")
128 #define VTK_M_THIRDPARTY_GCC_WARNING_PRAGMAS
132 #if defined(VTKM_CLANG) && (__apple_build_version__ >= 7000072)
138 #define VTK_M_THIRDPARTY_CLANG_WARNING_PRAGMAS \
139 _Pragma("GCC diagnostic ignored \"-Wunused-local-typedef\"") \
140 _Pragma("GCC diagnostic ignored \"-Wnon-virtual-dtor\"") \
141 _Pragma("GCC diagnostic ignored \"-Wdeprecated\"")
142 _Pragma(
"GCC diagnostic ignored \"-Wunused-template\"")
143 #elif defined(VTKM_CLANG) && defined(__ibmxl__)
144 #define VTK_M_THIRDPARTY_CLANG_WARNING_PRAGMAS \
145 _Pragma("GCC diagnostic ignored \"-Wnon-virtual-dtor\"") \
146 _Pragma("GCC diagnostic ignored \"-Wdeprecated\"")
147 #elif defined(VTKM_CLANG)
148 #define VTK_M_THIRDPARTY_CLANG_WARNING_PRAGMAS \
149 _Pragma("GCC diagnostic ignored \"-Wnon-virtual-dtor\"") \
150 _Pragma("GCC diagnostic ignored \"-Wdeprecated\"")
151 _Pragma(
"GCC diagnostic ignored \"-Wunused-template\"")
153 #define VTK_M_THIRDPARTY_CLANG_WARNING_PRAGMAS
158 #if defined(VTKM_GCC) && (__GNUC__ == 4 && __GNUC_MINOR__ < 6)
159 #define VTK_M_THIRDPARTY_WARNINGS_PUSH
160 #define VTK_M_THRIDPARTY_WARNINGS_POP
162 #define VTK_M_THIRDPARTY_WARNINGS_PUSH _Pragma("GCC diagnostic push")
163 #define VTK_M_THRIDPARTY_WARNINGS_POP _Pragma("GCC diagnostic pop")
166 #define VTKM_THIRDPARTY_PRE_INCLUDE \
167 VTK_M_THIRDPARTY_WARNINGS_PUSH \
168 VTK_M_THIRDPARTY_GENERAL_WARNING_PRAGMAS \
169 VTK_M_THIRDPARTY_GCC_WARNING_PRAGMAS \
170 VTK_M_THIRDPARTY_CLANG_WARNING_PRAGMAS
171 #define VTKM_THIRDPARTY_POST_INCLUDE \
172 VTK_M_THRIDPARTY_WARNINGS_POP
174 #elif (defined(VTKM_MSVC))
175 #define VTKM_THIRDPARTY_PRE_INCLUDE \
176 __pragma(warning(push)) \
177 __pragma(warning(disable:4100)) \
178 __pragma(warning(disable:4127)) \
179 __pragma(warning(disable:4201)) \
180 __pragma(warning(disable:4244)) \
181 __pragma(warning(disable:4267)) \
182 __pragma(warning(disable:4324)) \
183 __pragma(warning(disable:4510)) \
184 __pragma(warning(disable:4512)) \
185 __pragma(warning(disable:4515)) \
186 __pragma(warning(disable:4610)) \
187 __pragma(warning(disable:4800))
188 #define VTKM_THIRDPARTY_POST_INCLUDE \
189 __pragma(warning(pop))
191 #define VTKM_THIRDPARTY_PRE_INCLUDE
192 #define VTKM_THIRDPARTY_POST_INCLUDE
196 #if defined(__GLIBCXX__) && \
197 (__GLIBCXX__ < 20150422 || __GLIBCXX__ == 20160726 || __GLIBCXX__ == 20150626 || \
198 __GLIBCXX__ == 20150623)
215 #define VTKM_USING_GLIBCXX_4
224 #if ( defined(VTKM_GCC) && ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9) ) ) || \
225 ( defined(VTKM_ICC) && (__INTEL_COMPILER >= 1500) ) || \
226 ( defined(VTKM_CLANG) && defined(__apple_build_version__) && (__apple_build_version__ >= 7000000) ) || \
227 ( defined(VTKM_CLANG) && !defined(__apple_build_version__) && (__clang_major__ > 3) ) || \
228 ( defined(VTKM_CLANG) && !defined(__apple_build_version__) && (__clang_major__ == 3 && __clang_minor__ >= 5) )
229 #define VTKM_COMPILER_SUPPORTS_VECTOR_PRAGMAS 1
239 #if defined(VTKM_COMPILER_SUPPORTS_VECTOR_PRAGMAS) &&\
240 defined(VTKM_VECTORIZATION_ENABLED)
241 #if defined(VTKM_CLANG)
243 #define VTKM_VECTORIZATION_PRE_LOOP \
244 _Pragma("clang loop vectorize(enable) interleave(enable)")
245 #define VTKM_VECTORIZATION_IN_LOOP
246 #elif defined(VTKM_ICC) && defined(NDEBUG)
261 #define VTKM_VECTORIZATION_PRE_LOOP
262 #define VTKM_VECTORIZATION_IN_LOOP
263 #elif defined(VTKM_GCC)
265 #define VTKM_VECTORIZATION_PRE_LOOP \
267 #define VTKM_VECTORIZATION_IN_LOOP
270 #define VTKM_VECTORIZATION_PRE_LOOP
271 #define VTKM_VECTORIZATION_IN_LOOP
275 #define VTKM_VECTORIZATION_PRE_LOOP
276 #define VTKM_VECTORIZATION_IN_LOOP
280 #ifndef VTKM_ENABLE_CUDA
284 #ifndef VTKM_ENABLE_TBB
285 #define VTKM_ENABLE_TBB
288 #ifndef VTKM_ENABLE_OPENMP
289 #define VTKM_ENABLE_OPENMP
292 #ifndef VTKM_ENABLE_KOKKOS
296 #ifndef VTKM_KOKKOS_CUDA
300 #ifndef VTKM_KOKKOS_HIP
304 #if defined(VTKM_KOKKOS_HIP) || defined(VTKM_KOKKOS_CUDA)
309 #define VTKM_ENABLE_MPI
317 #ifdef VTKM_ENABLE_CUDA
318 #define VTKM_CUDA_VERSION_MAJOR
319 #define VTKM_CUDA_VERSION_MINOR
322 #if __cplusplus >= 201402L || \
323 ( defined(VTKM_MSVC) && _MSC_VER >= 1910 ) || \
324 ( defined(VTKM_ICC) && defined(__INTEL_CXX11_MODE__) )
325 #define VTKM_HAVE_CXX_14
327 #error "VTK-m requires at least a C++14 compiler"
331 #define VTKM_ENABLE_LOGGING
344 #define VTKM_SWALLOW_SEMICOLON_PRE_BLOCK \
345 __pragma(warning(push)) \
346 __pragma(warning(disable:4127)) \
348 #define VTKM_SWALLOW_SEMICOLON_POST_BLOCK \
350 __pragma(warning(pop))
351 #else // not VTKM_MSVC
352 #define VTKM_SWALLOW_SEMICOLON_PRE_BLOCK \
354 #define VTKM_SWALLOW_SEMICOLON_POST_BLOCK \
364 #define VTKM_PASS_COMMAS(...) __VA_ARGS__
394 #define VTKM_EXPAND(expr) expr
400 #pragma warning(disable:4503)
410 #pragma warning(disable:4251)
419 #if !defined(VTKM_FALLTHROUGH) && defined(__has_cpp_attribute)
420 # if __cplusplus >= 201703L && __has_cpp_attribute(fallthrough)
421 # define VTKM_FALLTHROUGH [[fallthrough]]
422 # elif __cplusplus >= 201103L && __has_cpp_attribute(gnu::fallthrough)
423 # define VTKM_FALLTHROUGH [[gnu::fallthrough]]
424 # elif __cplusplus >= 201103L && __has_cpp_attribute(clang::fallthrough)
425 # define VTKM_FALLTHROUGH [[clang::fallthrough]]
429 #ifndef VTKM_FALLTHROUGH
430 # define VTKM_FALLTHROUGH ((void)0)
433 #endif //vtkm_internal_Configure_h