diff options
author | Tom de Vries <tom@codesourcery.com> | 2017-11-14 09:12:14 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2017-11-14 09:12:14 +0000 |
commit | dde76623dd2b3df7e471e9b8fe058b176569560d (patch) | |
tree | a0e5a8041396ba030a98f2367ae7be03612e53f2 /libgomp | |
parent | 3d8d3012c439ac5fbac45f96ba959b6d5c84cef4 (diff) | |
download | gcc-dde76623dd2b3df7e471e9b8fe058b176569560d.zip gcc-dde76623dd2b3df7e471e9b8fe058b176569560d.tar.gz gcc-dde76623dd2b3df7e471e9b8fe058b176569560d.tar.bz2 |
Allow asyncwait-1.c to run for non-nvidia devices
2017-11-14 Tom de Vries <tom@codesourcery.com>
* testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c: Allow to run for
non-nvidia devices.
From-SVN: r254723
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 5 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c | 16 |
2 files changed, 19 insertions, 2 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 19966bd..eaa50dd 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2017-11-14 Tom de Vries <tom@codesourcery.com> + + * testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c: Allow to run for + non-nvidia devices. + 2017-11-07 Jakub Jelinek <jakub@redhat.com> PR c++/82835 diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c index d478ce2..e780845 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c @@ -1,9 +1,11 @@ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ -/* { dg-additional-options "-lcuda" } */ +/* { dg-do run } */ +/* { dg-additional-options "-lcuda" { target openacc_nvidia_accel_selected } } */ #include <openacc.h> #include <stdlib.h> +#if defined ACC_DEVICE_TYPE_nvidia #include "cuda.h" +#endif #include <stdio.h> #include <sys/time.h> @@ -11,14 +13,18 @@ int main (int argc, char **argv) { +#if defined ACC_DEVICE_TYPE_nvidia CUresult r; CUstream stream1; +#endif int N = 128; //1024 * 1024; float *a, *b, *c, *d, *e; int i; int nbytes; +#if defined ACC_DEVICE_TYPE_nvidia acc_init (acc_device_nvidia); +#endif nbytes = N * sizeof (float); @@ -210,6 +216,7 @@ main (int argc, char **argv) } +#if defined ACC_DEVICE_TYPE_nvidia r = cuStreamCreate (&stream1, CU_STREAM_NON_BLOCKING); if (r != CUDA_SUCCESS) { @@ -218,6 +225,7 @@ main (int argc, char **argv) } acc_set_cuda_stream (1, stream1); +#endif for (i = 0; i < N; i++) { @@ -642,6 +650,7 @@ main (int argc, char **argv) } +#if defined ACC_DEVICE_TYPE_nvidia r = cuStreamCreate (&stream1, CU_STREAM_NON_BLOCKING); if (r != CUDA_SUCCESS) { @@ -650,6 +659,7 @@ main (int argc, char **argv) } acc_set_cuda_stream (1, stream1); +#endif for (i = 0; i < N; i++) { @@ -892,7 +902,9 @@ main (int argc, char **argv) abort (); } +#if defined ACC_DEVICE_TYPE_nvidia acc_shutdown (acc_device_nvidia); +#endif return 0; } |