Skip to content

Commit e583ff5

Browse files
authored
[SYCL][ESIMD] Reenable local_accessor atomic_update() tests on DG2 (#12932)
1 parent f1e66f5 commit e583ff5

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// This test checks DWORD local accessor atomic operations.
99
//===----------------------------------------------------------------------===//
1010
// REQUIRES-INTEL-DRIVER: lin: 26690, win: 101.4576
11-
// TODO: disabled temporarily because of flaky issue.
12-
// UNSUPPORTED: windows
1311
// RUN: %{build} -o %t.out
1412
// RUN: %{run} %t.out
1513
//

sycl/test-e2e/ESIMD/lsc/local_accessor_atomic_smoke.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ bool test(queue q) {
180180
auto accessor = local_accessor<T, 1>(size, cgh);
181181

182182
cgh.parallel_for<TestID<T, N, ImplF>>(
183-
rng, [=](id<1> ii) SYCL_ESIMD_KERNEL {
184-
int i = ii;
183+
rng, [=](sycl::nd_item<1> ndi) SYCL_ESIMD_KERNEL {
184+
int i = ndi.get_global_id(0);
185185
#ifndef USE_SCALAR_OFFSET
186186
simd<uint32_t, N> offsets(start_ind * sizeof(T),
187187
stride * sizeof(T));
@@ -192,7 +192,8 @@ bool test(queue q) {
192192
data.copy_from(arr);
193193

194194
simd<uint32_t, size> LocalOffsets(0, sizeof(T));
195-
scatter<T, size>(accessor, LocalOffsets, data, 0, 1);
195+
if (ndi.get_local_id(0) == 0)
196+
scatter<T, size>(accessor, LocalOffsets, data, 0, 1);
196197
simd_mask<N> m = 1;
197198
if (masked_lane < N)
198199
m[masked_lane] = 0;
@@ -221,8 +222,11 @@ bool test(queue q) {
221222
;
222223
}
223224
}
224-
auto data0 = gather<T, size>(accessor, LocalOffsets, 0);
225-
data0.copy_to(arr);
225+
barrier();
226+
if (ndi.get_local_id(0) == 0) {
227+
auto data0 = gather<T, size>(accessor, LocalOffsets, 0);
228+
data0.copy_to(arr);
229+
}
226230
});
227231
});
228232
e.wait();

sycl/test-e2e/ESIMD/lsc/local_accessor_atomic_smoke_cmpxchg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
// This test checks local accessor cmpxchg atomic operations.
99
//===----------------------------------------------------------------------===//
10-
// REQUIRES: gpu-intel-pvc
10+
// REQUIRES: gpu-intel-pvc || gpu-intel-dg2
1111
// RUN: %{build} -o %t.out
1212
// RUN: %{run} %t.out
1313
//

sycl/test-e2e/ESIMD/lsc/lsc_slm_atomic_smoke.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
// This test checks LSC SLM atomic operations.
99
//===----------------------------------------------------------------------===//
10-
// REQUIRES: gpu-intel-pvc
10+
// REQUIRES: gpu-intel-pvc || gpu-intel-dg2
1111
// RUN: %{build} -o %t.out
1212
// RUN: %{run} %t.out
1313

@@ -123,16 +123,17 @@ bool test(queue q) {
123123
try {
124124
auto e = q.submit([&](handler &cgh) {
125125
cgh.parallel_for<TestID<T, N, ImplF>>(
126-
rng, [=](id<1> ii) SYCL_ESIMD_KERNEL {
127-
int i = ii;
126+
rng, [=](sycl::nd_item<1> ndi) SYCL_ESIMD_KERNEL {
127+
int i = ndi.get_global_id(0);
128128
slm_init<32768>();
129129
simd<uint32_t, N> offsets(start_ind * sizeof(T),
130130
stride * sizeof(T));
131131
simd<T, size> data;
132132
data.copy_from(arr);
133133

134134
simd<uint32_t, size> slm_offsets(0, sizeof(T));
135-
lsc_slm_scatter(slm_offsets, data);
135+
if (ndi.get_local_id(0) == 0)
136+
lsc_slm_scatter(slm_offsets, data);
136137

137138
simd_mask<N> m = 1;
138139
if (masked_lane < N)
@@ -161,8 +162,11 @@ bool test(queue q) {
161162
;
162163
}
163164
}
164-
auto data0 = lsc_slm_gather<T>(slm_offsets);
165-
data0.copy_to(arr);
165+
barrier();
166+
if (ndi.get_local_id(0) == 0) {
167+
auto data0 = lsc_slm_gather<T>(slm_offsets);
168+
data0.copy_to(arr);
169+
}
166170
});
167171
});
168172
e.wait();

0 commit comments

Comments
 (0)