diff mbox series

[og9] Fix libgomp.oacc-fortran/lib-16.f90 test

Message ID 34e3c3d6-2213-8bb0-693a-1b71b1998ee5@gmail.com
State New
Headers show
Series [og9] Fix libgomp.oacc-fortran/lib-16.f90 test | expand

Commit Message

Kwok Cheung Yeung Nov. 22, 2019, 4:11 p.m. UTC
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  <kcy@codesourcery.com>

	libgomp/
	* testsuite/libgomp.oacc-fortran/lib-16.f90: Fix async-safety issue.

Comments

Julian Brown Nov. 22, 2019, 4:31 p.m. UTC | #1
On Fri, 22 Nov 2019 16:11:15 +0000
Kwok Cheung Yeung <kcyeung77@gmail.com> wrote:

> 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?

Fine by me, FWIW!

Thanks,

Julian
diff mbox series

Patch

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