From 9cb0b4076e5680dcd22dac1ddeb7be33c5ab459c Mon Sep 17 00:00:00 2001 From: Fabian Knorr Date: Sat, 28 Dec 2024 11:40:56 +0100 Subject: [PATCH] Fix: Add global offset to global id in ND-range parallel for --- src/simsycl/schedule.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simsycl/schedule.cc b/src/simsycl/schedule.cc index 2fb8921..05a7969 100644 --- a/src/simsycl/schedule.cc +++ b/src/simsycl/schedule.cc @@ -244,7 +244,7 @@ void cooperative_for_nd_range(const sycl::device &device, const sycl::nd_range(local_range) + local_id; + const auto global_id = range.get_offset() + group_id * sycl::id(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,