1 /* { dg-do run { target openacc_nvidia_accel_selected } } */
2 /* { dg-additional-options "-lcuda" } */
11 main (int argc
, char **argv
)
19 acc_init (acc_device_nvidia
);
21 (void) acc_get_device_num (acc_device_nvidia
);
23 streams
= (CUstream
*) malloc (N
* sizeof (void *));
25 for (i
= 0; i
< N
; i
++)
27 streams
[i
] = (CUstream
) acc_get_cuda_stream (i
);
28 if (streams
[i
] != NULL
)
31 r
= cuStreamCreate (&streams
[i
], CU_STREAM_DEFAULT
);
32 if (r
!= CUDA_SUCCESS
)
34 fprintf (stderr
, "cuStreamCreate failed: %d\n", r
);
38 if (!acc_set_cuda_stream (i
, streams
[i
]))
44 if (acc_set_cuda_stream (N
+ 1, s
) != 0)
47 acc_shutdown (acc_device_nvidia
);
52 /* { dg-output "" } */