[clang] Remove incorrect CUDA defines (PR #123898)

Sergey Kozub via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 22 02:18:27 PST 2025


https://github.com/sergey-kozub updated https://github.com/llvm/llvm-project/pull/123898

>From 1c4a581d45b622591f5062830f2ff1e33b159a64 Mon Sep 17 00:00:00 2001
From: Sergey Kozub <skozub at nvidia.com>
Date: Wed, 22 Jan 2025 07:38:55 +0000
Subject: [PATCH] Remove incorrect CUDA defines

---
 clang/include/clang/Basic/Cuda.h     | 4 +---
 clang/lib/Basic/Cuda.cpp             | 4 +---
 clang/lib/Driver/ToolChains/Cuda.cpp | 6 ------
 3 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/clang/include/clang/Basic/Cuda.h b/clang/include/clang/Basic/Cuda.h
index 1cdfc8178db843..f33ba46233a7ab 100644
--- a/clang/include/clang/Basic/Cuda.h
+++ b/clang/include/clang/Basic/Cuda.h
@@ -44,12 +44,10 @@ enum class CudaVersion {
   CUDA_124,
   CUDA_125,
   CUDA_126,
-  CUDA_127,
   CUDA_128,
-  CUDA_129,
   FULLY_SUPPORTED = CUDA_123,
   PARTIALLY_SUPPORTED =
-      CUDA_129, // Partially supported. Proceed with a warning.
+      CUDA_128, // Partially supported. Proceed with a warning.
   NEW = 10000,  // Too new. Issue a warning, but allow using it.
 };
 const char *CudaVersionToString(CudaVersion V);
diff --git a/clang/lib/Basic/Cuda.cpp b/clang/lib/Basic/Cuda.cpp
index b1461429d4f51a..1bfec0b37c5ee8 100644
--- a/clang/lib/Basic/Cuda.cpp
+++ b/clang/lib/Basic/Cuda.cpp
@@ -44,9 +44,7 @@ static const CudaVersionMapEntry CudaNameVersionMap[] = {
     CUDA_ENTRY(12, 4),
     CUDA_ENTRY(12, 5),
     CUDA_ENTRY(12, 6),
-    CUDA_ENTRY(12, 7),
     CUDA_ENTRY(12, 8),
-    CUDA_ENTRY(12, 9),
     {"", CudaVersion::NEW, llvm::VersionTuple(std::numeric_limits<int>::max())},
     {"unknown", CudaVersion::UNKNOWN, {}} // End of list tombstone.
 };
@@ -232,7 +230,7 @@ CudaVersion MinVersionForOffloadArch(OffloadArch A) {
     return CudaVersion::CUDA_120;
   case OffloadArch::SM_100:
   case OffloadArch::SM_100a:
-    return CudaVersion::CUDA_127;
+    return CudaVersion::CUDA_128;
   default:
     llvm_unreachable("invalid enum");
   }
diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp b/clang/lib/Driver/ToolChains/Cuda.cpp
index 27e1969dabe551..d4099216c81ba8 100644
--- a/clang/lib/Driver/ToolChains/Cuda.cpp
+++ b/clang/lib/Driver/ToolChains/Cuda.cpp
@@ -89,12 +89,8 @@ CudaVersion getCudaVersion(uint32_t raw_version) {
     return CudaVersion::CUDA_125;
   if (raw_version < 12070)
     return CudaVersion::CUDA_126;
-  if (raw_version < 12080)
-    return CudaVersion::CUDA_127;
   if (raw_version < 12090)
     return CudaVersion::CUDA_128;
-  if (raw_version < 12100)
-    return CudaVersion::CUDA_129;
   return CudaVersion::NEW;
 }
 
@@ -688,9 +684,7 @@ void NVPTX::getNVPTXTargetFeatures(const Driver &D, const llvm::Triple &Triple,
   case CudaVersion::CUDA_##CUDA_VER:                                           \
     PtxFeature = "+ptx" #PTX_VER;                                              \
     break;
-    CASE_CUDA_VERSION(129, 87);
     CASE_CUDA_VERSION(128, 87);
-    CASE_CUDA_VERSION(127, 86);
     CASE_CUDA_VERSION(126, 85);
     CASE_CUDA_VERSION(125, 85);
     CASE_CUDA_VERSION(124, 84);



More information about the cfe-commits mailing list