public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: Julian Brown <julian@codesourcery.com>, <gcc-patches@gcc.gnu.org>
Cc: Jakub Jelinek <jakub@redhat.com>, <Thomas_Schwinge@mentor.com>
Subject: Re: [PATCH] OpenACC: whole struct vs. component mappings (PR107028)
Date: Wed, 28 Sep 2022 17:17:30 +0200	[thread overview]
Message-ID: <66a6261f-cf6f-3a54-b928-eb86ffab4db7@codesourcery.com> (raw)
In-Reply-To: <20220928132024.64984-1-julian@codesourcery.com>

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

On 28.09.22 15:20, Julian Brown wrote:

This patch fixes an ICE when both a complete struct variable and
components of that struct are mapped on the same directive for OpenACC,
using a modified version of the scheme used for OpenMP in the following
patch [...]
Tested with offloading to NVPTX. OK?

OpenACC comments:

I do note that there are now two "appears more than once in map clauses". The
newly added  error_at in oacc_resolve_clause_dependencies is triggered by
gcc/testsuite/gfortran.dg/goacc/{derived-types-3.f90,goacc/mapping-tests-{1,4}.f90}.

However, it looks as if no testcase triggers anymore the OpenACC-only error_at
in omp_accumulate_sibling_list. My impression is that the oacc_resolve_clause_dependencies
check + 'if (grp->deleted) continue;' in the sibling-list function makes this difficult to hit.

I don't see immediately whether some cases can still reach omp_accumulate_sibling_list –
if so, a testcase would be nice, or whether that error_at can now be removed.


However, I note that *without* the patch, the *following* *error* triggers – while
it compiles *silently* *with* the *patch* applied:

   15 |   !$acc enter data copyin(x%A, x%A%i(5), x%A%i(5))
      |                                                  ^
Error: ‘x.a.i’ appears more than once in map clauses

   15 |   !$acc enter data copyin(x%A, x%A%i(5), x%A%i(4))
      |                                                  ^
Error: ‘x.a.i’ appears more than once in map clauses

BTW: The two testcases differ by the array-element: '5'/'5' vs. '5'/'4'.
Testcase is a modified existing one:

--- a/gcc/testsuite/gfortran.dg/goacc/mapping-tests-4.f90
+++ b/gcc/testsuite/gfortran.dg/goacc/mapping-tests-4.f90
@@ -3 +3 @@ subroutine foo
-    integer i, j
+    integer i(5), j
@@ -15 +15 @@ subroutine foo
-  !$acc enter data copyin(x%A, x%A%i, x%A%i)
+  !$acc enter data copyin(x%A, x%A%i(5), x%A%i(4))

Otherwise, the patch looks sensible - as far as I understand it.
However, it surely would help if Thomas and/or Jakub could have a second look.

Tobias


2022-09-28  Julian Brown  <julian@codesourcery.com><mailto:julian@codesourcery.com>

gcc/
        PR middle-end/107028
        * gimplify.cc (omp_group_base): Fix IF_PRESENT handling.
        (omp_check_mapping_compatibility, oacc_resolve_clause_dependencies):
        New functions.
        (build_struct_sibling_lists): Skip deleted groups.  Don't build sibling
        list for struct variables that are fully mapped on the same directive
        for OpenACC.
        (gimplify_scan_omp_clauses): Call oacc_resolve_clause_dependencies.

gcc/testsuite/
        PR middle-end/107028
        * c-c++-common/goacc/struct-component-kind-1.c: New test.
        * g++.dg/goacc/pr107028-1.C: New test.
        * g++.dg/goacc/pr107028-2.C: New test.

-----------------
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

  reply	other threads:[~2022-09-28 15:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 13:20 Julian Brown
2022-09-28 15:17 ` Tobias Burnus [this message]
2022-09-29 12:59   ` Julian Brown
2022-09-29 13:09     ` Tobias Burnus

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=66a6261f-cf6f-3a54-b928-eb86ffab4db7@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=Thomas_Schwinge@mentor.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=julian@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).