diff mbox

Add map clauses to libgomp test device-3.f90

Message ID alpine.LNX.2.20.13.1611151941360.28312@monopod.intra.ispras.ru
State New
Headers show

Commit Message

Alexander Monakov Nov. 15, 2016, 4:52 p.m. UTC
On Mon, 14 Nov 2016, Alexander Monakov wrote:
> On Mon, 14 Nov 2016, Martin Jambor wrote:
> 
> > Hi,
> > 
> > yesterday I forgot to send out the following patch.  The test
> > libgomp/testsuite/libgomp.fortran/examples-4/device-3.f90 was failing
> > for me when I was testing the HSA branch merge but I believe the test
> > itself is wrong and the failure is due to us now adhering to OpenMP
> > 4.5 default mapping of scalars (i.e. firstprivate, as opposed to
> > tofrom in 4.0) and the test itself needs to be fixed in the following
> > way.
> 
> From inspection, I believe device-1.f90 in the same directory has the same
> issue?

Yep, I do see new test execution failures with both Intel MIC and PTX offloading
on device-1.f90, device-3.f90 and target2.f90.  Here's an actually-tested patch
for the first two (on target2.f90 there's a different problem).

	Martin Jambor  <mjambor@suse.cz>
	Alexander Monakov  <amonakov@ispras.ru>

	* testsuite/libgomp.fortran/examples-4/device-1.f90 (e_57_1): Add
	mapping clauses to target constructs.
	* testsuite/libgomp.fortran/examples-4/device-3.f90 (e_57_3): Ditto.

Comments

Jakub Jelinek Nov. 15, 2016, 4:57 p.m. UTC | #1
On Tue, Nov 15, 2016 at 07:52:56PM +0300, Alexander Monakov wrote:
> On Mon, 14 Nov 2016, Alexander Monakov wrote:
> > On Mon, 14 Nov 2016, Martin Jambor wrote:
> > 
> > > Hi,
> > > 
> > > yesterday I forgot to send out the following patch.  The test
> > > libgomp/testsuite/libgomp.fortran/examples-4/device-3.f90 was failing
> > > for me when I was testing the HSA branch merge but I believe the test
> > > itself is wrong and the failure is due to us now adhering to OpenMP
> > > 4.5 default mapping of scalars (i.e. firstprivate, as opposed to
> > > tofrom in 4.0) and the test itself needs to be fixed in the following
> > > way.
> > 
> > From inspection, I believe device-1.f90 in the same directory has the same
> > issue?
> 
> Yep, I do see new test execution failures with both Intel MIC and PTX offloading
> on device-1.f90, device-3.f90 and target2.f90.  Here's an actually-tested patch
> for the first two (on target2.f90 there's a different problem).
> 
> 	Martin Jambor  <mjambor@suse.cz>
> 	Alexander Monakov  <amonakov@ispras.ru>
> 
> 	* testsuite/libgomp.fortran/examples-4/device-1.f90 (e_57_1): Add
> 	mapping clauses to target constructs.
> 	* testsuite/libgomp.fortran/examples-4/device-3.f90 (e_57_3): Ditto.

Ok, thanks.

	Jakub
diff mbox

Patch

diff --git a/libgomp/testsuite/libgomp.fortran/examples-4/device-1.f90 b/libgomp/testsuite/libgomp.fortran/examples-4/device-1.f90
index a411db4..30148f1 100644
--- a/libgomp/testsuite/libgomp.fortran/examples-4/device-1.f90
+++ b/libgomp/testsuite/libgomp.fortran/examples-4/device-1.f90
@@ -9,12 +9,12 @@  program e_57_1
   a = 100
   b = 0
 
-  !$omp target if(a > 200 .and. a < 400)
+  !$omp target map(from: c) if(a > 200 .and. a < 400)
     c = omp_is_initial_device ()
   !$omp end target
 
   !$omp target data map(to: b) if(a > 200 .and. a < 400)
-    !$omp target
+    !$omp target map(from: b, d)
       b = 100
       d = omp_is_initial_device ()
     !$omp end target
@@ -25,12 +25,12 @@  program e_57_1
   a = a + 200
   b = 0
 
-  !$omp target if(a > 200 .and. a < 400)
+  !$omp target map(from: c) if(a > 200 .and. a < 400)
     c = omp_is_initial_device ()
   !$omp end target
 
   !$omp target data map(to: b) if(a > 200 .and. a < 400)
-    !$omp target
+    !$omp target map(from: b, d)
       b = 100
       d = omp_is_initial_device ()
     !$omp end target
@@ -41,12 +41,12 @@  program e_57_1
   a = a + 200
   b = 0
 
-  !$omp target if(a > 200 .and. a < 400)
+  !$omp target map(from: c) if(a > 200 .and. a < 400)
     c = omp_is_initial_device ()
   !$omp end target
 
   !$omp target data map(to: b) if(a > 200 .and. a < 400)
-    !$omp target
+    !$omp target map(from: b, d)
       b = 100
       d = omp_is_initial_device ()
     !$omp end target
diff --git a/libgomp/testsuite/libgomp.fortran/examples-4/device-3.f90 b/libgomp/testsuite/libgomp.fortran/examples-4/device-3.f90
index a29f1b5..d770b91 100644
--- a/libgomp/testsuite/libgomp.fortran/examples-4/device-3.f90
+++ b/libgomp/testsuite/libgomp.fortran/examples-4/device-3.f90
@@ -8,13 +8,13 @@  program e_57_3
   integer :: default_device
 
   default_device = omp_get_default_device ()
-  !$omp target
+  !$omp target map(from: res)
     res = omp_is_initial_device ()
   !$omp end target
   if (res) call abort
 
   call omp_set_default_device (omp_get_num_devices ())
-  !$omp target
+  !$omp target map(from: res)
     res = omp_is_initial_device ()
   !$omp end target
   if (.not. res) call abort