[clang] [llvm] [CUDA] Add a pseudo GPU sm_next which allows overriding for SM/PTX version. (PR #100247)
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 23 16:42:33 PDT 2024
================
@@ -648,6 +658,13 @@ void NVPTX::getNVPTXTargetFeatures(const Driver &D, const llvm::Triple &Triple,
Features.push_back(Args.MakeArgString(PtxFeature));
return;
}
+ // Add --cuda-next-ptx to the list of features, but carry on to add the
+ // default PTX feature for the detected CUDA SDK. NVPTX back-end will use the
+ // higher version.
+ StringRef NextPtx = Args.getLastArgValue(options::OPT_cuda_next_ptx_EQ);
+ if (!NextPtx.empty())
+ Features.push_back(Args.MakeArgString("+ptx" + NextPtx));
----------------
Artem-B wrote:
Not quite. `--ptx-feature` applies globally for all sub-compilations. I'e it overrides the PTX feature which is applied based on the CUDA SDK version we've detected. These new options only override the sub-compilation targeting `sm_next`. `sm_next` is expected to be used alongside the subcompilations for the 'normal' GPUs and I intentionally want to keep them as-is.
https://github.com/llvm/llvm-project/pull/100247
More information about the llvm-commits
mailing list