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 getSystemGPUArchs(
const llvm::opt::ArgList &Args)
const override;
179 Tool *buildAssembler()
const override;
180 Tool *buildLinker()
const override;
183 bool Freestanding =
false;
189 const ToolChain &HostTC,
const llvm::opt::ArgList &Args);
195 std::string getInputFilename(
const InputInfo &Input)
const override;
197 llvm::opt::DerivedArgList *
198 TranslateArgs(
const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
201 addClangTargetOptions(
const llvm::opt::ArgList &DriverArgs,
202 llvm::opt::ArgStringList &CC1Args,
205 llvm::DenormalMode getDefaultDenormalModeForType(
206 const llvm::opt::ArgList &DriverArgs,
const JobAction &JA,
207 const llvm::fltSemantics *FPType =
nullptr)
const override;
209 void AddCudaIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
210 llvm::opt::ArgStringList &CC1Args)
const override;
212 void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args)
const override;
213 CXXStdlibType GetCXXStdlibType(
const llvm::opt::ArgList &Args)
const override;
215 AddClangSystemIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
216 llvm::opt::ArgStringList &CC1Args)
const override;
217 void AddClangCXXStdlibIncludeArgs(
218 const llvm::opt::ArgList &Args,
219 llvm::opt::ArgStringList &CC1Args)
const override;
220 void AddIAMCUIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
221 llvm::opt::ArgStringList &CC1Args)
const override;
226 computeMSVCVersion(
const Driver *D,
227 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...
The JSON file list parser is used to communicate input to InstallAPI.