Skip to content

Commit

Permalink
Add CMS_UNROLL_LOOP defines for Intel compilers and use with pragme o…
Browse files Browse the repository at this point in the history
…mp simd instructions that cause internal icc error
  • Loading branch information
gartung committed May 13, 2022
1 parent 056f7ef commit 8326129
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions FWCore/Utilities/interface/CMSUnrollLoop.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
#define CMS_UNROLL_LOOP_COUNT(N) _Pragma(EDM_STRINGIZE(clang loop unroll_count(N)))
#define CMS_UNROLL_LOOP_DISABLE _Pragma(EDM_STRINGIZE(clang loop unroll(disable)))

#elif defined(__INTEL_COMPILER)
// Intel icc compiler
#define CMS_UNROLL_LOOP _Pragma(STRINGIFY(unroll))
#define CMS_UNROLL_LOOP_COUNT(N) _Pragma(STRINGIFY(unroll(N)))
#define CMS_UNROLL_LOOP_DISABLE _Pragma(STRINGIFY(nounroll))

#elif defined(__GNUC__)
// GCC host compiler

Expand Down
6 changes: 6 additions & 0 deletions RecoTracker/MkFitCore/src/PropagationMPlex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -822,16 +822,22 @@ namespace mkfit {
float cosahTmp[NN];
float sinahTmp[NN];
if constexpr (Config::useTrigApprox) {
#ifndef __INTEL_COMPILER
#pragma omp simd
#endif
for (int n = 0; n < NN; ++n) {
sincos4(alpha[n] * 0.5f, sinahTmp[n], cosahTmp[n]);
}
} else {
#ifndef __INTEL_COMPILER
#pragma omp simd
#endif
for (int n = 0; n < NN; ++n) {
cosahTmp[n] = std::cos(alpha[n] * 0.5f);
}
#ifndef __INTEL_COMPILER
#pragma omp simd
#endif
for (int n = 0; n < NN; ++n) {
sinahTmp[n] = std::sin(alpha[n] * 0.5f);
}
Expand Down

0 comments on commit 8326129

Please sign in to comment.