10 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CUDA_H
11 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CUDA_H
19 #include "llvm/ADT/Optional.h"
20 #include "llvm/ADT/SmallSet.h"
21 #include "llvm/Support/Compiler.h"
34 std::string InstallPath;
37 std::string LibDevicePath;
38 std::string IncludePath;
39 llvm::StringMap<std::string> LibDeviceMap;
43 mutable llvm::SmallSet<CudaArch, 4> ArchsWithVersionTooLowErrors;
47 const llvm::opt::ArgList &Args);
50 llvm::opt::ArgStringList &CC1Args)
const;
61 void print(raw_ostream &OS)
const;
77 return LibDeviceMap.lookup(Gpu);
88 :
Tool(
"NVPTX::Assembler",
"ptxas", TC, RF_Full, llvm::sys::WEM_UTF8,
95 const llvm::opt::ArgList &TCArgs,
96 const char *LinkingOutput)
const override;
104 :
Tool(
"NVPTX::Linker",
"fatbinary", TC, RF_Full, llvm::sys::WEM_UTF8,
111 const llvm::opt::ArgList &TCArgs,
112 const char *LinkingOutput)
const override;
118 namespace toolchains {
123 const ToolChain &HostTC,
const llvm::opt::ArgList &Args);
129 llvm::opt::DerivedArgList *
130 TranslateArgs(
const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
132 void addClangTargetOptions(
const llvm::opt::ArgList &DriverArgs,
133 llvm::opt::ArgStringList &CC1Args,
146 void AddCudaIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
147 llvm::opt::ArgStringList &CC1Args)
const override;
149 void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args)
const override;
150 CXXStdlibType GetCXXStdlibType(
const llvm::opt::ArgList &Args)
const override;
152 AddClangSystemIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
153 llvm::opt::ArgStringList &CC1Args)
const override;
154 void AddClangCXXStdlibIncludeArgs(
155 const llvm::opt::ArgList &Args,
156 llvm::opt::ArgStringList &CC1Args)
const override;
157 void AddIAMCUIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
158 llvm::opt::ArgStringList &CC1Args)
const override;
163 computeMSVCVersion(
const Driver *D,
164 const llvm::opt::ArgList &Args)
const override;
170 Tool *buildAssembler()
const override;
171 Tool *buildLinker()
const override;
178 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CUDA_H
Represents a version number in the form major[.minor[.subminor[.build]]].
StringRef getLibPath() const
Get the detected Cuda library path.
StringRef getInstallPath() const
Get the detected Cuda installation path.
CudaInstallationDetector(const Driver &D, const llvm::Triple &HostTriple, const llvm::opt::ArgList &Args)
A class to find a viable CUDA installation.
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
StringRef getIncludePath() const
Get the detected Cuda Include path.
void print(raw_ostream &OS) const
Print information about the detected CUDA installation.
StringRef getBinPath() const
Get the detected path to Cuda's bin directory.
CudaVersion version() const
Get the detected Cuda install's version.
Compilation - A set of tasks to perform for a single driver invocation.
StringRef getLibDevicePath() const
Get the detected Cuda device library path.
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.
Defines the clang::VersionTuple class, which represents a version in the form major[.minor[.subminor]].
bool isValid() const
Check whether we detected a valid Cuda install.
void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const