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

Single thread acc throw for invalid workdiv fix #2391

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions include/alpaka/acc/AccCpuOmp2Blocks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ namespace alpaka
TKernelFnObj const& kernelFnObj,
TArgs&&... args)
{
if(workDiv.m_blockThreadExtent.prod() != static_cast<TIdx>(1u))
ikbuibui marked this conversation as resolved.
Show resolved Hide resolved
{
throw std::runtime_error(
"The given work division is not valid for a single thread Acc: "
+ getAccName<AccCpuOmp2Blocks<TDim, TIdx>>() + ". Threads per block should be 1!");
}

return TaskKernelCpuOmp2Blocks<TDim, TIdx, TKernelFnObj, TArgs...>(
workDiv,
kernelFnObj,
Expand Down
7 changes: 7 additions & 0 deletions include/alpaka/acc/AccCpuSerial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ namespace alpaka
TKernelFnObj const& kernelFnObj,
TArgs&&... args)
{
if(workDiv.m_blockThreadExtent.prod() != static_cast<TIdx>(1u))
{
throw std::runtime_error(
"The given work division is not valid for a single thread Acc: "
+ getAccName<AccCpuSerial<TDim, TIdx>>() + ". Threads per block should be 1!");
}

return TaskKernelCpuSerial<TDim, TIdx, TKernelFnObj, TArgs...>(
workDiv,
kernelFnObj,
Expand Down
7 changes: 7 additions & 0 deletions include/alpaka/acc/AccCpuTbbBlocks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,13 @@ namespace alpaka
TKernelFnObj const& kernelFnObj,
TArgs&&... args)
{
if(workDiv.m_blockThreadExtent.prod() != static_cast<TIdx>(1u))
{
throw std::runtime_error(
"The given work division is not valid for a single thread Acc: "
+ getAccName<AccCpuTbbBlocks<TDim, TIdx>>() + ". Threads per block should be 1!");
}

return TaskKernelCpuTbbBlocks<TDim, TIdx, TKernelFnObj, TArgs...>(
workDiv,
kernelFnObj,
Expand Down
Loading