Skip to content

Commit 62eeadc

Browse files
committed
[SYCL] Fix root_group.cpp
Signed-off-by: Hu, Peisen <[email protected]>
1 parent 4c3ffd8 commit 62eeadc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

sycl/test-e2e/GroupAlgorithm/root_group.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ void testRootGroup() {
7373
sycl::buffer<int> dataBuf{sycl::range{maxWGs * WorkGroupSize}};
7474
const auto range = sycl::nd_range<1>{maxWGs * WorkGroupSize, WorkGroupSize};
7575
struct TestKernel1 {
76-
sycl::buffer<bool> m_dataBuf;
77-
sycl::handler m_h;
76+
sycl::buffer<bool> *m_dataBuf;
77+
sycl::handler *m_h;
7878
TestKernel1(sycl::buffer<bool> dataBuf, sycl::handler h)
79-
: m_dataBuf(dataBuf), m_h(h) {}
79+
: m_dataBuf(&dataBuf), m_h(&h) {}
8080
void operator()(sycl::nd_item<1> it) const {
81-
sycl::accessor data{m_dataBuf, m_h};
81+
sycl::accessor data{*m_dataBuf, *m_h};
8282
volatile float X = 1.0f;
8383
volatile float Y = 1.0f;
8484
auto root = it.ext_oneapi_get_root_group();
@@ -127,12 +127,12 @@ void testRootGroupFunctions() {
127127
sycl::buffer<bool> testResultsBuf{sycl::range{testCount}};
128128
const auto range = sycl::nd_range<1>{maxWGs * WorkGroupSize, WorkGroupSize};
129129
struct TestKernel2 {
130-
sycl::buffer<bool> m_testResultsBuf;
131-
sycl::handler m_h;
130+
sycl::buffer<bool> *m_testResultsBuf;
131+
sycl::handler *m_h;
132132
TestKernel2(sycl::buffer<bool> testResultsBuf, sycl::handler h)
133-
: m_testResultsBuf(testResultsBuf), m_h(h) {}
133+
: m_testResultsBuf(&testResultsBuf), m_h(&h) {}
134134
void operator()(sycl::nd_item<1> it) const {
135-
sycl::accessor testResults{m_testResultsBuf, m_h};
135+
sycl::accessor testResults{*m_testResultsBuf, *m_h};
136136
const auto root = it.ext_oneapi_get_root_group();
137137
if (root.leader() || root.get_local_id() == 3) {
138138
testResults[0] = root.get_group_id() == sycl::id<1>(0);

0 commit comments

Comments
 (0)