From patchwork Mon Nov 15 08:00:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 47653 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 59AC03857C52 for ; Mon, 15 Nov 2021 08:00:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 59AC03857C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1636963259; bh=XA5hYmV3R6FqNl6W5R8Bm1AFLatcP6TJ89fQ8EOHcX4=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=SYYGTAZhstPi9slFDJmqhlK5JaXzvheHO2F2Hj0olR4QN91B5VEz94glMRsLiGC2n RrW4dEyT2/iQIO4O99/cdhR9tUErKYxf666fBwmM9R1xdWXfBWenmoMaA6zPetcvM5 UW/hsrivJTAGktOnDa3tCZJaCYlw2IhwSIuZfiJ4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 5E3193858D39 for ; Mon, 15 Nov 2021 08:00:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5E3193858D39 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-172-LyI78Gb3PXqIojlRdQ_R3Q-1; Mon, 15 Nov 2021 03:00:27 -0500 X-MC-Unique: LyI78Gb3PXqIojlRdQ_R3Q-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 001F41006AA1; Mon, 15 Nov 2021 08:00:27 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.54]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7475570886; Mon, 15 Nov 2021 08:00:26 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 1AF80Nuf2198945 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 09:00:23 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 1AF80MM62198944; Mon, 15 Nov 2021 09:00:22 +0100 Date: Mon, 15 Nov 2021 09:00:22 +0100 To: gcc-patches@gcc.gnu.org Subject: [committed] libgomp: Add a testcase for omp_get_num_teams inside of target inside of host teams Message-ID: <20211115080022.GS2710@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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 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: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Cc: Tobias Burnus Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi! This is https://github.com/OpenMP/spec/issues/3183 There is an agreement that we should return 1 team inside of target, even if that target is inside of host teams. We were doing that when offloading and not during host fallback, r12-5151 should fix that even for host fallback. Bootstrapped/regtested on x86_64-linux and i686-linux and tested with nvptx offloading on the former. 2021-11-15 Jakub Jelinek * testsuite/libgomp.c/teams-5.c: New test. Jakub --- libgomp/testsuite/libgomp.c/teams-5.c.jj 2021-11-12 17:10:07.739523564 +0100 +++ libgomp/testsuite/libgomp.c/teams-5.c 2021-11-12 17:09:41.424899991 +0100 @@ -0,0 +1,17 @@ +#include +#include + +int +main () +{ + #pragma omp teams num_teams (2) + { + if (omp_get_num_teams () != 2) + abort (); + #pragma omp parallel if (0) + #pragma omp target + if (omp_get_num_teams () != 1 || omp_get_team_num () != 0) + abort (); + } + return 0; +}