File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
sycl/test/host-interop-task Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -194,10 +194,36 @@ void test4() {
194
194
});
195
195
}
196
196
197
+ void test5 () {
198
+ buffer<int , 1 > Buffer1{BUFFER_SIZE};
199
+ buffer<int , 1 > Buffer2{BUFFER_SIZE};
200
+
201
+ queue Q;
202
+
203
+ Q.submit ([&](handler &CGH) {
204
+ auto Acc = Buffer1.template get_access <mode::write>(CGH);
205
+
206
+ auto Kernel = [=](item<1 > Id) { Acc[Id] = 123 ; };
207
+ CGH.parallel_for <class Test5Init >(Acc.get_count (), Kernel);
208
+ });
209
+
210
+ copy (Buffer1, Buffer2, Q);
211
+
212
+ {
213
+ auto Acc = Buffer2.get_access <mode::read>();
214
+
215
+ for (size_t Idx =0 ; Idx < Acc.get_count (); ++Idx) {
216
+ std::cout << " Second buffer [" << Idx << " ] = " << Acc[Idx] << std::endl;
217
+ assert (Acc[Idx] == 123 );
218
+ }
219
+ }
220
+ }
221
+
197
222
int main () {
198
223
test1 ();
199
224
test2 ();
200
225
test3 ();
201
226
test4 ();
227
+ test5 ();
202
228
return 0 ;
203
229
}
You can’t perform that action at this time.
0 commit comments