[PATCH] OpenACC: whole struct vs. component mappings (PR107028)

Julian Brown julian@codesourcery.com
Thu Sep 29 12:59:11 GMT 2022


On Wed, 28 Sep 2022 17:17:30 +0200
Tobias Burnus <tobias@codesourcery.com> wrote:

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

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

This version of the patch removes the now-redundant check in
omp_accumulate_sibling_list.

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

...and this test now triggers an error again (as it should -- you can't
map more than one part of the same array). Slightly unfortunately we're
not using the existing "group map" any more, since it doesn't record
quite the right thing -- instead, a local hash set is used to detect
duplicates in oacc_resolve_clause_dependencies.

Re-tested with offloading to NVPTX. OK?

Thanks,

Julian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v2-0001-OpenACC-whole-struct-vs.-component-mappings-PR107.patch
Type: text/x-patch
Size: 13887 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20220929/89fc4749/attachment.bin>


More information about the Gcc-patches mailing list