From bcbc0710620ef764376c47f445b6de6170d6e5db Mon Sep 17 00:00:00 2001 From: Sergei Bastrakov Date: Wed, 19 Feb 2020 10:32:14 +0100 Subject: [PATCH] Activate the thread-element switching for the Omp4 backend with CUPLA_KERNEL_OPTI This is now consistent with the Omp2Blocks backend, fixes #156 --- include/cupla/traits/IsThreadSeqAcc.hpp | 16 ++++++++++++++++ include/cupla/types.hpp | 15 +++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/include/cupla/traits/IsThreadSeqAcc.hpp b/include/cupla/traits/IsThreadSeqAcc.hpp index 3d6b89480..405d87fdd 100644 --- a/include/cupla/traits/IsThreadSeqAcc.hpp +++ b/include/cupla/traits/IsThreadSeqAcc.hpp @@ -91,6 +91,22 @@ namespace traits }; #endif +#ifdef ALPAKA_ACC_CPU_BT_OMP4_ENABLED + template< + typename T_KernelDim, + typename T_IndexType + > + struct IsThreadSeqAcc< + ::alpaka::acc::AccCpuOmp4< + T_KernelDim, + T_IndexType + > + > + { + static constexpr bool value = true; + }; +#endif + } // namespace traits } // namespace CUPLA_ACCELERATOR_NAMESPACE } // namespace cupla diff --git a/include/cupla/types.hpp b/include/cupla/types.hpp index 5d2db88f6..838c17f5b 100644 --- a/include/cupla/types.hpp +++ b/include/cupla/types.hpp @@ -130,10 +130,17 @@ inline namespace CUPLA_ACCELERATOR_NAMESPACE #endif #ifdef ALPAKA_ACC_CPU_BT_OMP4_ENABLED - using Acc = ::alpaka::acc::AccCpuOmp4< - KernelDim, - IdxType - >; + #if (CUPLA_NUM_SELECTED_DEVICES == 1) + using Acc = ::alpaka::acc::AccCpuOmp4< + KernelDim, + IdxType + >; + #else + using AccThreadSeq = ::alpaka::acc::AccCpuOmp4< + KernelDim, + IdxType + >; + #endif #endif #endif