9#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CUDA_H
10#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CUDA_H
17#include "llvm/Support/Compiler.h"
18#include "llvm/Support/VersionTuple.h"
32 std::string InstallPath;
34 std::string LibDevicePath;
35 std::string IncludePath;
36 llvm::StringMap<std::string> LibDeviceMap;
44 const llvm::opt::ArgList &Args);
47 llvm::opt::ArgStringList &CC1Args)
const;
58 void print(raw_ostream &OS)
const;
75 return LibDeviceMap.lookup(Gpu);
92 const llvm::opt::ArgList &TCArgs,
93 const char *LinkingOutput)
const override;
106 const llvm::opt::ArgList &TCArgs,
107 const char *LinkingOutput)
const override;
119 const llvm::opt::ArgList &TCArgs,
120 const char *LinkingOutput)
const override;
124 const llvm::opt::ArgList &Args,
125 std::vector<StringRef> &Features);
130namespace toolchains {
135 const llvm::Triple &HostTriple,
const llvm::opt::ArgList &Args,
139 const llvm::opt::ArgList &Args);
141 llvm::opt::DerivedArgList *
142 TranslateArgs(
const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
146 addClangTargetOptions(
const llvm::opt::ArgList &DriverArgs,
147 llvm::opt::ArgStringList &CC1Args,
164 bool supportsDebugInfoOption(
const llvm::opt::Arg *A)
const override;
165 void adjustDebugInfoKind(llvm::codegenoptions::DebugInfoKind &DebugInfoKind,
166 const llvm::opt::ArgList &Args)
const override;
175 getSystemGPUArchs(
const llvm::opt::ArgList &Args)
const override;
180 Tool *buildAssembler()
const override;
181 Tool *buildLinker()
const override;
184 bool Freestanding =
false;
190 const ToolChain &HostTC,
const llvm::opt::ArgList &Args);
198 std::string getInputFilename(
const InputInfo &Input)
const override;
200 llvm::opt::DerivedArgList *
201 TranslateArgs(
const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
204 addClangTargetOptions(
const llvm::opt::ArgList &DriverArgs,
205 llvm::opt::ArgStringList &CC1Args,
208 llvm::DenormalMode getDefaultDenormalModeForType(
209 const llvm::opt::ArgList &DriverArgs,
const JobAction &JA,
210 const llvm::fltSemantics *FPType =
nullptr)
const override;
212 void AddCudaIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
213 llvm::opt::ArgStringList &CC1Args)
const override;
215 void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args)
const override;
216 CXXStdlibType GetCXXStdlibType(
const llvm::opt::ArgList &Args)
const override;
218 AddClangSystemIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
219 llvm::opt::ArgStringList &CC1Args)
const override;
220 void AddClangCXXStdlibIncludeArgs(
221 const llvm::opt::ArgList &Args,
222 llvm::opt::ArgStringList &CC1Args)
const override;
223 void AddIAMCUIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
224 llvm::opt::ArgStringList &CC1Args)
const override;
229 computeMSVCVersion(
const Driver *
D,
230 const llvm::opt::ArgList &Args)
const override;
235 Tool *buildAssembler()
const override;
236 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
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.