Skip to content

Commit 7ea6c30

Browse files
authored
Align pragma conditionals in onedal and daal (#3433)
1 parent bb876b3 commit 7ea6c30

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

cpp/oneapi/dal/backend/common.hpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,19 @@
3030
#define PRAGMA_TO_STR_(ARGS) PRAGMA_TO_STR(ARGS)
3131

3232
#if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER)
33-
#define PRAGMA_IVDEP _Pragma("ivdep")
34-
#define PRAGMA_NOVECTOR _Pragma("novector")
35-
#define PRAGMA_VECTOR_UNALIGNED _Pragma("vector unaligned")
33+
#define PRAGMA_IVDEP _Pragma("ivdep")
34+
#define PRAGMA_NOVECTOR _Pragma("novector")
35+
#define PRAGMA_VECTOR_UNALIGNED _Pragma("vector unaligned")
36+
// TODO: Temporary workaround. icx fails to vectorize some loops in debug build on Windows or with gcov.
37+
#if (defined(_MSC_VER) && defined(_DEBUG)) || defined(GCOV_BUILD)
38+
#define PRAGMA_VECTOR_ALWAYS
39+
#define PRAGMA_OMP_SIMD
40+
#define PRAGMA_OMP_SIMD_ARGS(ARGS)
41+
#else
3642
#define PRAGMA_VECTOR_ALWAYS _Pragma("vector always")
3743
#define PRAGMA_OMP_SIMD PRAGMA_TO_STR(omp simd)
3844
#define PRAGMA_OMP_SIMD_ARGS(ARGS) PRAGMA_TO_STR_(omp simd ARGS)
45+
#endif
3946
#elif defined(__GNUC__) || defined(__clang__)
4047
#define PRAGMA_IVDEP _Pragma("ivdep")
4148
#define PRAGMA_NOVECTOR

0 commit comments

Comments
 (0)