public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [gomp4] remove bogus tests
@ 2015-10-10 15:00 Nathan Sidwell
  2015-10-11 22:18 ` Nathan Sidwell
  2015-10-16  9:20 ` [gomp4,committed] Handle oacc region in oacc routine Tom de Vries
  0 siblings, 2 replies; 5+ messages in thread
From: Nathan Sidwell @ 2015-10-10 15:00 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 497 bytes --]

I've committed this to gomp4 branch.  Both these tests are trying an 'acc loop' 
  outside of an offload region.  That's an error.

Of course, a diagnostic should be emitted, but the remainder of the tests are 
apparently checking valid constructs.  So I chose to  simply remove the 
erroneous case for the moment.

If anyone's wondering, a patch  I'm working on blew up on these two cases 
because it tried to manipulate the  loop and then discovered it wasn't in an 
offloaded function.

nathan

[-- Attachment #2: gomp4-test.patch --]
[-- Type: text/x-patch, Size: 1058 bytes --]

2015-10-10  Nathan Sidwell  <nathan@codesourcery.com>

	* c-c++-common/goacc-gomp/nesting-1.c: Remove bogus loop case.
	* c-c++-common/goacc/nesting-1.c: Likewise.

Index: gcc/testsuite/c-c++-common/goacc-gomp/nesting-1.c
===================================================================
--- gcc/testsuite/c-c++-common/goacc-gomp/nesting-1.c	(revision 228669)
+++ gcc/testsuite/c-c++-common/goacc-gomp/nesting-1.c	(working copy)
@@ -44,16 +44,3 @@ f_acc_parallel (void)
     i = 0;
   }
 }
-
-void
-f_omp_parallel (void)
-{
-#pragma omp parallel
-  {
-    int i;
-
-#pragma acc loop
-    for (i = 0; i < 2; ++i)
-      ;
-  }
-}
Index: gcc/testsuite/c-c++-common/goacc/nesting-1.c
===================================================================
--- gcc/testsuite/c-c++-common/goacc/nesting-1.c	(revision 228669)
+++ gcc/testsuite/c-c++-common/goacc/nesting-1.c	(working copy)
@@ -92,10 +92,6 @@ f_acc_data (void)
 #pragma acc enter data copyin(i)
 
 #pragma acc exit data delete(i)
-
-#pragma acc loop
-      for (i = 0; i < 2; ++i)
-	;
     }
   }
 }

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gomp4] remove bogus tests
  2015-10-10 15:00 [gomp4] remove bogus tests Nathan Sidwell
@ 2015-10-11 22:18 ` Nathan Sidwell
  2015-10-16  9:20 ` [gomp4,committed] Handle oacc region in oacc routine Tom de Vries
  1 sibling, 0 replies; 5+ messages in thread
From: Nathan Sidwell @ 2015-10-11 22:18 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 232 bytes --]

On 10/10/15 11:00, Nathan Sidwell wrote:
> I've committed this to gomp4 branch.  Both these tests are trying an 'acc loop'
>   outside of an offload region.  That's an error.

Missed that goacc/nesting-1 had 2 bogus loops.

nathan


[-- Attachment #2: gomp4-test-2.patch --]
[-- Type: text/x-patch, Size: 548 bytes --]

2015-10-11  Nathan Sidwell  <nathan@codesourcery.com>

	* c-c++-common/goacc/nesting-1.c: Remove another bogus loop.

Index: gcc/testsuite/c-c++-common/goacc/nesting-1.c
===================================================================
--- gcc/testsuite/c-c++-common/goacc/nesting-1.c	(revision 228678)
+++ gcc/testsuite/c-c++-common/goacc/nesting-1.c	(working copy)
@@ -58,10 +58,6 @@ f_acc_data (void)
 
 #pragma acc exit data delete(i)
 
-#pragma acc loop
-    for (i = 0; i < 2; ++i)
-      ;
-
 #pragma acc data
     {
 #pragma acc parallel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gomp4,committed] Handle oacc region in oacc routine
@ 2015-10-16  9:20 ` Tom de Vries
  2015-10-22  9:24   ` OpenACC constructs nesting checks (was: [gomp4,committed] Handle oacc region in oacc routine) Thomas Schwinge
  0 siblings, 1 reply; 5+ messages in thread
From: Tom de Vries @ 2015-10-16  9:20 UTC (permalink / raw)
  To: gcc-patches; +Cc: Thomas Schwinge, Jakub Jelinek

[-- Attachment #1: Type: text/plain, Size: 233 bytes --]

Hi,

this patch checks for occurance of oacc offload regions in oacc routines 
(which means nested parallelism, which is currently not supported) and 
gives an appropriate error message.

Committed to gomp-4_0-branch.

Thanks,
- Tom

[-- Attachment #2: 0001-Handle-oacc-region-in-oacc-routine.patch --]
[-- Type: text/x-patch, Size: 1534 bytes --]

Handle oacc region in oacc routine

2015-10-16  Tom de Vries  <tom@codesourcery.com>

	* omp-low.c (check_omp_nesting_restrictions): Check for oacc region in
	oacc routine.

	* c-c++-common/goacc/parallel-in-routine.c: New test.
---
 gcc/omp-low.c                                          | 9 +++++++++
 gcc/testsuite/c-c++-common/goacc/parallel-in-routine.c | 8 ++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 gcc/testsuite/c-c++-common/goacc/parallel-in-routine.c

diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index f27bde7..f7e4afc 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -3204,6 +3204,15 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
 	}
       break;
     case GIMPLE_OMP_TARGET:
+      if (is_gimple_omp_offloaded (stmt)
+	  && get_oacc_fn_attrib (cfun->decl) != NULL)
+	{
+	  error_at (gimple_location (stmt),
+		    "OpenACC region inside of OpenACC routine, nested "
+		    "parallelism not supported yet");
+	  return false;
+	}
+
       for (; ctx != NULL; ctx = ctx->outer)
 	{
 	  if (gimple_code (ctx->stmt) != GIMPLE_OMP_TARGET)
diff --git a/gcc/testsuite/c-c++-common/goacc/parallel-in-routine.c b/gcc/testsuite/c-c++-common/goacc/parallel-in-routine.c
new file mode 100644
index 0000000..b93d63b
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/goacc/parallel-in-routine.c
@@ -0,0 +1,8 @@
+#pragma acc routine
+void
+foo (void)
+{
+#pragma acc parallel /* { dg-error "OpenACC region inside of OpenACC routine, nested parallelism not supported yet" } */
+  ;
+}
+
-- 
1.9.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* OpenACC constructs nesting checks (was: [gomp4,committed] Handle oacc region in oacc routine)
  2015-10-16  9:20 ` [gomp4,committed] Handle oacc region in oacc routine Tom de Vries
@ 2015-10-22  9:24   ` Thomas Schwinge
  2015-10-28  9:16     ` OpenACC constructs nesting checks Tom de Vries
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Schwinge @ 2015-10-22  9:24 UTC (permalink / raw)
  To: Tom de Vries; +Cc: Jakub Jelinek, gcc-patches, nathan

[-- Attachment #1: Type: text/plain, Size: 1364 bytes --]

Hi Tom!

On Fri, 16 Oct 2015 11:17:25 +0200, Tom de Vries <Tom_deVries@mentor.com> wrote:
> this patch checks for occurance of oacc offload regions in oacc routines 
> (which means nested parallelism, which is currently not supported) and 
> gives an appropriate error message.

> --- /dev/null
> +++ b/gcc/testsuite/c-c++-common/goacc/parallel-in-routine.c
> @@ -0,0 +1,8 @@
> +#pragma acc routine
> +void
> +foo (void)
> +{
> +#pragma acc parallel /* { dg-error "OpenACC region inside of OpenACC routine, nested parallelism not supported yet" } */
> +  ;
> +}

Please move such tests into
gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c and/or
gcc/testsuite/c-c++-common/goacc-gomp/nesting-fail-1.c, and nesting tests
that are expected to succeed into
gcc/testsuite/c-c++-common/goacc/nesting-1.c and/or
gcc/testsuite/c-c++-common/goacc-gomp/nesting-1.c.  (I have not looked up
the corresponding Fortran testsuite files.)


When fixing that, please also add back (checking for appropriate
diagnostics) the tests that Nathan apparently didn't know where to put,
and thus removed, in
<http://news.gmane.org/find-root.php?message_id=%3C56192805.6090200%40acm.org%3E>
(gomp-4_0-branch r228678), and
<http://news.gmane.org/find-root.php?message_id=%3C561AE027.9040601%40acm.org%3E>
(gomp-4_0-branch r228694).


Grüße
 Thomas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: OpenACC constructs nesting checks
  2015-10-22  9:24   ` OpenACC constructs nesting checks (was: [gomp4,committed] Handle oacc region in oacc routine) Thomas Schwinge
@ 2015-10-28  9:16     ` Tom de Vries
  0 siblings, 0 replies; 5+ messages in thread
From: Tom de Vries @ 2015-10-28  9:16 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: Jakub Jelinek, gcc-patches, nathan

[-- Attachment #1: Type: text/plain, Size: 1642 bytes --]

On 22/10/15 11:10, Thomas Schwinge wrote:
> Hi Tom!
>
> On Fri, 16 Oct 2015 11:17:25 +0200, Tom de Vries <Tom_deVries@mentor.com> wrote:
>> this patch checks for occurance of oacc offload regions in oacc routines
>> (which means nested parallelism, which is currently not supported) and
>> gives an appropriate error message.
>
>> --- /dev/null
>> +++ b/gcc/testsuite/c-c++-common/goacc/parallel-in-routine.c
>> @@ -0,0 +1,8 @@
>> +#pragma acc routine
>> +void
>> +foo (void)
>> +{
>> +#pragma acc parallel /* { dg-error "OpenACC region inside of OpenACC routine, nested parallelism not supported yet" } */
>> +  ;
>> +}
>
> Please move such tests into
> gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c and/or
> gcc/testsuite/c-c++-common/goacc-gomp/nesting-fail-1.c, and nesting tests
> that are expected to succeed into
> gcc/testsuite/c-c++-common/goacc/nesting-1.c and/or
> gcc/testsuite/c-c++-common/goacc-gomp/nesting-1.c.  (I have not looked up
> the corresponding Fortran testsuite files.)
>
>
> When fixing that, please also add back (checking for appropriate
> diagnostics) the tests that Nathan apparently didn't know where to put,
> and thus removed, in
> <http://news.gmane.org/find-root.php?message_id=%3C56192805.6090200%40acm.org%3E>
> (gomp-4_0-branch r228678), and
> <http://news.gmane.org/find-root.php?message_id=%3C561AE027.9040601%40acm.org%3E>
> (gomp-4_0-branch r228694).
>
>

Committed attached patches:

      1	Move goacc/parallel-in-routine.c to goacc/nesting-fail-1.c
      2	Test for acc loop in omp parallel
      3	Move dg-error tests from goacc/nesting-1.c to
         goacc/nesting-fail-1.c

Thanks,
- Tom

[-- Attachment #2: 0001-Move-goacc-parallel-in-routine.c-to-goacc-nesting-fa.patch --]
[-- Type: text/x-patch, Size: 1609 bytes --]

Move goacc/parallel-in-routine.c to goacc/nesting-fail-1.c

2015-10-28  Tom de Vries  <tom@codesourcery.com>

	* c-c++-common/goacc/parallel-in-routine.c (foo): Move function ...
	* c-c++-common/goacc/nesting-fail-1.c (f_acc_routine): ... here.
	* c-c++-common/goacc/parallel-in-routine.c: Remove.
---
 gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c      | 8 ++++++++
 gcc/testsuite/c-c++-common/goacc/parallel-in-routine.c | 8 --------
 2 files changed, 8 insertions(+), 8 deletions(-)
 delete mode 100644 gcc/testsuite/c-c++-common/goacc/parallel-in-routine.c

diff --git a/gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c b/gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c
index 9bc95e9..855444c 100644
--- a/gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c
@@ -37,3 +37,11 @@ f_acc_kernels (void)
 #pragma acc exit data delete(i) /* { dg-error "enter/exit data construct inside of kernels region" } */
   }
 }
+
+#pragma acc routine
+void
+f_acc_routine (void)
+{
+#pragma acc parallel /* { dg-error "OpenACC region inside of OpenACC routine, nested parallelism not supported yet" } */
+  ;
+}
diff --git a/gcc/testsuite/c-c++-common/goacc/parallel-in-routine.c b/gcc/testsuite/c-c++-common/goacc/parallel-in-routine.c
deleted file mode 100644
index b93d63b..0000000
--- a/gcc/testsuite/c-c++-common/goacc/parallel-in-routine.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#pragma acc routine
-void
-foo (void)
-{
-#pragma acc parallel /* { dg-error "OpenACC region inside of OpenACC routine, nested parallelism not supported yet" } */
-  ;
-}
-
-- 
1.9.1


[-- Attachment #3: 0002-Test-for-acc-loop-in-omp-parallel.patch --]
[-- Type: text/x-patch, Size: 1060 bytes --]

Test for acc loop in omp parallel

2015-10-28  Tom de Vries  <tom@codesourcery.com>

	* c-c++-common/goacc-gomp/nesting-fail-1.c (f_omp): Test for acc loop in
	omp parallel.
---
 gcc/testsuite/c-c++-common/goacc-gomp/nesting-fail-1.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/testsuite/c-c++-common/goacc-gomp/nesting-fail-1.c b/gcc/testsuite/c-c++-common/goacc-gomp/nesting-fail-1.c
index 1ba5b17..cd1f1eb 100644
--- a/gcc/testsuite/c-c++-common/goacc-gomp/nesting-fail-1.c
+++ b/gcc/testsuite/c-c++-common/goacc-gomp/nesting-fail-1.c
@@ -14,6 +14,9 @@ f_omp (void)
 #pragma acc update host(i) /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
 #pragma acc enter data copyin(i) /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
 #pragma acc exit data delete(i) /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
+#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
+    for (i = 0; i < 2; ++i)
+      ;
   }
 
 #pragma omp for
-- 
1.9.1


[-- Attachment #4: 0003-Move-dg-error-tests-from-goacc-nesting-1.c-to-goacc-.patch --]
[-- Type: text/x-patch, Size: 2052 bytes --]

Move dg-error tests from goacc/nesting-1.c to goacc/nesting-fail-1.c

2015-10-28  Tom de Vries  <tom@codesourcery.com>

	* c-c++-common/goacc/nesting-1.c (f_acc_data): Move dg-error tests to ...
	* c-c++-common/goacc/nesting-fail-1.c (f_acc_data): ... here.
---
 gcc/testsuite/c-c++-common/goacc/nesting-1.c      |  8 --------
 gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c | 19 +++++++++++++++++++
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/gcc/testsuite/c-c++-common/goacc/nesting-1.c b/gcc/testsuite/c-c++-common/goacc/nesting-1.c
index 3a8f838..cab4f98 100644
--- a/gcc/testsuite/c-c++-common/goacc/nesting-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/nesting-1.c
@@ -58,10 +58,6 @@ f_acc_data (void)
 
 #pragma acc exit data delete(i)
 
-#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
-    for (i = 0; i < 2; ++i)
-      ;
-
 #pragma acc data
     {
 #pragma acc parallel
@@ -92,10 +88,6 @@ f_acc_data (void)
 #pragma acc enter data copyin(i)
 
 #pragma acc exit data delete(i)
-
-#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
-      for (i = 0; i < 2; ++i)
-	;
     }
   }
 }
diff --git a/gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c b/gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c
index 855444c..bced28a 100644
--- a/gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c
@@ -45,3 +45,22 @@ f_acc_routine (void)
 #pragma acc parallel /* { dg-error "OpenACC region inside of OpenACC routine, nested parallelism not supported yet" } */
   ;
 }
+
+void
+f_acc_data (void)
+{
+  unsigned int i;
+#pragma acc data
+  {
+#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
+    for (i = 0; i < 2; ++i)
+      ;
+
+#pragma acc data
+    {
+#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
+      for (i = 0; i < 2; ++i)
+	;
+    }
+  }
+}
-- 
1.9.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-28  8:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-10 15:00 [gomp4] remove bogus tests Nathan Sidwell
2015-10-11 22:18 ` Nathan Sidwell
2015-10-16  9:20 ` [gomp4,committed] Handle oacc region in oacc routine Tom de Vries
2015-10-22  9:24   ` OpenACC constructs nesting checks (was: [gomp4,committed] Handle oacc region in oacc routine) Thomas Schwinge
2015-10-28  9:16     ` OpenACC constructs nesting checks 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).