public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed, libgomp, openacc, testsuite] Fix async/wait logic in lib-13.f90
@ 2018-07-26  7:57 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2018-07-26  7:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: Thomas Schwinge

Hi,

the purpose of the lib-13.f90 test-case is to test acc_wait_all_async.  The
test indeed calls acc_wait_all_async, but then subsequentlys calls
acc_wait_all, so the acc_wait_all_async functionality is not tested.
Furthermore, all acc_async_test calls are placed in a location where they are
not guaranteed to succeed, which explains why there's an xfail for the lower
optimization levels.

This patch fixes the problems by replacing acc_wait_all with an acc_wait on
the async id used for the acc_wait_all_async call, and moving the
acc_async_test calls to the correct locations.

Reg-tested on x86_64 with nvptx accelerator.

Committed to trunk.

Thanks,
- Tom

[libgomp, openacc, testsuite] Fix async/wait logic in lib-13.f90

2018-07-26  Tom de Vries  <tdevries@suse.de>

	* testsuite/libgomp.oacc-fortran/lib-13.f90: Replace acc_wait_all with
	acc_wait.  Move acc_async_test calls to correct locations.  Remove
	xfail.

---
 libgomp/testsuite/libgomp.oacc-fortran/lib-13.f90 | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/libgomp/testsuite/libgomp.oacc-fortran/lib-13.f90 b/libgomp/testsuite/libgomp.oacc-fortran/lib-13.f90
index 6d713b1cd95..da944c35de9 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/lib-13.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/lib-13.f90
@@ -1,5 +1,4 @@
 ! { dg-do run }
-! { dg-xfail-run-if "TODO" { openacc_nvidia_accel_selected } { "-O0" "-O1" } { "" } }
 
 program main
   use openacc
@@ -22,13 +21,12 @@ program main
     end do
   !$acc end data
 
-  if (acc_async_test (1) .neqv. .TRUE.) call abort
-  if (acc_async_test (2) .neqv. .TRUE.) call abort
-
   call acc_wait_all_async (nprocs + 1)
 
-  if (acc_async_test (nprocs + 1) .neqv. .TRUE.) call abort
+  call acc_wait (nprocs + 1)
 
-  call acc_wait_all ()
+  if (acc_async_test (1) .neqv. .TRUE.) call abort
+  if (acc_async_test (2) .neqv. .TRUE.) call abort
+  if (acc_async_test (nprocs + 1) .neqv. .TRUE.) call abort
 
 end program

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-07-26  7:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-26  7:57 [committed, libgomp, openacc, testsuite] Fix async/wait logic in lib-13.f90 Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).