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: 51461 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 9EAD73858425 for ; Tue, 1 Mar 2022 08:03:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9EAD73858425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1646121824; 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=Rv562e69sLmNwJ/tEGj7W7PcaLi9m4iQUTNYDF6cE8sKgjRLhqdaEuaxg+x+EI9Bx 7iIjtmo5LYRrq8aIOnXRIB77G+SWBFaKAUnoYWVfS8hlc8ncHyHyrnR5MjgLjcK1lB MvHUdZ76rGX/NRNeOUzkSs1R35hb7T5w8TqNe5zQ= 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+patchwork=sourceware.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" > $@