]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libgomp/testsuite/libgomp.oacc-c-c++-common/lib-84.c
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
]))
42 for (i
= 0; i
< N
; i
++)
51 for (j
= 0; j
< N
; j
++)
61 acc_shutdown (acc_device_nvidia
);
66 /* { dg-output "" } */