From patchwork Mon Oct 14 16:41:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1997062 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=LZhtZA5F; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XS30W3kFdz1xtb for ; Tue, 15 Oct 2024 03:41:47 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B53B8385AE5B for ; Mon, 14 Oct 2024 16:41:45 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by sourceware.org (Postfix) with ESMTPS id 7295B3858414 for ; Mon, 14 Oct 2024 16:41:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7295B3858414 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=baylibre.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7295B3858414 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::12d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728924074; cv=none; b=iml/O0cQ3dZ7Wx5rt3DnkiRfIrQjG1F7XTmyPtdmwTA+RG8/23VI/WVFkrL9YQrWhz407rSd2AfR/ii4aBhxd7GZTFKb5B64gtKc+xyAEFv5MLT/nCEToH6Ja4YenlZFSaV5h0+TOxLr75WZcMdtMj6C6DosREiIzhXWk1ivH0s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728924074; c=relaxed/simple; bh=cluRCNGcIVjNBAjGwZbU+mslKpQwBRewUn7bmI5cUkk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=CTIpqawVe53KXhHRGYFB/CoYqfYYxBi87I06FjjkhGyNSlGaia1eCRIJrJYXhkUrJvTzMsxUxDYgqr7COXMQrPi5u3VpEodPxgXTFqs97HKss0iX+gaQdRuwYaAKi360QpVSW4a+VrzhixXlCG1T4AGvBZoepjffOAciPKI4Jk0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-539ee1acb86so1884164e87.0 for ; Mon, 14 Oct 2024 09:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1728924068; x=1729528868; darn=gcc.gnu.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=sUNxDnv12lJFYsNIzyqa9WuBmGa0IPlq2kqfm9Hhs1s=; b=LZhtZA5FO03HWJro9pQHJlBcU/TvMmWh34FLpYNjHAJQmvHXmNA9QkxcjZVP8KUvZM +ukgkk4LnWbc5qk3sfXWlUNv6GxNK0jxLTRKBXpvdA7MSkbZ2SnDD1JT/NESfrr72Xs9 gTF6itndZlIBR2GAR3uG2+wkEtFoufGhfGH8I9kZoFW2WJ6Sty7mZ8jJQbYccl/hZQ0r 8BkU0+PlVmtJ+x6AFkt4uRnTiiszBah7YZAEzIdtm9wczuTc27ZwYmfnOuKNuXYx7UNL Dhq3EyUQ3KRHUE5hgr+VHS5K+VS04a2fF0So2MNhvjf0vFvkRp7ZINmO1fmp2HOFXOG4 DZzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728924068; x=1729528868; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=sUNxDnv12lJFYsNIzyqa9WuBmGa0IPlq2kqfm9Hhs1s=; b=dD257HbmsBna6F9WXpXYUr8KnOFJ25oH0JeX9t6XBPjgX0z+eUpw06qlOhkqMhrI6A WhcVAqLbCWIiOifPhd9yX8Crr28019+HSI+vM47aQtzDivdcZgb3kcqSWACXX2khssx7 17FS1nYRVYY7Gre36Vld1LpV+IHMeXj2aqyI8K7Z1wnAdXF3BmmP5b6/t7WmJC2xD5tR lAY7+OAvoMPh76XyKRdj9BCBT5zb11Vc3i+uftzKbEUFvsmLP27Sxw5lIxLTWkhXOM+F l9bVo6xsIoB53dLNK4zZNBpneyEhQLm3lJvjNxenlK8KdNRBhGmbUJHA6g+PFunBP+zO SO3g== X-Gm-Message-State: AOJu0Yx0O/hryrW3XBl7ZRmEU0HX+yVFPUaoxCfImqFHXGkB0VNfcYCJ gHen5s2a1dVjLVB/8ct8ELKB066FU3TzfaeBpYSr9mMmC47Qizz5sCca1kHR26+dtPPzD1qBHYF D X-Google-Smtp-Source: AGHT+IFUATTj2+YsgkF04U6lME9f/6O62wVB3th9B+tgxAc2Bs+N+imjx6hHSoWq2L6kVbNHsSqQ+g== X-Received: by 2002:a05:6512:2202:b0:536:55a8:6f78 with SMTP id 2adb3069b0e04-539e54e8532mr3193524e87.17.1728924067404; Mon, 14 Oct 2024 09:41:07 -0700 (PDT) Received: from euler.schwinge.ddns.net (p200300c8b733b9005e8fc6f38b6af531.dip0.t-ipconnect.de. [2003:c8:b733:b900:5e8f:c6f3:8b6a:f531]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431182ff6d3sm124185905e9.12.2024.10.14.09.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 09:41:06 -0700 (PDT) From: Thomas Schwinge To: gcc-patches@gcc.gnu.org Cc: fortran@gcc.gnu.org, Tobias Burnus Subject: OpenACC 'nohost' clause: harmonize 'libgomp.oacc-{c-c++-common,fortran}/routine-nohost-1.*' In-Reply-To: <87o8av8g2q.fsf@euler.schwinge.homeip.net> References: <85bef1e7-8ecd-c7d8-7a4c-fdad81e8350e@codesourcery.com> <87o8av8g2q.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.30+8~g47a4bad (https://notmuchmail.org) Emacs/29.4 (x86_64-pc-linux-gnu) Date: Mon, 14 Oct 2024 18:41:04 +0200 Message-ID: <87zfn67i3j.fsf@euler.schwinge.ddns.net> MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Hi! On 2021-07-22T00:20:13+0200, I wrote: > [...], I've now pushed "OpenACC 'nohost' clause" to > master branch in commit a61f6afbee370785cf091fe46e2e022748528307, [...] Via Tobias' recent commit 3269a722b7a03613e9c4e2862bc5088c4a17cc11 "Fortran: Use OpenACC's acc_on_device builtin, fix OpenMP' __builtin_is_initial_device", I remembered this thing from three years ago: > --- /dev/null > +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-nohost-1.c > @@ -0,0 +1,63 @@ > +/* Test 'nohost' clause via 'acc_on_device'. > + > + With optimizations disabled, we currently don't expect that 'acc_on_device' "evaluates at compile time to a constant". > + { dg-skip-if "TODO PR82391" { *-*-* } { "-O0" } } > +*/ > + > +/* { dg-additional-options "-fdump-tree-oaccdevlow" } */ > + > +/* { dg-additional-options "-fno-inline" } for stable results regarding OpenACC 'routine'. */ > +[...] Here we do specify '-fno-inline'... > --- /dev/null > +++ b/libgomp/testsuite/libgomp.oacc-fortran/routine-nohost-1.f90 > @@ -0,0 +1,63 @@ > +! Test 'nohost' clause via 'acc_on_device'. > + > +! { dg-do run } > + > +! With optimizations disabled, we currently don't expect that 'acc_on_device' "evaluates at compile time to a constant". > +! { dg-skip-if "TODO PR82391" { *-*-* } { "-O0" } } > + > +! { dg-additional-options "-fdump-tree-oaccdevlow" } > + > +program main > +[...] ..., but here we didn't. To address that, I've pushed to trunk branch commit de0320712d026a2d1eeb57aef277fa5a91808ac2 (HEAD, upstream/trunk) "OpenACC 'nohost' clause: harmonize 'libgomp.oacc-{c-c++-common,fortran}/routine-nohost-1.*'", see attached. Grüße Thomas From de0320712d026a2d1eeb57aef277fa5a91808ac2 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 14 Oct 2024 14:38:13 +0200 Subject: [PATCH] OpenACC 'nohost' clause: harmonize 'libgomp.oacc-{c-c++-common,fortran}/routine-nohost-1.*' The test case 'libgomp.oacc-fortran/routine-nohost-1.f90' added in 2021 commit a61f6afbee370785cf091fe46e2e022748528307 "OpenACC 'nohost' clause" was dependend on inlining being enabled, and otherwise ('-fno-inline') failed to optimize/link: /tmp/ccb2hsPd.o: In function `MAIN__._omp_fn.0': routine-nohost-1.f90:(.text+0xf4): undefined reference to `fact_nohost_' However, as of recent commit 3269a722b7a03613e9c4e2862bc5088c4a17cc11 "Fortran: Use OpenACC's acc_on_device builtin, fix OpenMP' __builtin_is_initial_device", we're now properly handling OpenACC/Fortran 'acc_on_device', and may specify '-fno-inline', like done in 'libgomp.oacc-c-c++-common/routine-nohost-1.c'. libgomp/ * testsuite/libgomp.oacc-fortran/routine-nohost-1.f90: Add '-fno-inline'. --- libgomp/testsuite/libgomp.oacc-fortran/routine-nohost-1.f90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libgomp/testsuite/libgomp.oacc-fortran/routine-nohost-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/routine-nohost-1.f90 index b0537b8ff0b..e5f3e5740da 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/routine-nohost-1.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/routine-nohost-1.f90 @@ -7,6 +7,8 @@ ! { dg-additional-options "-fdump-tree-oaccloops" } +! { dg-additional-options "-fno-inline" } for stable results regarding OpenACC 'routine'. + program main use openacc implicit none -- 2.34.1