[CUDA] Bump supported CUDA version to 11.5

Differential Revision: https://reviews.llvm.org/D113249
This commit is contained in:
Carlos Galvez 2021-11-05 09:13:33 +00:00
parent 81081daef0
commit 7ecec3f0f5
8 changed files with 21 additions and 6 deletions

View File

@ -158,7 +158,7 @@ C++2b Feature Support
CUDA Language Changes in Clang
------------------------------
- Clang now supports CUDA versions up to 11.4.
- Clang now supports CUDA versions up to 11.5.
- Default GPU architecture has been changed from sm_20 to sm_35.
Objective-C Language Changes in Clang

View File

@ -41,7 +41,9 @@
#pragma push_macro("PTX72")
#pragma push_macro("PTX73")
#pragma push_macro("PTX74")
#define PTX74 "ptx74"
#pragma push_macro("PTX75")
#define PTX75 "ptx75"
#define PTX74 "ptx74|" PTX75
#define PTX73 "ptx73|" PTX74
#define PTX72 "ptx72|" PTX73
#define PTX71 "ptx71|" PTX72
@ -827,3 +829,4 @@ TARGET_BUILTIN(__nvvm_cp_async_wait_all, "v", "", AND(SM_80,PTX70))
#pragma pop_macro("PTX72")
#pragma pop_macro("PTX73")
#pragma pop_macro("PTX74")
#pragma pop_macro("PTX75")

View File

@ -33,9 +33,10 @@ enum class CudaVersion {
CUDA_112,
CUDA_113,
CUDA_114,
FULLY_SUPPORTED = CUDA_114,
CUDA_115,
FULLY_SUPPORTED = CUDA_115,
PARTIALLY_SUPPORTED =
CUDA_114, // Partially supported. Proceed with a warning.
CUDA_115, // Partially supported. Proceed with a warning.
NEW = 10000, // Too new. Issue a warning, but allow using it.
};
const char *CudaVersionToString(CudaVersion V);

View File

@ -40,6 +40,8 @@ const char *CudaVersionToString(CudaVersion V) {
return "11.3";
case CudaVersion::CUDA_114:
return "11.4";
case CudaVersion::CUDA_115:
return "11.5";
case CudaVersion::NEW:
return "";
}
@ -62,6 +64,7 @@ CudaVersion CudaStringToVersion(const llvm::Twine &S) {
.Case("11.2", CudaVersion::CUDA_112)
.Case("11.3", CudaVersion::CUDA_113)
.Case("11.4", CudaVersion::CUDA_114)
.Case("11.5", CudaVersion::CUDA_115)
.Default(CudaVersion::UNKNOWN);
}
@ -241,6 +244,8 @@ CudaVersion ToCudaVersion(llvm::VersionTuple Version) {
return CudaVersion::CUDA_113;
case 114:
return CudaVersion::CUDA_114;
case 115:
return CudaVersion::CUDA_115;
default:
return CudaVersion::UNKNOWN;
}

View File

@ -44,6 +44,7 @@ NVPTXTargetInfo::NVPTXTargetInfo(const llvm::Triple &Triple,
if (!Feature.startswith("+ptx"))
continue;
PTXVersion = llvm::StringSwitch<unsigned>(Feature)
.Case("+ptx75", 75)
.Case("+ptx74", 74)
.Case("+ptx73", 73)
.Case("+ptx72", 72)

View File

@ -65,6 +65,8 @@ CudaVersion getCudaVersion(uint32_t raw_version) {
return CudaVersion::CUDA_113;
if (raw_version < 11050)
return CudaVersion::CUDA_114;
if (raw_version < 11060)
return CudaVersion::CUDA_115;
return CudaVersion::NEW;
}
@ -707,6 +709,7 @@ void CudaToolChain::addClangTargetOptions(
case CudaVersion::CUDA_##CUDA_VER: \
PtxFeature = "+ptx" #PTX_VER; \
break;
CASE_CUDA_VERSION(115, 75);
CASE_CUDA_VERSION(114, 74);
CASE_CUDA_VERSION(113, 73);
CASE_CUDA_VERSION(112, 72);

View File

@ -23,8 +23,8 @@ Prerequisites
-------------
CUDA is supported since llvm 3.9. Clang currently supports CUDA 7.0 through
10.1. If clang detects a newer CUDA version, it will issue a warning and will
attempt to use detected CUDA SDK it as if it were CUDA-10.1.
11.5. If clang detects a newer CUDA version, it will issue a warning and will
attempt to use detected CUDA SDK it as if it were CUDA 11.5.
Before you build CUDA code, you'll need to have installed the CUDA SDK. See
`NVIDIA's CUDA installation guide

View File

@ -93,6 +93,8 @@ def PTX73 : SubtargetFeature<"ptx73", "PTXVersion", "73",
"Use PTX version 7.3">;
def PTX74 : SubtargetFeature<"ptx74", "PTXVersion", "74",
"Use PTX version 7.4">;
def PTX75 : SubtargetFeature<"ptx75", "PTXVersion", "75",
"Use PTX version 7.5">;
//===----------------------------------------------------------------------===//
// NVPTX supported processors.