Skip to content

Commit 0cb5307

Browse files
0x12CCkbenzie
andauthored
[SYCL] Fix root group test case (#13653)
Includes the following changes: - Fix the `get_local_range`, `get_max_local_range`, `get_local_linear_range` tests. The expected values now match the extension specification. - Re-enable the test case on L0. It should pass once oneapi-src/unified-runtime#1581 is merged. --------- Signed-off-by: Michael Aziz <[email protected]> Co-authored-by: Kenneth Benzie (Benie) <[email protected]>
1 parent 5b77c1e commit 0cb5307

File tree

2 files changed

+25
-32
lines changed

2 files changed

+25
-32
lines changed

sycl/plugins/unified_runtime/CMakeLists.txt

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,23 +95,17 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT)
9595
endfunction()
9696

9797
set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
98-
# commit 396fb20498c315a526c961d7cb645b42795acd2c
99-
# Merge: 719bb9cd e2ffea69
98+
# commit 905804c2e93dd046140057fd07a5d6191063bedc
99+
# Merge: 0a11fb44 d3d3f6e5
100100
# Author: Kenneth Benzie (Benie) <[email protected]>
101-
# Date: Thu May 23 10:53:03 2024 +0100
102-
# Merge pull request #1501 from RossBrunton/ross/kerneltests
103-
# [Testing] Spec clarifications and testing updates for kernel
104-
set(UNIFIED_RUNTIME_TAG 396fb20498c315a526c961d7cb645b42795acd2c)
101+
# Date: Mon May 27 10:34:13 2024 +0100
102+
# Merge pull request #1581 from 0x12CC/l0_cooperative_kernels
103+
# Implement L0 cooperative kernel functions
104+
set(UNIFIED_RUNTIME_TAG 905804c2e93dd046140057fd07a5d6191063bedc)
105105

106106
fetch_adapter_source(level_zero
107107
${UNIFIED_RUNTIME_REPO}
108-
# commit e428745588dd87e5db3c0bc0df1183eb7d0811a5
109-
# Merge: fb3cbd16 80d46bb1
110-
# Author: Kenneth Benzie (Benie) <[email protected]>
111-
# Date: Fri May 24 10:31:13 2024 +0100
112-
# Merge pull request #1656 from pbalcer/leaks-program-kernel
113-
# fix leaks on level-zero interop program and kernel handles
114-
e428745588dd87e5db3c0bc0df1183eb7d0811a5
108+
${UNIFIED_RUNTIME_TAG}
115109
)
116110

117111
fetch_adapter_source(opencl

sycl/test-e2e/GroupAlgorithm/root_group.cpp

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Fails with opencl non-cpu and level_zero on linux, enable when fixed.
2-
// XFAIL: (opencl && !cpu) || (linux && level_zero)
1+
// Fails with opencl non-cpu, enable when fixed.
2+
// XFAIL: (opencl && !cpu)
33
// RUN: %{build} -I . -o %t.out
44
// RUN: %{run} %t.out
55

@@ -48,20 +48,19 @@ void testRootGroup() {
4848
const auto range = sycl::nd_range<1>{maxWGs * WorkGroupSize, WorkGroupSize};
4949
q.submit([&](sycl::handler &h) {
5050
sycl::accessor data{dataBuf, h};
51-
h.parallel_for<class RootGroupKernel>(
52-
range, props, [=](sycl::nd_item<1> it) {
53-
auto root = it.ext_oneapi_get_root_group();
54-
data[root.get_local_id()] = root.get_local_id();
55-
sycl::group_barrier(root);
51+
h.parallel_for<
52+
class RootGroupKernel>(range, props, [=](sycl::nd_item<1> it) {
53+
auto root = it.ext_oneapi_get_root_group();
54+
data[root.get_local_id()] = root.get_local_id();
55+
sycl::group_barrier(root);
5656

57-
root =
58-
sycl::ext::oneapi::experimental::this_work_item::get_root_group<
59-
1>();
60-
int sum = data[root.get_local_id()] +
61-
data[root.get_local_range() - root.get_local_id() - 1];
62-
sycl::group_barrier(root);
63-
data[root.get_local_id()] = sum;
64-
});
57+
root =
58+
sycl::ext::oneapi::experimental::this_work_item::get_root_group<1>();
59+
int sum = data[root.get_local_id()] +
60+
data[root.get_local_range() - root.get_local_id() - 1];
61+
sycl::group_barrier(root);
62+
data[root.get_local_id()] = sum;
63+
});
6564
});
6665
sycl::host_accessor data{dataBuf};
6766
const int workItemCount = static_cast<int>(range.get_global_range().size());
@@ -95,15 +94,15 @@ void testRootGroupFunctions() {
9594
? root.get_local_id() == sycl::id<1>(0)
9695
: root.get_local_id() == sycl::id<1>(3);
9796
testResults[2] = root.get_group_range() == sycl::range<1>(1);
98-
testResults[3] =
99-
root.get_local_range() == sycl::range<1>(WorkGroupSize);
97+
testResults[3] = root.get_local_range() == it.get_global_range();
10098
testResults[4] =
101-
root.get_max_local_range() == sycl::range<1>(WorkGroupSize);
99+
root.get_max_local_range() == root.get_local_range();
102100
testResults[5] = root.get_group_linear_id() == 0;
103101
testResults[6] =
104102
root.get_local_linear_id() == root.get_local_id().get(0);
105103
testResults[7] = root.get_group_linear_range() == 1;
106-
testResults[8] = root.get_local_linear_range() == WorkGroupSize;
104+
testResults[8] =
105+
root.get_local_linear_range() == root.get_local_range().size();
107106
}
108107
});
109108
});

0 commit comments

Comments
 (0)