From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by sourceware.org (Postfix) with ESMTPS id 5E8943858D35 for ; Tue, 6 Feb 2024 09:03:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5E8943858D35 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 5E8943858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::133 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707210231; cv=none; b=TkuMhbTErTvgSrMc0PTTgR9Uj5yXcX+MNigkLmzoR+o/BpT8umuA7f3cpjUz2BYHqbNHkWdS4+dUyt4+7SEpLqg/gRbgovzsuRUir3TKy1TCnTKq0J+Cxy2uGfcpUTi2eRTqlDV/6pfacvzTVg32cRExVkn1AxKRil9PXsu7WnI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707210231; c=relaxed/simple; bh=vWiqizHuJ3qtxwBmIw3hDdk5SL3yi8hiNUtvtSInSkE=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=xs146zzJkf3QBtdFPZVDymFtHad+vCpO6Vvew3DyF1wnqpxVuPcMevjnls4RzuXW1ystFw94rak9q8IyPRe0wD7Xz/1sOdCi8BTV/yznXxCKFCCezI96w6v0DuPD0Wf/SNMq4Lh1LJmQTV/7u6cacymyY8NZnChay26qcmEunw4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-5114c05806eso966221e87.1 for ; Tue, 06 Feb 2024 01:03:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1707210219; x=1707815019; darn=gcc.gnu.org; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=nVF2ZUT7aO4aCGH6y1pH6SOlaQx+w31NufQkbxM0F2g=; b=zc8vQjZEHdb32yMJKOEsQCI0XmcY2TZAX+Ellrs/YB5R7WCx6ph4N4ab7YombIlYxK ZL9ZdMMg2qo91ewx+6hWVRB3OjU5lTH+lUWwZ6pj9088ZWkd3qzLsisrKErl3ejevQ9O KUKknHH0IPUMwrpZ42ScRZbvmYWjeRlLvrLAbeYqp1ujd/Iw4fXZgCydhYCgvl3U6mJN w4Hum2GFPRcrAeO1Wf7O/1fh1oN4F04P6cTIg+uOVc5Lfz3DgRUywc1x0/Pa7GMARHLB rywPkFmGgnbn2HwBANfBWGuKmPLNZkJe/ZBlnOPcW0SGmBkrT4Q1knK3wnfmxh3sr/OY fh5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707210219; x=1707815019; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=nVF2ZUT7aO4aCGH6y1pH6SOlaQx+w31NufQkbxM0F2g=; b=uIoAcoPwexNcInZtGwtHSC7Om2+/MGzasRzsVSqFKVVK0TvwpcH/IJ2UfqMwhI5feb S6vVnKKb5BKRKf8uLvot0NUuYDz/R7fNptyVHz0BXYH5+H8iFl+5ItYuEVB4hhv3V/DL jctCjggitLlxNv1Au0UaQW+7QTLWk9RQ0qM2OBo4GdYyc3pIGiSzlmQ6h/+2OF7jE2dE bup84ADCVhwfT86lnyN8JRnY3l9aNthn6pCDp0ZeL1e9cGVBOGXZhIL3LnnVXSWIY9E4 qp4QkfiuvBrXVzwPWjSlyw8L8lkYLeBgj6Lof8dcFilwipNgyLPMSXybT3BYIFIb8VLH 4u5w== X-Gm-Message-State: AOJu0Yyyy07VdN0FOjCnixY77iGPTZCk0i+SoA4EFetbXBjHh5EK0iFA AlH2ERzIXN76o+hV8c92XaKKWI8hlO2T2d5C6u424CLFjOdKeolYHbl7nYmmaUozqy6GJIr0fD0 / X-Google-Smtp-Source: AGHT+IFyvA9Wvn4qve+Hqrz07rdylIBymjmWfATEH5Uzhjium4CBRKyCoM4RgaLHdNSBbmpA3ZGSXg== X-Received: by 2002:ac2:5059:0:b0:511:49f8:b42f with SMTP id a25-20020ac25059000000b0051149f8b42fmr1512049lfm.8.1707210218800; Tue, 06 Feb 2024 01:03:38 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCVJ2tjRcbkqVv4imP7G12wMZE+QJcYMRZGufXGqXry1MuFaTcn6MJeZuSsejtXH5/JiabK34MZpjn7uRjNFD9D9jNbPx5mus//w50BN4SY26Q7CmlOdGuqCY2g1O+KYifFmBtokdVt8EToiTTrQBtLya4s= Received: from ?IPV6:2001:16b8:2a95:cf00:bd15:1dd4:9371:ee78? (200116b82a95cf00bd151dd49371ee78.dip.versatel-1u1.de. [2001:16b8:2a95:cf00:bd15:1dd4:9371:ee78]) by smtp.gmail.com with ESMTPSA id e12-20020a170906044c00b00a35cf6727c1sm887348eja.105.2024.02.06.01.03.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Feb 2024 01:03:38 -0800 (PST) Content-Type: multipart/alternative; boundary="------------xWiJWskulu0R7i0TZ1y9BX19" Message-ID: <8ba3944a-44e5-41dd-b78f-95091eb140f6@baylibre.com> Date: Tue, 6 Feb 2024 10:03:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] openmp, fortran: Add Fortran support for indirect clause on the declare target directive Content-Language: en-US To: Kwok Cheung Yeung Cc: Jakub Jelinek , gcc-patches , fortran@gcc.gnu.org References: <3290a0f5-3b9d-4c3c-b7c5-e9ddec4520c7@baylibre.com> From: Tobias Burnus In-Reply-To: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 List-Id: This is a multi-part message in MIME format. --------------xWiJWskulu0R7i0TZ1y9BX19 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Kwok Cheung Yeung wrote: > As previously discussed, this version of the patch adds code to emit a > warning when a directive like this: > > !$omp declare target indirect(.true.) > > is encountered (i.e. a target directive containing at least one > clause, but no to/enter clause, which appears to violate the OpenMP > standard). A test is also added to > gfortran.dg/gomp/declare-target-indirect-1.f90 to test for this. Thanks. And indeed, the 5.1 spec requires under "Restrictions to the declare target directive are as follows:" "If the directive has a clause, it must contain at least one 'to' clause or at least one 'link' clause.". [5.2 replaced 'to' by its alias 'enter' and the 6.0 preview added 'local' to the list.] > I have also added a declare-target-indirect-3.f90 test to libgomp to > check that procedures passed via a dummy argument work properly when > used in an indirect call. > > Okay for mainline? LGTM. I just wonder whether there should be a value test and not just a does-not-crash-when-called test for the latter testcase, i.e. > +++ b/libgomp/testsuite/libgomp.fortran/declare-target-indirect-3.f90 > @@ -0,0 +1,25 @@ > +! { dg-do run } > + > +! Check that indirect calls work on procedures passed in via a dummy argument > + > +module m > +contains > + subroutine bar > + !$omp declare target enter(bar) indirect e.g. "integer function bar()" ... " bar = 42" > + end subroutine > + > + subroutine foo(f) > + procedure(bar) :: f > + > + !$omp target > + call f And then: if (f() /= 42) stop 1 > + !$omp end target > + end subroutine > +end module Thanks, Tobias --------------xWiJWskulu0R7i0TZ1y9BX19--