Skip to content

Commit 3e98b3a

Browse files
[SYCL][E2E] Fix buffer_location test for GPU (#15452)
This commit fixes and issue in buffer_location where the code would attempt to read from a device USM allocation. According to the SYCL specification, these allocations must be explicitly copied to/from host. Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 4901f2e commit 3e98b3a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sycl/test-e2e/USM/buffer_location.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// UNSUPPORTED: gpu
1+
// REQUIRES: aspect-usm_device_allocations
22
// RUN: %{build} -o %t1.out
33
// RUN: %{run} %t1.out
44

@@ -72,7 +72,10 @@ int main() {
7272
});
7373
e2.wait();
7474

75-
if (*test_src_ptr != dst_val) {
75+
int res_val = 0;
76+
q.copy(test_src_ptr, &res_val, 1).wait();
77+
78+
if (res_val != dst_val) {
7679
return -1;
7780
}
7881

0 commit comments

Comments
 (0)