From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 00AE03858D1E; Fri, 30 Sep 2022 15:01:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 00AE03858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.93,358,1654588800"; d="scan'208,217";a="83805986" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 30 Sep 2022 07:01:54 -0800 IronPort-SDR: 1cqszbA8HhbHl5oRSBU3bNNoJ4aCApQC6jA1pBiH+VtmtLpSKxUI3NvCwgiB9SHgm5rYf9Vqkw wnN08mA3UeoYUEZu9QzZgHIsT02pwxgt1Zsz2l4UoM7u0nmlxhdJXgWonJgZxC5scJ1//q8LRI RP7miqblIOK7busuS8hvcNm458YhlxTLWCZWYUHj0vyiku9XVlCwjh722qf3l7T1zDQIOOtPJq F8yxdpi7XcxDmDaRNtR+f0tW6slt7CNSL1p2ogX4t73Ud/YpKI/eGF12996JI/LHTluwhA8z8H upA= Content-Type: multipart/alternative; boundary="------------pesV8uhoBtd09HX4DDKYlW4k" Message-ID: Date: Fri, 30 Sep 2022 17:01:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH v3 06/11] OpenMP: Pointers and member mappings Content-Language: en-US To: Julian Brown CC: Jakub Jelinek , , , References: <20220918201929.60a6282e@squid.athome> <20220923082946.321d55f0@squid.athome> <4cb8ef27-5cb0-42d5-2e66-5bf93bd11c48@codesourcery.com> <20220930143022.1cc80cbd@squid.athome> From: Tobias Burnus In-Reply-To: <20220930143022.1cc80cbd@squid.athome> X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,KAM_DMARC_STATUS,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --------------pesV8uhoBtd09HX4DDKYlW4k Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable On 30.09.22 15:30, Julian Brown wrote: On Fri, 23 Sep 2022 14:10:51 +0200 Tobias Burnus <= mailto:tobias@codesourcery.com> wrote: ... I added n->expr->expr_type =3D=3D EXPR_VARIABLE to the condition -- I think that should suffice for now? Yes. A similar mean way to write code would be: integer, target :: A(5) integer, pointer :: p(:), p2(:) type(t) :: var allocate(p2(1:20)) p =3D> A var%p2 =3D> p2 !$omp target map(A(3:4), p2(4:8), p, var%p2) .... !$omp end target which has a similar issue =E2=80=93 it is not clear from the syntax whether p's or var%p2's pointer target has been mapped or not. Again, I don't think you're allowed to write that: that's "different list items" sharing the same "original storage", IIUC. (It'd be nice to diagnose it at compile time, but that's probably not that easy...) Hmm, isn't that implied to be valid per: "[Fortran] If a list item in a map clause is an associated pointer and the = pointer is not the base pointer of another list item in a map clause on the same construct, then it is treated as if its pointer target is implicitly mapped in the same clause." (OpenMP 5.2, 5.8.3 map Clause [152:1-4]; seems to be identical to OpenMP 5.1, 2.21.7.1 map Clause [349:9-12]) Admittedly, in 5.0 I only see the wording (OpenMP 5.0, [316:22-25]), which is also not handled - but different: "[Fortran] Each pointer component that is a list item that results from a mapped derived type variable is treated as if its association status is undefined, unless the pointer component appears as another list item or as the base pointer of another list item in a map clause on the same construct." I think the that's for the following case (which is also covered by the more general 5.1/5.2 wording): type t integer, pointer :: p(:) integer, pointer :: p2(:) end type t type(t) :: var integer, target :: tgt(5), tgt2(1000) var%p =3D> tgt var%p =3D> tgt2 !$omp target map(tgt, tgt2(4:6), var) var%p(1) =3D 5 var%p2(5) =3D 7 !$omp end target and I think GCC does not handled this, but I might be wrong. Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955 --------------pesV8uhoBtd09HX4DDKYlW4k--