[Mlir-commits] [mlir] [mlir][NVVM] Reject malformed target chip names (PR #220873)

Guray Ozen llvmlistbot at llvm.org
Mon Sep 7 03:15:33 PDT 2026


================
@@ -62,16 +64,28 @@ struct NVVMCheckSMVersion {
 
   // Parses an SM version string and returns an equivalent full SM version
   // integer.
-  static unsigned getTargetFullSmVersionFromStr(StringRef smVersionString) {
-    bool isAA = smVersionString.back() == kArchAcceleratedSuffix;
-    bool isFS = smVersionString.back() == kFamilySpecificSuffix;
+  static std::optional<unsigned>
+  getTargetFullSmVersionFromStr(StringRef smVersionString) {
+    if (!smVersionString.consume_front("sm_"))
----------------
grypp wrote:

can we de-magic `sm_`? Maybe add
```
kStreamingMultiprocessorSuffix = `sm_`
``

https://github.com/llvm/llvm-project/pull/220873


More information about the Mlir-commits mailing list