[libgomp] In OpenACC testing, by default only build for the offload target that we're actually going to test

... to avoid compilation overhead, and to keep simple '-foffload=[...]'
handling in test cases.

	libgomp/
	* testsuite/libgomp.oacc-c++/c++.exp: Specify
	"-foffload=$offload_target".
	* testsuite/libgomp.oacc-c/c.exp: Likewise.
	* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
	* testsuite/lib/libgomp.exp
	(check_effective_target_openacc_nvidia_accel_configured): Remove,
	as (conceptually) merged into
	check_effective_target_openacc_nvidia_accel_selected.  Adjust all
	users.

From-SVN: r269109
This commit is contained in:
Thomas Schwinge 2019-02-22 11:51:35 +01:00 committed by Thomas Schwinge
parent 0a0384b43a
commit b03d721a62
8 changed files with 33 additions and 20 deletions

View File

@ -1,5 +1,15 @@
2019-02-22 Thomas Schwinge <thomas@codesourcery.com> 2019-02-22 Thomas Schwinge <thomas@codesourcery.com>
* testsuite/libgomp.oacc-c++/c++.exp: Specify
"-foffload=$offload_target".
* testsuite/libgomp.oacc-c/c.exp: Likewise.
* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
* testsuite/lib/libgomp.exp
(check_effective_target_openacc_nvidia_accel_configured): Remove,
as (conceptually) merged into
check_effective_target_openacc_nvidia_accel_selected. Adjust all
users.
* plugin/configfrag.ac: Populate and AC_SUBST offload_targets. * plugin/configfrag.ac: Populate and AC_SUBST offload_targets.
* testsuite/libgomp-test-support.exp.in: Adjust. * testsuite/libgomp-test-support.exp.in: Adjust.
* testsuite/lib/libgomp.exp: Likewise. Don't populate * testsuite/lib/libgomp.exp: Likewise. Don't populate

View File

@ -362,18 +362,6 @@ proc check_effective_target_offload_device_shared_as { } {
} ] } ]
} }
# Return 1 if configured for 'nvptx' offloading.
proc check_effective_target_openacc_nvidia_accel_configured { } {
global offload_targets
if { ![string match "*,nvptx*,*" ",$offload_targets,"] } {
return 0
}
# PR libgomp/65099: Currently, we only support offloading in 64-bit
# configurations.
return [is-effective-target lp64]
}
# Return 1 if at least one Nvidia GPU is accessible. # Return 1 if at least one Nvidia GPU is accessible.
proc check_effective_target_openacc_nvidia_accel_present { } { proc check_effective_target_openacc_nvidia_accel_present { } {

View File

@ -112,6 +112,11 @@ if { $lang_test_file_found } {
} }
set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared" set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared"
# To avoid compilation overhead, and to keep simple '-foffload=[...]'
# handling in test cases, by default only build for the offload target
# that we're actually going to test.
set tagopt "$tagopt -foffload=$offload_target"
# Force usage of the corresponding OpenACC device type.
setenv ACC_DEVICE_TYPE $openacc_device_type setenv ACC_DEVICE_TYPE $openacc_device_type
# To get better test coverage for device-specific code that is only # To get better test coverage for device-specific code that is only

View File

@ -1,11 +1,11 @@
/* { dg-do link } */ /* { dg-do link } */
/* { dg-excess-errors "lto1, mkoffload and lto-wrapper fatal errors" { target openacc_nvidia_accel_configured } } */ /* { dg-excess-errors "lto1, mkoffload and lto-wrapper fatal errors" { target openacc_nvidia_accel_selected } } */
int var; int var;
#pragma acc declare create (var) #pragma acc declare create (var)
void __attribute__((noinline, noclone)) void __attribute__((noinline, noclone))
foo () /* { dg-error "function 'foo' has been referenced in offloaded code but hasn't been marked to be included in the offloaded code" "" { target openacc_nvidia_accel_configured } } */ foo () /* { dg-error "function 'foo' has been referenced in offloaded code but hasn't been marked to be included in the offloaded code" "" { target openacc_nvidia_accel_selected } } */
{ {
var++; var++;
} }

View File

@ -154,7 +154,7 @@ int main ()
int gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max; int gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max;
gangs_min = workers_min = vectors_min = INT_MAX; gangs_min = workers_min = vectors_min = INT_MAX;
gangs_max = workers_max = vectors_max = INT_MIN; gangs_max = workers_max = vectors_max = INT_MIN;
#pragma acc parallel copy (vectors_actual) /* { dg-warning "using vector_length \\(32\\), ignoring 1" "" { target openacc_nvidia_accel_configured } } */ \ #pragma acc parallel copy (vectors_actual) /* { dg-warning "using vector_length \\(32\\), ignoring 1" "" { target openacc_nvidia_accel_selected } } */ \
vector_length (VECTORS) /* { dg-warning "'vector_length' value must be positive" "" { target c++ } } */ vector_length (VECTORS) /* { dg-warning "'vector_length' value must be positive" "" { target c++ } } */
{ {
/* We're actually executing with vector_length (1), just the GCC nvptx /* We're actually executing with vector_length (1), just the GCC nvptx
@ -265,7 +265,7 @@ int main ()
int gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max; int gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max;
gangs_min = workers_min = vectors_min = INT_MAX; gangs_min = workers_min = vectors_min = INT_MAX;
gangs_max = workers_max = vectors_max = INT_MIN; gangs_max = workers_max = vectors_max = INT_MIN;
#pragma acc parallel copy (workers_actual) /* { dg-warning "using num_workers \\(32\\), ignoring 2097152" "" { target openacc_nvidia_accel_configured } } */ \ #pragma acc parallel copy (workers_actual) /* { dg-warning "using num_workers \\(32\\), ignoring 2097152" "" { target openacc_nvidia_accel_selected } } */ \
num_workers (WORKERS) num_workers (WORKERS)
{ {
if (acc_on_device (acc_device_host)) if (acc_on_device (acc_device_host))
@ -350,7 +350,7 @@ int main ()
int gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max; int gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max;
gangs_min = workers_min = vectors_min = INT_MAX; gangs_min = workers_min = vectors_min = INT_MAX;
gangs_max = workers_max = vectors_max = INT_MIN; gangs_max = workers_max = vectors_max = INT_MIN;
#pragma acc parallel copy (vectors_actual) /* { dg-warning "using vector_length \\(1024\\), ignoring 2097152" "" { target openacc_nvidia_accel_configured } } */ \ #pragma acc parallel copy (vectors_actual) /* { dg-warning "using vector_length \\(1024\\), ignoring 2097152" "" { target openacc_nvidia_accel_selected } } */ \
vector_length (VECTORS) vector_length (VECTORS)
{ {
if (acc_on_device (acc_device_host)) if (acc_on_device (acc_device_host))
@ -390,7 +390,7 @@ int main ()
int gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max; int gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max;
gangs_min = workers_min = vectors_min = INT_MAX; gangs_min = workers_min = vectors_min = INT_MAX;
gangs_max = workers_max = vectors_max = INT_MIN; gangs_max = workers_max = vectors_max = INT_MIN;
#pragma acc parallel copy (vectors_actual) /* { dg-warning "using vector_length \\(32\\), ignoring runtime setting" "" { target openacc_nvidia_accel_configured } } */ \ #pragma acc parallel copy (vectors_actual) /* { dg-warning "using vector_length \\(32\\), ignoring runtime setting" "" { target openacc_nvidia_accel_selected } } */ \
vector_length (vectors) vector_length (vectors)
{ {
if (acc_on_device (acc_device_host)) if (acc_on_device (acc_device_host))
@ -437,7 +437,7 @@ int main ()
int gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max; int gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max;
gangs_min = workers_min = vectors_min = INT_MAX; gangs_min = workers_min = vectors_min = INT_MAX;
gangs_max = workers_max = vectors_max = INT_MIN; gangs_max = workers_max = vectors_max = INT_MIN;
#pragma acc parallel copy (gangs_actual, workers_actual, vectors_actual) /* { dg-warning "using vector_length \\(32\\), ignoring 11" "" { target openacc_nvidia_accel_configured } } */ \ #pragma acc parallel copy (gangs_actual, workers_actual, vectors_actual) /* { dg-warning "using vector_length \\(32\\), ignoring 11" "" { target openacc_nvidia_accel_selected } } */ \
num_gangs (gangs) \ num_gangs (gangs) \
num_workers (WORKERS) \ num_workers (WORKERS) \
vector_length (VECTORS) vector_length (VECTORS)

View File

@ -4,7 +4,7 @@
int int
main (void) main (void)
{ {
#pragma acc parallel vector_length (64) num_workers (16) /* { dg-warning "using num_workers \\(15\\), ignoring 16" "" { target openacc_nvidia_accel_configured } } */ #pragma acc parallel vector_length (64) num_workers (16) /* { dg-warning "using num_workers \\(15\\), ignoring 16" "" { target openacc_nvidia_accel_selected } } */
{ {
#pragma acc loop worker #pragma acc loop worker
for (unsigned int i = 0; i < 32; i++) for (unsigned int i = 0; i < 32; i++)

View File

@ -75,6 +75,11 @@ foreach offload_target [concat [split $offload_targets ","] "disable"] {
} }
set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared" set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared"
# To avoid compilation overhead, and to keep simple '-foffload=[...]'
# handling in test cases, by default only build for the offload target
# that we're actually going to test.
set tagopt "$tagopt -foffload=$offload_target"
# Force usage of the corresponding OpenACC device type.
setenv ACC_DEVICE_TYPE $openacc_device_type setenv ACC_DEVICE_TYPE $openacc_device_type
# To get better test coverage for device-specific code that is only # To get better test coverage for device-specific code that is only

View File

@ -94,6 +94,11 @@ if { $lang_test_file_found } {
} }
set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared" set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared"
# To avoid compilation overhead, and to keep simple '-foffload=[...]'
# handling in test cases, by default only build for the offload target
# that we're actually going to test.
set tagopt "$tagopt -foffload=$offload_target"
# Force usage of the corresponding OpenACC device type.
setenv ACC_DEVICE_TYPE $openacc_device_type setenv ACC_DEVICE_TYPE $openacc_device_type
# For Fortran we're doing torture testing, as Fortran has far more tests # For Fortran we're doing torture testing, as Fortran has far more tests