public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed][nvptx] Set -misa=sm_35 by default
@ 2020-10-09 11:56 Tom de Vries
  2020-10-09 12:19 ` Tobias Burnus
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Tom de Vries @ 2020-10-09 11:56 UTC (permalink / raw)
  To: gcc-patches

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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [committed][nvptx] Set -misa=sm_35 by default
  2020-10-09 11:56 [committed][nvptx] Set -misa=sm_35 by default Tom de Vries
@ 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
  2021-01-13 11:59 ` [committed][nvptx] Set -misa=sm_35 by default Thomas Schwinge
  2 siblings, 1 reply; 12+ messages in thread
From: Tobias Burnus @ 2020-10-09 12:19 UTC (permalink / raw)
  To: Tom de Vries, gcc-patches

Hi,

On 10/9/20 1:56 PM, Tom de Vries wrote:
> 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.

Interestingly, at
https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#release-notes__ptx-release-history
they still claim to support everything down to sm_10. (They talk about
supported targets, but still.)

> Fix this by setting -misa=sm_35 by default.

Can you update the release notes?

The other question is whether and, if so, how we want to add support for
newer PTX ISA versions than 3.1 = CUDA 5.0. In terms of PTX ISA itself,
moving to 6.3 would be a great step forward but requires at least CUDA
10. Hence, it could either a bump of the minimal CUDA version or to have
some way to specify the PTX version. Thoughty?

Tobias

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [committed][nvptx] Set -misa=sm_35 by default
  2020-10-09 12:19 ` Tobias Burnus
@ 2020-10-09 12:36   ` Tom de Vries
  0 siblings, 0 replies; 12+ messages in thread
From: Tom de Vries @ 2020-10-09 12:36 UTC (permalink / raw)
  To: Tobias Burnus, gcc-patches

On 10/9/20 2:19 PM, Tobias Burnus wrote:
> Hi,
> 
> On 10/9/20 1:56 PM, Tom de Vries wrote:
>> 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.
> 
> Interestingly, at
> https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#release-notes__ptx-release-history
> 
> they still claim to support everything down to sm_10. (They talk about
> supported targets, but still.)
>

Hi,

ha, funny.  Well, ptxas is pretty convinced it doesn't want to support it ;)

>> Fix this by setting -misa=sm_35 by default.
> 
> Can you update the release notes?
> 
> The other question is whether and, if so, how we want to add support for
> newer PTX ISA versions than 3.1 = CUDA 5.0. In terms of PTX ISA itself,
> moving to 6.3 would be a great step forward but requires at least CUDA
> 10. Hence, it could either a bump of the minimal CUDA version or to have
> some way to specify the PTX version. Thoughty?

A PR is open for this: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96005.

FWIW, I'm not planning to work on this short term, my plate is pretty full.

Thanks,
- Tom


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [patch, committed] nvptx - invoke.texi: Update default of -misa (was: [committed][nvptx] Set -misa=sm_35 by default)
  2020-10-09 11:56 [committed][nvptx] Set -misa=sm_35 by default Tom de Vries
  2020-10-09 12:19 ` Tobias Burnus
@ 2020-10-12 11:34 ` 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
  2 siblings, 1 reply; 12+ messages in thread
From: Tobias Burnus @ 2020-10-12 11:34 UTC (permalink / raw)
  To: Tom de Vries, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]

On 10/9/20 1:56 PM, Tom de Vries wrote:

> [nvptx] Set -misa=sm_35 by default
I committed the attached follow-up commit as obvious,
r11-3818-g91e4e16b550540723cca824b9674c7d8c43f4849

Tobias

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter

[-- Attachment #2: committed.diff --]
[-- Type: text/x-patch, Size: 851 bytes --]

commit 91e4e16b550540723cca824b9674c7d8c43f4849
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Mon Oct 12 13:13:20 2020 +0200

    nvptx - invoke.texi: Update default of -misa
    
    Followup to commit 383400a6078d75bbfa1216c9af2c37f7e88740c9
    
    gcc/ChangeLog
            * doc/invoke.texi (nvptx's -misa): Update default to sm_35.

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index b8c807e631c..307f4f5426c 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -25593,7 +25593,7 @@ Generate code for 32-bit or 64-bit ABI.
 @opindex march
 Generate code for given the specified PTX ISA (e.g.@: @samp{sm_35}).  ISA
 strings must be lower-case.  Valid ISA strings include @samp{sm_30} and
-@samp{sm_35}.  The default ISA is sm_30.
+@samp{sm_35}.  The default ISA is sm_35.
 
 @item -mmainkernel
 @opindex mmainkernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch, committed] nvptx - invoke.texi: Update default of -misa (was: [committed][nvptx] Set -misa=sm_35 by default)
  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
  0 siblings, 0 replies; 12+ messages in thread
From: Tom de Vries @ 2020-10-12 11:41 UTC (permalink / raw)
  To: Tobias Burnus, gcc-patches

On 10/12/20 1:34 PM, Tobias Burnus wrote:
> On 10/9/20 1:56 PM, Tom de Vries wrote:
> 
>> [nvptx] Set -misa=sm_35 by default
> I committed the attached follow-up commit as obvious,
> r11-3818-g91e4e16b550540723cca824b9674c7d8c43f4849

Thanks for catching this.

Thanks,
- Tom

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [committed][nvptx] Set -misa=sm_35 by default
  2020-10-09 11:56 [committed][nvptx] Set -misa=sm_35 by default Tom de Vries
  2020-10-09 12:19 ` Tobias Burnus
  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
@ 2021-01-13 11:59 ` Thomas Schwinge
  2021-01-22 15:23   ` Thomas Schwinge
  2021-03-23  8:04   ` Thomas Schwinge
  2 siblings, 2 replies; 12+ messages in thread
From: Thomas Schwinge @ 2021-01-13 11:59 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 3110 bytes --]

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, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-nvptx-Let-nvptx-as-figure-out-the-target-architectur.patch --]
[-- Type: text/x-diff, Size: 1665 bytes --]

From eac0d3458f38cd5bb4c930b2887a547b64b046ef Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Wed, 13 Jan 2021 09:04:47 +0100
Subject: [PATCH] [nvptx] Let nvptx-as figure out the target architecture
 [PR97348]

... now that it has been enhanced to do so.

This is a follow-up to PR97348 commit 383400a6078d75bbfa1216c9af2c37f7e88740c9
"[nvptx] Set -misa=sm_35 by default".

	gcc/
	PR target/97348
	* config/nvptx/nvptx.h (ASM_SPEC): Don't set.
	* config/nvptx/nvptx.opt (misa): Adjust comment.
---
 gcc/config/nvptx/nvptx.h   | 5 -----
 gcc/config/nvptx/nvptx.opt | 1 -
 2 files changed, 6 deletions(-)

diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h
index 2451703e77f..1a61e6207f6 100644
--- a/gcc/config/nvptx/nvptx.h
+++ b/gcc/config/nvptx/nvptx.h
@@ -29,11 +29,6 @@
 
 #define STARTFILE_SPEC "%{mmainkernel:crt0.o}"
 
-/* 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 51363e4e276..cf7f9022663 100644
--- a/gcc/config/nvptx/nvptx.opt
+++ b/gcc/config/nvptx/nvptx.opt
@@ -61,7 +61,6 @@ 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_SM35)
 Specify the version of the ptx ISA to use.
-- 
2.17.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [committed][nvptx] Set -misa=sm_35 by default
  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-03-23  8:04   ` Thomas Schwinge
  1 sibling, 1 reply; 12+ messages in thread
From: Thomas Schwinge @ 2021-01-22 15:23 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 3296 bytes --]

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, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-nvptx-Let-nvptx-as-figure-out-the-target-architectur.patch --]
[-- Type: text/x-diff, Size: 1665 bytes --]

From eac0d3458f38cd5bb4c930b2887a547b64b046ef Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Wed, 13 Jan 2021 09:04:47 +0100
Subject: [PATCH] [nvptx] Let nvptx-as figure out the target architecture
 [PR97348]

... now that it has been enhanced to do so.

This is a follow-up to PR97348 commit 383400a6078d75bbfa1216c9af2c37f7e88740c9
"[nvptx] Set -misa=sm_35 by default".

	gcc/
	PR target/97348
	* config/nvptx/nvptx.h (ASM_SPEC): Don't set.
	* config/nvptx/nvptx.opt (misa): Adjust comment.
---
 gcc/config/nvptx/nvptx.h   | 5 -----
 gcc/config/nvptx/nvptx.opt | 1 -
 2 files changed, 6 deletions(-)

diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h
index 2451703e77f..1a61e6207f6 100644
--- a/gcc/config/nvptx/nvptx.h
+++ b/gcc/config/nvptx/nvptx.h
@@ -29,11 +29,6 @@
 
 #define STARTFILE_SPEC "%{mmainkernel:crt0.o}"
 
-/* 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 51363e4e276..cf7f9022663 100644
--- a/gcc/config/nvptx/nvptx.opt
+++ b/gcc/config/nvptx/nvptx.opt
@@ -61,7 +61,6 @@ 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_SM35)
 Specify the version of the ptx ISA to use.
-- 
2.17.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [committed][nvptx] Set -misa=sm_35 by default
  2021-01-22 15:23   ` Thomas Schwinge
@ 2021-02-05 16:10     ` Thomas Schwinge
  2021-02-16 16:58       ` Thomas Schwinge
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Schwinge @ 2021-02-05 16:10 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 3458 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-nvptx-Let-nvptx-as-figure-out-the-target-architectur.patch --]
[-- Type: text/x-diff, Size: 1665 bytes --]

From eac0d3458f38cd5bb4c930b2887a547b64b046ef Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Wed, 13 Jan 2021 09:04:47 +0100
Subject: [PATCH] [nvptx] Let nvptx-as figure out the target architecture
 [PR97348]

... now that it has been enhanced to do so.

This is a follow-up to PR97348 commit 383400a6078d75bbfa1216c9af2c37f7e88740c9
"[nvptx] Set -misa=sm_35 by default".

	gcc/
	PR target/97348
	* config/nvptx/nvptx.h (ASM_SPEC): Don't set.
	* config/nvptx/nvptx.opt (misa): Adjust comment.
---
 gcc/config/nvptx/nvptx.h   | 5 -----
 gcc/config/nvptx/nvptx.opt | 1 -
 2 files changed, 6 deletions(-)

diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h
index 2451703e77f..1a61e6207f6 100644
--- a/gcc/config/nvptx/nvptx.h
+++ b/gcc/config/nvptx/nvptx.h
@@ -29,11 +29,6 @@
 
 #define STARTFILE_SPEC "%{mmainkernel:crt0.o}"
 
-/* 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 51363e4e276..cf7f9022663 100644
--- a/gcc/config/nvptx/nvptx.opt
+++ b/gcc/config/nvptx/nvptx.opt
@@ -61,7 +61,6 @@ 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_SM35)
 Specify the version of the ptx ISA to use.
-- 
2.17.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [committed][nvptx] Set -misa=sm_35 by default
  2021-02-05 16:10     ` Thomas Schwinge
@ 2021-02-16 16:58       ` Thomas Schwinge
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Schwinge @ 2021-02-16 16:58 UTC (permalink / raw)
  To: Tom de Vries, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 3989 bytes --]

Hi!

Tom, ping?


Also, I have now pushed to devel/omp/gcc-10 branch cherry-picks of Tom's
"[nvptx] Set -misa=sm_35 by default" in commit
d4b73f42df11282c7c170b55eb29cd8ff6b998d8, and Tobias' "nvptx -
invoke.texi: Update default of -misa" in commit
c77b42af4fa245ea87aee0ad55fa2b76611afb47, see attached, too.


Grüße
 Thomas


On 2021-02-05T17:10:01+0100, Thomas Schwinge <thomas@codesourcery.com> wrote:
> 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-nvptx-Let-nvptx-as-figure-out-the-target-architectur.patch --]
[-- Type: text/x-diff, Size: 1665 bytes --]

From eac0d3458f38cd5bb4c930b2887a547b64b046ef Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Wed, 13 Jan 2021 09:04:47 +0100
Subject: [PATCH] [nvptx] Let nvptx-as figure out the target architecture
 [PR97348]

... now that it has been enhanced to do so.

This is a follow-up to PR97348 commit 383400a6078d75bbfa1216c9af2c37f7e88740c9
"[nvptx] Set -misa=sm_35 by default".

	gcc/
	PR target/97348
	* config/nvptx/nvptx.h (ASM_SPEC): Don't set.
	* config/nvptx/nvptx.opt (misa): Adjust comment.
---
 gcc/config/nvptx/nvptx.h   | 5 -----
 gcc/config/nvptx/nvptx.opt | 1 -
 2 files changed, 6 deletions(-)

diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h
index 2451703e77f..1a61e6207f6 100644
--- a/gcc/config/nvptx/nvptx.h
+++ b/gcc/config/nvptx/nvptx.h
@@ -29,11 +29,6 @@
 
 #define STARTFILE_SPEC "%{mmainkernel:crt0.o}"
 
-/* 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 51363e4e276..cf7f9022663 100644
--- a/gcc/config/nvptx/nvptx.opt
+++ b/gcc/config/nvptx/nvptx.opt
@@ -61,7 +61,6 @@ 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_SM35)
 Specify the version of the ptx ISA to use.
-- 
2.17.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0001-nvptx-Set-misa-sm_35-by-default.og10.patch --]
[-- Type: text/x-diff, Size: 2751 bytes --]

From d4b73f42df11282c7c170b55eb29cd8ff6b998d8 Mon Sep 17 00:00:00 2001
From: Tom de Vries <tdevries@suse.de>
Date: Fri, 9 Oct 2020 11:36:10 +0200
Subject: [PATCH 1/2] [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.

(cherry picked from commit 383400a6078d75bbfa1216c9af2c37f7e88740c9)
---
 gcc/ChangeLog.omp          | 7 +++++++
 gcc/config/nvptx/nvptx.h   | 5 ++++-
 gcc/config/nvptx/nvptx.opt | 3 ++-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp
index 029e13d1855..96896146824 100644
--- a/gcc/ChangeLog.omp
+++ b/gcc/ChangeLog.omp
@@ -1,3 +1,10 @@
+2021-02-16  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.
+
 2021-02-09  Kwok Cheung Yeung  <kcy@codesourcery.com>
 
 	Backport from mainline
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.
-- 
2.17.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0002-nvptx-invoke.texi-Update-default-of-misa.og10.patch --]
[-- Type: text/x-diff, Size: 1392 bytes --]

From c77b42af4fa245ea87aee0ad55fa2b76611afb47 Mon Sep 17 00:00:00 2001
From: Tobias Burnus <tobias@codesourcery.com>
Date: Mon, 12 Oct 2020 13:13:20 +0200
Subject: [PATCH 2/2] nvptx - invoke.texi: Update default of -misa

Followup to commit 383400a6078d75bbfa1216c9af2c37f7e88740c9

gcc/ChangeLog
	* doc/invoke.texi (nvptx's -misa): Update default to sm_35.

(cherry picked from commit 91e4e16b550540723cca824b9674c7d8c43f4849)
---
 gcc/ChangeLog.omp   | 4 ++++
 gcc/doc/invoke.texi | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp
index 96896146824..ba959fb37a4 100644
--- a/gcc/ChangeLog.omp
+++ b/gcc/ChangeLog.omp
@@ -1,3 +1,7 @@
+2021-02-16  Tobias Burnus  <tobias@codesourcery.com>
+
+	* doc/invoke.texi (nvptx's -misa): Update default to sm_35.
+
 2021-02-16  Tom de Vries  <tdevries@suse.de>
 
 	PR target/97348
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index fe04b4d8e6a..dc00a0bf6a8 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -25008,7 +25008,7 @@ Generate code for 32-bit or 64-bit ABI.
 @opindex march
 Generate code for given the specified PTX ISA (e.g.@: @samp{sm_35}).  ISA
 strings must be lower-case.  Valid ISA strings include @samp{sm_30} and
-@samp{sm_35}.  The default ISA is sm_30.
+@samp{sm_35}.  The default ISA is sm_35.
 
 @item -mmainkernel
 @opindex mmainkernel
-- 
2.17.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [committed][nvptx] Set -misa=sm_35 by default
  2021-01-13 11:59 ` [committed][nvptx] Set -misa=sm_35 by default Thomas Schwinge
  2021-01-22 15:23   ` 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
  1 sibling, 2 replies; 12+ messages in thread
From: Thomas Schwinge @ 2021-03-23  8:04 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 3401 bytes --]

Hi Tom!

Ping, one item specifically: "backporting [...] to release branches" (see
below) -- this ping is dedicated to the upcoming GCC 10.3 release.  ;-)

On 2021-01-13T12:59:14+0100, I wrote:
> 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.
>>
>> 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.


Grüße
 Thomas


> Further:

> 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.)

>> [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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-nvptx-Let-nvptx-as-figure-out-the-target-architectur.patch --]
[-- Type: text/x-diff, Size: 1665 bytes --]

From eac0d3458f38cd5bb4c930b2887a547b64b046ef Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Wed, 13 Jan 2021 09:04:47 +0100
Subject: [PATCH] [nvptx] Let nvptx-as figure out the target architecture
 [PR97348]

... now that it has been enhanced to do so.

This is a follow-up to PR97348 commit 383400a6078d75bbfa1216c9af2c37f7e88740c9
"[nvptx] Set -misa=sm_35 by default".

	gcc/
	PR target/97348
	* config/nvptx/nvptx.h (ASM_SPEC): Don't set.
	* config/nvptx/nvptx.opt (misa): Adjust comment.
---
 gcc/config/nvptx/nvptx.h   | 5 -----
 gcc/config/nvptx/nvptx.opt | 1 -
 2 files changed, 6 deletions(-)

diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h
index 2451703e77f..1a61e6207f6 100644
--- a/gcc/config/nvptx/nvptx.h
+++ b/gcc/config/nvptx/nvptx.h
@@ -29,11 +29,6 @@
 
 #define STARTFILE_SPEC "%{mmainkernel:crt0.o}"
 
-/* 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 51363e4e276..cf7f9022663 100644
--- a/gcc/config/nvptx/nvptx.opt
+++ b/gcc/config/nvptx/nvptx.opt
@@ -61,7 +61,6 @@ 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_SM35)
 Specify the version of the ptx ISA to use.
-- 
2.17.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [committed][nvptx] Set -misa=sm_35 by default
  2021-03-23  8:04   ` Thomas Schwinge
@ 2021-05-03 13:54     ` Tom de Vries
  2021-05-04  6:30     ` Tom de Vries
  1 sibling, 0 replies; 12+ messages in thread
From: Tom de Vries @ 2021-05-03 13:54 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: gcc-patches

On 3/23/21 9:04 AM, Thomas Schwinge wrote:
> From eac0d3458f38cd5bb4c930b2887a547b64b046ef Mon Sep 17 00:00:00 2001
> From: Thomas Schwinge <thomas@codesourcery.com>
> Date: Wed, 13 Jan 2021 09:04:47 +0100
> Subject: [PATCH] [nvptx] Let nvptx-as figure out the target architecture
>  [PR97348]
> 
> ... now that it has been enhanced to do so.
> 
> This is a follow-up to PR97348 commit 383400a6078d75bbfa1216c9af2c37f7e88740c9
> "[nvptx] Set -misa=sm_35 by default".
> 
> 	gcc/
> 	PR target/97348
> 	* config/nvptx/nvptx.h (ASM_SPEC): Don't set.
> 	* config/nvptx/nvptx.opt (misa): Adjust comment.
> ---
>  gcc/config/nvptx/nvptx.h   | 5 -----
>  gcc/config/nvptx/nvptx.opt | 1 -
>  2 files changed, 6 deletions(-)
> 
> diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h
> index 2451703e77f..1a61e6207f6 100644
> --- a/gcc/config/nvptx/nvptx.h
> +++ b/gcc/config/nvptx/nvptx.h
> @@ -29,11 +29,6 @@
>  
>  #define STARTFILE_SPEC "%{mmainkernel:crt0.o}"
>  
> -/* 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 51363e4e276..cf7f9022663 100644
> --- a/gcc/config/nvptx/nvptx.opt
> +++ b/gcc/config/nvptx/nvptx.opt
> @@ -61,7 +61,6 @@ 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_SM35)
>  Specify the version of the ptx ISA to use.
> -- 2.17.1

Hi Thomas,

Sorry for the delay.  LGTM, please apply.

Thanks,
- Tom

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [committed][nvptx] Set -misa=sm_35 by default
  2021-03-23  8:04   ` Thomas Schwinge
  2021-05-03 13:54     ` Tom de Vries
@ 2021-05-04  6:30     ` Tom de Vries
  1 sibling, 0 replies; 12+ messages in thread
From: Tom de Vries @ 2021-05-04  6:30 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: gcc-patches

On 3/23/21 9:04 AM, Thomas Schwinge wrote:
> 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+?

Hmm, so you're talking about making -misa=sm_35 the default for gcc 10/9/8?

Let's see, users of the latest nvidia consumer microarchitecture: ampere
are forced to use a cuda11.0+ toolchain, which means that the sm_30
default is wrong for them.

Cuda 5.x supports both sm_30 and sm_35, so users should be fine.

Cuda 4.x supports neither sm_30 nor sm_35, so users also shouldn't
observe a difference.

There might be users of cuda 4.x or older and a specific newer driver
that supports sm_30 but not sm_35, and those will be the only ones
affected.  I think we can explicitly unsupport that scenario.

So, in conclusion, LGTM.

Thanks,
- Tom


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-05-04  6:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09 11:56 [committed][nvptx] Set -misa=sm_35 by default Tom de Vries
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

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).