Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 50a968b

Browse files
committed
addressed review comments
1 parent 11a9a73 commit 50a968b

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

SYCL/Basic/multi_device_context.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#include <stdlib.h>
99
#include <sycl/sycl.hpp>
1010

11-
sycl::event add(sycl::queue q, sycl::buffer<int> buff, int *usm,
12-
sycl::event e) {
11+
sycl::event add(sycl::queue& q, sycl::buffer<int>& buff, int *usm,
12+
sycl::event& e) {
1313
return q.submit([&](sycl::handler &cgh) {
1414
auto acc = buff.get_access<sycl::access::mode::read_write>(cgh);
1515
cgh.depends_on(e);
@@ -35,25 +35,23 @@ int main() {
3535

3636
int a = 1;
3737
int b = 2;
38-
int c = 4;
39-
int d = 5;
4038
{
4139
sycl::buffer<int> buff1(&a, 1);
4240
sycl::buffer<int> buff2(&b, 1);
4341

4442
// Test copying usm.
4543
int *usm1 = sycl::malloc_device<int>(1, q1);
4644
int *usm2 = sycl::malloc_device<int>(1, q2);
47-
sycl::event e1 = q1.memcpy(usm1, &c, 1);
48-
sycl::event e2 = q2.memcpy(usm2, &d, 1);
45+
sycl::event e1 = q1.fill(usm1, 4, 1);
46+
sycl::event e2 = q2.fill(usm2, 5, 1);
4947

5048
// Test combination of usm and buffers in a kernel.
5149
sycl::event e3 = add(q1, buff1, usm1, e1);
5250
sycl::event e4 = add(q2, buff2, usm2, e2);
5351

5452
// Change values in usm to ensure results are distinct.
55-
sycl::event e5 = q1.memcpy(usm1, &d, 1, e3);
56-
sycl::event e6 = q2.memcpy(usm2, &c, 1, e4);
53+
sycl::event e5 = q1.fill(usm1, 5, 1, e3);
54+
sycl::event e6 = q2.fill(usm2, 4, 1, e4);
5755

5856
// Use each buffer on the other device than before - tests that copying
5957
// between devices works.

0 commit comments

Comments
 (0)