Skip to content

Commit b399dea

Browse files
committed
fix test - do not access memory from differnt context in a kernel
1 parent eb7e401 commit b399dea

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

sycl/test-e2e/Basic/multi_context_wait.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// RUN: %{build} -o %t.out
22
// RUN: %{run} %t.out
3-
// UNSUPPORTED: gpu-intel-dg2
4-
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/18734
53

64
#include <sycl/detail/core.hpp>
75
#include <sycl/usm.hpp>
@@ -73,15 +71,21 @@ void test_kernel() {
7371

7472
auto events = submit_dependencies(q1, q2, mem1, mem2);
7573

74+
q1.submit([&](sycl::handler &cgh) {
75+
cgh.depends_on(events[0]);
76+
cgh.depends_on(events[1]);
77+
cgh.parallel_for(sycl::range<1>(1024),
78+
[=](auto item) { assert(mem1[item.get_id()] == 1); });
79+
});
80+
7681
q2.submit([&](sycl::handler &cgh) {
7782
cgh.depends_on(events[0]);
7883
cgh.depends_on(events[1]);
79-
cgh.parallel_for(sycl::range<1>(1024), [=](auto item) {
80-
assert(mem1[item.get_id()] == 1);
81-
assert(mem2[item.get_id()] == 2);
82-
});
84+
cgh.parallel_for(sycl::range<1>(1024),
85+
[=](auto item) { assert(mem2[item.get_id()] == 2); });
8386
});
8487

88+
q1.wait();
8589
q2.wait();
8690

8791
sycl::free(mem1, c1);

0 commit comments

Comments
 (0)