From c68ddd5e2a9dd0cfe21c3661404d7d4c323b23cf Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Thu, 31 Oct 2019 17:40:13 +0100 Subject: [PATCH] Enable more 'libgomp.oacc-*/lib-*' testcases for non-'openacc_nvidia_accel_selected' 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. --- .../testsuite/libgomp.oacc-c-c++-common/lib-11.c | 10 +++-- .../testsuite/libgomp.oacc-c-c++-common/lib-13.c | 2 +- .../testsuite/libgomp.oacc-c-c++-common/lib-14.c | 2 +- .../testsuite/libgomp.oacc-c-c++-common/lib-15.c | 2 +- .../testsuite/libgomp.oacc-c-c++-common/lib-20.c | 4 +- .../testsuite/libgomp.oacc-c-c++-common/lib-23.c | 4 +- .../testsuite/libgomp.oacc-c-c++-common/lib-24.c | 2 +- .../testsuite/libgomp.oacc-c-c++-common/lib-34.c | 4 +- .../testsuite/libgomp.oacc-c-c++-common/lib-42.c | 4 +- .../testsuite/libgomp.oacc-c-c++-common/lib-44.c | 4 +- .../testsuite/libgomp.oacc-c-c++-common/lib-48.c | 4 +- .../testsuite/libgomp.oacc-c-c++-common/lib-5.c | 20 ++++++++- .../testsuite/libgomp.oacc-c-c++-common/lib-52.c | 6 +-- .../testsuite/libgomp.oacc-c-c++-common/lib-53.c | 6 +-- .../testsuite/libgomp.oacc-c-c++-common/lib-54.c | 6 +-- .../testsuite/libgomp.oacc-c-c++-common/lib-57.c | 2 +- .../testsuite/libgomp.oacc-c-c++-common/lib-58.c | 2 +- .../testsuite/libgomp.oacc-c-c++-common/lib-6.c | 47 ++++++++++++++++------ .../testsuite/libgomp.oacc-c-c++-common/lib-62.c | 3 +- .../testsuite/libgomp.oacc-c-c++-common/lib-63.c | 3 +- .../testsuite/libgomp.oacc-c-c++-common/lib-64.c | 3 +- .../testsuite/libgomp.oacc-c-c++-common/lib-65.c | 3 +- .../testsuite/libgomp.oacc-c-c++-common/lib-67.c | 3 +- .../testsuite/libgomp.oacc-c-c++-common/lib-68.c | 3 +- .../testsuite/libgomp.oacc-c-c++-common/lib-86.c | 27 ++++++++----- .../testsuite/libgomp.oacc-c-c++-common/lib-87.c | 27 ++++++++----- .../testsuite/libgomp.oacc-c-c++-common/lib-88.c | 9 +---- .../testsuite/libgomp.oacc-c-c++-common/lib-89.c | 18 ++++----- .../testsuite/libgomp.oacc-c-c++-common/lib-92.c | 18 ++++----- libgomp/testsuite/libgomp.oacc-fortran/lib-10.f90 | 6 +-- libgomp/testsuite/libgomp.oacc-fortran/lib-14.f90 | 3 +- libgomp/testsuite/libgomp.oacc-fortran/lib-5.f90 | 46 ++++++++++++++++----- libgomp/testsuite/libgomp.oacc-fortran/lib-7.f90 | 46 ++++++++++++++++----- libgomp/testsuite/libgomp.oacc-fortran/lib-8.f90 | 6 +-- 34 files changed, 225 insertions(+), 130 deletions(-) diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-11.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-11.c index 86cfeb6..1f05161 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-11.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-11.c @@ -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 #include @@ -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 "" } */ diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-13.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-13.c index aca4c25..90b137f 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-13.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-13.c @@ -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 #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-14.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-14.c index de6d38b..892f97c 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-14.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-14.c @@ -1,6 +1,6 @@ /* Check acc_is_present. */ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-15.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-15.c index 50c1701..335b26f 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-15.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-15.c @@ -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 #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-20.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-20.c index 10d3cbc..f1d9a21 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-20.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-20.c @@ -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 #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-23.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-23.c index b1f3e71..d39f31e 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-23.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-23.c @@ -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 #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-24.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-24.c index 09e2817..96e3129 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-24.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-24.c @@ -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 #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-34.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-34.c index a24916d..8ddd897 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-34.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-34.c @@ -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 #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-42.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-42.c index 30b90d4..adab109 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-42.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-42.c @@ -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 #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-44.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-44.c index 8bbf016..f02fe21 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-44.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-44.c @@ -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 #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-48.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-48.c index afa137f..9975c9e 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-48.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-48.c @@ -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 #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-5.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-5.c index 961a62c..1e0ab9c 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-5.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-5.c @@ -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; } diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-52.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-52.c index 25c70c2..9a562b3 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-52.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-52.c @@ -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 #include @@ -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 "" } */ diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-53.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-53.c index a8ee7df..d452a69 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-53.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-53.c @@ -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 #include @@ -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 "" } */ diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-54.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-54.c index fc221f4..1922754 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-54.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-54.c @@ -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 #include @@ -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 "" } */ diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-57.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-57.c index 971a014..81653c6 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-57.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-57.c @@ -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 "" } */ diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-58.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-58.c index fedda77..c6bc261 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-58.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-58.c @@ -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 "" } */ diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-6.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-6.c index afdd480..a3affc0 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-6.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-6.c @@ -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 (); diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-62.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-62.c index ace4b05..2e7184a 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-62.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-62.c @@ -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 #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-63.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-63.c index a3fa728..84bbccb 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-63.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-63.c @@ -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 #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-64.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-64.c index b57f67a..e26681a 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-64.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-64.c @@ -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 #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-65.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-65.c index 0fca821..69add3f 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-65.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-65.c @@ -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 #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-67.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-67.c index ec3c2a5..c13333b 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-67.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-67.c @@ -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 #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-68.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-68.c index f109034..7fffd0b 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-68.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-68.c @@ -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 #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-86.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-86.c index b8a8ee9..7e8a7e2 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-86.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-86.c @@ -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 (); diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-87.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-87.c index 147d443..cdc87ed 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-87.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-87.c @@ -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 (); diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-88.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-88.c index 10f4ad8..c1cccd9 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-88.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-88.c @@ -1,4 +1,4 @@ -/* { dg-do run } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include @@ -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; } diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-89.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-89.c index 061c409..6b4e3ac 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-89.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-89.c @@ -1,4 +1,4 @@ -/* { dg-do run } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include @@ -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; } diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-92.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-92.c index 18193e0..0043fb3 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-92.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-92.c @@ -1,4 +1,4 @@ -/* { dg-do run } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include @@ -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; } diff --git a/libgomp/testsuite/libgomp.oacc-fortran/lib-10.f90 b/libgomp/testsuite/libgomp.oacc-fortran/lib-10.f90 index 2875f16..2b2f8fe 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/lib-10.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/lib-10.f90 @@ -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) diff --git a/libgomp/testsuite/libgomp.oacc-fortran/lib-14.f90 b/libgomp/testsuite/libgomp.oacc-fortran/lib-14.f90 index bf35631..90c2868 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/lib-14.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/lib-14.f90 @@ -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 diff --git a/libgomp/testsuite/libgomp.oacc-fortran/lib-5.f90 b/libgomp/testsuite/libgomp.oacc-fortran/lib-5.f90 index 505b2c6..08808a4 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/lib-5.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/lib-5.f90 @@ -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 diff --git a/libgomp/testsuite/libgomp.oacc-fortran/lib-7.f90 b/libgomp/testsuite/libgomp.oacc-fortran/lib-7.f90 index 2ce93c3..fa610b1 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/lib-7.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/lib-7.f90 @@ -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 diff --git a/libgomp/testsuite/libgomp.oacc-fortran/lib-8.f90 b/libgomp/testsuite/libgomp.oacc-fortran/lib-8.f90 index 263cedb..2b36b40 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/lib-8.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/lib-8.f90 @@ -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) -- 2.7.4