================ @@ -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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits