Skip to content

Commit

Permalink
Merge pull request #830 from jiezzhang/jiezzhang/fix_scan_linear_id
Browse files Browse the repository at this point in the history
Compute group local linear id correctly
  • Loading branch information
bader authored Nov 9, 2023
2 parents dd0283b + d49e2a4 commit f36daa4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/group_functions/group_scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ void check_scan_over_group(sycl::queue& queue, sycl::range<D> range, OpT op,
// Use the local id of the item in the group to place results of
// the scan operation in the order of the items.
auto g_index = group.get_group_linear_id() *
group.get_group_linear_range() +
group.get_local_linear_range() +
group.get_local_linear_id();
local_id_acc[g_index] = group.get_local_linear_id();

Expand All @@ -436,7 +436,7 @@ void check_scan_over_group(sycl::queue& queue, sycl::range<D> range, OpT op,
// Use the local id of the item in the sub-group to place
// results of the scan operation in the order of the items.
auto sg_index = sub_group.get_group_linear_id() *
sub_group.get_group_linear_range() +
sub_group.get_local_linear_range() +
sub_group.get_local_linear_id();
local_id_acc[range_size + sg_index] =
sub_group.get_local_linear_id();
Expand Down

0 comments on commit f36daa4

Please sign in to comment.