Niels Sascha Reedijk 92b3138b83 Import GCC 13.1.0 and dependencies
Updated dependencies:
 * GMP 6.2.1
 * ISL 0.24
 * MPL 1.2.1
 * MPFR 4.1.0

The dependencies were pulled in by running the ./contrib/download_prerequisites script and then
manually removing the symbolic links and archives, and renaming the directories (i.e mv isl-0.24 to isl)
2023-06-18 01:43:18 +01:00

73 lines
1.4 KiB
C

/* { dg-do run { target openacc_nvidia_accel_selected } } */
/* { dg-additional-options "-lcuda" } */
/* { dg-require-effective-target openacc_cuda } */
#include <stdlib.h>
#include <unistd.h>
#include <openacc.h>
#include <stdio.h>
#include <cuda.h>
#if !defined __cplusplus
# undef static_assert
# define static_assert _Static_assert
#endif
static_assert (acc_async_sync == -2, "acc_async_sync?");
static_assert (acc_async_noval == -1, "acc_async_noval?");
int
main (int argc, char **argv)
{
const int N = 100;
int i;
CUstream *streams;
CUstream s;
CUresult r;
acc_init (acc_device_nvidia);
(void) acc_get_device_num (acc_device_nvidia);
streams = (CUstream *) malloc ((2 + N) * sizeof (void *));
streams += 2;
/* "streams[i]" is valid for i in [acc_async_sync..N). */
for (i = acc_async_sync; i < N; i++)
{
streams[i] = (CUstream) acc_get_cuda_stream (i);
if (streams[i] != NULL)
abort ();
r = cuStreamCreate (&streams[i], CU_STREAM_DEFAULT);
if (r != CUDA_SUCCESS)
{
fprintf (stderr, "cuStreamCreate failed: %d\n", r);
abort ();
}
int ret = acc_set_cuda_stream (i, streams[i]);
if (i == acc_async_sync)
{
if (ret == 1)
abort ();
}
else
{
if (ret != 1)
abort ();
}
}
s = NULL;
if (acc_set_cuda_stream (N + 1, s) != 0)
abort ();
acc_shutdown (acc_device_nvidia);
exit (0);
}
/* { dg-output "" } */