Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common: disabling #pragma omp simd on windows debug builds #2834

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/common/dnnl_thread.hpp
Original file line number Diff line number Diff line change
@@ -184,13 +184,18 @@ inline int dnnl_get_current_num_threads() {
#define OMP_GET_NUM_THREADS() 1
#endif

// MSVC still supports omp 2.0 only
#if defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
// Disabling OMP SIMD feature in the following scenarios:
// * For MSVC as it only supports OpenMP 2.0
// * In debug mode on Windows to avoid incorrect code generation
// by Intel(R) oneAPI DPC++/C++ Compiler
#if defined(_MSC_VER) \
&& ((!defined(__clang__) && !defined(__INTEL_COMPILER)) \
|| defined(_DEBUG))
#define collapse(x)
#define PRAGMA_OMP_SIMD(...)
#else
#define PRAGMA_OMP_SIMD(...) PRAGMA_MACRO(CHAIN2(omp, simd __VA_ARGS__))
#endif // defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
#endif // defined(_MSC_VER) && ((!defined(__clang__) && !defined(__INTEL_COMPILER)) || defined(_DEBUG))

namespace dnnl {
namespace impl {