[clang] [llvm] NVPTX: Add target names in TargetParser (PR #212734)
Durgadoss R via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 30 04:36:41 PDT 2026
================
@@ -0,0 +1,71 @@
+//===--- NVPTXTargetParser.def - NVPTX target data -----------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is the single source of truth for the NVPTX (CUDA) GPU list. Each
+// row describes one virtual architecture (sm_XX). Adding a new target is a
+// single row here.
+//
+// NVPTX_GPU(NAME, KIND, VIRTUAL, SM_ID, MIN_VER, MAX_VER, SUFFIX)
+// NAME - Canonical processor name string, e.g. "sm_90".
+// KIND - GPUKind enumerator suffix; the enumerator is GK_<KIND>
+// VIRTUAL - Virtual (compute_) arch name string, e.g. "compute_90".
+// SM_ID - Numeric compute-capability id (sm_90 -> 900).
+// MIN_VER - Earliest supporting CudaVersion
+// MAX_VER - Latest supporting CudaVersion.
+// SUFFIX - Arch suffix class: NONE, ACCELERATED (sm_90a), FAMILY (sm_90f).
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef NVPTX_GPU
+#define NVPTX_GPU(NAME, KIND, VIRTUAL, SM_ID, MIN_VER, MAX_VER, SUFFIX)
----------------
durga4github wrote:
We have the `getMinPTXVersionForSM()` function in NVPTXSubtarget.cpp that maintains yet another table, mapping each SM to its minimum required PTX version.
Would it be reasonable to extend this mapping, with another column for MIN_PTX_VER (as a follow-up)?
Just want to check if it aligns with the direction you have in mind...
https://github.com/llvm/llvm-project/pull/212734
More information about the cfe-commits
mailing list