diff --git a/include/alpaka/acc/AccCpuOmp2Blocks.hpp b/include/alpaka/acc/AccCpuOmp2Blocks.hpp index df52d90d03b..27661f58432 100644 --- a/include/alpaka/acc/AccCpuOmp2Blocks.hpp +++ b/include/alpaka/acc/AccCpuOmp2Blocks.hpp @@ -189,6 +189,13 @@ namespace alpaka TKernelFnObj const& kernelFnObj, TArgs&&... args) { + if(workDiv.m_blockThreadExtent.prod() != static_cast(1u)) + { + throw std::runtime_error( + "The given work division is not valid for a single thread Acc: " + + getAccName>() + ". Threads per block should be 1!"); + } + return TaskKernelCpuOmp2Blocks( workDiv, kernelFnObj, diff --git a/include/alpaka/acc/AccCpuSerial.hpp b/include/alpaka/acc/AccCpuSerial.hpp index 4a4e8f0621a..e1b223f8915 100644 --- a/include/alpaka/acc/AccCpuSerial.hpp +++ b/include/alpaka/acc/AccCpuSerial.hpp @@ -182,6 +182,13 @@ namespace alpaka TKernelFnObj const& kernelFnObj, TArgs&&... args) { + if(workDiv.m_blockThreadExtent.prod() != static_cast(1u)) + { + throw std::runtime_error( + "The given work division is not valid for a single thread Acc: " + + getAccName>() + ". Threads per block should be 1!"); + } + return TaskKernelCpuSerial( workDiv, kernelFnObj, diff --git a/include/alpaka/acc/AccCpuTbbBlocks.hpp b/include/alpaka/acc/AccCpuTbbBlocks.hpp index 1d2c7aec5a5..d283523e7a5 100644 --- a/include/alpaka/acc/AccCpuTbbBlocks.hpp +++ b/include/alpaka/acc/AccCpuTbbBlocks.hpp @@ -183,6 +183,13 @@ namespace alpaka TKernelFnObj const& kernelFnObj, TArgs&&... args) { + if(workDiv.m_blockThreadExtent.prod() != static_cast(1u)) + { + throw std::runtime_error( + "The given work division is not valid for a single thread Acc: " + + getAccName>() + ". Threads per block should be 1!"); + } + return TaskKernelCpuTbbBlocks( workDiv, kernelFnObj, diff --git a/include/alpaka/kernel/TaskKernelCpuOmp2Blocks.hpp b/include/alpaka/kernel/TaskKernelCpuOmp2Blocks.hpp index d1e5f4b0574..d3e1d396ddd 100644 --- a/include/alpaka/kernel/TaskKernelCpuOmp2Blocks.hpp +++ b/include/alpaka/kernel/TaskKernelCpuOmp2Blocks.hpp @@ -826,10 +826,6 @@ namespace alpaka // The number of blocks in the grid. TIdx const numBlocksInGrid(gridBlockExtent.prod()); - if(blockThreadExtent.prod() != static_cast(1u)) - { - throw std::runtime_error("Only one thread per block allowed in the OpenMP 2.0 block accelerator!"); - } // Get the OpenMP schedule information for the given kernel and parameter types auto const schedule = std::apply( diff --git a/include/alpaka/kernel/TaskKernelCpuSerial.hpp b/include/alpaka/kernel/TaskKernelCpuSerial.hpp index 2889ac3d2a1..a9a370d1cbb 100644 --- a/include/alpaka/kernel/TaskKernelCpuSerial.hpp +++ b/include/alpaka/kernel/TaskKernelCpuSerial.hpp @@ -79,11 +79,6 @@ namespace alpaka *static_cast const*>(this), blockSharedMemDynSizeBytes); - if(blockThreadExtent.prod() != static_cast(1u)) - { - throw std::runtime_error("A block for the serial accelerator can only ever have one single thread!"); - } - // Execute the blocks serially. meta::ndLoopIncIdx( gridBlockExtent, diff --git a/include/alpaka/kernel/TaskKernelCpuTbbBlocks.hpp b/include/alpaka/kernel/TaskKernelCpuTbbBlocks.hpp index 0bc578ccc5a..4ca90dd5d3f 100644 --- a/include/alpaka/kernel/TaskKernelCpuTbbBlocks.hpp +++ b/include/alpaka/kernel/TaskKernelCpuTbbBlocks.hpp @@ -83,11 +83,6 @@ namespace alpaka // The number of blocks in the grid. TIdx const numBlocksInGrid = gridBlockExtent.prod(); - if(blockThreadExtent.prod() != static_cast(1u)) - { - throw std::runtime_error("A block for the TBB accelerator can only ever have one single thread!"); - } - tbb::this_task_arena::isolate( [&] {