From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id A66303877426 for ; Mon, 2 Aug 2021 13:09:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A66303877426 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: Yv8FUVStuIV9vn8/KwI4CCnRKWMiA6o071hSavxDw13n8BIDquNYplbvTPTrC6Wk7NtVMtYNS+ CuQhgpmcRz9ciBitKPLYvGDN8wTiWR1IsJAkwb5Czj6SUTpcLYphV9fMZfhq64qmYQTog17hwQ PedibRtpYD1JBUWC3IJxNkHWauvj5DMLeZnyZExc32HMfLrCWSaRwbLTnVuPbeIBpFw9aqyeCk HqLl4A01r7KmkLFRIEB+aU5n1uN8WmmpdFJYoHVLTUPee4eoekuadOuY/GrZPEayTAQQrWONxZ NET/W5e67wg+IiOpA6CuOg24 X-IronPort-AV: E=Sophos;i="5.84,289,1620720000"; d="scan'208";a="64179776" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 02 Aug 2021 05:09:42 -0800 IronPort-SDR: XPqfJBKohvq81FP+JJumSillxTDk2wsVxHQudSPYk8MWr2n4pdcIrEweuzcNVy7MOWVN7sgN4/ uSCo3KjxgK/2vvoqOfX8nKN1zYX7MInulMf9bWILSCQA4oO+nCjs98rdCFJLdWhNV9eu8lrtvL s0O+g6aQ0/4XNr8omnAlPF5oB8XJubmn0yQn+5XvUj/IHx2IF6xnCHJOlU07gKss4gyEKwsnlR iCOnWm2BEFtqJ5SfYlw/DUa4ebQ/bwEvwJctxi71N3K2wvcjm8ZygNrge1p14igDFMPUP/2bA2 bmA= Subject: Re: [PATCH, libgomp, OpenMP 5.0] Implement omp_get_device_num To: Tobias Burnus , gcc-patches , Thomas Schwinge , Jakub Jelinek , Andrew Stubbs , Tom de Vries CC: "Vollweiler, Marcel (DI SW CAS EPS STS)" References: <32c3546a-49c1-bedf-3002-c4e7783bf312@codesourcery.com> <6271c5fa-a20d-8333-66d0-64ee2bca397f@codesourcery.com> From: Chung-Lin Tang Message-ID: <770f8215-213a-7f50-fa4d-5ba1a21d9abd@codesourcery.com> Date: Mon, 2 Aug 2021 21:09:25 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <6271c5fa-a20d-8333-66d0-64ee2bca397f@codesourcery.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) To svr-orw-mbx-02.mgc.mentorg.com (147.34.90.202) X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, BODY_8BITS, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_MANYTO, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Mon, 02 Aug 2021 13:09:44 -0000 On 2021/7/23 7:01 PM, Tobias Burnus wrote: > I personally prefer having: >    int initial_dev; > and inside 'omp target' (with 'map(from:initial_dev)'): >    initial_device = omp_is_initial_device(); > > Then the check would be: >   if (initial_device && host_device_num != device_num) >     abort(); >   if (!initial_device && host_device_num == device_num) >     abort(); > > (Likewise for Fortran.) Thanks, I've adjusted the new testcases to use this style. > And instead of restricting the target to nvptx/gcn, we could just add > dg-xfail-run-if for *-intelmic-* and *-intelmicemul-*. I've added a 'offload_target_intelmic' to use on the new testcases. > Additionally, offload_target_nvptx/...amdgcn only check whether > compilation support is available not whether a device exists > at run time. > (The device availability is checked by target_offload_device, > using omp_is_initial_device().) I guess there is value in testing compilation as long as the compiler is properly configured, and leaving the execution as an independent test. OTOH, I think the OpenMP execution tests are not properly forcing offload (or not) using the environment variables, unlike what we have for OpenACC. Thanks, Chung-Lin