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

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Fri May 30 11:35:00 PDT 2025


================
@@ -127,15 +127,22 @@ class NVPTXSubtarget : public NVPTXGenSubtargetInfo {
   bool hasPTXASUnreachableBug() const { return PTXVersion < 83; }
   bool hasCvtaParam() const { return SmVersion >= 70 && PTXVersion >= 77; }
   unsigned int getFullSmVersion() const { return FullSmVersion; }
-  unsigned int getSmVersion() const { return getFullSmVersion() / 10; }
+  unsigned int getSmVersion() const { return getFullSmVersion() / 100; }
   // GPUs with "a" suffix have include architecture-accelerated features that
   // are supported on the specified architecture only, hence such targets do not
   // follow the onion layer model. hasArchAccelFeatures() allows
   // distinguishing such GPU variants from the base GPU architecture.
-  // - 0 represents base GPU model,
-  // - non-zero value identifies particular architecture-accelerated variant.
+  // - false represents non-accelerated architecture.
+  // - true represents architecture-accelerated variant.
   bool hasArchAccelFeatures() const { return getFullSmVersion() % 10; }
-
+  // GPUs with 'f' suffix have architecture-accelerated features which are
+  // portable across all future architectures under same SM major. For example,
+  // sm_100f features will work for sm_10X future architectures.
----------------
Artem-B wrote:

Did you mean `will work for sm_10X*f*` ? My understanding is that it will still imply that it will only work with family arch accelerated future architectures, not the plan ones. E.g. sm_100f will compile for  sm_103f, but not for sm_103.

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


More information about the llvm-commits mailing list