Skip to content

Commit bc4c227

Browse files
Changes to test_async_submit
Few changes to reduce sporadic test failures. 1. Choose initial global work-size to be a multiple of max_work_group_size to ensure that enough work is being generated in the test 2. Retry submission if asyncronicity is not yet detected and double the work if that does not help
1 parent de1b1a4 commit bc4c227

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

dpctl/tests/test_sycl_kernel_submit.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,18 +167,21 @@ def test_async_submit():
167167
assert isinstance(kern2Kernel, dpctl_prog.SyclKernel)
168168

169169
status_complete = dpctl.event_status_type.complete
170+
170171
# choose input size based on capability of the device
171172
f = q.sycl_device.max_work_group_size
172173
n = f * 1024
173-
X = dpt.empty((3, n), dtype="u4", usm_type="device", sycl_queue=q)
174+
n_alloc = 4 * n
175+
176+
X = dpt.empty((3, n_alloc), dtype="u4", usm_type="device", sycl_queue=q)
174177
first_row = dpctl_mem.as_usm_memory(X[0])
175178
second_row = dpctl_mem.as_usm_memory(X[1])
176179
third_row = dpctl_mem.as_usm_memory(X[2])
177180

178181
p1, p2 = 17, 27
179182

180183
async_detected = False
181-
for _ in range(5):
184+
for attemp in range(5):
182185
e1 = q.submit(
183186
kern1Kernel,
184187
[
@@ -224,6 +227,10 @@ def test_async_submit():
224227
async_detected = True
225228
e3.wait()
226229
break
230+
else
231+
n = n * (1 if attempt % 2 == 0 else 2)
232+
if n > n_alloc:
233+
break
227234

228235
assert async_detected, "No evidence of async submission detected, unlucky?"
229236
Xnp = dpt.asnumpy(X)

0 commit comments

Comments
 (0)