Disable gather/scatter for non-first vectorized epilogue
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / acc_set_cuda_stream-1.c
blob93981ff5cb7f86db8d87a47593286a6b19e57753
1 /* Verify expected nvptx plugin behavior for "acc_set_cuda_stream" for
2 "acc_async_sync". */
4 /* { dg-do run { target openacc_nvidia_accel_selected } } */
5 /* { dg-set-target-env-var GOMP_DEBUG "1" } */
7 #undef NDEBUG
8 #include <assert.h>
9 #include <openacc.h>
11 int main(void)
13 int async = 42;
15 /* Initialize. */
16 #pragma acc parallel async(acc_async_sync)
18 #pragma acc parallel async(async)
20 #pragma acc wait
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);
27 assert (ret == 0);
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)
37 #pragma acc wait
39 return 0;
42 /* { dg-output "Refusing request to set CUDA stream associated with \"acc_async_sync\"" } */