[llvm] [NVPTX] Add family-specific architectures support (PR #141899)

Rajat Bajpai via llvm-commits llvm-commits at lists.llvm.org
Fri May 30 03:19:16 PDT 2025


================
@@ -36,17 +36,20 @@ class FeaturePTX<int version>:
 
 foreach sm = [20, 21, 30, 32, 35, 37, 50, 52, 53,
               60, 61, 62, 70, 72, 75, 80, 86, 87,
-              89, 90, 100, 101, 103, 120, 121] in
+              89, 90] in
   def SM#sm: FeatureSM<""#sm, !mul(sm, 10)>;
 
-// Arch-specific targets. PTX for these is not compatible with any other
-// architectures.
-def SM90a : FeatureSM<"90a", 901>;
-def SM100a: FeatureSM<"100a", 1001>;
-def SM101a: FeatureSM<"101a", 1011>;
-def SM103a: FeatureSM<"103a", 1031>;
-def SM120a: FeatureSM<"120a", 1201>;
-def SM121a: FeatureSM<"121a", 1211>;
+// Full SM version for sm_90a is 901
+def SM90a: FeatureSM<"90a", 901>;
+
+foreach sm = [100, 101, 103, 120, 121] in {
+  def SM#sm: FeatureSM<""#sm, !mul(sm, 10)>;
+  // Arch-specific targets. PTX for these is not compatible with any other
+  // architectures.
+  def SM#sm#a: FeatureSM<""#sm#"a", !add(!mul(sm, 10), 1)>;
+  // Family-specific targets. PTX for these is compatible within the same family.
+  def SM#sm#f: FeatureSM<""#sm#"f", !add(!mul(sm, 10), 2)>;
----------------
rajatbajpai wrote:

Your understanding is correct. I have changed the full sm version. Now, we have following order.
1. 10000 // sm_100
2. 10010 // sm_100f
3. 10011 // sm_100a

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


More information about the llvm-commits mailing list