9 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CUDA_H 10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CUDA_H 17 #include "llvm/ADT/Optional.h" 18 #include "llvm/ADT/SmallSet.h" 19 #include "llvm/Support/Compiler.h" 20 #include "llvm/Support/VersionTuple.h" 33 std::string InstallPath;
36 std::string LibDevicePath;
37 std::string IncludePath;
38 llvm::StringMap<std::string> LibDeviceMap;
42 mutable llvm::SmallSet<CudaArch, 4> ArchsWithBadVersion;
46 const llvm::opt::ArgList &Args);
49 llvm::opt::ArgStringList &CC1Args)
const;
60 void print(raw_ostream &OS)
const;
76 return LibDeviceMap.lookup(Gpu);
87 :
Tool(
"NVPTX::Assembler",
"ptxas", TC, RF_Full,
llvm::sys::WEM_UTF8,
94 const llvm::opt::ArgList &TCArgs,
95 const char *LinkingOutput)
const override;
103 :
Tool(
"NVPTX::Linker",
"fatbinary", TC, RF_Full,
llvm::sys::WEM_UTF8,
110 const llvm::opt::ArgList &TCArgs,
111 const char *LinkingOutput)
const override;
117 :
Tool(
"NVPTX::OpenMPLinker",
"nvlink", TC, RF_Full,
llvm::sys::WEM_UTF8,
124 const llvm::opt::ArgList &TCArgs,
125 const char *LinkingOutput)
const override;
131 namespace toolchains {
136 const ToolChain &HostTC,
const llvm::opt::ArgList &Args,
143 std::string getInputFilename(
const InputInfo &Input)
const override;
145 llvm::opt::DerivedArgList *
146 TranslateArgs(
const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
148 void addClangTargetOptions(
const llvm::opt::ArgList &DriverArgs,
149 llvm::opt::ArgStringList &CC1Args,
160 bool supportsDebugInfoOption(
const llvm::opt::Arg *A)
const override;
162 const llvm::opt::ArgList &Args)
const override;
166 llvm::opt::ArgStringList &CC1Args)
const override;
168 void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args)
const override;
169 CXXStdlibType GetCXXStdlibType(
const llvm::opt::ArgList &Args)
const override;
171 AddClangSystemIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
172 llvm::opt::ArgStringList &CC1Args)
const override;
173 void AddClangCXXStdlibIncludeArgs(
174 const llvm::opt::ArgList &Args,
175 llvm::opt::ArgStringList &CC1Args)
const override;
176 void AddIAMCUIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
177 llvm::opt::ArgStringList &CC1Args)
const override;
182 computeMSVCVersion(
const Driver *D,
183 const llvm::opt::ArgList &Args)
const override;
191 Tool *buildAssembler()
const override;
192 Tool *buildLinker()
const override;
202 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CUDA_H StringRef getLibPath() const
Get the detected Cuda library path.
Specialize PointerLikeTypeTraits to allow LazyGenerationalUpdatePtr to be placed into a PointerUnion...
CudaInstallationDetector(const Driver &D, const llvm::Triple &HostTriple, const llvm::opt::ArgList &Args)
void print(raw_ostream &OS) const
Print information about the detected CUDA installation.
A class to find a viable CUDA installation.
StringRef getInstallPath() const
Get the detected Cuda installation path.
void CheckCudaVersionSupportsArch(CudaArch Arch) const
Emit an error if Version does not support the given Arch.
std::string getLibDeviceFile(StringRef Gpu) const
Get libdevice file for given architecture.
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
StringRef getLibDevicePath() const
Get the detected Cuda device library path.
void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
CudaVersion version() const
Get the detected Cuda install's version.
bool isValid() const
Check whether we detected a valid Cuda install.
StringRef getIncludePath() const
Get the detected Cuda Include path.
Dataflow Directional Tag Classes.
Compilation - A set of tasks to perform for a single driver invocation.
StringRef getBinPath() const
Get the detected path to Cuda's bin directory.