Skip to content

Commit

Permalink
Merge pull request #1285 from IntelPython/tweak-sycl-kernel-submit-tests
Browse files Browse the repository at this point in the history
Tweak test_async_submit to improve test suite stability
  • Loading branch information
oleksandr-pavlyk authored Jul 17, 2023
2 parents d3ce80e + 51fa298 commit f52182d
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions dpctl/tests/test_sycl_kernel_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,22 @@ def test_async_submit():
pytest.skip("OpenCL queue could not be created")
oclSrc = (
"kernel void kern1(global unsigned int *res, unsigned int mod) {"
" size_t unused_sum = 0;"
" size_t i = 0; "
" for (i = 0; i < 4000; i++) { "
" unused_sum += i;"
" } "
" size_t index = get_global_id(0);"
" int ri = (index % mod);"
" res[index] = (ri * ri) % mod;"
"}"
" "
"kernel void kern2(global unsigned int *res, unsigned int mod) {"
" size_t unused_sum = 0;"
" size_t i = 0; "
" for (i = 0; i < 4000; i++) { "
" unused_sum += i;"
" } "
" size_t index = get_global_id(0);"
" int ri = (index % mod);"
" int ri2 = (ri * ri) % mod;"
Expand All @@ -137,13 +147,13 @@ def test_async_submit():
" global unsigned int *res, global unsigned int *arg1, "
" global unsigned int *arg2)"
"{"
" size_t index = get_global_id(0);"
" size_t i = 0; "
" size_t unused_sum = 0;"
" for (i = 0; i < 4000; i++) { "
" size_t index = get_global_id(0);"
" size_t i = 0; "
" size_t unused_sum = 0;"
" for (i = 0; i < 4000; i++) { "
" unused_sum += i;"
" } "
" res[index] = "
" } "
" res[index] = "
" (arg1[index] < arg2[index]) ? arg1[index] : arg2[index];"
"}"
)
Expand Down

0 comments on commit f52182d

Please sign in to comment.