Hi Tobias!

On 2019-11-06T00:47:05+0100, I wrote:
> --- a/libgomp/testsuite/libgomp.oacc-fortran/common-block-2.f90
> +++ b/libgomp/testsuite/libgomp.oacc-fortran/common-block-2.f90
> @@ -76,7 +76,9 @@ program main
>  
>    !$acc enter data create(b)
>  
> -  !$acc parallel loop pcopy(b)
> +  !$acc parallel loop &
> +  !$acc   no_create(b) ! ... here means 'present(b)'.
> +  !TODO But we get: "libgomp: cuStreamSynchronize error: an illegal memory 
> access was encountered".
>    do i = 1, n
>       b(i) = i
>    end do

Either I'm completely confused -- always possible ;-) -- or there's
something wrong; see the two attached test cases, not actually related to
Fortran common blocks at all.  If such a basic usage of the 'no_create'
clause doesn't work...?  So, again..., seems that my suspicion was right
that this patch doesn't have sufficient test coverage at all.  Or, I'm
completely confused -- we still have that option, too.  ;-\


Grüße
 Thomas


From 38fcb35dcb98b0fd709db72896455895243d8e54 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tho...@codesourcery.com>
Date: Wed, 6 Nov 2019 13:39:12 +0100
Subject: [PATCH] 'libgomp.oacc-c-c++-common/common-block-2_.c',
 'libgomp.oacc-fortran/common-block-2_.f90'

---
 .../common-block-2_.c                         | 19 +++++++++++++++
 .../libgomp.oacc-fortran/common-block-2_.f90  | 23 +++++++++++++++++++
 2 files changed, 42 insertions(+)
 create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/common-block-2_.c
 create mode 100644 libgomp/testsuite/libgomp.oacc-fortran/common-block-2_.f90

diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/common-block-2_.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/common-block-2_.c
new file mode 100644
index 00000000000..5cf547049ab
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/common-block-2_.c
@@ -0,0 +1,19 @@
+// Adapted/reduced from 'libgomp.oacc-fortran/common-block-2.f90'.
+
+int main()
+{
+#define N 100
+  float b[N];
+
+#pragma acc enter data create(b)
+
+#pragma acc parallel loop \
+  /*present(b)*/ /* ... works.  */ \
+  no_create(b) /* ... here also means 'present(b)', but we get: "libgomp: cuStreamSynchronize error: an illegal memory access was encountered".  */
+  for (int i = 0; i < N; ++i)
+    b[i] = i;
+
+#pragma acc exit data delete(b)
+
+  return 0;
+}
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/common-block-2_.f90 b/libgomp/testsuite/libgomp.oacc-fortran/common-block-2_.f90
new file mode 100644
index 00000000000..f3f25869bea
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/common-block-2_.f90
@@ -0,0 +1,23 @@
+! { dg-do run }
+
+! Adapted/reduced from 'libgomp.oacc-fortran/common-block-2.f90'.
+
+program main
+  implicit none
+  integer i
+  integer, parameter :: n = 100
+  real*4 b(n)
+  !common /BLOCK/ b
+
+  !$acc enter data create(b)
+
+  !$acc parallel loop &
+  !!$acc   present(b) ! ... works.
+  !$acc   no_create(b) ! ... here also means 'present(b)', but we get: "libgomp: cuStreamSynchronize error: an illegal memory access was encountered".
+  do i = 1, n
+     b(i) = i
+  end do
+  !$acc end parallel loop
+
+  !$acc exit data delete(b)
+end program main
-- 
2.17.1

Attachment: signature.asc
Description: PGP signature

Reply via email to