diff options
author | Tom de Vries <tdevries@suse.de> | 2020-10-09 11:36:10 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2020-10-09 13:55:08 +0200 |
commit | 383400a6078d75bbfa1216c9af2c37f7e88740c9 (patch) | |
tree | d5f0933e7f577aeb8121d019ef80e2d9c7af2141 /gcc | |
parent | 8c26cfc6af38a3c4d16f510ee8ac3ae11ea2bbbd (diff) | |
download | gcc-383400a6078d75bbfa1216c9af2c37f7e88740c9.zip gcc-383400a6078d75bbfa1216c9af2c37f7e88740c9.tar.gz gcc-383400a6078d75bbfa1216c9af2c37f7e88740c9.tar.bz2 |
[nvptx] Set -misa=sm_35 by default
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 again cuda 9.1.
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/nvptx/nvptx.h | 5 | ||||
-rw-r--r-- | 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 6ebcc76..17fe157 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 75c3d54..d6910a9 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. |