1 /* { dg-do run { target openacc_nvidia_accel_selected } } */
2 /* { dg-additional-options "-lcuda" } */
3 /* { dg-require-effective-target openacc_cuda } */
13 main (int argc
, char **argv
)
17 struct timeval tv1
, tv2
;
20 acc_init (acc_device_nvidia
);
22 stream
= (CUstream
) acc_get_cuda_stream (0);
26 r
= cuStreamCreate (&stream
, CU_STREAM_DEFAULT
);
27 if (r
!= CUDA_SUCCESS
)
29 fprintf (stderr
, "cuStreamCreate failed: %d\n", r
);
33 if (!acc_set_cuda_stream (0, stream
))
36 gettimeofday (&tv1
, NULL
);
38 acc_wait_all_async (0);
42 gettimeofday (&tv2
, NULL
);
44 t1
= ((tv2
.tv_sec
- tv1
.tv_sec
) * 1000000) + (tv2
.tv_usec
- tv1
.tv_usec
);
48 fprintf (stderr
, "too long\n");
52 acc_shutdown (acc_device_nvidia
);
57 /* { dg-output "" } */