================ @@ -26,24 +27,38 @@ static cl::opt<bool> NoF16Math("nvptx-no-f16-math", cl::Hidden, cl::desc("NVPTX Specific: Disable generation of f16 math ops."), cl::init(false)); +static cl::opt<unsigned> + NextSM("nvptx-next-sm", cl::Hidden, + cl::desc("NVPTX Specific: Override SM ID for sm_next."), + cl::init(90)); +static cl::opt<unsigned> + NextPTX("nvptx-next-ptx", cl::Hidden, + cl::desc("NVPTX Specific: Override PTX version for sm_next."), + cl::init(85)); + // Pin the vtable to this file. void NVPTXSubtarget::anchor() {} NVPTXSubtarget &NVPTXSubtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS) { - // Provide the default CPU if we don't have one. - TargetName = std::string(CPU.empty() ? "sm_30" : CPU); + // Provide the default CPU if we don't have one. + TargetName = std::string(CPU.empty() ? "sm_30" : CPU); - ParseSubtargetFeatures(TargetName, /*TuneCPU*/ TargetName, FS); + ParseSubtargetFeatures(TargetName, /*TuneCPU*/ TargetName, FS); + if (TargetName == "sm_next") { + TargetName = "sm_" + itostr(NextSM); + FullSmVersion = NextSM * 10; ---------------- Artem-B wrote:
Done. SM override now takes `sm_XXX` options and allows passing them through. 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