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) \
60 std::string VS = S.str();
69 if (I->TVersion == Version)
75struct OffloadArchToStringMap {
82#define SM2(sm, ca) {OffloadArch::SM_##sm, "sm_" #sm, ca}
83#define SM(sm) SM2(sm, "compute_" #sm)
84#define GFX(gpu) {OffloadArch::GFX##gpu, "gfx" #gpu, "compute_amdgcn"}
88 SM2(20,
"compute_20"),
SM2(21,
"compute_20"),
158 auto result = std::find_if(
160 [A](
const OffloadArchToStringMap &map) {
return A == map.arch; });
163 return result->arch_name;
167 auto result = std::find_if(
169 [A](
const OffloadArchToStringMap &map) {
return A == map.arch; });
172 return result->virtual_arch_name;
176 auto result = std::find_if(
178 [S](
const OffloadArchToStringMap &map) {
return S == map.arch_name; });
225 llvm_unreachable(
"invalid enum");
262 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