12#include "clang/Config/config.h"
19#include "llvm/ADT/StringExtras.h"
20#include "llvm/Option/ArgList.h"
21#include "llvm/Support/FileSystem.h"
22#include "llvm/Support/FormatAdapters.h"
23#include "llvm/Support/FormatVariadic.h"
24#include "llvm/Support/Path.h"
25#include "llvm/Support/Process.h"
26#include "llvm/Support/Program.h"
27#include "llvm/Support/VirtualFileSystem.h"
28#include "llvm/TargetParser/Host.h"
29#include "llvm/TargetParser/TargetParser.h"
30#include <system_error>
41 if (raw_version < 7050)
42 return CudaVersion::CUDA_70;
43 if (raw_version < 8000)
44 return CudaVersion::CUDA_75;
45 if (raw_version < 9000)
46 return CudaVersion::CUDA_80;
47 if (raw_version < 9010)
48 return CudaVersion::CUDA_90;
49 if (raw_version < 9020)
50 return CudaVersion::CUDA_91;
51 if (raw_version < 10000)
52 return CudaVersion::CUDA_92;
53 if (raw_version < 10010)
54 return CudaVersion::CUDA_100;
55 if (raw_version < 10020)
56 return CudaVersion::CUDA_101;
57 if (raw_version < 11000)
58 return CudaVersion::CUDA_102;
59 if (raw_version < 11010)
60 return CudaVersion::CUDA_110;
61 if (raw_version < 11020)
62 return CudaVersion::CUDA_111;
63 if (raw_version < 11030)
64 return CudaVersion::CUDA_112;
65 if (raw_version < 11040)
66 return CudaVersion::CUDA_113;
67 if (raw_version < 11050)
68 return CudaVersion::CUDA_114;
69 if (raw_version < 11060)
70 return CudaVersion::CUDA_115;
71 if (raw_version < 11070)
72 return CudaVersion::CUDA_116;
73 if (raw_version < 11080)
74 return CudaVersion::CUDA_117;
75 if (raw_version < 11090)
76 return CudaVersion::CUDA_118;
77 if (raw_version < 12010)
78 return CudaVersion::CUDA_120;
79 if (raw_version < 12020)
80 return CudaVersion::CUDA_121;
81 return CudaVersion::NEW;
87 auto StartsWithWords =
88 [](llvm::StringRef Line,
90 for (StringRef word : words) {
91 if (!Line.consume_front(word))
98 Input = Input.ltrim();
99 while (!Input.empty()) {
101 StartsWithWords(Input.ltrim(), {
"#",
"define",
"CUDA_VERSION"})) {
103 Line->consumeInteger(10, RawVersion);
104 return getCudaVersion(RawVersion);
107 Input = Input.drop_front(Input.find_first_of(
"\n\r")).ltrim();
109 return CudaVersion::UNKNOWN;
116 if (!VersionString.empty())
117 VersionString.insert(0,
" ");
118 D.
Diag(diag::warn_drv_new_cuda_version)
123 D.
Diag(diag::warn_drv_partially_supported_cuda_version)
128 const Driver &D,
const llvm::Triple &HostTriple,
129 const llvm::opt::ArgList &Args)
135 Candidate(std::string Path,
bool StrictChecking =
false)
136 : Path(Path), StrictChecking(StrictChecking) {}
141 std::initializer_list<const char *> Versions = {
"8.0",
"7.5",
"7.0"};
144 if (Args.hasArg(clang::driver::options::OPT_cuda_path_EQ)) {
145 Candidates.emplace_back(
146 Args.getLastArgValue(clang::driver::options::OPT_cuda_path_EQ).str());
147 }
else if (HostTriple.isOSWindows()) {
148 for (
const char *Ver : Versions)
149 Candidates.emplace_back(
150 D.
SysRoot +
"/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v" +
153 if (!Args.hasArg(clang::driver::options::OPT_cuda_path_ignore_env)) {
162 if (llvm::ErrorOr<std::string> ptxas =
163 llvm::sys::findProgramByName(
"ptxas")) {
165 llvm::sys::fs::real_path(*ptxas, ptxasAbsolutePath);
167 StringRef ptxasDir = llvm::sys::path::parent_path(ptxasAbsolutePath);
168 if (llvm::sys::path::filename(ptxasDir) ==
"bin")
169 Candidates.emplace_back(
170 std::string(llvm::sys::path::parent_path(ptxasDir)),
175 Candidates.emplace_back(D.
SysRoot +
"/usr/local/cuda");
176 for (
const char *Ver : Versions)
177 Candidates.emplace_back(D.
SysRoot +
"/usr/local/cuda-" + Ver);
179 Distro Dist(FS, llvm::Triple(llvm::sys::getProcessTriple()));
183 Candidates.emplace_back(D.
SysRoot +
"/usr/lib/cuda");
186 bool NoCudaLib = Args.hasArg(options::OPT_nogpulib);
188 for (
const auto &Candidate : Candidates) {
189 InstallPath = Candidate.Path;
190 if (InstallPath.empty() || !FS.exists(InstallPath))
193 BinPath = InstallPath +
"/bin";
194 IncludePath = InstallPath +
"/include";
195 LibDevicePath = InstallPath +
"/nvvm/libdevice";
197 if (!(FS.exists(IncludePath) && FS.exists(BinPath)))
199 bool CheckLibDevice = (!NoCudaLib || Candidate.StrictChecking);
200 if (CheckLibDevice && !FS.exists(LibDevicePath))
204 if (
auto CudaHFile = FS.getBufferForFile(InstallPath +
"/include/cuda.h"))
205 Version = parseCudaHFile((*CudaHFile)->getBuffer());
209 Version = FS.exists(LibDevicePath +
"/libdevice.10.bc")
216 std::string FilePath = LibDevicePath +
"/libdevice.10.bc";
217 if (FS.exists(FilePath)) {
224 LibDeviceMap[GpuArchName] = FilePath;
229 for (llvm::vfs::directory_iterator LI = FS.dir_begin(LibDevicePath, EC),
231 !EC && LI != LE; LI = LI.increment(EC)) {
232 StringRef FilePath = LI->path();
233 StringRef FileName = llvm::sys::path::filename(FilePath);
236 const StringRef LibDeviceName =
"libdevice.";
237 if (!(FileName.startswith(LibDeviceName) && FileName.endswith(
".bc")))
239 StringRef GpuArch = FileName.slice(
240 LibDeviceName.size(), FileName.find(
'.', LibDeviceName.size()));
241 LibDeviceMap[GpuArch] = FilePath.str();
245 if (GpuArch ==
"compute_20") {
246 LibDeviceMap[
"sm_20"] = std::string(FilePath);
247 LibDeviceMap[
"sm_21"] = std::string(FilePath);
248 LibDeviceMap[
"sm_32"] = std::string(FilePath);
249 }
else if (GpuArch ==
"compute_30") {
250 LibDeviceMap[
"sm_30"] = std::string(FilePath);
252 LibDeviceMap[
"sm_50"] = std::string(FilePath);
253 LibDeviceMap[
"sm_52"] = std::string(FilePath);
254 LibDeviceMap[
"sm_53"] = std::string(FilePath);
256 LibDeviceMap[
"sm_60"] = std::string(FilePath);
257 LibDeviceMap[
"sm_61"] = std::string(FilePath);
258 LibDeviceMap[
"sm_62"] = std::string(FilePath);
259 }
else if (GpuArch ==
"compute_35") {
260 LibDeviceMap[
"sm_35"] = std::string(FilePath);
261 LibDeviceMap[
"sm_37"] = std::string(FilePath);
262 }
else if (GpuArch ==
"compute_50") {
264 LibDeviceMap[
"sm_50"] = std::string(FilePath);
265 LibDeviceMap[
"sm_52"] = std::string(FilePath);
266 LibDeviceMap[
"sm_53"] = std::string(FilePath);
274 if (LibDeviceMap.empty() && !NoCudaLib)
283 const ArgList &DriverArgs, ArgStringList &CC1Args)
const {
284 if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
288 llvm::sys::path::append(
P,
"include");
289 llvm::sys::path::append(
P,
"cuda_wrappers");
290 CC1Args.push_back(
"-internal-isystem");
291 CC1Args.push_back(DriverArgs.MakeArgString(
P));
294 if (DriverArgs.hasArg(options::OPT_nogpuinc))
298 D.
Diag(diag::err_drv_no_cuda_installation);
302 CC1Args.push_back(
"-include");
303 CC1Args.push_back(
"__clang_cuda_runtime_wrapper.h");
309 ArchsWithBadVersion[(
int)Arch])
314 if (Version < MinVersion || Version > MaxVersion) {
315 ArchsWithBadVersion[(
int)Arch] =
true;
316 D.
Diag(diag::err_drv_cuda_version_unsupported)
325 OS <<
"Found CUDA installation: " << InstallPath <<
", version "
335enum DeviceDebugInfoLevel {
338 EmitSameDebugInfoAsHost,
352 const Arg *A = Args.getLastArg(options::OPT_O_Group);
353 bool IsDebugEnabled = !A || A->getOption().matches(options::OPT_O0) ||
354 Args.hasFlag(options::OPT_cuda_noopt_device_debug,
355 options::OPT_no_cuda_noopt_device_debug,
357 if (
const Arg *A = Args.getLastArg(options::OPT_g_Group)) {
358 const Option &Opt = A->getOption();
359 if (Opt.matches(options::OPT_gN_Group)) {
360 if (Opt.matches(options::OPT_g0) || Opt.matches(options::OPT_ggdb0))
361 return DisableDebugInfo;
362 if (Opt.matches(options::OPT_gline_directives_only))
363 return DebugDirectivesOnly;
365 return IsDebugEnabled ? EmitSameDebugInfoAsHost : DebugDirectivesOnly;
374 const char *LinkingOutput)
const {
377 assert(TC.getTriple().isNVPTX() &&
"Wrong platform");
379 StringRef GPUArchName;
387 GPUArchName = Args.getLastArgValue(options::OPT_march_EQ);
388 assert(!GPUArchName.empty() &&
"Must have an architecture passed in.");
394 "Device action expected to have an architecture.");
397 if (!Args.hasArg(options::OPT_no_cuda_version_check)) {
398 TC.CudaInstallation.CheckCudaVersionSupportsArch(gpu_arch);
401 ArgStringList CmdArgs;
402 CmdArgs.push_back(TC.getTriple().isArch64Bit() ?
"-m64" :
"-m32");
404 if (DIKind == EmitSameDebugInfoAsHost) {
407 CmdArgs.push_back(
"-g");
408 CmdArgs.push_back(
"--dont-merge-basicblocks");
409 CmdArgs.push_back(
"--return-at-end");
410 }
else if (Arg *A = Args.getLastArg(options::OPT_O_Group)) {
418 StringRef OOpt =
"3";
419 if (A->getOption().matches(options::OPT_O4) ||
420 A->getOption().matches(options::OPT_Ofast))
422 else if (A->getOption().matches(options::OPT_O0))
424 else if (A->getOption().matches(options::OPT_O)) {
426 OOpt = llvm::StringSwitch<const char *>(A->getValue())
434 CmdArgs.push_back(Args.MakeArgString(llvm::Twine(
"-O") + OOpt));
438 CmdArgs.push_back(
"-O0");
440 if (DIKind == DebugDirectivesOnly)
441 CmdArgs.push_back(
"-lineinfo");
444 if (Args.hasArg(options::OPT_v))
445 CmdArgs.push_back(
"-v");
447 CmdArgs.push_back(
"--gpu-name");
449 CmdArgs.push_back(
"--output-file");
450 std::string OutputFileName = TC.getInputFilename(Output);
454 if (!
C.getInputArgs().getLastArg(options::OPT_c)) {
456 llvm::sys::path::replace_extension(
Filename,
"cubin");
460 C.addTempFile(Args.MakeArgString(OutputFileName));
462 CmdArgs.push_back(Args.MakeArgString(OutputFileName));
463 for (
const auto &II : Inputs)
464 CmdArgs.push_back(Args.MakeArgString(II.getFilename()));
466 for (
const auto &A : Args.getAllArgValues(options::OPT_Xcuda_ptxas))
467 CmdArgs.push_back(Args.MakeArgString(A));
472 Relocatable = Args.hasFlag(options::OPT_fopenmp_relocatable_target,
473 options::OPT_fnoopenmp_relocatable_target,
477 Relocatable = Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc,
484 CmdArgs.push_back(
"-c");
487 if (Arg *A = Args.getLastArg(options::OPT_ptxas_path_EQ))
488 Exec = A->getValue();
490 Exec = Args.MakeArgString(TC.GetProgramPath(
"ptxas"));
491 C.addCommand(std::make_unique<Command>(
495 Exec, CmdArgs, Inputs, Output));
499 bool includePTX =
true;
500 for (Arg *A : Args) {
501 if (!(A->getOption().matches(options::OPT_cuda_include_ptx_EQ) ||
502 A->getOption().matches(options::OPT_no_cuda_include_ptx_EQ)))
505 const StringRef ArchStr = A->getValue();
506 if (ArchStr ==
"all" || ArchStr == gpu_arch) {
507 includePTX = A->getOption().matches(options::OPT_cuda_include_ptx_EQ);
521 const char *LinkingOutput)
const {
524 assert(TC.getTriple().isNVPTX() &&
"Wrong platform");
526 ArgStringList CmdArgs;
528 CmdArgs.push_back(
"--cuda");
529 CmdArgs.push_back(TC.getTriple().isArch64Bit() ?
"-64" :
"-32");
530 CmdArgs.push_back(Args.MakeArgString(
"--create"));
531 CmdArgs.push_back(Args.MakeArgString(Output.
getFilename()));
533 CmdArgs.push_back(
"-g");
535 for (
const auto &II : Inputs) {
536 auto *A = II.getAction();
537 assert(A->getInputs().size() == 1 &&
538 "Device offload action is expected to have a single input");
539 const char *gpu_arch_str = A->getOffloadingArch();
540 assert(gpu_arch_str &&
541 "Device action expected to have associated a GPU architecture!");
544 if (II.getType() == types::TY_PP_Asm &&
549 const char *Arch = (II.getType() == types::TY_PP_Asm)
553 Args.MakeArgString(llvm::Twine(
"--image=profile=") + Arch +
554 ",file=" + getToolChain().getInputFilename(II)));
557 for (
const auto &A : Args.getAllArgValues(options::OPT_Xcuda_fatbinary))
558 CmdArgs.push_back(Args.MakeArgString(A));
560 const char *Exec = Args.MakeArgString(TC.GetProgramPath(
"fatbinary"));
561 C.addCommand(std::make_unique<Command>(
565 Exec, CmdArgs, Inputs, Output));
572 const char *LinkingOutput)
const {
575 ArgStringList CmdArgs;
577 assert(TC.getTriple().isNVPTX() &&
"Wrong platform");
581 CmdArgs.push_back(
"-o");
586 CmdArgs.push_back(
"-g");
588 if (Args.hasArg(options::OPT_v))
589 CmdArgs.push_back(
"-v");
591 StringRef GPUArch = Args.getLastArgValue(options::OPT_march_EQ);
592 assert(!GPUArch.empty() &&
"At least one GPU Arch required for nvlink.");
594 CmdArgs.push_back(
"-arch");
595 CmdArgs.push_back(Args.MakeArgString(GPUArch));
602 llvm::sys::path::parent_path(TC.getDriver().Dir);
603 llvm::sys::path::append(DefaultLibPath, CLANG_INSTALL_LIBDIR_BASENAME);
604 CmdArgs.push_back(Args.MakeArgString(Twine(
"-L") + DefaultLibPath));
606 for (
const auto &II : Inputs) {
607 if (II.getType() == types::TY_LLVM_IR || II.getType() == types::TY_LTO_IR ||
608 II.getType() == types::TY_LTO_BC || II.getType() == types::TY_LLVM_BC) {
609 C.getDriver().Diag(diag::err_drv_no_linker_llvm_support)
610 << getToolChain().getTripleString();
616 if (!II.isFilename())
623 auto InputFile = getToolChain().getInputFilename(II);
624 if (llvm::sys::path::extension(InputFile) !=
".cubin") {
628 if (II.getAction() && II.getAction()->getInputs().size() == 0) {
630 Args.MakeArgString(getToolChain().getDriver().GetTemporaryPath(
631 llvm::sys::path::stem(InputFile),
"cubin"));
632 if (llvm::sys::fs::copy_file(InputFile,
C.addTempFile(CubinF)))
635 CmdArgs.push_back(CubinF);
638 llvm::sys::path::replace_extension(
Filename,
"cubin");
639 CmdArgs.push_back(Args.MakeArgString(
Filename));
642 CmdArgs.push_back(Args.MakeArgString(InputFile));
646 C.addCommand(std::make_unique<Command>(
650 Args.MakeArgString(getToolChain().GetProgramPath(
"nvlink")), CmdArgs,
655 const llvm::opt::ArgList &Args,
656 std::vector<StringRef> &Features) {
657 if (Args.hasArg(options::OPT_cuda_feature_EQ)) {
658 StringRef PtxFeature =
659 Args.getLastArgValue(options::OPT_cuda_feature_EQ,
"+ptx42");
660 Features.push_back(Args.MakeArgString(PtxFeature));
668 const char *PtxFeature =
nullptr;
669 switch (CudaInstallation.
version()) {
670#define CASE_CUDA_VERSION(CUDA_VER, PTX_VER) \
671 case CudaVersion::CUDA_##CUDA_VER: \
672 PtxFeature = "+ptx" #PTX_VER; \
691#undef CASE_CUDA_VERSION
693 PtxFeature =
"+ptx42";
695 Features.push_back(PtxFeature);
702 const llvm::Triple &HostTriple,
703 const ArgList &Args,
bool Freestanding =
false)
704 :
ToolChain(D, Triple, Args), CudaInstallation(D, HostTriple, Args),
705 Freestanding(Freestanding) {
706 if (CudaInstallation.isValid())
707 getProgramPaths().push_back(std::string(CudaInstallation.getBinPath()));
710 getProgramPaths().push_back(getDriver().Dir);
720llvm::opt::DerivedArgList *
724 DerivedArgList *DAL =
727 DAL =
new DerivedArgList(Args.getBaseArgs());
729 const OptTable &Opts = getDriver().getOpts();
732 if (!llvm::is_contained(*DAL, A))
735 if (!DAL->hasArg(options::OPT_march_EQ))
736 DAL->AddJoinedArg(
nullptr, Opts.getOption(options::OPT_march_EQ),
743 const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args,
749 CC1Args.append({
"-mllvm",
"--nvptx-lower-global-ctor-dtor"});
753 const Option &O = A->getOption();
754 return (O.matches(options::OPT_gN_Group) &&
755 !O.matches(options::OPT_gmodules)) ||
756 O.matches(options::OPT_g_Flag) ||
757 O.matches(options::OPT_ggdbN_Group) || O.matches(options::OPT_ggdb) ||
758 O.matches(options::OPT_gdwarf) || O.matches(options::OPT_gdwarf_2) ||
759 O.matches(options::OPT_gdwarf_3) || O.matches(options::OPT_gdwarf_4) ||
760 O.matches(options::OPT_gdwarf_5) ||
761 O.matches(options::OPT_gcolumn_info);
765 llvm::codegenoptions::DebugInfoKind &DebugInfoKind,
766 const ArgList &Args)
const {
768 case DisableDebugInfo:
769 DebugInfoKind = llvm::codegenoptions::NoDebugInfo;
771 case DebugDirectivesOnly:
772 DebugInfoKind = llvm::codegenoptions::DebugDirectivesOnly;
774 case EmitSameDebugInfoAsHost:
785 const ToolChain &HostTC,
const ArgList &Args)
786 :
NVPTXToolChain(D, Triple, HostTC.getTriple(), Args), HostTC(HostTC) {}
789 const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args,
793 StringRef GpuArch = DriverArgs.getLastArgValue(options::OPT_march_EQ);
794 assert(!GpuArch.empty() &&
"Must have an explicit GPU arch.");
797 "Only OpenMP or CUDA offloading kinds are supported for NVIDIA GPUs.");
801 {
"-fcuda-is-device",
"-mllvm",
"-enable-memcpyopt-without-libcalls"});
808 CC1Args.push_back(
"-fcuda-allow-variadic-functions");
811 if (DriverArgs.hasArg(options::OPT_nogpulib))
815 DriverArgs.hasArg(options::OPT_S))
819 if (LibDeviceFile.empty()) {
820 getDriver().
Diag(diag::err_drv_no_cuda_libdevice) << GpuArch;
824 CC1Args.push_back(
"-mlink-builtin-bitcode");
825 CC1Args.push_back(DriverArgs.MakeArgString(LibDeviceFile));
829 if (DriverArgs.hasFlag(options::OPT_fcuda_short_ptr,
830 options::OPT_fno_cuda_short_ptr,
false))
831 CC1Args.append({
"-mllvm",
"--nvptx-short-ptr"});
835 DriverArgs.MakeArgString(Twine(
"-target-sdk-version=") +
841 diag::err_drv_omp_offload_target_cuda_version_not_support)
856 const llvm::opt::ArgList &DriverArgs,
const JobAction &JA,
857 const llvm::fltSemantics *FPType)
const {
859 if (FPType && FPType == &llvm::APFloat::IEEEsingle() &&
860 DriverArgs.hasFlag(options::OPT_fgpu_flush_denormals_to_zero,
861 options::OPT_fno_gpu_flush_denormals_to_zero,
false))
862 return llvm::DenormalMode::getPreserveSign();
866 return llvm::DenormalMode::getIEEE();
870 ArgStringList &CC1Args)
const {
872 if (!DriverArgs.hasArg(options::OPT_nogpuinc) &&
873 !DriverArgs.hasArg(options::OPT_no_cuda_version_check)) {
874 StringRef Arch = DriverArgs.getLastArgValue(options::OPT_march_EQ);
875 assert(!Arch.empty() &&
"Must have an explicit GPU arch.");
890 llvm::sys::path::replace_extension(
Filename,
"cubin");
894llvm::opt::DerivedArgList *
898 DerivedArgList *DAL =
901 DAL =
new DerivedArgList(Args.getBaseArgs());
910 if (!llvm::is_contained(*DAL, A))
913 if (!DAL->hasArg(options::OPT_march_EQ)) {
914 StringRef Arch = BoundArch;
919 llvm::formatv(
"{0}", llvm::fmt_consume(ArchsOrErr.takeError()));
921 << llvm::Triple::getArchTypeName(
getArch()) << ErrMsg <<
"-march";
924 Arch = Args.MakeArgString(ArchsOrErr->front());
927 DAL->AddJoinedArg(
nullptr, Opts.getOption(options::OPT_march_EQ), Arch);
933 for (Arg *A : Args) {
937 if (!BoundArch.empty()) {
938 DAL->eraseArg(options::OPT_march_EQ);
939 DAL->AddJoinedArg(
nullptr, Opts.getOption(options::OPT_march_EQ),
949 if (Arg *A = Args.getLastArg(options::OPT_nvptx_arch_tool_EQ))
950 Program = A->getValue();
956 return StdoutOrErr.takeError();
959 for (StringRef Arch : llvm::split((*StdoutOrErr)->getBuffer(),
"\n"))
961 GPUArchs.push_back(Arch.str());
963 if (GPUArchs.empty())
964 return llvm::createStringError(std::error_code(),
965 "No NVIDIA GPU detected in the system");
967 return std::move(GPUArchs);
996 ArgStringList &CC1Args)
const {
1001 {
"-internal-isystem",
1006 ArgStringList &CC1Args)
const {
1011 ArgStringList &CC1Args)
const {
1029 const ArgList &Args)
const {
const char * getOffloadingArch() const
OffloadKind getOffloadingDeviceKind() const
bool isDeviceOffloading(OffloadKind OKind) const
bool isOffloading(OffloadKind OKind) const
Compilation - A set of tasks to perform for a single driver invocation.
A class to find a viable CUDA installation.
void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
CudaInstallationDetector(const Driver &D, const llvm::Triple &HostTriple, const llvm::opt::ArgList &Args)
void WarnIfUnsupportedVersion()
CudaVersion version() const
Get the detected Cuda install's version.
std::string getLibDeviceFile(StringRef Gpu) const
Get libdevice file for given architecture.
void CheckCudaVersionSupportsArch(CudaArch Arch) const
Emit an error if Version does not support the given Arch.
void print(raw_ostream &OS) const
Print information about the detected CUDA installation.
StringRef getIncludePath() const
Get the detected Cuda Include path.
bool isValid() const
Check whether we detected a valid Cuda install.
Distro - Helper class for detecting and classifying Linux distributions.
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
std::string SysRoot
sysroot, if present
DiagnosticBuilder Diag(unsigned DiagID) const
const llvm::opt::OptTable & getOpts() const
std::string ResourceDir
The path to the compiler resource directory.
llvm::vfs::FileSystem & getVFS() const
bool willEmitRemarks(const llvm::opt::ArgList &Args)
const char * CudaArchToVirtualArchString(CudaArch A)
CudaVersion MaxVersionForCudaArch(CudaArch A)
Get the latest CudaVersion that supports the given CudaArch.
CudaArch StringToCudaArch(llvm::StringRef S)
CudaVersion MinVersionForCudaArch(CudaArch A)
Get the earliest CudaVersion that supports the given CudaArch.
@ C
Languages that the frontend can parse and compile.
static bool IsNVIDIAGpuArch(CudaArch A)
const char * CudaVersionToString(CudaVersion V)
const char * CudaArchToString(CudaArch A)
YAML serialization mapping.