public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Chung-Lin Tang <cltang@codesourcery.com>, <gcc-patches@gcc.gnu.org>
Cc: Catherine Moore <clm@codesourcery.com>,
	Tobias Burnus <tobias@codesourcery.com>
Subject: Enable 'c-c++-common/goacc/{if,self}-clause-1.c' for C++ (was: [PATCH, OpenACC 2.7] Implement self clause for compute constructs)
Date: Wed, 25 Oct 2023 11:02:04 +0200	[thread overview]
Message-ID: <87msw7vzw3.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <87pm13w04d.fsf@euler.schwinge.homeip.net>

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

Hi!

On 2023-10-25T10:57:06+0200, I wrote:
> With minor textual conflicts resolved, I've pushed this to master branch
> in commit 3a3596389c2e539cb8fd5dc5784a4e2afe193a2a
> "OpenACC 2.7: Implement self clause for compute constructs", see
> attached.
>
>
> I'll then apply/submit a number of follow-on commits.

> --- /dev/null
> +++ b/gcc/testsuite/c-c++-common/goacc/self-clause-1.c
> @@ -0,0 +1,22 @@
> +/* { dg-skip-if "not yet" { c++ } } */

Pushed to master branch commit 76cc5463227308c4dd2b70ccfe04d2b5361db0fe
"Enable 'c-c++-common/goacc/{if,self}-clause-1.c' for C++", see attached.

> +
> +void
> +f (int b)
> +{
> +  struct { int i; } *p;
> +
> +#pragma acc parallel self self(b) /* { dg-error "too many 'self' clauses" } */
> +  ;
> +#pragma acc parallel self(*p) /* { dg-error "used struct type value where scalar is required" } */
> +  ;
> +
> +#pragma acc kernels self self(b) /* { dg-error "too many 'self' clauses" } */
> +  ;
> +#pragma acc kernels self(*p) /* { dg-error "used struct type value where scalar is required" } */
> +  ;
> +
> +#pragma acc serial self self(b) /* { dg-error "too many 'self' clauses" } */
> +  ;
> +#pragma acc serial self(*p) /* { dg-error "used struct type value where scalar is required" } */
> +  ;
> +}


Grüße
 Thomas


-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Enable-c-c-common-goacc-if-self-clause-1.c-for-C.patch --]
[-- Type: text/x-diff, Size: 3335 bytes --]

From 76cc5463227308c4dd2b70ccfe04d2b5361db0fe Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Fri, 20 Oct 2023 14:07:37 +0200
Subject: [PATCH] Enable 'c-c++-common/goacc/{if,self}-clause-1.c' for C++

As discovered via recent
commit 3a3596389c2e539cb8fd5dc5784a4e2afe193a2a
"OpenACC 2.7: Implement self clause for compute constructs",
'c-c++-common/goacc/if-clause-1.c', which the new
'c-c++-common/goacc/self-clause-1.c' was copied from, was not enabled for C++.

	gcc/testsuite/
	* c-c++-common/goacc/if-clause-1.c: Enable for C++
	* c-c++-common/goacc/self-clause-1.c: Likewise.
---
 gcc/testsuite/c-c++-common/goacc/if-clause-1.c   |  6 ++++--
 gcc/testsuite/c-c++-common/goacc/self-clause-1.c | 14 ++++++++++----
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/gcc/testsuite/c-c++-common/goacc/if-clause-1.c b/gcc/testsuite/c-c++-common/goacc/if-clause-1.c
index 85abf1659e9..d78520bdd1b 100644
--- a/gcc/testsuite/c-c++-common/goacc/if-clause-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/if-clause-1.c
@@ -1,4 +1,4 @@
-/* { dg-skip-if "not yet" { c++ } } */
+/* See also 'self-clause-1.c'.  */
 
 void
 f (void)
@@ -6,5 +6,7 @@ f (void)
   struct { int i; } *p;
 #pragma acc data copyout(p) if(1) if(1) /* { dg-error "too many 'if' clauses" } */
   ;
-#pragma acc update device(p) if(*p) /* { dg-error "used struct type value where scalar is required" } */
+#pragma acc update device(p) if(*p)
+  /* { dg-error {used struct type value where scalar is required} {} { target c } .-1 }
+     { dg-error {could not convert '\* p' from 'f\(\)::<unnamed struct>' to 'bool'} {} { target c++ } .-2 } */
 }
diff --git a/gcc/testsuite/c-c++-common/goacc/self-clause-1.c b/gcc/testsuite/c-c++-common/goacc/self-clause-1.c
index ed5d072e81f..fe892bea210 100644
--- a/gcc/testsuite/c-c++-common/goacc/self-clause-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/self-clause-1.c
@@ -1,4 +1,4 @@
-/* { dg-skip-if "not yet" { c++ } } */
+/* See also 'if-clause-1.c'.  */
 
 void
 f (int b)
@@ -7,16 +7,22 @@ f (int b)
 
 #pragma acc parallel self self(b) /* { dg-error "too many 'self' clauses" } */
   ;
-#pragma acc parallel self(*p) /* { dg-error "used struct type value where scalar is required" } */
+#pragma acc parallel self(*p)
+  /* { dg-error {used struct type value where scalar is required} {} { target c } .-1 }
+     { dg-error {could not convert '\* p' from 'f\(int\)::<unnamed struct>' to 'bool'} {} { target c++ } .-2 } */
   ;
 
 #pragma acc kernels self self(b) /* { dg-error "too many 'self' clauses" } */
   ;
-#pragma acc kernels self(*p) /* { dg-error "used struct type value where scalar is required" } */
+#pragma acc kernels self(*p)
+  /* { dg-error {used struct type value where scalar is required} {} { target c } .-1 }
+     { dg-error {could not convert '\* p' from 'f\(int\)::<unnamed struct>' to 'bool'} {} { target c++ } .-2 } */
   ;
 
 #pragma acc serial self self(b) /* { dg-error "too many 'self' clauses" } */
   ;
-#pragma acc serial self(*p) /* { dg-error "used struct type value where scalar is required" } */
+#pragma acc serial self(*p)
+  /* { dg-error {used struct type value where scalar is required} {} { target c } .-1 }
+     { dg-error {could not convert '\* p' from 'f\(int\)::<unnamed struct>' to 'bool'} {} { target c++ } .-2 } */
   ;
 }
-- 
2.34.1


  reply	other threads:[~2023-10-25  9:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13 15:52 [PATCH, OpenACC 2.7] Implement self clause for compute constructs Chung-Lin Tang
2023-10-25  8:57 ` Thomas Schwinge
2023-10-25  9:02   ` Thomas Schwinge [this message]
2023-10-25  9:10   ` Disentangle handling of OpenACC 'host', 'self' pragma tokens (was: [PATCH, OpenACC 2.7] Implement self clause for compute constructs) Thomas Schwinge
2023-10-25  9:21   ` Consistently order 'OMP_CLAUSE_SELF' right after 'OMP_CLAUSE_IF' " Thomas Schwinge
2023-10-25  9:29   ` Extend test suite coverage for OpenACC 'self' clause for compute constructs " Thomas Schwinge
2023-10-25  9:35     ` Handle OpenACC 'self' clause for compute constructs in OpenACC 'kernels' decomposition (was: Extend test suite coverage for OpenACC 'self' clause for compute constructs (was: [PATCH, OpenACC 2.7] Implement self clause for compute constructs)) Thomas Schwinge
2023-10-25  9:44   ` Minor fixes for OpenACC/Fortran 'self' clause for compute constructs (was: [PATCH, OpenACC 2.7] Implement self clause for compute constructs) Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87msw7vzw3.fsf@euler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=clm@codesourcery.com \
    --cc=cltang@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tobias@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).