From patchwork Mon Jun 19 08:02:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 109758 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2839729vqr; Mon, 19 Jun 2023 01:03:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ61OqXw4cjzySMuy4qweSQP+x/kfbTEhJjkWMGPEld2idiwnzkid/mB4n7UbL1kNXNj6FL5 X-Received: by 2002:a17:906:58d2:b0:988:7a66:93d8 with SMTP id e18-20020a17090658d200b009887a6693d8mr2264742ejs.75.1687161830743; Mon, 19 Jun 2023 01:03:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687161830; cv=none; d=google.com; s=arc-20160816; b=Pj0oqyk1l6DYFhqV23owwtv4Oato5zSuyPEAohgl/ycIfZa6BaEW3/N+089s3aOACn +UQQFY775nBeJKSMzbtjnpEF+FsSo1hEorZtwi9W7Q049s6M1OMIpWvK9xS4R0SWtWHT DLL3t0DXtCJwa0qYk4zJ7Z6WjZ8QCzzfKkz3qIaAFINzczDg8kHskXJsvvYyGi8IjrOm GJh1ZeDJwfYFyCxFYlyDOJz0jCY4cns/g2vQUr0B9mEJVBf6Yku9/uRYyGIq2HZ6BwdF 5JwaeAlyap/JmDsq3G7gCiiahdmGd/bu45AZ7UwJoc+uVbfvcZ3x6UwiuzjR6e0fCvPJ Ukkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:in-reply-to:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :ironport-sdr:dmarc-filter:delivered-to; bh=cIVlgvmqqkXydizUVUVR8WG825PfHM9E8gk0hLGQt28=; b=GhJHxtKMvCgkd+ahV0UAV62GIeIeqO9pK6SbRikLjn8E2YfBTINoL/U1ylKaEQiDa3 J30ZWgyhSXKQFn84FD2MIBwS1XUOyJWp+nGI4a/NiXmKBW6R/0nG9/FFvsiM1brZF7SQ vuplXtZSINQcOEYld8O0EIZn7yQRw2dtXI1oofg0HFtRVu/SpyzKUEYfVObGLfVNn1Iu u5AFl57jzoj2B5pd7eFJE4G6a4L+cGyDjDehnx3W4zawW/3Yz/NACl1tiX+jrBlDQ6aJ Fpz7MdzK4nSg71kvJ1Xd41nSkkytWhvigIM/TZSOTdcTfiPgPNiHtnu7Al/RRe+OeK84 lwUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id m16-20020a170906259000b0097894b09c9asi2990457ejb.213.2023.06.19.01.03.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 01:03:50 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 75A783858C60 for ; Mon, 19 Jun 2023 08:03:46 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 36D9F3858D32 for ; Mon, 19 Jun 2023 08:03:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 36D9F3858D32 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="6.00,254,1681200000"; d="diff'?scan'208";a="10298544" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 19 Jun 2023 00:03:03 -0800 IronPort-SDR: +xdxyJTEV6iOCA6rFbTmKV84L9GYnvrgF+j2/zk5Arh1vQiKBQIsw3+36qDiV4Dfyh0lk3quTV wlqyFJGgjIJ5O7JI2WUJp7ylS2DzgEXWImTM+jhvUXOgrVVIqSOzcNJDVtt0aj2/0+mHOIgV6+ OVFP67mptHOR9N/bfYvYlp9vENPkKOx4e9/LQkl4fZ6HYNoHbBNLQLY+2w0297orlVkAj6QhkL sHf8UKPrDzrGUxZBXidfmpdJnTmN3tYiOq/KSZ2YonT1KFn2I2L62yLzpN1txDtFmRwpy4vZfy suo= Message-ID: Date: Mon, 19 Jun 2023 10:02:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: [committed] libgomp.c/target-51.c: Accept more error-msg variants in dg-output (was: Re: [committed] libgomp: Fix OMP_TARGET_OFFLOAD=mandatory) Content-Language: en-US To: Thomas Schwinge CC: References: <1487d7d4-8611-0d78-6bf2-9bffdd4daa64@codesourcery.com> <91bb9136-f8a4-e516-3f42-ed6d66dc8ce0@codesourcery.com> <87cz1vf8as.fsf@euler.schwinge.homeip.net> From: Tobias Burnus In-Reply-To: <87cz1vf8as.fsf@euler.schwinge.homeip.net> 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=-11.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769117403575212896?= X-GMAIL-MSGID: =?utf-8?q?1769117403575212896?= On 16.06.23 22:42, Thomas Schwinge wrote: > I see the new tests PASS, but with offloading enabled (nvptx) also see: > > PASS: libgomp.c/target-51.c (test for excess errors) > PASS: libgomp.c/target-51.c execution test > [-PASS:-]{+FAIL:+} libgomp.c/target-51.c output pattern test > > ... due to: > > Output was: > > libgomp: OMP_TARGET_OFFLOAD is set to MANDATORY, but device cannot be used for offloading > > Should match: > .*libgomp: OMP_TARGET_OFFLOAD is set to MANDATORY, but device not found.* Thanks for the report. I can offer yet another wording for the same program – and also with nvptx enabled: libgomp: OMP_TARGET_OFFLOAD is set to MANDATORY, but device cannot be used for offloading And I can also offer (which is already in the testcase with "! offload_device"): libgomp: OMP_TARGET_OFFLOAD is set to MANDATORY, but only the host device is available I think I will just match "..., but .*" without distinguishing check_effective_target_* ... ... which I now did in commit r14-1926-g01fe115ba7eafe (see also attached patch). * * * With offloading, there are simply too many possibilities: * Not compiled with offloading support - vs. with (ENABLE_OFFLOADING) * Support compiled in but either compiler or library support not installed (requires configuring with --enable-offload-defaulted) * Offloading libgomp plugins there but no CUDA or hsa runtime libraries * The latter being installed but no device available Plus -foffload=disable or only enabling an (at runtime) unavailable or unsupported device type or other issues like CUDA and device present but an issue with the kernel driver (or similar half-broken states) or ... [And with remote testing issues related to dg-set-target-env-var and only few systems supporting offloading, a full test coverage is even harder.] Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 commit 01fe115ba7eafebcf97bbac9e157038a003d0c85 Author: Tobias Burnus Date: Mon Jun 19 09:52:10 2023 +0200 libgomp.c/target-51.c: Accept more error-msg variants in dg-output Depending on the details, the testcase can fail with different but related messages; all of the following all could be observed for this testcase: libgomp: OMP_TARGET_OFFLOAD is set to MANDATORY, but device cannot be used for offloading libgomp: OMP_TARGET_OFFLOAD is set to MANDATORY, but device not found libgomp: OMP_TARGET_OFFLOAD is set to MANDATORY, but only the host device is available Before, the last two were tested for with 'target offload_device' and '! offload_device', respectively. Now, all three are accepted by matching '.*' already after 'but' and without distinguishing whether the effective target is an offload_device or not. (For completeness, there is a fourth error that follows this pattern: 'OMP_TARGET_OFFLOAD is set to MANDATORY, but device is finalized'.) libgomp/ * testsuite/libgomp.c/target-51.c: Accept more error msg variants as expected dg-output. --- libgomp/testsuite/libgomp.c/target-51.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libgomp/testsuite/libgomp.c/target-51.c b/libgomp/testsuite/libgomp.c/target-51.c index bbe9ade6e24..db0363bfc14 100644 --- a/libgomp/testsuite/libgomp.c/target-51.c +++ b/libgomp/testsuite/libgomp.c/target-51.c @@ -9,8 +9,7 @@ /* See comment in target-50.c/target-50.c for why the output differs. */ -/* { dg-output ".*libgomp: OMP_TARGET_OFFLOAD is set to MANDATORY, but only the host device is available.*" { target { ! offload_device } } } */ -/* { dg-output ".*libgomp: OMP_TARGET_OFFLOAD is set to MANDATORY, but device not found.*" { target offload_device } } */ +/* { dg-output ".*libgomp: OMP_TARGET_OFFLOAD is set to MANDATORY, but .*" } } */ int main ()