-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,13 +60,15 @@ | |
// the actual GCC version on the system. | ||
#define _PSTL_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) | ||
|
||
#if __clang__ | ||
#if defined(__clang__) | ||
// according to clang documentation, version can be vendor specific | ||
# define _PSTL_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) | ||
#endif | ||
|
||
// Enable SIMD for compilers that support OpenMP 4.0 | ||
#if (_OPENMP >= 201307) || (__INTEL_COMPILER >= 1600) || (!defined(__INTEL_COMPILER) && _PSTL_GCC_VERSION >= 40900) || \ | ||
#if (defined(_OPENMP) && _OPENMP >= 201307) || \ | ||
(defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1600) || \ | ||
(!defined(__INTEL_COMPILER) && _PSTL_GCC_VERSION >= 40900) || \ | ||
defined(__clang__) | ||
# define _PSTL_PRAGMA_SIMD _PSTL_PRAGMA(omp simd) | ||
# define _PSTL_PRAGMA_DECLARE_SIMD _PSTL_PRAGMA(omp declare simd) | ||
|
@@ -81,13 +83,13 @@ | |
# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM) | ||
#endif //Enable SIMD | ||
|
||
#if (__INTEL_COMPILER) | ||
#if defined(__INTEL_COMPILER) | ||
# define _PSTL_PRAGMA_FORCEINLINE _PSTL_PRAGMA(forceinline) | ||
#else | ||
# define _PSTL_PRAGMA_FORCEINLINE | ||
#endif | ||
|
||
#if (__INTEL_COMPILER >= 1900) | ||
#if defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1900 | ||
# define _PSTL_PRAGMA_SIMD_SCAN(PRM) _PSTL_PRAGMA(omp simd reduction(inscan, PRM)) | ||
# define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan inclusive(PRM)) | ||
# define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan exclusive(PRM)) | ||
|
@@ -100,32 +102,47 @@ | |
// Should be defined to 1 for environments with a vendor implementation of C++17 execution policies | ||
#define _PSTL_CPP17_EXECUTION_POLICIES_PRESENT (_MSC_VER >= 1912) | ||
|
||
#define _PSTL_CPP14_2RANGE_MISMATCH_EQUAL_PRESENT \ | ||
(_MSC_VER >= 1900 || __cplusplus >= 201300L || __cpp_lib_robust_nonmodifying_seq_ops == 201304) | ||
#define _PSTL_CPP14_MAKE_REVERSE_ITERATOR_PRESENT \ | ||
(_MSC_VER >= 1900 || __cplusplus >= 201402L || __cpp_lib_make_reverse_iterator == 201402) | ||
#define _PSTL_CPP14_INTEGER_SEQUENCE_PRESENT (_MSC_VER >= 1900 || __cplusplus >= 201402L) | ||
#define _PSTL_CPP14_VARIABLE_TEMPLATES_PRESENT \ | ||
(!__INTEL_COMPILER || __INTEL_COMPILER >= 1700) && (_MSC_FULL_VER >= 190023918 || __cplusplus >= 201402L) | ||
#if (defined(_MSC_VER) && _MSC_VER >= 1900) || \ | ||
__cplusplus >= 201300L || \ | ||
__cpp_lib_robust_nonmodifying_seq_ops == 201304 | ||
# define _PSTL_CPP14_2RANGE_MISMATCH_EQUAL_PRESENT | ||
#endif | ||
#if (defined(_MSC_VER) && _MSC_VER >= 1900) || \ | ||
__cplusplus >= 201402L || \ | ||
__cpp_lib_make_reverse_iterator == 201402 | ||
# define _PSTL_CPP14_MAKE_REVERSE_ITERATOR_PRESENT | ||
#endif | ||
#if (defined(_MSC_VER) && _MSC_VER >= 1900) || __cplusplus >= 201402L | ||
# define _PSTL_CPP14_INTEGER_SEQUENCE_PRESENT | ||
#endif | ||
#if (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700) || \ | ||
(defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918) || \ | ||
__cplusplus >= 201402L | ||
# define _PSTL_CPP14_VARIABLE_TEMPLATES_PRESENT | ||
#endif | ||
|
||
#define _PSTL_EARLYEXIT_PRESENT (__INTEL_COMPILER >= 1800) | ||
#define _PSTL_MONOTONIC_PRESENT (__INTEL_COMPILER >= 1800) | ||
#if defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1800 | ||
# define _PSTL_EARLYEXIT_PRESENT | ||
# define _PSTL_MONOTONIC_PRESENT | ||
#endif | ||
|
||
#if (__INTEL_COMPILER >= 1900 || !defined(__INTEL_COMPILER) && _PSTL_GCC_VERSION >= 40900 || _OPENMP >= 201307) | ||
# define _PSTL_UDR_PRESENT 1 | ||
#else | ||
# define _PSTL_UDR_PRESENT 0 | ||
#if (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1900) || \ | ||
(!defined(__INTEL_COMPILER) && _PSTL_GCC_VERSION >= 40900) || \ | ||
(defined(_OPENMP) && _OPENMP >= 201307) | ||
# define _PSTL_UDR_PRESENT | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ldionne
Author
Member
|
||
#endif | ||
|
||
#define _PSTL_UDS_PRESENT (__INTEL_COMPILER >= 1900 && __INTEL_COMPILER_BUILD_DATE >= 20180626) | ||
#if defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1900 && __INTEL_COMPILER_BUILD_DATE >= 20180626 | ||
# define _PSTL_UDS_PRESENT | ||
#endif | ||
|
||
#if _PSTL_EARLYEXIT_PRESENT | ||
#if defined(_PSTL_EARLYEXIT_PRESENT) | ||
# define _PSTL_PRAGMA_SIMD_EARLYEXIT _PSTL_PRAGMA(omp simd early_exit) | ||
#else | ||
# define _PSTL_PRAGMA_SIMD_EARLYEXIT | ||
#endif | ||
|
||
#if _PSTL_MONOTONIC_PRESENT | ||
#if defined(_PSTL_MONOTONIC_PRESENT) | ||
# define _PSTL_PRAGMA_SIMD_ORDERED_MONOTONIC(PRM) _PSTL_PRAGMA(omp ordered simd monotonic(PRM)) | ||
# define _PSTL_PRAGMA_SIMD_ORDERED_MONOTONIC_2ARGS(PRM1, PRM2) _PSTL_PRAGMA(omp ordered simd monotonic(PRM1, PRM2)) | ||
#else | ||
|
@@ -143,7 +160,7 @@ | |
#define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP) \ | ||
_PSTL_PRAGMA(omp declare reduction(NAME:OP : omp_out(omp_in)) initializer(omp_priv = omp_orig)) | ||
|
||
#if (__INTEL_COMPILER >= 1600) | ||
#if defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1600 | ||
# define _PSTL_PRAGMA_VECTOR_UNALIGNED _PSTL_PRAGMA(vector unaligned) | ||
#else | ||
# define _PSTL_PRAGMA_VECTOR_UNALIGNED | ||
|
@@ -156,15 +173,15 @@ | |
# define _PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED | ||
#endif | ||
|
||
#if _MSC_VER || __INTEL_COMPILER //the preprocessors don't type a message location | ||
#if defined(_MSC_VER) || defined(__INTEL_COMPILER) // the preprocessors don't type a message location | ||
# define _PSTL_PRAGMA_LOCATION __FILE__ ":" _PSTL_STRING(__LINE__) ": [Parallel STL message]: " | ||
#else | ||
# define _PSTL_PRAGMA_LOCATION " [Parallel STL message]: " | ||
#endif | ||
|
||
#define _PSTL_PRAGMA_MESSAGE_IMPL(x) _PSTL_PRAGMA(message(_PSTL_STRING_CONCAT(_PSTL_PRAGMA_LOCATION, x))) | ||
|
||
#if _PSTL_USAGE_WARNINGS | ||
#if defined(_PSTL_USAGE_WARNINGS) | ||
# define _PSTL_PRAGMA_MESSAGE(x) _PSTL_PRAGMA_MESSAGE_IMPL(x) | ||
# define _PSTL_PRAGMA_MESSAGE_POLICIES(x) _PSTL_PRAGMA_MESSAGE_IMPL(x) | ||
#else | ||
|
@@ -173,8 +190,13 @@ | |
#endif | ||
|
||
// broken macros | ||
#define _PSTL_CPP11_STD_ROTATE_BROKEN ((__GLIBCXX__ && __GLIBCXX__ < 20150716) || (_MSC_VER && _MSC_VER < 1800)) | ||
#if (defined(__GLIBCXX__) && __GLIBCXX__ < 20150716) || \ | ||
(defined(_MSC_VER) && _MSC_VER < 1800) | ||
# define _PSTL_CPP11_STD_ROTATE_BROKEN | ||
#endif | ||
|
||
#define _PSTL_ICC_18_OMP_SIMD_BROKEN (__INTEL_COMPILER == 1800) | ||
#if defined(__INTEL_COMPILER) && __INTEL_COMPILER == 1800 | ||
# define _PSTL_ICC_18_OMP_SIMD_BROKEN | ||
#endif | ||
|
||
#endif /* _PSTL_CONFIG_H */ |
Changing how these macros are defined was not required to fix the uses of these macros that cause
-Wundef
warnings, but causes other problems downstream: oneapi-src/oneDPL#1602