From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by sourceware.org (Postfix) with ESMTPS id 4D4EE385782A; Wed, 1 Sep 2021 07:06:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4D4EE385782A Received: by mail-io1-xd2e.google.com with SMTP id j18so2714527ioj.8; Wed, 01 Sep 2021 00:06:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NgDWKZMJv0sK0BN40Mb+leP4Qq1z36yVhIC7wCExKxM=; b=OL1asviHWM36LZ5RJXTS6UNbU4x64+u7uMjHUJJL+qRKx70r5JafJi6HT/RciH0YU9 DERcSlzsokb9IxPpMud937ywJWbg7HzkzxZdBiauT/oMHpGAK6BZSeLKIfYuxxzsw0U1 je0WJLyGsSj0VLTRPwvG8SE8d9IvvWZOFTQ6LXAow+nzldNHmeM5cHWU2gVWda5eaa79 14n8aKgZv6lzEjNgva2BwSSbzBeSR+boLprbiry5ScKq9RgMKMXNdYVje+ydEBj/5c+Y RmhsPYdjrKkjA2AfJXidzuJ3kgsL0sJ4Pfb416lSO4BeAMPdGX23alQ8k6QWOxChzs9J mhgA== X-Gm-Message-State: AOAM530piQ5533H8+V9Mu/NHZtifmQ/cTXaTnMgsnekGbsisqpFBQGLe 7yDMaA7opjIlbAvyugeCRfoFA9M4Yfmgm8/kpBw= X-Google-Smtp-Source: ABdhPJyvlkxlHUt+7nOnWuHd2GXXs//aouqqBl6brx3R6ivP7Skr/H3qHMlFpWxNkNPXQPozbYQtSS5iD6YW64u+65o= X-Received: by 2002:a6b:5a04:: with SMTP id o4mr25588454iob.44.1630480002639; Wed, 01 Sep 2021 00:06:42 -0700 (PDT) MIME-Version: 1.0 References: <20210720133037.GC2380545@tucnak> <92ad1db1-c3ab-0482-0854-832804ed4ede@codesourcery.com> <20210823174733.GY2380545@tucnak> <31cce4eb-8f87-e84e-8bfe-3678581e90ef@codesourcery.com> <20210830062637.GH920497@tucnak> In-Reply-To: <20210830062637.GH920497@tucnak> From: Christophe Lyon Date: Wed, 1 Sep 2021 09:06:31 +0200 Message-ID: Subject: Re: [Patch v2] C, C++, Fortran, OpenMP: Add support for device-modifiers for 'omp target device' To: Jakub Jelinek Cc: Marcel Vollweiler , GCC Patches , Tobias Burnus , fortran@gcc.gnu.org X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2021 07:06:45 -0000 On Mon, Aug 30, 2021 at 8:27 AM Jakub Jelinek via Gcc-patches < gcc-patches@gcc.gnu.org> wrote: > On Wed, Aug 25, 2021 at 12:14:09PM +0200, Marcel Vollweiler wrote: > > Add support for device-modifiers for 'omp target device'. > > > > 'device_num' and 'ancestor' are now parsed on target device constructs > for C, > > C++, and Fortran (see OpenMP specification 5.0, p. 170). When 'ancestor' > is > > used, then 'sorry, not supported' is output. Moreover, the restrictions > for > > 'ancestor' are implemented (see OpenMP specification 5.0, p. 174f). > > > > gcc/c/ChangeLog: > > > > * c-parser.c (c_parser_omp_clause_device): Parse device-modifiers > 'device_num' > > and 'ancestor' in 'target device' clauses. > > > > gcc/cp/ChangeLog: > > > > * parser.c (cp_parser_omp_clause_device): Parse device-modifiers > 'device_num' > > and 'ancestor' in 'target device' clauses. > > * semantics.c (finish_omp_clauses): Error handling. Constant > device ids must > > evaluate to '1' if 'ancestor' is used. > > > > gcc/fortran/ChangeLog: > > > > * gfortran.h: Add variable for 'ancestor' in struct > gfc_omp_clauses. > > * openmp.c (gfc_match_omp_clauses): Parse device-modifiers > 'device_num' > > and 'ancestor' in 'target device' clauses. > > * trans-openmp.c (gfc_trans_omp_clauses): Set > OMP_CLAUSE_DEVICE_ANCESTOR. > > > > gcc/ChangeLog: > > > > * gimplify.c (gimplify_scan_omp_clauses): Error handling. > 'ancestor' only > > allowed on target constructs and only with particular other > clauses. > > * omp-expand.c (expand_omp_target): Output of 'sorry, not > supported' if > > 'ancestor' is used. > > * omp-low.c (check_omp_nesting_restrictions): Error handling. No > nested OpenMP > > structs when 'ancestor' is used. > > (scan_omp_1_stmt): No usage of OpenMP runtime routines in a target > region when > > 'ancestor' is used. > > * tree-pretty-print.c (dump_omp_clause): Append 'ancestor'. > > * tree.h (OMP_CLAUSE_DEVICE_ANCESTOR): Define macro. > > > > gcc/testsuite/ChangeLog: > > > > * c-c++-common/gomp/target-device-1.c: New test. > > * c-c++-common/gomp/target-device-2.c: New test. > > * c-c++-common/gomp/target-device-ancestor-1.c: New test. > > * c-c++-common/gomp/target-device-ancestor-2.c: New test. > > * c-c++-common/gomp/target-device-ancestor-3.c: New test. > > * c-c++-common/gomp/target-device-ancestor-4.c: New test. > > * gfortran.dg/gomp/target-device-1.f90: New test. > > * gfortran.dg/gomp/target-device-2.f90: New test. > > * gfortran.dg/gomp/target-device-ancestor-1.f90: New test. > > * gfortran.dg/gomp/target-device-ancestor-2.f90: New test. > > * gfortran.dg/gomp/target-device-ancestor-3.f90: New test. > > * gfortran.dg/gomp/target-device-ancestor-4.f90: New test. > The last new test fails on aarch64: /gcc/testsuite/gfortran.dg/gomp/target-device-ancestor-4.f90:7:15: Error: Sorry, 'reverse_offload' clause at (1) on REQUIRES directive is not yet supported compiler exited with status 1 PASS: gfortran.dg/gomp/target-device-ancestor-4.f90 -O (test for errors, line 7) XFAIL: gfortran.dg/gomp/target-device-ancestor-4.f90 -O sorry, unimplemented: 'ancestor' not yet supported (test for warnings, line 9) PASS: gfortran.dg/gomp/target-device-ancestor-4.f90 -O (test for excess errors) gfortran.dg/gomp/target-device-ancestor-4.f90 -O : dump file does not exist UNRESOLVED: gfortran.dg/gomp/target-device-ancestor-4.f90 -O scan-tree-dump original "pragma omp target [^\n\r)]*device\\(ancestor:1\\)" Can you fix it? Thanks, Christophe > Ok, thanks. > > Jakub > >