3#include "llvm/ADT/StringRef.h"
4#include "llvm/ADT/Twine.h"
5#include "llvm/Support/ErrorHandling.h"
6#include "llvm/Support/VersionTuple.h"
15#define CUDA_ENTRY(major, minor) \
17 #major "." #minor, CudaVersion::CUDA_##major##minor, \
18 llvm::VersionTuple(major, minor) \
61 std::string VS = S.str();
70 if (I->TVersion == Version)
76struct OffloadArchToStringMap {
83#define SM2(sm, ca) {OffloadArch::SM_##sm, "sm_" #sm, ca}
84#define SM(sm) SM2(sm, "compute_" #sm)
85#define GFX(gpu) {OffloadArch::GFX##gpu, "gfx" #gpu, "compute_amdgcn"}
89 SM2(20,
"compute_20"),
SM2(21,
"compute_20"),
163 auto result = std::find_if(
165 [A](
const OffloadArchToStringMap &map) {
return A == map.arch; });
168 return result->arch_name;
172 auto result = std::find_if(
174 [A](
const OffloadArchToStringMap &map) {
return A == map.arch; });
177 return result->virtual_arch_name;
181 auto result = std::find_if(
183 [S](
const OffloadArchToStringMap &map) {
return S == map.arch_name; });
233 llvm_unreachable(
"invalid enum");
270 llvm_unreachable(
"Unknown CUDA feature.");
const char * virtual_arch_name
#define CUDA_ENTRY(major, minor)
__device__ __2f16 float c
The JSON file list parser is used to communicate input to InstallAPI.
static const OffloadArchToStringMap arch_names[]
CudaVersion MaxVersionForOffloadArch(OffloadArch A)
Get the latest CudaVersion that supports the given OffloadArch.
static bool IsAMDOffloadArch(OffloadArch A)
CudaVersion ToCudaVersion(llvm::VersionTuple)
CudaVersion CudaStringToVersion(const llvm::Twine &S)
bool CudaFeatureEnabled(llvm::VersionTuple, CudaFeature)
const char * CudaVersionToString(CudaVersion V)
static const CudaVersionMapEntry CudaNameVersionMap[]
const char * OffloadArchToVirtualArchString(OffloadArch A)
OffloadArch StringToOffloadArch(llvm::StringRef S)
@ CUDA_USES_FATBIN_REGISTER_END
const char * OffloadArchToString(OffloadArch A)
CudaVersion MinVersionForOffloadArch(OffloadArch A)
Get the earliest CudaVersion that supports the given OffloadArch.
llvm::VersionTuple TVersion