Skip to content

[SYCL][CUDA] Bug fix: non-uniform work-groups error on CUDA #2857

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

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 4 additions & 2 deletions sycl/include/CL/sycl/ONEAPI/reduction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,8 @@ reduAuxCGFuncImpl(handler &CGH, size_t NWorkItems, size_t NWorkGroups,

bool IsUpdateOfUserVar =
Reduction::accessor_mode == access::mode::read_write && NWorkGroups == 1;
nd_range<1> Range{range<1>(NWorkItems), range<1>(WGSize)};
size_t NWorkItemsExt = ((NWorkItems + WGSize - 1) / WGSize) * WGSize;
nd_range<1> Range{range<1>(NWorkItemsExt), range<1>(WGSize)};
CGH.parallel_for<Name>(Range, [=](nd_item<1> NDIt) {
typename Reduction::binary_operation BOp;
size_t WGID = NDIt.get_group_linear_id();
Expand Down Expand Up @@ -936,7 +937,8 @@ reduAuxCGFuncImpl(handler &CGH, size_t NWorkItems, size_t NWorkGroups,
auto BOp = Redu.getBinaryOperation();
using Name = typename get_reduction_aux_kernel_name_t<
KernelName, KernelType, Reduction::is_usm, UniformPow2WG, OutputT>::name;
nd_range<1> Range{range<1>(NWorkItems), range<1>(WGSize)};
size_t NWorkItemsExt = ((NWorkItems + WGSize - 1) / WGSize) * WGSize;
nd_range<1> Range{range<1>(NWorkItemsExt), range<1>(WGSize)};
CGH.parallel_for<Name>(Range, [=](nd_item<1> NDIt) {
size_t WGSize = NDIt.get_local_range().size();
size_t LID = NDIt.get_local_linear_id();
Expand Down