[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
Thu Aug 8 12:51:04 PDT 2024
================
@@ -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
More information about the llvm-commits
mailing list