public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Julian Brown <julian@codesourcery.com>
To: fortran@gcc.gnu.org
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH v4 4/4] OpenMP/OpenACC: Unordered/non-constant component offset struct mapping
Date: Mon, 10 Oct 2022 07:24:54 +0100	[thread overview]
Message-ID: <20221010072454.20f49013@squid.athome> (raw)
Message-ID: <20221010062454.pk3MKTNTf5tiB0bNPiBrWqcmb2jpzpZim2fLQx8dcJc@z> (raw)
In-Reply-To: <3ff03cb463d35ffe96b1271a146f24899b2cb573.1665351785.git.julian@codesourcery.com>

On Sun, 9 Oct 2022 14:51:37 -0700
Julian Brown <julian@codesourcery.com> wrote:

> diff --git a/libgomp/testsuite/libgomp.fortran/map-subarray-3.f90
> b/libgomp/testsuite/libgomp.fortran/map-subarray-3.f90 new file mode
> 100644 index 00000000000..b009a4224cc
> --- /dev/null
> +++ b/libgomp/testsuite/libgomp.fortran/map-subarray-3.f90
> @@ -0,0 +1,48 @@
> +
> +gvar(1)%arr => arr1
> +gvar(2)%arr => arr2
> +gvar(3)%arr => arr3
> +
> +gvar(1)%arr = 0
> +gvar(2)%arr = 0
> +gvar(3)%arr = 0
> +
> +i = 1
> +j = 2
> +
> +!$omp target map(gvar(i)%arr, gvar(j)%arr, gvar(j)%arr(1:5))
> +gvar(i)%arr(1) = gvar(i)%arr(1) + 1
> +gvar(j)%arr(1) = gvar(j)%arr(1) + 2
> +!$omp end target
> +
> +i = 2
> +j = 1
> +
> +!$omp target map(gvar(i)%arr, gvar(j)%arr, gvar(j)%arr(1:5))
> +gvar(i)%arr(1) = gvar(i)%arr(1) + 3
> +gvar(j)%arr(1) = gvar(j)%arr(1) + 4
> +!$omp end target
> +
> +if (gvar(i)%arr(1).ne.4) stop 1
> +if (gvar(j)%arr(1).ne.6) stop 2

Oops, this should have been:

-if (gvar(i)%arr(1).ne.4) stop 1
-if (gvar(j)%arr(1).ne.6) stop 2
+if (gvar(1)%arr(1).ne.5) stop 1
+if (gvar(2)%arr(1).ne.5) stop 2

Julian



  reply	other threads:[~2022-10-10  7:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-09 21:51 [PATCH v4 0/4] Fortran pointers and unordered structs Julian Brown
2022-10-09 21:51 ` [PATCH v4 1/4] OpenMP: Pointers and member mappings Julian Brown
2022-10-09 21:51 ` [PATCH v4 2/4] OpenMP/OpenACC: Reindent TO/FROM/_CACHE_ stanza in {c_}finish_omp_clause Julian Brown
2022-10-09 21:51 ` [PATCH v4 3/4] OpenMP/OpenACC: Rework clause expansion and nested struct handling Julian Brown
2022-10-09 21:51 ` [PATCH v4 4/4] OpenMP/OpenACC: Unordered/non-constant component offset struct mapping Julian Brown
2022-10-10  6:24   ` Julian Brown [this message]
2022-10-10  6:24     ` Julian Brown
2022-10-10 10:38   ` Jakub Jelinek

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=20221010072454.20f49013@squid.athome \
    --to=julian@codesourcery.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /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).