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

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 9 11:44:58 PDT 2025


================
@@ -33,20 +33,61 @@ class FeaturePTX<int version>:
    SubtargetFeature<"ptx"# version, "PTXVersion",
                     "" # version,
                     "Use PTX version " # version>;
-
+//
+// NVPTX Architecture Hierarchy and Ordering:
+// 
+// Family: 2/3/5/6/7/8/9/10/12 (Follows Onion model, older family is compatible with newer family)
+// Arch: 2*/3*/5*/6*/7*/8*/9*/10*/12*
+//
+// Family-specific: F*f : F*f > F* =>
+// + The plain base architecture is compatible with the family-specific architecture
+//   (e.g. sm_100 compatible with >= sm_100*f*)
+// + The family-specific architecture is compatible with future family-specific
+//   architectures within the same family (e.g. sm_100f compatible with >= sm_10X*f*
+//   but not with sm_12X*f*)
+//
+//    Family and SM Target Definition:
+//    +----------------+--------------------------------------------------------+
+//    | Family         | Target SM architectures included                       |
+//    +----------------+--------------------------------------------------------+
+//    | sm_10x family  | sm_100f, sm_103f, future targets in sm_10x family      |
+//    | sm_101 family  | sm_101f (exception)                                    |
+//    | sm_12x family  | sm_120f, sm_121f, future targets in sm_12x family      |
+//    +----------------+--------------------------------------------------------+
+//
+// Architecture-specific: F*a : F*a > F*f > F* =>
----------------
Artem-B wrote:

All the words could be more formally summarized along the lines of:
For an architecture `sm_XYz` where X is the major revision number, NY- minor revision number, z - optional feature suffix, the following order is defined among the fields denoted by `{}`:
* sm_{X1Y1} > sm_{X2Y2} iff X1Y1 > X2Y2
* sm_X{Y1}f  > sm_X{Y2}f iff Y1 > Y2
* sm_XY{a} > sm_XY{f} > sm_{XY}{}



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


More information about the llvm-commits mailing list