@@ -47,16 +47,16 @@ lang: en
4747 int* d_x = malloc_device<int >(N, q);
4848 int* d_y = malloc_device<int >(N, q);
4949 // Copy data from host to device
50- q.memcpy(d_x, h_x.data(), N * sizeof(int)).wait();
51- q.memcpy(d_y, h_y.data(), N * sizeof(int)).wait ();
50+ q.memcpy(d_x, h_x.data(), N * sizeof(int)); q .wait();
51+ q.memcpy(d_y, h_y.data(), N * sizeof(int)); qwait ();
5252
5353 q.submit([ &] (handler& cgh) {
5454 cgh.parallel_for(range<1>(N), [ =] (sid<1> id) {
5555 d_y[ id] += a* x_d[ i] ;
5656 });
57- }).wait();
57+ }); q .wait();
5858 // Copy results back to host
59- q.memcpy(h_y.data(), d_y, N * sizeof(int)).wait();
59+ q.memcpy(h_y.data(), d_y, N * sizeof(int)); q .wait();
6060
6161 // Verify the results
6262 for (int i = 0; i < N; i++) {
@@ -85,7 +85,7 @@ lang: en
8585 cgh.parallel_for(range<1>(N), [=](id<1> idx) {
8686 y[idx] += a*x[i];
8787 });
88- }).wait();
88+ }); q .wait();
8989
9090 // No memcpy needed — host can read directly
9191 for (int i = 0; i < N; i++) {
0 commit comments