[committed][nvptx] Set -misa=sm_35 by default

Thomas Schwinge thomas@codesourcery.com
Fri Feb 5 16:10:01 GMT 2021


Hi Tom!

Ping.


Grüße
 Thomas


On 2021-01-22T16:23:57+0100, I wrote:
> Hi Tom!
>
> Ping.
>
>
> Grüße
>  Thomas
>
>
> On 2021-01-13T12:59:14+0100, I wrote:
>> Hi Tom!
>>
>> On 2020-10-09T13:56:09+0200, Tom de Vries <tdevries@suse.de> wrote:
>>> The nvptx-as assembler verifies the ptx code using ptxas, if there's any
>>> in the PATH.
>>>
>>
>> After quite some digression to first add a testsuite to nvptx-tools (see
>> <https://twitter.com/schwinge_thomas/status/1348626368578408449> or just
>> <https://github.com/MentorEmbedded/nvptx-tools/tree/master/test/>), which
>> I found advisable generally, and then given the kinds of changes we're
>> now doing :-) -- I've now prepared nvptx-as code changes as discussed in
>> <https://github.com/MentorEmbedded/nvptx-tools/issues/24> "nvptx-as
>> should not assume a default sm version".  (Currently testing.)
>>
>>> 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.
>>
>> ACK.
>>
>> What is your opinion about backporting that (plus Tobias' documentation
>> update, plus corresponding web 'changes.html' updates?) to release
>> branches, so that nvptx offloading users may use GCC 10/9/8 with CUDA
>> 11.0+?
>>
>> I don't think losing sm_30 support is a major concern: support for sm_35
>> has been introduced with PTX ISA 3.1, CUDA 5.0, driver r302.
>>
>>
>> Further:
>>
>>> [nvptx] Set -misa=sm_35 by default
>>
>>>     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.
>>
>>> --- a/gcc/config/nvptx/nvptx.h
>>> +++ b/gcc/config/nvptx/nvptx.h
>>
>>> -#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}"
>>
>>> --- a/gcc/config/nvptx/nvptx.opt
>>> +++ b/gcc/config/nvptx/nvptx.opt
>>
>>> +; 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.
>>
>> As I'd suggested in
>> <https://github.com/MentorEmbedded/nvptx-tools/issues/24> "nvptx-as
>> should not assume a default sm version", I'd then push the attached
>> "[nvptx] Let nvptx-as figure out the target architecture [PR97348]" to
>> GCC master branch, OK?  (Currently testing.)
>>
>> That one I wouldn't backport to GCC release branches, so that we don't
>> require users to update nvptx-tools for these builds.
>>
>>
>> Grüße
>>  Thomas


-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-nvptx-Let-nvptx-as-figure-out-the-target-architectur.patch
Type: text/x-diff
Size: 1666 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210205/44237e7e/attachment.bin>


More information about the Gcc-patches mailing list