From: Tom de Vries <tdevries@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [committed][nvptx] Set -misa=sm_35 by default
Date: Fri, 9 Oct 2020 13:56:09 +0200 [thread overview]
Message-ID: <20201009115608.GA26608@delia> (raw)
Hi,
The nvptx-as assembler verifies the ptx code using ptxas, if there's any
in the PATH.
The default in the nvptx port for -misa=sm_xx is sm_30, but the ptxas of the
latest cuda release (11.1) no longer supports sm_30.
Consequently we cannot build gcc against that release (although we should
still be able to build without any cuda release).
Fix this by setting -misa=sm_35 by default.
Tested check-gcc on nvptx.
Tested libgomp on x86_64-linux with nvpx accelerator.
Both build against cuda 9.1.
Committed to trunk.
Thanks,
- Tom
[nvptx] Set -misa=sm_35 by default
gcc/ChangeLog:
2020-10-09 Tom de Vries <tdevries@suse.de>
PR target/97348
* config/nvptx/nvptx.h (ASM_SPEC): Also pass -m to nvptx-as if
default is used.
* config/nvptx/nvptx.opt (misa): Init with PTX_ISA_SM35.
---
gcc/config/nvptx/nvptx.h | 5 ++++-
gcc/config/nvptx/nvptx.opt | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h
index 6ebcc760771..17fe157058c 100644
--- a/gcc/config/nvptx/nvptx.h
+++ b/gcc/config/nvptx/nvptx.h
@@ -29,7 +29,10 @@
#define STARTFILE_SPEC "%{mmainkernel:crt0.o}"
-#define ASM_SPEC "%{misa=*:-m %*}"
+/* Default needs to be in sync with default for misa in nvptx.opt.
+ We add a default here to work around a hard-coded sm_30 default in
+ nvptx-as. */
+#define ASM_SPEC "%{misa=*:-m %*; :-m sm_35}"
#define TARGET_CPU_CPP_BUILTINS() \
do \
diff --git a/gcc/config/nvptx/nvptx.opt b/gcc/config/nvptx/nvptx.opt
index 75c3d54864e..d6910a96cf0 100644
--- a/gcc/config/nvptx/nvptx.opt
+++ b/gcc/config/nvptx/nvptx.opt
@@ -59,6 +59,7 @@ Enum(ptx_isa) String(sm_30) Value(PTX_ISA_SM30)
EnumValue
Enum(ptx_isa) String(sm_35) Value(PTX_ISA_SM35)
+; Default needs to be in sync with default in ASM_SPEC in nvptx.h.
misa=
-Target RejectNegative ToLower Joined Enum(ptx_isa) Var(ptx_isa_option) Init(PTX_ISA_SM30)
+Target RejectNegative ToLower Joined Enum(ptx_isa) Var(ptx_isa_option) Init(PTX_ISA_SM35)
Specify the version of the ptx ISA to use.
next reply other threads:[~2020-10-09 11:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-09 11:56 Tom de Vries [this message]
2020-10-09 12:19 ` Tobias Burnus
2020-10-09 12:36 ` Tom de Vries
2020-10-12 11:34 ` [patch, committed] nvptx - invoke.texi: Update default of -misa (was: [committed][nvptx] Set -misa=sm_35 by default) Tobias Burnus
2020-10-12 11:41 ` Tom de Vries
2021-01-13 11:59 ` [committed][nvptx] Set -misa=sm_35 by default Thomas Schwinge
2021-01-22 15:23 ` Thomas Schwinge
2021-02-05 16:10 ` Thomas Schwinge
2021-02-16 16:58 ` Thomas Schwinge
2021-03-23 8:04 ` Thomas Schwinge
2021-05-03 13:54 ` Tom de Vries
2021-05-04 6:30 ` Tom de Vries
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201009115608.GA26608@delia \
--to=tdevries@suse.de \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).