diff options
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/oacc-parallel.c | 17 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.oacc-fortran/self-1.f90 | 15 |
2 files changed, 12 insertions, 20 deletions
diff --git a/libgomp/oacc-parallel.c b/libgomp/oacc-parallel.c index cf37a1b..16cf394 100644 --- a/libgomp/oacc-parallel.c +++ b/libgomp/oacc-parallel.c @@ -184,19 +184,11 @@ GOACC_parallel_keyed (int flags_m, void (*fn) (void *), /* Host fallback if "if" clause is false or if the current device is set to the host. */ - if (flags & GOACC_FLAG_HOST_FALLBACK) - { - prof_info.device_type = acc_device_host; - api_info.device_type = prof_info.device_type; - goacc_save_and_set_bind (acc_device_host); - fn (hostaddrs); - goacc_restore_bind (); - goto out_prof; - } - else if (flags & GOACC_FLAG_LOCAL_DEVICE) - { + if ((flags & GOACC_FLAG_HOST_FALLBACK) /* TODO: a proper pthreads based "multi-core CPU" local device implementation. Currently, this is still the same as host-fallback. */ + || (flags & GOACC_FLAG_LOCAL_DEVICE)) + { prof_info.device_type = acc_device_host; api_info.device_type = prof_info.device_type; goacc_save_and_set_bind (acc_device_host); @@ -457,7 +449,8 @@ GOACC_data_start (int flags_m, size_t mapnum, /* Host fallback or 'do nothing'. */ if ((acc_dev->capabilities & GOMP_OFFLOAD_CAP_SHARED_MEM) - || (flags & GOACC_FLAG_HOST_FALLBACK)) + || (flags & GOACC_FLAG_HOST_FALLBACK) + || (flags & GOACC_FLAG_LOCAL_DEVICE)) { prof_info.device_type = acc_device_host; api_info.device_type = prof_info.device_type; diff --git a/libgomp/testsuite/libgomp.oacc-fortran/self-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/self-1.f90 index b9ec9de..6c1233d 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/self-1.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/self-1.f90 @@ -2,7 +2,6 @@ ! This is 'if-1.f90' with 'self(!cond)' instead of 'if(cond)' on compute ! constructs. -! ..., which the exception of certain 'kernels' constructs. ! { dg-do run } ! { dg-additional-options "-cpp" } @@ -523,7 +522,7 @@ program main a(:) = 16.0 - !$acc kernels if (0 == 1) ! { dg-line l_compute[incr c_compute] } + !$acc kernels self (0 /= 1) ! { dg-line l_compute[incr c_compute] } ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute } ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */ ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 } @@ -569,7 +568,7 @@ program main a(:) = 22.0 - !$acc kernels if (zero == 1) ! { dg-line l_compute[incr c_compute] } + !$acc kernels self (zero /= 1) ! { dg-line l_compute[incr c_compute] } ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute } ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */ ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 } @@ -615,7 +614,7 @@ program main a(:) = 76.0 - !$acc kernels if (.FALSE.) ! { dg-line l_compute[incr c_compute] } + !$acc kernels self (.TRUE.) ! { dg-line l_compute[incr c_compute] } ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute } ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */ ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 } @@ -665,7 +664,7 @@ program main nn = 0 - !$acc kernels if (nn == 1) ! { dg-line l_compute[incr c_compute] } + !$acc kernels self (nn /= 1) ! { dg-line l_compute[incr c_compute] } ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute } ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */ ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 } @@ -715,7 +714,7 @@ program main nn = 0; - !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if ((nn + nn) > 0) ! { dg-line l_compute[incr c_compute] } + !$acc kernels copyin (a(1:N)) copyout (b(1:N)) self (.NOT. ((nn + nn) > 0)) ! { dg-line l_compute[incr c_compute] } ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute } ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */ ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 } @@ -735,7 +734,7 @@ program main a(:) = 91.0 - !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (-2 > 0) ! { dg-line l_compute[incr c_compute] } + !$acc kernels copyin (a(1:N)) copyout (b(1:N)) self (.NOT. (-2 > 0)) ! { dg-line l_compute[incr c_compute] } ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute } ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */ ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 } @@ -781,7 +780,7 @@ program main a(:) = 87.0 - !$acc kernels if (one == 0) ! { dg-line l_compute[incr c_compute] } + !$acc kernels self (one /= 0) ! { dg-line l_compute[incr c_compute] } ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute } ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */ ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 } |