]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Enable more 'libgomp.oacc-*/lib-*' testcases for non-'openacc_nvidia_accel_selected'
authorThomas Schwinge <thomas@codesourcery.com>
Thu, 31 Oct 2019 16:40:13 +0000 (17:40 +0100)
committerThomas Schwinge <thomas@codesourcery.com>
Tue, 8 Jun 2021 09:51:45 +0000 (11:51 +0200)
libgomp/
* testsuite/libgomp.oacc-c-c++-common/lib-11.c: Enable for all but
'-DACC_MEM_SHARED=0'.
* testsuite/libgomp.oacc-c-c++-common/lib-13.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-14.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-15.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-20.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-23.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-24.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-34.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-42.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-44.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-48.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-88.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-89.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-92.c: Likewise.
* testsuite/libgomp.oacc-fortran/lib-14.f90: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-5.c: Add
'acc_device_radeon' testing.
* testsuite/libgomp.oacc-c-c++-common/lib-6.c: Likewise.
* testsuite/libgomp.oacc-fortran/lib-5.f90: Likewise.
* testsuite/libgomp.oacc-fortran/lib-7.f90: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-52.c: Enable for all.
* testsuite/libgomp.oacc-c-c++-common/lib-53.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-54.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-86.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-87.c: Likewise.
* testsuite/libgomp.oacc-fortran/lib-10.f90: Likewise.
* testsuite/libgomp.oacc-fortran/lib-8.f90: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-57.c: Improve checking
for non-'openacc_nvidia_accel_selected'.
* testsuite/libgomp.oacc-c-c++-common/lib-58.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-62.c: Clarify that "Not
all implement this checking".
* testsuite/libgomp.oacc-c-c++-common/lib-63.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-64.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-65.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-67.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-68.c: Likewise.

34 files changed:
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-11.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-13.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-14.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-15.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-20.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-23.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-24.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-34.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-42.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-44.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-48.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-5.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-52.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-53.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-54.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-57.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-58.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-6.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-62.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-63.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-64.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-65.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-67.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-68.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-86.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-87.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-88.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-89.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-92.c
libgomp/testsuite/libgomp.oacc-fortran/lib-10.f90
libgomp/testsuite/libgomp.oacc-fortran/lib-14.f90
libgomp/testsuite/libgomp.oacc-fortran/lib-5.f90
libgomp/testsuite/libgomp.oacc-fortran/lib-7.f90
libgomp/testsuite/libgomp.oacc-fortran/lib-8.f90

index 86cfeb68c5d0285424877fd52064d38d3af1aa93..1f05161436c02c46d480d15e16250b0802b7e024 100644 (file)
@@ -1,5 +1,4 @@
-/* Only nvptx plugin does the required error checking.
-   { dg-do run { target openacc_nvidia_accel_selected } } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -22,6 +21,9 @@ main (int argc, char **argv)
   return 0;
 }
 
-/* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
-/* { dg-output "invalid device address" } */
+/* { dg-output "CheCKpOInT(\n|\r\n|\r)+" } */
+/* { dg-output "libgomp: invalid device address(\n|\r\n|\r)+" { target openacc_nvidia_accel_selected } } */
+/* { dg-output "libgomp: GCN fatal error: Could not free device memory(\n|\r\n|\r)+" { target openacc_radeon_accel_selected } }
+   { dg-output "Runtime message: HSA_STATUS_ERROR_INVALID_ALLOCATION: The requested allocation is not valid\.(\n|\r\n|\r)+" { target openacc_radeon_accel_selected } } */
+/* { dg-output "libgomp: error in freeing device memory in acc_free(\n|\r\n|\r)+$" } */
 /* { dg-shouldfail "" } */
index aca4c252091c7dc3c4714959a9cb2fced056c517..90b137fb20ba3f890e904cf1d661a72aa1f9b9e0 100644 (file)
@@ -1,6 +1,6 @@
 /* Check acc_is_present and acc_delete.  */
 
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
 
 #include <stdlib.h>
 #include <openacc.h>
index de6d38b060ce4f10be0e645ea1401ec49e047e76..892f97c31efdbec7b60f6ba8b4b9e4870dbbdbd8 100644 (file)
@@ -1,6 +1,6 @@
 /* Check acc_is_present.  */
 
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
 
 #include <stdlib.h>
 #include <openacc.h>
index 50c17011fe794b881a38ec15c89f830fa3e5365b..335b26f8fcac0bf8488f27876ce76530b4ac688e 100644 (file)
@@ -1,6 +1,6 @@
 /* Check acc_is_present and acc_copyout.  */
 
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
 
 #include <stdlib.h>
 #include <openacc.h>
index 10d3cbc5cc6faceb5feb0074d0f3bd0c49410875..f1d9a21ecd38283f7281cea0a5006f5f4d0efd05 100644 (file)
@@ -1,6 +1,6 @@
-/* Exercise acc_copyin and acc_copyout on nvidia targets.  */
+/* Exercise acc_copyin and acc_copyout.  */
 
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
 
 #include <stdio.h>
 #include <stdlib.h>
index b1f3e71f2788d611dfe19fdc460b91e6fb28a3d0..d39f31e6245e0ef5d81f81aecdacb0830dea9632 100644 (file)
@@ -1,6 +1,6 @@
-/* Exercise acc_copyin and acc_copyout on nvidia targets.  */
+/* Exercise acc_copyin and acc_copyout.  */
 
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
 
 #include <stdio.h>
 #include <stdlib.h>
index 09e2817f41dba372e5d0207fbbd9935fa8e3dea0..96e3129e563588d963be008a96192e0276e76a7b 100644 (file)
@@ -1,6 +1,6 @@
 /* Exercise acc_create, acc_is_present and acc_delete.  */
 
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
 
 #include <stdlib.h>
 #include <openacc.h>
index a24916d13066c63a63ac249adb721d0b75de9372..8ddd897826ffa0f00ef7769c6f7df374b6a884d1 100644 (file)
@@ -1,6 +1,6 @@
-/* Exercise an invalid acc_present_or_create on nvidia targets.  */
+/* Exercise an invalid acc_present_or_create.  */
 
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
 
 #include <stdio.h>
 #include <stdlib.h>
index 30b90d49c7b4ab1651d57ceea7ade63c964f7841..adab1098ed82d827d34b29a004979e60ef84c774 100644 (file)
@@ -1,6 +1,6 @@
-/* Exercise acc_update_device on unmapped data on nvidia targets.  */
+/* Exercise acc_update_device on unmapped data.  */
 
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
 
 #include <stdio.h>
 #include <stdlib.h>
index 8bbf016a19192fda5ac40c81739b16ba4866bed5..f02fe2188dc1622a477dadb89d74b41f7205334b 100644 (file)
@@ -1,6 +1,6 @@
-/* Exercise acc_update_device with size zero data on nvidia targets.  */
+/* Exercise acc_update_device with size zero data.  */
 
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
 
 #include <stdio.h>
 #include <stdlib.h>
index afa137ff098bf49eeb66ca24dc809a9f8cf0ab23..9975c9e990be758cf6dcc8045983f6985f7c38a9 100644 (file)
@@ -1,6 +1,6 @@
-/* Exercise acc_update_self with a size zero data mapping on nvidia targets.  */
+/* Exercise acc_update_self with a size zero data mapping.  */
 
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
 
 #include <stdio.h>
 #include <string.h>
index 961a62c2b637c6705c27dc66cbcb548c1f31b97b..1e0ab9cca70d68e89563b95637b86f4a1edade32 100644 (file)
@@ -35,6 +35,24 @@ main (int argc, char **argv)
       acc_shutdown (acc_device_nvidia);
     }
 
-  return 0;
+  if (acc_get_num_devices (acc_device_radeon) != 0)
+    {
+      acc_init (acc_device_radeon);
+
+      if (acc_get_device_type () != acc_device_radeon)
+        abort ();
+
+      acc_shutdown (acc_device_radeon);
+
+      acc_init (acc_device_default);
 
+      acc_set_device_type (acc_device_radeon);
+
+      if (acc_get_device_type () != acc_device_radeon)
+        abort ();
+
+      acc_shutdown (acc_device_radeon);
+    }
+
+  return 0;
 }
index 25c70c226f4be60531df207e9829b299958f5972..9a562b3d0aa7573250aa5e86050352b8dcb69cfa 100644 (file)
@@ -1,6 +1,4 @@
-/* Exercise acc_map_data with a NULL data mapping on nvidia targets.  */
-
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* Exercise acc_map_data with a NULL data mapping.  */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -30,6 +28,6 @@ main (int argc, char **argv)
 }
 
 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
-/* { dg-output "\\\[\[^\n\r]*,\\\+256\]->\[\[0-9a-fA-FxX\]+,\\\+256\\\] is a bad map" { target openacc_nvidia_accel_selected } } */
+/* { dg-output "\\\[\[^\n\r]*,\\\+256\]->\[\[0-9a-fA-FxX\]+,\\\+256\\\] is a bad map" { target { ! openacc_host_selected } } } */
 /* { dg-output "cannot map data on shared-memory system" { target openacc_host_selected } } */
 /* { dg-shouldfail "" } */
index a8ee7df629c7052b27302e0f1efb2384886098d8..d452a694750201668ed7c05b50f6182402e6e70d 100644 (file)
@@ -1,6 +1,4 @@
-/* Exercise acc_map_data with a NULL data mapping on nvidia targets.  */
-
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* Exercise acc_map_data with a NULL data mapping.  */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -30,6 +28,6 @@ main (int argc, char **argv)
 }
 
 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
-/* { dg-output "\\\[\[0-9a-fA-FxX\]+,\\\+256\]->\\\[\[^\n\r]*,\\\+256\\\] is a bad map" { target openacc_nvidia_accel_selected } } */
+/* { dg-output "\\\[\[0-9a-fA-FxX\]+,\\\+256\]->\\\[\[^\n\r]*,\\\+256\\\] is a bad map" { target { ! openacc_host_selected } } } */
 /* { dg-output "cannot map data on shared-memory system" { target openacc_host_selected } } */
 /* { dg-shouldfail "" } */
index fc221f471167fdb7ac8d82d42bdc8a1b04d4c5d8..1922754631249cd84ea3d4393e852d8c4454c475 100644 (file)
@@ -1,6 +1,4 @@
-/* Exercise acc_map_data with data size of zero on nvidia targets.  */
-
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* Exercise acc_map_data with data size of zero.  */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -30,6 +28,6 @@ main (int argc, char **argv)
 }
 
 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
-/* { dg-output "\\\[\[0-9a-fA-FxX\]+,\\\+0\\\]->\\\[\[0-9a-fA-FxX\]+,\\\+0\\\] is a bad map" { target openacc_nvidia_accel_selected } } */
+/* { dg-output "\\\[\[0-9a-fA-FxX\]+,\\\+0\\\]->\\\[\[0-9a-fA-FxX\]+,\\\+0\\\] is a bad map" { target { ! openacc_host_selected } } } */
 /* { dg-output "cannot map data on shared-memory system" { target openacc_host_selected } } */
 /* { dg-shouldfail "" } */
index 971a0147f3d2ccbb916fa6d9067560c6a109d818..81653c6a0832ae56b84cf92a19c4f86b821158df 100644 (file)
@@ -33,6 +33,6 @@ main (int argc, char **argv)
 }
 
 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
-/* { dg-output "\[0-9a-fA-FxX\]+ is not a mapped block" { target openacc_nvidia_accel_selected } } */
+/* { dg-output "\[0-9a-fA-FxX\]+ is not a mapped block" { target { ! openacc_host_selected } } } */
 /* { dg-output "cannot map data on shared-memory system" { target openacc_host_selected } } */
 /* { dg-shouldfail "" } */
index fedda77004b0da3a5fcef7808341020446187751..c6bc2610cac6b5aec05097fcc4ad0dffaf356e90 100644 (file)
@@ -33,6 +33,6 @@ main (int argc, char **argv)
 }
 
 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
-/* { dg-output "\[^\n\r]* is not a mapped block" { target openacc_nvidia_accel_selected } } */
+/* { dg-output "\[^\n\r]* is not a mapped block" { target { ! openacc_host_selected } } } */
 /* { dg-output "cannot map data on shared-memory system" { target openacc_host_selected } } */
 /* { dg-shouldfail "" } */
index afdd480cb7164a4480a7042b32152ccdd2eec03f..a3affc0c20d97c2afd958af1a04cd05448933708 100644 (file)
@@ -11,26 +11,47 @@ main (int argc, char **argv)
   if (acc_get_device_type () == acc_device_default)
     abort ();
 
-  if (acc_get_num_devices (acc_device_nvidia) == 0)
-    return 0;
+  if (acc_get_num_devices (acc_device_nvidia))
+    {
+      acc_set_device_type (acc_device_nvidia);
 
-  acc_set_device_type (acc_device_nvidia);
+      if (acc_get_device_type () != acc_device_nvidia)
+       abort ();
 
-  if (acc_get_device_type () != acc_device_nvidia)
-    abort ();
+      acc_shutdown (acc_device_nvidia);
 
-  acc_shutdown (acc_device_nvidia);
+      acc_set_device_type (acc_device_nvidia);
 
-  acc_set_device_type (acc_device_nvidia);
+      if (acc_get_device_type () != acc_device_nvidia)
+       abort ();
 
-  if (acc_get_device_type () != acc_device_nvidia)
-    abort ();
+      devnum = acc_get_num_devices (acc_device_host);
+      if (devnum != 1)
+       abort ();
 
-  devnum = acc_get_num_devices (acc_device_host);
-  if (devnum != 1)
-    abort ();
+      acc_shutdown (acc_device_nvidia);
+    }
+
+  if (acc_get_num_devices (acc_device_radeon))
+    {
+      acc_set_device_type (acc_device_radeon);
+
+      if (acc_get_device_type () != acc_device_radeon)
+       abort ();
+
+      acc_shutdown (acc_device_radeon);
+
+      acc_set_device_type (acc_device_radeon);
+
+      if (acc_get_device_type () != acc_device_radeon)
+       abort ();
+
+      devnum = acc_get_num_devices (acc_device_host);
+      if (devnum != 1)
+       abort ();
 
-  acc_shutdown (acc_device_nvidia);
+      acc_shutdown (acc_device_radeon);
+    }
 
   if (acc_get_device_type () == acc_device_default)
     abort ();
index ace4b058b9b4a9002eb60ea44664f8a81223f6f1..2e7184a918bbfb2625a599ad286ad39e451a4e28 100644 (file)
@@ -1,4 +1,5 @@
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* Not all implement this checking.
+   { dg-skip-if "" { openacc_radeon_accel_selected || openacc_host_selected } } */
 
 #include <stdio.h>
 #include <string.h>
index a3fa728510f887abb737db3c086f7e1565ed92ee..84bbccb448e6b69a6cc2e279c2ccc3668e05d46f 100644 (file)
@@ -1,4 +1,5 @@
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* Not all implement this checking.
+   { dg-skip-if "" { openacc_radeon_accel_selected || openacc_host_selected } } */
 
 #include <stdio.h>
 #include <string.h>
index b57f67a005851449900243fecd4accd7e56869f7..e26681a7b4d884b7f414188bb7b1e91184d0f3b8 100644 (file)
@@ -1,4 +1,5 @@
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* Not all implement this checking.
+   { dg-skip-if "" { openacc_radeon_accel_selected || openacc_host_selected } } */
 
 #include <stdio.h>
 #include <string.h>
index 0fca8214e76d21acadebd19686eec22a12e0b227..69add3ffedb5b74ef7784b4d48c110f4d7f43533 100644 (file)
@@ -1,4 +1,5 @@
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* Not all implement this checking.
+   { dg-skip-if "" { openacc_radeon_accel_selected || openacc_host_selected } } */
 
 #include <stdio.h>
 #include <string.h>
index ec3c2a53baf73a5a3a5b818cc13fe76dd9bfb6a9..c13333b3b48fe109021795f3ca8ffddc7b6b8f52 100644 (file)
@@ -1,4 +1,5 @@
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* Not all implement this checking.
+   { dg-skip-if "" { openacc_radeon_accel_selected || openacc_host_selected } } */
 
 #include <stdio.h>
 #include <string.h>
index f10903443d8f132405a8993a51f55fb056779e75..7fffd0b9f0b82362b7985c0c672c006546e14a43 100644 (file)
@@ -1,4 +1,5 @@
-/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* Not all implement this checking.
+   { dg-skip-if "" { openacc_radeon_accel_selected || openacc_host_selected } } */
 
 #include <stdio.h>
 #include <string.h>
index b8a8ee94a5856dfb60da119c07c7a7e3d0b9c1c4..7e8a7e20203fde5f27642c4487a977621378d43f 100644 (file)
@@ -7,9 +7,6 @@
 int
 main (int argc, char **argv)
 {
-  if (acc_get_num_devices (acc_device_nvidia) == 0)
-    return 0;
-
   if (acc_get_current_cuda_device () != 0)
     abort ();
 
@@ -20,18 +17,28 @@ main (int argc, char **argv)
 
   acc_shutdown (acc_device_host);
 
-  if (acc_get_num_devices (acc_device_nvidia) == 0)
-    return 0;
-
   if (acc_get_current_cuda_device () != 0)
     abort ();
 
-  acc_init (acc_device_nvidia);
+  if (acc_get_num_devices (acc_device_nvidia))
+    {
+      acc_init (acc_device_nvidia);
 
-  if (acc_get_current_cuda_device () == 0)
-    abort ();
+      if (acc_get_current_cuda_device () == 0)
+       abort ();
+
+      acc_shutdown (acc_device_nvidia);
+    }
+
+  if (acc_get_num_devices (acc_device_radeon))
+    {
+      acc_init (acc_device_radeon);
+
+      if (acc_get_current_cuda_device () != 0)
+       abort ();
 
-  acc_shutdown (acc_device_nvidia);
+      acc_shutdown (acc_device_radeon);
+    }
 
   if (acc_get_current_cuda_device () != 0)
     abort ();
index 147d443b54dc4212d10c2242a7f3a7a7d8ab6124..cdc87edc5908a28e3b6270000924de5d882fce90 100644 (file)
@@ -7,9 +7,6 @@
 int
 main (int argc, char **argv)
 {
-  if (acc_get_num_devices (acc_device_nvidia) == 0)
-    return 0;
-
   if (acc_get_current_cuda_context () != 0)
     abort ();
 
@@ -20,18 +17,28 @@ main (int argc, char **argv)
 
   acc_shutdown (acc_device_host);
 
-  if (acc_get_num_devices (acc_device_nvidia) == 0)
-    return 0;
-
   if (acc_get_current_cuda_context () != 0)
     abort ();
 
-  acc_init (acc_device_nvidia);
+  if (acc_get_num_devices (acc_device_nvidia))
+    {
+      acc_init (acc_device_nvidia);
 
-  if (acc_get_current_cuda_context () == 0)
-    abort ();
+      if (acc_get_current_cuda_context () == 0)
+       abort ();
+
+      acc_shutdown (acc_device_nvidia);
+    }
+
+  if (acc_get_num_devices (acc_device_radeon))
+    {
+      acc_init (acc_device_radeon);
+
+      if (acc_get_current_cuda_context () != 0)
+       abort ();
 
-  acc_shutdown (acc_device_nvidia);
+      acc_shutdown (acc_device_radeon);
+    }
 
   if (acc_get_current_cuda_context () != 0)
     abort ();
index 10f4ad8664aa087626ddf302c4903a9a7888f1a9..c1cccd919c3152ce6c532a89a6528cc7b3c476d6 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do run } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
 
 #include <stdio.h>
 #include <pthread.h>
@@ -47,10 +47,7 @@ main (int argc, char **argv)
   pthread_attr_t attr;
   pthread_t *tid;
 
-  if (acc_get_num_devices (acc_device_nvidia) == 0)
-    return 0;
-
-  acc_init (acc_device_nvidia);
+  acc_init (acc_device_default);
 
   x = (unsigned char *) malloc (N);
 
@@ -103,8 +100,6 @@ main (int argc, char **argv)
   if (acc_is_present (x, N) != 0)
     abort ();
 
-  acc_shutdown (acc_device_nvidia);
-
   return 0;
 }
 
index 061c4099c2dad5eb81f9b60ffb300717e52a03bf..6b4e3acf7dbded041408b807566e44d268459bbb 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do run } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
 
 #include <stdio.h>
 #include <pthread.h>
@@ -23,11 +23,16 @@ test (void *arg)
 
   tid = (int) (long) arg;
 
-  devnum = acc_get_device_num (acc_device_nvidia);
-  acc_set_device_num (devnum, acc_device_nvidia);
+  devnum = acc_get_device_num (acc_device_default);
+  acc_set_device_num (devnum, acc_device_default);
 
+#if ACC_DEVICE_TYPE_nvidia
   if (acc_get_current_cuda_context () == NULL)
     abort ();
+#else
+  if (acc_get_current_cuda_context () != NULL)
+    abort ();
+#endif
 
   p = (unsigned char *) malloc (N);
 
@@ -50,10 +55,7 @@ main (int argc, char **argv)
   pthread_attr_t attr;
   pthread_t *tid;
 
-  if (acc_get_num_devices (acc_device_nvidia) == 0)
-    return 0;
-
-  acc_init (acc_device_nvidia);
+  acc_init (acc_device_default);
 
   x = (unsigned char **) malloc (NTHREADS * N);
   d_x = (void **) malloc (NTHREADS * N);
@@ -110,8 +112,6 @@ main (int argc, char **argv)
        abort ();
     }
 
-  acc_shutdown (acc_device_nvidia);
-
   return 0;
 }
 
index 18193e0e8f945dba2bd0c12510df044fb72ec6ab..0043fb3109db54b0b3684a732a124fe3d757bd30 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do run } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
 
 #include <pthread.h>
 #include <stdio.h>
@@ -22,11 +22,16 @@ test (void *arg)
 
   tid = (int) (long) arg;
 
-  devnum = acc_get_device_num (acc_device_nvidia);
-  acc_set_device_num (devnum, acc_device_nvidia);
+  devnum = acc_get_device_num (acc_device_default);
+  acc_set_device_num (devnum, acc_device_default);
 
+#if ACC_DEVICE_TYPE_nvidia
   if (acc_get_current_cuda_context () == NULL)
     abort ();
+#else
+  if (acc_get_current_cuda_context () != NULL)
+    abort ();
+#endif
 
   acc_copyout (x[tid], N);
 
@@ -49,10 +54,7 @@ main (int argc, char **argv)
   pthread_t *tid;
   unsigned char *p;
 
-  if (acc_get_num_devices (acc_device_nvidia) == 0)
-    return 0;
-
-  acc_init (acc_device_nvidia);
+  acc_init (acc_device_default);
 
   x = (unsigned char **) malloc (NTHREADS * N);
   d_x = (void **) malloc (NTHREADS * N);
@@ -104,8 +106,6 @@ main (int argc, char **argv)
        abort ();
     }
 
-  acc_shutdown (acc_device_nvidia);
-
   return 0;
 }
 
index 2875f162ba45a188ff5e4128bc2e1d5f46610586..2b2f8fede0289de6f1d220de613a9bc69c91a6a2 100644 (file)
@@ -15,9 +15,7 @@ program main
   integer, parameter :: c_size = sizeof (c)
   integer, parameter :: r_size = sizeof (r)
 
-  if (acc_get_num_devices (acc_device_nvidia) .eq. 0) call exit
-
-  call acc_init (acc_device_nvidia)
+  call acc_init (acc_device_default)
 
   call set3d (.FALSE., a_3d_i, a_3d_c, a_3d_r)
 
@@ -39,8 +37,6 @@ program main
     end do
   end do
 
-  call acc_shutdown (acc_device_nvidia)
-
 contains
 
   subroutine set3d (clear, a_i, a_c, a_r)
index bf35631c96bc00cf4f05c2648a030324fed62ba8..90c2868e643fc656bebde37f6d2677c1c79c0e75 100644 (file)
@@ -1,7 +1,8 @@
 ! Exercise the data movement runtime library functions on non-shared memory
 ! targets.
 
-! { dg-do run { target openacc_nvidia_accel_selected } }
+! { dg-do run }
+! { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } }
 
 program main
   use openacc
index 505b2c6f2461d5953256a7474b8734b3b685935b..08808a4023bac94a214e5b36e33f2b0c8020a450 100644 (file)
@@ -6,26 +6,52 @@ program main
 
   integer n
 
-  if (acc_get_num_devices (acc_device_nvidia) .eq. 0) call exit
+  if (acc_get_num_devices (acc_device_nvidia) .ne. 0) then
 
-  call acc_init (acc_device_nvidia)
+     call acc_init (acc_device_nvidia)
 
-  n = 0
+     n = 0
 
-  call acc_set_device_num (n, acc_device_nvidia)
+     call acc_set_device_num (n, acc_device_nvidia)
 
-  if (acc_get_device_num (acc_device_nvidia) .ne. 0) STOP 1
+     if (acc_get_device_num (acc_device_nvidia) .ne. 0) stop 11
 
-  if (acc_get_num_devices (acc_device_nvidia) .gt. 1) then
+     if (acc_get_num_devices (acc_device_nvidia) .gt. 1) then
 
-    n = 1
+        n = 1
 
-    call acc_set_device_num (n, acc_device_nvidia)
+        call acc_set_device_num (n, acc_device_nvidia)
 
-    if (acc_get_device_num (acc_device_nvidia) .ne. 1) STOP 2
+        if (acc_get_device_num (acc_device_nvidia) .ne. 1) stop 12
+
+     end if
+
+     call acc_shutdown (acc_device_nvidia)
 
   end if
 
-  call acc_shutdown (acc_device_nvidia)
+  if (acc_get_num_devices (acc_device_radeon) .ne. 0) then
+
+     call acc_init (acc_device_radeon)
+
+     n = 0
+
+     call acc_set_device_num (n, acc_device_radeon)
+
+     if (acc_get_device_num (acc_device_radeon) .ne. 0) stop 21
+
+     if (acc_get_num_devices (acc_device_radeon) .gt. 1) then
+
+        n = 1
+
+        call acc_set_device_num (n, acc_device_radeon)
+
+        if (acc_get_device_num (acc_device_radeon) .ne. 1) stop 22
+
+     end if
+
+     call acc_shutdown (acc_device_radeon)
+
+  end if
 
 end program
index 2ce93c359caedcb68b1d2f2f7743e98c7ebb0daf..fa610b16d34f767018e7cb02ebe2fdd875f5c4be 100644 (file)
@@ -6,26 +6,52 @@ program main
 
   integer n
 
-  if (acc_get_num_devices (acc_device_nvidia) .eq. 0) call exit
+  if (acc_get_num_devices (acc_device_nvidia) .ne. 0) then
 
-  call acc_init (acc_device_nvidia)
+     call acc_init (acc_device_nvidia)
 
-  n = 0
+     n = 0
 
-  call acc_set_device_num (n, acc_device_nvidia)
+     call acc_set_device_num (n, acc_device_nvidia)
 
-  if (acc_get_device_num (acc_device_nvidia) .ne. 0) STOP 1
+     if (acc_get_device_num (acc_device_nvidia) .ne. 0) STOP 1
 
-  if (acc_get_num_devices (acc_device_nvidia) .gt. 1) then
+     if (acc_get_num_devices (acc_device_nvidia) .gt. 1) then
 
-    n = 1
+        n = 1
 
-    call acc_set_device_num (n, acc_device_nvidia)
+        call acc_set_device_num (n, acc_device_nvidia)
 
-    if (acc_get_device_num (acc_device_nvidia) .ne. 1) STOP 2
+        if (acc_get_device_num (acc_device_nvidia) .ne. 1) STOP 2
+
+     end if
+
+     call acc_shutdown (acc_device_nvidia)
 
   end if
 
-  call acc_shutdown (acc_device_nvidia)
+  if (acc_get_num_devices (acc_device_radeon) .ne. 0) then
+
+     call acc_init (acc_device_radeon)
+
+     n = 0
+
+     call acc_set_device_num (n, acc_device_radeon)
+
+     if (acc_get_device_num (acc_device_radeon) .ne. 0) STOP 1
+
+     if (acc_get_num_devices (acc_device_radeon) .gt. 1) then
+
+        n = 1
+
+        call acc_set_device_num (n, acc_device_radeon)
+
+        if (acc_get_device_num (acc_device_radeon) .ne. 1) STOP 2
+
+     end if
+
+     call acc_shutdown (acc_device_radeon)
+
+  end if
 
 end program
index 263cedb5c5b89e43549f140536daa735937b7780..2b36b4078f6cb5182661c2682a14a4e5767bef70 100644 (file)
@@ -16,9 +16,7 @@ program main
   integer, parameter :: c_size = sizeof (c)
   integer, parameter :: r_size = sizeof (r)
 
-  if (acc_get_num_devices (acc_device_nvidia) .eq. 0) call exit
-
-  call acc_init (acc_device_nvidia)
+  call acc_init (acc_device_default)
 
   call set3d (.FALSE., a_3d_i, a_3d_c, a_3d_r)
 
@@ -40,8 +38,6 @@ program main
     end do
   end do
 
-  call acc_shutdown (acc_device_nvidia)
-
 contains
 
   subroutine set3d (clear, a_i, a_c, a_r)