Stumbled over this as we recently got a sm_89 card.

-march-map= is mostly a future proof method for user to ensure to use always the best code gen for a specific card - without needing to know which GCC version added support for what --march=sm_... (or -misa=sm_... - those are aliases).

sm_89 was added in CUDA 11.8 (ptx isa 7.8) and sm_90a in CUDA 12.0 (ptx isa 8.0) but that's just FYI as -march-map=sm_xx, xx >= 80 is mapping to -march=sm_80 and implies -mptx=7.0 (i.e. ptx isa 7.0, added in CUDA 11.0); hence, any CUDA 11.0+ will do.

OK for mainline?

Tobias
nvptx.opt: Add sm_89 and sm_90a to -march-map=

The -march-map= options maps the compute capability to the closest
lower compute capability that has been implemented; for sm_89 and
sm_90a, that were previously missing, that's currently -march=sm_80
alias -misa=sm_80.

gcc/ChangeLog:

	* config/nvptx/nvptx.opt (march-map=): Add sm_89 and sm_90a.

Signed-off-by: Tobias Burnus <tbur...@baylibre.com>

diff --git a/gcc/config/nvptx/nvptx.opt b/gcc/config/nvptx/nvptx.opt
index 09d75fca037..deb006663d7 100644
--- a/gcc/config/nvptx/nvptx.opt
+++ b/gcc/config/nvptx/nvptx.opt
@@ -108,9 +108,15 @@ Target RejectNegative Alias(misa=,sm_80)
 march-map=sm_87
 Target RejectNegative Alias(misa=,sm_80)
 
+march-map=sm_89
+Target RejectNegative Alias(misa=,sm_80)
+
 march-map=sm_90
 Target RejectNegative Alias(misa=,sm_80)
 
+march-map=sm_90a
+Target RejectNegative Alias(misa=,sm_80)
+
 Enum
 Name(ptx_version) Type(int)
 Known PTX ISA versions (for use with the -mptx= option):

Reply via email to