From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 4A528385B529 for ; Thu, 30 May 2024 12:58:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4A528385B529 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4A528385B529 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717073934; cv=none; b=H6Z20No/akSDzj4KN0BfMhjIzL/27Mcilpb4GLGMeDSmKZdh48GPm5lnul7ZGxogZxgmcKcHsYODM8Sq9jPPaGS/BUaERtIO62suJrUJt+Tv6u0XQED75SxC8IVM0G7OORqlGnUngrfCiaf3NimyqV/pPHSFt3LP7sLGtV1R4ic= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717073934; c=relaxed/simple; bh=57LCyHgJQru0AR8WVcpVta4tfOHBGnQ2B+3Sd+oR7oU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=ve8sISNCoZz+fQrTIXQPhXm8N7ORcOGOMXaRn3fs569iEwcATVOOp2SOZcT4mrXMLsrpYhCQIn4+Vr4jSzV0cCdkdnh71C6UlErvw0uMm9Vdg7gmQa1X8sjh/UM+hlrsw7r62Ya84h2Ewa5++Sxqq9ZWDPSaabHGah2nxrPYdeA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 465DF339; Thu, 30 May 2024 05:59:15 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 79B0B3F792; Thu, 30 May 2024 05:58:50 -0700 (PDT) From: Richard Sandiford To: Tejas Belagod Mail-Followup-To: Tejas Belagod ,, , richard.sandiford@arm.com Cc: , Subject: Re: [PATCH 00/11] AArch64/OpenMP: Test SVE ACLE types with various OpenMP constructs. References: <20240527050626.3769230-1-tejas.belagod@arm.com> Date: Thu, 30 May 2024 13:58:49 +0100 In-Reply-To: <20240527050626.3769230-1-tejas.belagod@arm.com> (Tejas Belagod's message of "Mon, 27 May 2024 10:36:15 +0530") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-14.3 required=5.0 tests=BAYES_00,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,KAM_SHORT,SPF_HELO_NONE,SPF_NONE,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 List-Id: Tejas Belagod writes: > Note: This patch series is based on Richard's initial patch > https://gcc.gnu.org/pipermail/gcc-patches/2022-November/606741.html > and Jakub's suggestion > https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611892.html > > The following patch series handles various scenarios with OpenMP and SVE types. > The starting point for the series follows a suggestion from Jakub to cover all > the possible scenarios that could arise when OMP constructs/clauses etc are > used with SVE ACLE types. Here are a few instances that this patch series tests > and in some cases fixes the expected output. This patch series does not follow > a formal definition or a spec of how OMP interacts with SVE ACLE types, so it's > more of a proposed behaviour. Comments and discussion welcome. Thanks for doing this. I've left some comments on individual patches, but generally the series looks good from my limited abilit to evaluate it. Hopefully Jakub can say whether this catches all the cases that matter. Richard > This list is not exhaustive, but covers most scenarios of how SVE ACLE types > ought to interact with OMP constructs/clauses. > > 1. Poly-int structures that represent variable-sized objects and OMP runtime. > > Currently poly-int type structures are passed by value to OpenMP runtime > functions for shared clauses etc. This patch improves on this by passing > around poly-int structures by address to avoid copy-overhead. > > 2. SVE ACLE types in OMP Shared clauses. > > We test the behaviour where SVE ACLE type objects are shared in the following > methods into an OMP region: > a. Explicit Shared clause on SVE ACLE type objects. > b. Implicit shared clause. > c. Implicit shared with default clause. > d. SVE ALCE types in the presence of predetermined (static) shared objects. > > The associated tests ensure that all such shared objects are passed by address > into the OMP runtime. There are runtime tests to verify the functional > correctness of the change. > > 3. Offloading and SVE ACLE types. > > The target clause in OpenMP is used to offload loop kernels to accelerator > peripeherals. target's 'map' clause is used to move data from and to the > accelarator. When the data is SVE type, it may not be suitable because of > various reasons i.e. the two SVE targets may not agree on vector size or > some targets don't support variable vector size. This makes SVE unsuitable > for use in OMP's 'map' clause. We diagnose all such cases and issue errors > where appropriate. The cases we cover in this patch are: > > a. Implicitly-mapped SVE ACLE types in OMP target regions are diagnosed. > b. Explicitly-mapped SVE ACLE types in OMP target regions using map clause > are diagnosed. > c. Explicilty-mapped SVLE ACLE types of various directions - to, from, tofrom > in the map clause are diagnosed. > d. target enter and exit data clauses with map on SVE ACLE types are > diagnosed. > e. target data map with alloc on SVE ACLE types are diagnosed. > f. target update from clause on SVE ACLE types are diagnosed. > g. target private firstprivate with SVE ACLE types are diagnosed. > h. All combinations of target with work-sharing constructs like parallel, > loop, simd, teams, distribute etc are also diagnosed when SVE ACLE types > are involved. > > 3. Lastprivate and SVE ACLE types. > > Various OpenMP lastprivate clause scenarios with SVE object types are > diagnosed. Worksharing constructs like sections, for, distribute bind to an > implicit outer parallel region in whose scope SVE ACLE types are declared and > are therefore default private. The lastprivate clause list with SVE ACLE type > object items are diagnosed in this scenario. > > 4. Threadprivate on SVE ACLE type objects. > > We ensure threadprivate SVE ACLE type objects are supported. We also ensure > copyin clause is also supported. > > 5. User-Defined Reductions on SVE ACLE types. > > We define a reduction using OMP declare reduction using SVE ACLE intrinsics and > ensure its functional correctness with various work-sharing constructs like > for, simd, parallel, task, taskloop. > > 6. Uniform and Aligned Clause with SVE ACLE > > We ensure the uniform clause's functional correctness with simd construct and > associated SVE ACLE intrinsics in the simd region. There is no direct > interaction between uniform and SVE ACLE type objects, but we ensure the uniform > clause applies correctly to a region where SVE ACLE intrinsics are present. > Similarly for the aligned clause. > > 7. Linear clause and SVE ACLE type. > > We diagnose if a linear clause list item has SVE ACLE type objects present. > Its doesn't mean much if the linear clause is applied to SVE ACLE types. > > 8. Depend clause and SVE ACLE objects. > > We test for functional correctness many combinations of dependency of shared > SVE ACLE type objects in parallel regions. We test if in, out dependencies and > anti-dependencies are supported for SVE ACLE type objects using the depend > clause with work-sharing constructs like task. > > 9. 'doacross' clause and SVE ACLE object types. > > doacross is mainly supported for scalars and loop iteration variables. We > diagnose cases where SVE ACLE objects are used in doacross list items. > > Tejas Belagod (11): > OpenMP/PolyInt: Pass poly-int structures by address to OMP libs. > AArch64: Add test cases for SVE types in OpenMP shared clause. > AArch64: Diagnose OpenMP offloading when SVE types involved. > AArch64: Test OpenMP lastprivate clause for various constructs. > AArch64: Test OpenMP threadprivate clause on SVE type. > AArch64: Test OpenMP user-defined reductions with SVE types. > AArch64: Test OpenMP uniform clause on SVE types. > AArch64: Test OpenMP simd aligned clause with SVE types. > AArch64: Diagnose OpenMP linear clause for SVE type objects. > AArch64: Test OpenMP depend clause and its variations on SVE types > AArch64: Diagnose SVE type objects when applied to OpenMP doacross > clause. > > gcc/config/aarch64/aarch64-sve-builtins.cc | 31 +++ > gcc/gimplify.cc | 34 ++- > gcc/omp-low.cc | 3 +- > gcc/target.h | 19 +- > .../aarch64/sve/omp/aarch64-sve-omp.exp | 80 ++++++ > .../gcc.target/aarch64/sve/omp/depend-1.c | 223 ++++++++++++++++ > .../gcc.target/aarch64/sve/omp/doacross.c | 22 ++ > .../gcc.target/aarch64/sve/omp/lastprivate.c | 121 +++++++++ > .../gcc.target/aarch64/sve/omp/linear.c | 33 +++ > .../gcc.target/aarch64/sve/omp/offload-1.c | 237 ++++++++++++++++++ > .../gcc.target/aarch64/sve/omp/offload-2.c | 198 +++++++++++++++ > .../aarch64/sve/omp/offload-parallel-loop.c | 236 +++++++++++++++++ > .../aarch64/sve/omp/offload-parallel.c | 195 ++++++++++++++ > .../gcc.target/aarch64/sve/omp/offload-simd.c | 236 +++++++++++++++++ > .../sve/omp/offload-teams-distribute-simd.c | 237 ++++++++++++++++++ > .../sve/omp/offload-teams-distribute.c | 236 +++++++++++++++++ > .../aarch64/sve/omp/offload-teams-loop.c | 237 ++++++++++++++++++ > .../aarch64/sve/omp/offload-teams.c | 195 ++++++++++++++ > .../gcc.target/aarch64/sve/omp/shared.c | 186 ++++++++++++++ > .../gcc.target/aarch64/sve/omp/simd-aligned.c | 50 ++++ > .../gcc.target/aarch64/sve/omp/simd-uniform.c | 71 ++++++ > .../aarch64/sve/omp/target-device.c | 97 +++++++ > .../gcc.target/aarch64/sve/omp/target-link.c | 48 ++++ > .../aarch64/sve/omp/threadprivate.c | 44 ++++ > .../gcc.target/aarch64/sve/omp/udr-sve.c | 166 ++++++++++++ > 25 files changed, 3232 insertions(+), 3 deletions(-) > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/aarch64-sve-omp.exp > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/depend-1.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/doacross.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/lastprivate.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/linear.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/offload-1.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/offload-2.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/offload-parallel-loop.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/offload-parallel.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/offload-simd.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/offload-teams-distribute-simd.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/offload-teams-distribute.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/offload-teams-loop.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/offload-teams.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/shared.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/simd-aligned.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/simd-uniform.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/target-device.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/target-link.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/threadprivate.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/udr-sve.c