[PATCH] D141736: [NVPTX] Use 'sm_60' architecture when expanding %ptxas-verify macro.

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 10:42:14 PST 2023


tra accepted this revision.
tra added a comment.
This revision is now accepted and ready to land.

LGTM.



================
Comment at: llvm/test/lit.cfg.py:239
     tools.extend([ToolSubst('%ptxas', ptxas_executable),
-                  ToolSubst('%ptxas-verify', '{} -c -o /dev/null -'.format(
+                  ToolSubst('%ptxas-verify', '{} -arch=sm_60 -c -o /dev/null -'.format(
                       ptxas_executable))])
----------------
pavelkopyl wrote:
> tra wrote:
> > This will be a problem for cases where we generate PTX for a newer GPU variants. 
> > At the very least users need to be able to override `-arch=...` passed to ptxas-verify.
> > 
> > 
> > 
> I agree, but I guess overriding shouldn't be a problem. For example,
> 
> ```
> %{ llc < %s -march=nvptx63 -mcpu=sm_80 | %ptxas-verify -arch=sm_80 %}
> ```
> 
> gets expanded into:
>  
> ```
> ... | /usr/local/cuda-12/bin/ptxas -arch=sm_60 -c - -arch=sm_80
> ```
> 
> Ptxas warns on that:
> 
> "ptxas warning : incompatible redefinition for option 'gpu-name', the last value of this option was used".
> 
> So, the last 
> ```
> -arch=...
> ``` 
> 
> option has a precedence over the previous ones. This is what we need. The warning message is dropped by /dev/null. 
> 
It may be a good idea to update lit docs and document that the default for #ptxas/%ptxas-verify is sm_60 now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141736/new/

https://reviews.llvm.org/D141736



More information about the llvm-commits mailing list