Skip to content

Commit

Permalink
Fix access of device USM ptr from host
Browse files Browse the repository at this point in the history
  • Loading branch information
lbushi25 committed Feb 8, 2024
1 parent ae3e35e commit 6d25416
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion sycl/test-e2e/KernelFusion/sync_two_queues_event_dep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@ int main() {

q1.wait();
q2.wait();
int host_out[dataSize];
q1.memcpy(host_out, out, dataSize * sizeof(int));
q1.wait();
// Check the results
for (size_t i = 0; i < dataSize; ++i) {
assert(out[i] == (40 * i * i) && "Computation error");
assert(host_out[i] == (40 * i * i) && "Computation error");
}
sycl::free(in1, q1);
sycl::free(in2, q1);
Expand Down
8 changes: 5 additions & 3 deletions sycl/test-e2e/KernelFusion/sync_usm_mem_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@ int main() {
"Queue should not be in fusion mode anymore");

fw.complete_fusion({ext::codeplay::experimental::property::no_barriers{}});

int host_out[dataSize];
q.memcpy(host_out, out, dataSize * sizeof(int));
q.wait();
for (size_t i = 0; i < dataSize; ++i) {
std::cout << out[i] << ", ";
std::cout << host_out[i] << ", ";
}
std::cout << "\n";
// Check the results
for (size_t i = 0; i < dataSize; ++i) {
assert(out[i] == (20 * i * i) && "Computation error");
assert(host_out[i] == (20 * i * i) && "Computation error");
assert(dst[i] == (5 * i) && "Computation error");
}

Expand Down

0 comments on commit 6d25416

Please sign in to comment.