From d49e2a4ae6c356f1d39e232f97f9b8b4746b6fd4 Mon Sep 17 00:00:00 2001 From: JieZ Zhang Date: Wed, 8 Nov 2023 16:52:49 +0800 Subject: [PATCH] Compute local linear id correctly --- tests/group_functions/group_scan.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/group_functions/group_scan.h b/tests/group_functions/group_scan.h index 7f266613a..d15bd8bda 100644 --- a/tests/group_functions/group_scan.h +++ b/tests/group_functions/group_scan.h @@ -419,7 +419,7 @@ void check_scan_over_group(sycl::queue& queue, sycl::range 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(); @@ -436,7 +436,7 @@ void check_scan_over_group(sycl::queue& queue, sycl::range 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();