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 F2781383A326 for ; Tue, 14 Jun 2022 16:41:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F2781383A326 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.91,300,1647331200"; d="scan'208";a="77147793" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 14 Jun 2022 08:41:50 -0800 IronPort-SDR: pM2Tyr7ev7LoD+XzONufzeUL2izKW2dHsIjMUiTurs3TUL8sEMrQ3FL1m01P/+ECDYWLuNKiqX UW0ywJhY+3/tLgVJzn9dujQtE/0JqkIAuAMDMtSBf7zzKR7D1Bz//SaIupu5SL43phGZZdlx7x yEF0man5fw46+wIHpOJGrsjvYG8mxwsTcw4Zu4V2fPGn/pO2oiQDCYRZpjUmB4tRfTdX/zbJyr IhIHh6BdSPI9+qkXGwUiye7g2mYTGPm4HRFjXcXC1ILNKZZR5wvIZ58rndQITHyl0tlqHOKYyS h9g= From: Thomas Schwinge To: Jakub Jelinek CC: , Tobias Burnus , Marcel Vollweiler Subject: Re: [committed] openmp: Conforming device numbers and omp_{initial, invalid}_device In-Reply-To: References: User-Agent: Notmuch/0.29.1+93~g67ed7df (https://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) Date: Tue, 14 Jun 2022 18:41:37 +0200 Message-ID: <87r13ri4e6.fsf@dem-tschwing-1.ger.mentorg.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-15.mgc.mentorg.com (139.181.222.15) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2022 16:41:55 -0000 Hi Jakub! On 2022-06-13T14:06:39+0200, Jakub Jelinek via Gcc-patches wrote: > OpenMP 5.2 changed once more what device numbers are allowed. > libgomp/ > * testsuite/libgomp.c-c++-common/target-is-accessible-1.c (main): A= dd > test with omp_initial_device. Use -5 instead of -1 for negative va= lue > test. > * testsuite/libgomp.fortran/target-is-accessible-1.f90 (main): > Likewise. Reorder stop numbers. In an offloading configuration, I'm seeing: PASS: libgomp.fortran/get-mapped-ptr-1.f90 -O (test for excess error= s) [-PASS:-]{+FAIL:+} libgomp.fortran/get-mapped-ptr-1.f90 -O execution= test Does that one need similar treatment? It FAILs in 'STOP 1'; 'libgomp.fortran/get-mapped-ptr-1.f90': 1 program main 2 use omp_lib 3 use iso_c_binding 4 implicit none (external, type) 5 integer :: d, id 6 type(c_ptr) :: p 7 integer, target :: q 8 9 d =3D omp_get_default_device () 10 id =3D omp_get_initial_device () 11 12 if (d < 0 .or. d >=3D omp_get_num_devices ()) & 13 d =3D id 14 15 p =3D omp_target_alloc (c_sizeof (q), d) 16 if (.not. c_associated (p)) & 17 stop 0 ! okay 18 19 if (omp_target_associate_ptr (c_loc (q), p, c_sizeof (q), & 20 0_c_size_t, d) =3D=3D 0) then 21 22 if(c_associated (omp_get_mapped_ptr (c_loc (q), -1))) & 23 stop 1 [...] Gr=C3=BC=C3=9Fe Thomas > --- libgomp/testsuite/libgomp.c-c++-common/target-is-accessible-1.c.jj = 2022-05-23 21:44:48.950848384 +0200 > +++ libgomp/testsuite/libgomp.c-c++-common/target-is-accessible-1.c 202= 2-06-13 13:10:56.471535852 +0200 > @@ -17,7 +17,10 @@ main () > if (!omp_target_is_accessible (p, sizeof (int), id)) > __builtin_abort (); > > - if (omp_target_is_accessible (p, sizeof (int), -1)) > + if (!omp_target_is_accessible (p, sizeof (int), omp_initial_device)) > + __builtin_abort (); > + > + if (omp_target_is_accessible (p, sizeof (int), -5)) > __builtin_abort (); > > if (omp_target_is_accessible (p, sizeof (int), n + 1)) > --- libgomp/testsuite/libgomp.fortran/target-is-accessible-1.f90.jj 202= 2-05-23 21:44:48.954848343 +0200 > +++ libgomp/testsuite/libgomp.fortran/target-is-accessible-1.f90 202= 2-06-13 13:12:08.133819977 +0200 > @@ -19,12 +19,15 @@ program main > if (omp_target_is_accessible (p, c_sizeof (d), id) /=3D 1) & > stop 2 > > - if (omp_target_is_accessible (p, c_sizeof (d), -1) /=3D 0) & > + if (omp_target_is_accessible (p, c_sizeof (d), omp_initial_device) /= =3D 1) & > stop 3 > > - if (omp_target_is_accessible (p, c_sizeof (d), n + 1) /=3D 0) & > + if (omp_target_is_accessible (p, c_sizeof (d), -5) /=3D 0) & > stop 4 > > + if (omp_target_is_accessible (p, c_sizeof (d), n + 1) /=3D 0) & > + stop 5 > + > ! Currently, a host pointer is accessible if the device supports share= d > ! memory or omp_target_is_accessible is executed on the host. This > ! test case must be adapted when unified shared memory is avialable. > @@ -35,14 +38,14 @@ program main > !$omp end target > > if (omp_target_is_accessible (p, c_sizeof (d), d) /=3D shared_mem) & > - stop 5; > + stop 6; > > if (omp_target_is_accessible (c_loc (a), 128 * sizeof (a(1)), d) /= =3D shared_mem) & > - stop 6; > + stop 7; > > do i =3D 1, 128 > if (omp_target_is_accessible (c_loc (a(i)), sizeof (a(i)), d) /=3D= shared_mem) & > - stop 7; > + stop 8; > end do > > end do ----------------- 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