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,
163 bool supportsDebugInfoOption(
const llvm::opt::Arg *A)
const override;
164 void adjustDebugInfoKind(llvm::codegenoptions::DebugInfoKind &DebugInfoKind,
165 const llvm::opt::ArgList &Args)
const override;
174 Tool *buildAssembler()
const override;
175 Tool *buildLinker()
const override;
178 bool Freestanding =
false;
184 const ToolChain &HostTC,
const llvm::opt::ArgList &Args);
190 std::string getInputFilename(
const InputInfo &Input)
const override;
192 llvm::opt::DerivedArgList *
193 TranslateArgs(
const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
196 addClangTargetOptions(
const llvm::opt::ArgList &DriverArgs,
197 llvm::opt::ArgStringList &CC1Args,
200 llvm::DenormalMode getDefaultDenormalModeForType(
201 const llvm::opt::ArgList &DriverArgs,
const JobAction &JA,
202 const llvm::fltSemantics *FPType =
nullptr)
const override;
204 void AddCudaIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
205 llvm::opt::ArgStringList &CC1Args)
const override;
207 void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args)
const override;
208 CXXStdlibType GetCXXStdlibType(
const llvm::opt::ArgList &Args)
const override;
210 AddClangSystemIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
211 llvm::opt::ArgStringList &CC1Args)
const override;
212 void AddClangCXXStdlibIncludeArgs(
213 const llvm::opt::ArgList &Args,
214 llvm::opt::ArgStringList &CC1Args)
const override;
215 void AddIAMCUIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
216 llvm::opt::ArgStringList &CC1Args)
const override;
221 computeMSVCVersion(
const Driver *D,
222 const llvm::opt::ArgList &Args)
const override;
229 getSystemGPUArchs(
const llvm::opt::ArgList &Args)
const override;
232 Tool *buildAssembler()
const override;
233 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.
void CheckCudaVersionSupportsArch(CudaArch Arch) const
Emit an error if Version does not support the given Arch.
StringRef getBinPath() const
Get the detected path to Cuda's bin directory.
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...