diff options
author | Tom de Vries <tdevries@suse.de> | 2022-02-04 08:53:52 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2022-02-08 13:55:23 +0100 |
commit | decde11183bdccc46587d6614b75f3d56a2f2e4a (patch) | |
tree | 305a97636fdcfd591107c75ea0c0e3fed5abfd32 /.gitattributes | |
parent | 6de582dd62dfcb18f51e3dd01cf8519a74752530 (diff) | |
download | gcc-decde11183bdccc46587d6614b75f3d56a2f2e4a.zip gcc-decde11183bdccc46587d6614b75f3d56a2f2e4a.tar.gz gcc-decde11183bdccc46587d6614b75f3d56a2f2e4a.tar.bz2 |
[nvptx] Choose -mptx default based on -misa
While testing with driver version 390.147 I ran into the problem that it
doesn't support ptx isa version 6.3 (the new default), only 6.1.
Furthermore, using the -mptx option is a bit user-unfriendly.
Say we want to compile for sm_80. We can use -misa=sm_80 to specify that, but
then run into errors because the default ptx version is 6.3, which doesn't
support sm_80 yet.
Address both these issues by:
- picking a default -mptx based on the active -misa, and
- ensuring that the default -mptx is at least 6.0 (instead
of 6.3).
Also add an error in case of incompatible options like
"-misa=sm_80 -mptx=6.3":
...
cc1: error: PTX version (-mptx) needs to be at least 7.0 to support \
selected -misa (sm_80)
...
Tested on x86_64-linux with nvptx accelerator.
gcc/ChangeLog:
2022-02-08 Tom de Vries <tdevries@suse.de>
PR target/104283
* config/nvptx/nvptx-opts.h (enum ptx_version): Add PTX_VERSION_3_0
and PTX_VERSION_4_2.
* config/nvptx/nvptx.cc (first_ptx_version_supporting_sm)
(default_ptx_version_option, ptx_version_to_string)
(sm_version_to_string, handle_ptx_version_option): New function.
(nvptx_option_override): Call handle_ptx_version_option.
(nvptx_file_start): Use ptx_version_to_string and sm_version_to_string.
* config/nvptx/nvptx.md (define_insn "nvptx_shuffle<mode>")
(define_insn "nvptx_vote_ballot"): Use TARGET_PTX_6_0.
* config/nvptx/nvptx.opt (mptx): Remove 'Init'.
Diffstat (limited to '.gitattributes')
0 files changed, 0 insertions, 0 deletions