[llvm] [NVPTX] Add ptxas verification and kernel test to sm-version test (PR #139543)
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Mon May 12 11:55:15 PDT 2025
================
@@ -56,6 +56,64 @@
; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_121 | FileCheck %s --check-prefix=SM121
; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_121a | FileCheck %s --check-prefix=SM121a
+; RUN: %if ptxas %{ llc < %s -mtriple=nvptx -mcpu=sm_20 | %ptxas-verify %}
----------------
Artem-B wrote:
All of these need to be careful about ptxas versions.
We do not have control over which ptxas version the user may use, and that particular version may support only a subset of the GPUs.
So, for sm_20, it would have to be `%if ptxas && !ptxas-10.0`.
You will also need to adjust `-arch` flag appropriately for the `-ptxas-verify`, otherwise it will default to sm_60 (I think).
Does this test actually succeed in the current form when you run it with PTX enabled?
I suspect that it does not -- I would expect ptxas-verify to complain about the GPU for all GPUs newer than sm_60. It will also silently accept pre-sm_60 GPUs, and will happily compile them for sm_60, but it's not clear whether it's a test bug (we're not verifying compilation for the requested GPU) or a feature (we did verify that ptxas can successfully parse PTX generated by llc, and whether ptxas can actually target the GPU the PTX was intended for not LLVM's concern)
https://github.com/llvm/llvm-project/pull/139543
More information about the llvm-commits
mailing list