Skip to content

Commit 8407779

Browse files
authored
[CUDA] Mark CUDA-12.5 as supported and introduce ptx 8.5. (llvm#94113)
This PR is based on llvm#91516.
1 parent 707f4de commit 8407779

File tree

6 files changed

+13
-4
lines changed

6 files changed

+13
-4
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ CUDA/HIP Language Changes
954954

955955
CUDA Support
956956
^^^^^^^^^^^^
957-
- Clang now supports CUDA SDK up to 12.4
957+
- Clang now supports CUDA SDK up to 12.5
958958

959959
AIX Support
960960
^^^^^^^^^^^

clang/include/clang/Basic/BuiltinsNVPTX.def

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@
6262
#pragma push_macro("PTX82")
6363
#pragma push_macro("PTX83")
6464
#pragma push_macro("PTX84")
65-
#define PTX84 "ptx84"
65+
#pragma push_macro("PTX85")
66+
#define PTX85 "ptx85"
67+
#define PTX84 "ptx84|" PTX85
6668
#define PTX83 "ptx83|" PTX84
6769
#define PTX82 "ptx82|" PTX83
6870
#define PTX81 "ptx81|" PTX82
@@ -1094,3 +1096,4 @@ TARGET_BUILTIN(__nvvm_getctarank_shared_cluster, "iv*3", "", AND(SM_90,PTX78))
10941096
#pragma pop_macro("PTX82")
10951097
#pragma pop_macro("PTX83")
10961098
#pragma pop_macro("PTX84")
1099+
#pragma pop_macro("PTX85")

clang/include/clang/Basic/Cuda.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ enum class CudaVersion {
4242
CUDA_122,
4343
CUDA_123,
4444
CUDA_124,
45+
CUDA_125,
4546
FULLY_SUPPORTED = CUDA_123,
4647
PARTIALLY_SUPPORTED =
47-
CUDA_124, // Partially supported. Proceed with a warning.
48+
CUDA_125, // Partially supported. Proceed with a warning.
4849
NEW = 10000, // Too new. Issue a warning, but allow using it.
4950
};
5051
const char *CudaVersionToString(CudaVersion V);

clang/lib/Basic/Cuda.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ static const CudaVersionMapEntry CudaNameVersionMap[] = {
4242
CUDA_ENTRY(12, 2),
4343
CUDA_ENTRY(12, 3),
4444
CUDA_ENTRY(12, 4),
45+
CUDA_ENTRY(12, 5),
4546
{"", CudaVersion::NEW, llvm::VersionTuple(std::numeric_limits<int>::max())},
4647
{"unknown", CudaVersion::UNKNOWN, {}} // End of list tombstone.
4748
};

clang/lib/Driver/ToolChains/Cuda.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ CudaVersion getCudaVersion(uint32_t raw_version) {
8484
return CudaVersion::CUDA_123;
8585
if (raw_version < 12050)
8686
return CudaVersion::CUDA_124;
87+
if (raw_version < 12060)
88+
return CudaVersion::CUDA_125;
8789
return CudaVersion::NEW;
8890
}
8991

@@ -690,6 +692,7 @@ void NVPTX::getNVPTXTargetFeatures(const Driver &D, const llvm::Triple &Triple,
690692
case CudaVersion::CUDA_##CUDA_VER: \
691693
PtxFeature = "+ptx" #PTX_VER; \
692694
break;
695+
CASE_CUDA_VERSION(125, 85);
693696
CASE_CUDA_VERSION(124, 84);
694697
CASE_CUDA_VERSION(123, 83);
695698
CASE_CUDA_VERSION(122, 82);

llvm/lib/Target/NVPTX/NVPTX.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ foreach sm = [20, 21, 30, 32, 35, 37, 50, 52, 53,
4141
def SM90a: FeatureSM<"90a", 901>;
4242

4343
foreach version = [32, 40, 41, 42, 43, 50, 60, 61, 62, 63, 64, 65,
44-
70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84] in
44+
70, 71, 72, 73, 74, 75, 76, 77, 78,
45+
80, 81, 82, 83, 84, 85] in
4546
def PTX#version: FeaturePTX<version>;
4647

4748
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)