9 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CUDA_H
10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CUDA_H
18 #include "llvm/Support/Compiler.h"
19 #include "llvm/Support/VersionTuple.h"
33 std::string InstallPath;
35 std::string LibDevicePath;
36 std::string IncludePath;
37 llvm::StringMap<std::string> LibDeviceMap;
45 const llvm::opt::ArgList &Args);
48 llvm::opt::ArgStringList &CC1Args)
const;
59 void print(raw_ostream &OS)
const;
76 return LibDeviceMap.lookup(Gpu);
93 const llvm::opt::ArgList &TCArgs,
94 const char *LinkingOutput)
const override;
107 const llvm::opt::ArgList &TCArgs,
108 const char *LinkingOutput)
const override;
120 const llvm::opt::ArgList &TCArgs,
121 const char *LinkingOutput)
const override;
127 :
Tool(
"NVPTX::OpenMPLinker",
"nvlink", TC) {}
133 const llvm::opt::ArgList &TCArgs,
134 const char *LinkingOutput)
const override;
142 if (!SYCLToolChainLinker)
143 SYCLToolChainLinker.reset(
new SYCL::Linker(getToolChain()));
144 return SYCLToolChainLinker.get();
147 mutable std::unique_ptr<Tool> SYCLToolChainLinker;
151 const llvm::opt::ArgList &Args,
152 std::vector<StringRef> &Features);
157 namespace toolchains {
162 const llvm::Triple &HostTriple,
const llvm::opt::ArgList &Args,
166 const llvm::opt::ArgList &Args);
168 llvm::opt::DerivedArgList *
169 TranslateArgs(
const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
173 addClangTargetOptions(
const llvm::opt::ArgList &DriverArgs,
174 llvm::opt::ArgStringList &CC1Args,
191 bool supportsDebugInfoOption(
const llvm::opt::Arg *A)
const override;
192 void adjustDebugInfoKind(llvm::codegenoptions::DebugInfoKind &DebugInfoKind,
193 const llvm::opt::ArgList &Args)
const override;
202 getSystemGPUArchs(
const llvm::opt::ArgList &Args)
const override;
207 Tool *buildAssembler()
const override;
208 Tool *buildLinker()
const override;
211 bool Freestanding =
false;
217 const ToolChain &HostTC,
const llvm::opt::ArgList &Args,
226 std::string getInputFilename(
const InputInfo &Input)
const override;
228 llvm::opt::DerivedArgList *
229 TranslateArgs(
const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
232 addClangTargetOptions(
const llvm::opt::ArgList &DriverArgs,
233 llvm::opt::ArgStringList &CC1Args,
236 llvm::DenormalMode getDefaultDenormalModeForType(
237 const llvm::opt::ArgList &DriverArgs,
const JobAction &JA,
238 const llvm::fltSemantics *FPType =
nullptr)
const override;
240 void AddCudaIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
241 llvm::opt::ArgStringList &CC1Args)
const override;
243 void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args)
const override;
244 CXXStdlibType GetCXXStdlibType(
const llvm::opt::ArgList &Args)
const override;
246 AddClangSystemIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
247 llvm::opt::ArgStringList &CC1Args)
const override;
248 void AddClangCXXStdlibIncludeArgs(
249 const llvm::opt::ArgList &Args,
250 llvm::opt::ArgStringList &CC1Args)
const override;
251 void AddIAMCUIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
252 llvm::opt::ArgStringList &CC1Args)
const override;
257 computeMSVCVersion(
const Driver *
D,
258 const llvm::opt::ArgList &Args)
const override;
264 Tool *buildAssembler()
const override;
265 Tool *buildLinker()
const override;
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()
StringRef getLibDevicePath() const
Get the detected Cuda device library path.
CudaVersion version() const
Get the detected Cuda install's version.
StringRef getInstallPath() const
Get the detected Cuda installation path.
std::string getLibDeviceFile(StringRef Gpu) const
Get libdevice file for given architecture.
StringRef getBinPath() const
Get the detected path to Cuda's bin directory.
void CheckCudaVersionSupportsArch(OffloadArch 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.
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
The JSON file list parser is used to communicate input to InstallAPI.