Skip to content

Commit

Permalink
Fix: Add global offset to global id in ND-range parallel for
Browse files Browse the repository at this point in the history
  • Loading branch information
fknorr committed Dec 28, 2024
1 parent 6692407 commit 9cb0b40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/simsycl/schedule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ void cooperative_for_nd_range(const sycl::device &device, const sycl::nd_range<D
}

const auto group_id = linear_index_to_id(group_range, group_linear_id);
const auto global_id = group_id * sycl::id<Dimensions>(local_range) + local_id;
const auto global_id = range.get_offset() + group_id * sycl::id<Dimensions>(local_range) + local_id;

// if sub-group range is not divisible by local range, the last sub-group will be smaller
const auto sub_group_local_linear_range = std::min(sub_group_max_local_linear_range,
Expand Down

0 comments on commit 9cb0b40

Please sign in to comment.