libgomp.oacc-fortran/lib-16.f90 in the libgomp testsuite currently fails
with:
Program aborted. Backtrace:
#0 0x4013bf in MAIN__
at
src/gcc-gcn-master/libgomp/testsuite/libgomp.oacc-fortran/lib-16.f90:28
#1 0x4013bf in main
at
src/gcc-gcn-master/libgomp/testsuite/libgomp.oacc-fortran/lib-16.f90:6
In commit 3a25e449d04d5768c3a799264ba0e5cab8ae181f ([og9] Fix OpenACC
"ephemeral" asynchronous host-to-device copies), lib-16-2.f90 has two
acc_waits added to wait for an asynchronous update to complete before
operating on the data. Since lib-16-2.f90 is supposed to be identical to
lib-16.f90 except for using 'include "openacc_lib.h"' instead of 'use
openacc', any changes to lib-16-2.f90 should also apply to lib-16.f90.
When the changes are applied to lib-16.f90, the test passes.
Okay to commit to OG9?
Thanks
Kwok
2019-11-22 Kwok Cheung Yeung <k...@codesourcery.com>
libgomp/
* testsuite/libgomp.oacc-fortran/lib-16.f90: Fix async-safety issue.
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/lib-16.f90
b/libgomp/testsuite/libgomp.oacc-fortran/lib-16.f90
index 011f9cf..5e01099 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/lib-16.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/lib-16.f90
@@ -27,6 +27,9 @@ program main
if (acc_is_present (h) .neqv. .TRUE.) call abort
+ ! We must wait for the update to be done.
+ call acc_wait (async)
+
h(:) = 0
call acc_copyout_async (h, sizeof (h), async)
@@ -45,6 +48,8 @@ program main
if (acc_is_present (h) .neqv. .TRUE.) call abort
+ call acc_wait (async)
+
do i = 1, N
if (h(i) /= i + i) call abort
end do