From patchwork Tue Mar 1 08:01:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 1599283 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=uADlleT0; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K7Fxs5g21z9sCq for ; Tue, 1 Mar 2022 22:53:20 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 830553858408 for ; Tue, 1 Mar 2022 08:03:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 830553858408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1646121815; bh=zMOSd/o3oHQCFFCPyrVclZS/8GgZkAYG3p6eBdYcJxU=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=uADlleT0Nerafv9kB9cO0szMY+EJmRowbrlToFAImNPVZ6Ma3IFAPBeaI/LGYHE9u Qf8z4dLgST3DktKFhxOqHQ87V5aF9LMKVe57fzrxmoIjWf30IoOjakHnsSYiNz/r3j wk3mH96s4ghh1/U9Uuysvl3R4uME7+smswpcamSc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 90CC1385801D for ; Tue, 1 Mar 2022 08:02:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 90CC1385801D Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id C20911F37E; Tue, 1 Mar 2022 08:01:59 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A58DB13B08; Tue, 1 Mar 2022 08:01:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CNBMJ/fSHWLeNAAAMHmgww (envelope-from ); Tue, 01 Mar 2022 08:01:59 +0000 Date: Tue, 1 Mar 2022 09:01:58 +0100 To: gcc-patches@gcc.gnu.org Subject: [committed][nvptx] Use nvptx-sm.def for t-omp-device Message-ID: <20220301080156.GA16806@delia.home> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: Tom de Vries via Gcc-patches From: Tom de Vries Reply-To: Tom de Vries Cc: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi, Add a script gen-omp-device-properties.sh that uses nvptx-sm.def to generate omp-device-properties-nvptx. Tested on x86_64 with nvptx accelerator. Committed to trunk. Thanks, - Tom [nvptx] Use nvptx-sm.def for t-omp-device gcc/ChangeLog: 2022-02-25 Tom de Vries * config/nvptx/gen-omp-device-properties.sh: New file. * config/nvptx/t-omp-device: Use gen-omp-device-properties.sh. --- gcc/config/nvptx/gen-omp-device-properties.sh | 33 +++++++++++++++++++++++++++ gcc/config/nvptx/t-omp-device | 7 +++--- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/gcc/config/nvptx/gen-omp-device-properties.sh b/gcc/config/nvptx/gen-omp-device-properties.sh new file mode 100644 index 00000000000..175092cdde6 --- /dev/null +++ b/gcc/config/nvptx/gen-omp-device-properties.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +# Copyright (C) 2022 Free Software Foundation, Inc. +# +# This file is part of GCC. +# +# GCC is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GCC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +nvptx_sm_def="$1/nvptx-sm.def" + +sms=$(grep ^NVPTX_SM $nvptx_sm_def | sed 's/.*(//;s/,.*//') + +echo kind: gpu +echo arch: nvptx + +isa="" +for sm in $sms; do + isa="$isa sm_$sm" +done + +echo isa: $isa diff --git a/gcc/config/nvptx/t-omp-device b/gcc/config/nvptx/t-omp-device index 4228218a424..c2b28a41ee4 100644 --- a/gcc/config/nvptx/t-omp-device +++ b/gcc/config/nvptx/t-omp-device @@ -1,4 +1,3 @@ -omp-device-properties-nvptx: $(srcdir)/config/nvptx/nvptx.cc - echo kind: gpu > $@ - echo arch: nvptx >> $@ - echo isa: sm_30 sm_35 sm_53 sm_70 sm_75 sm_80 >> $@ +omp-device-properties-nvptx: $(srcdir)/config/nvptx/nvptx-sm.def + $(SHELL) $(srcdir)/config/nvptx/gen-omp-device-properties.sh \ + "$(srcdir)/config/nvptx" > $@