1 /* Verify expected nvptx plugin behavior for "acc_set_cuda_stream" for
4 /* { dg-do run { target openacc_nvidia_accel_selected } } */
5 /* { dg-set-target-env-var GOMP_DEBUG "1" } */
16 #pragma acc parallel async(acc_async_sync)
18 #pragma acc parallel async(async)
22 void *cuda_stream_sync
= acc_get_cuda_stream (acc_async_sync
);
23 assert (cuda_stream_sync
== NULL
);
24 void *cuda_stream_async
= acc_get_cuda_stream (async
);
25 assert (cuda_stream_async
!= NULL
);
26 int ret
= acc_set_cuda_stream (acc_async_sync
, cuda_stream_async
);
28 void *cuda_stream_sync_
= acc_get_cuda_stream (acc_async_sync
);
29 assert (cuda_stream_sync_
== cuda_stream_sync
);
30 void *cuda_stream_async_
= acc_get_cuda_stream (async
);
31 assert (cuda_stream_async_
== cuda_stream_async
);
33 #pragma acc parallel async(acc_async_sync)
35 #pragma acc parallel async(async)
42 /* { dg-output "Refusing request to set CUDA stream associated with \"acc_async_sync\"" } */