clang 22.0.0git
clang::driver::CudaInstallationDetector Class Reference

A class to find a viable CUDA installation. More...

#include "clang/Driver/CudaInstallationDetector.h"

Public Member Functions

 CudaInstallationDetector (const Driver &D, const llvm::Triple &HostTriple, const llvm::opt::ArgList &Args)
void AddCudaIncludeArgs (const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
void CheckCudaVersionSupportsArch (OffloadArch Arch) const
 Emit an error if Version does not support the given Arch.
bool isValid () const
 Check whether we detected a valid Cuda install.
void print (raw_ostream &OS) const
 Print information about the detected CUDA installation.
CudaVersion version () const
 Get the detected Cuda install's version.
StringRef getInstallPath () const
 Get the detected Cuda installation path.
StringRef getBinPath () const
 Get the detected path to Cuda's bin directory.
StringRef getIncludePath () const
 Get the detected Cuda Include path.
StringRef getLibDevicePath () const
 Get the detected Cuda device library path.
std::string getLibDeviceFile (StringRef Gpu) const
 Get libdevice file for given architecture.
void WarnIfUnsupportedVersion () const

Detailed Description

A class to find a viable CUDA installation.

Definition at line 20 of file CudaInstallationDetector.h.

Constructor & Destructor Documentation

◆ CudaInstallationDetector()

CudaInstallationDetector::CudaInstallationDetector ( const Driver & D,
const llvm::Triple & HostTriple,
const llvm::opt::ArgList & Args )

Member Function Documentation

◆ AddCudaIncludeArgs()

void CudaInstallationDetector::AddCudaIncludeArgs ( const llvm::opt::ArgList & DriverArgs,
llvm::opt::ArgStringList & CC1Args ) const

Definition at line 295 of file Cuda.cpp.

References isValid().

◆ CheckCudaVersionSupportsArch()

void CudaInstallationDetector::CheckCudaVersionSupportsArch ( OffloadArch Arch) const

Emit an error if Version does not support the given Arch.

If either Version or Arch is unknown, does not emit an error. Emits at most one error per Arch.

Definition at line 320 of file Cuda.cpp.

References Arch, clang::CudaVersionToString(), clang::MaxVersionForOffloadArch(), clang::MinVersionForOffloadArch(), clang::OffloadArchToString(), and clang::UNKNOWN.

◆ getBinPath()

StringRef clang::driver::CudaInstallationDetector::getBinPath ( ) const
inline

Get the detected path to Cuda's bin directory.

Definition at line 61 of file CudaInstallationDetector.h.

◆ getIncludePath()

StringRef clang::driver::CudaInstallationDetector::getIncludePath ( ) const
inline

Get the detected Cuda Include path.

Definition at line 63 of file CudaInstallationDetector.h.

◆ getInstallPath()

StringRef clang::driver::CudaInstallationDetector::getInstallPath ( ) const
inline

Get the detected Cuda installation path.

Definition at line 59 of file CudaInstallationDetector.h.

◆ getLibDeviceFile()

std::string clang::driver::CudaInstallationDetector::getLibDeviceFile ( StringRef Gpu) const
inline

Get libdevice file for given architecture.

Definition at line 67 of file CudaInstallationDetector.h.

◆ getLibDevicePath()

StringRef clang::driver::CudaInstallationDetector::getLibDevicePath ( ) const
inline

Get the detected Cuda device library path.

Definition at line 65 of file CudaInstallationDetector.h.

◆ isValid()

bool clang::driver::CudaInstallationDetector::isValid ( ) const
inline

Check whether we detected a valid Cuda install.

Definition at line 49 of file CudaInstallationDetector.h.

Referenced by AddCudaIncludeArgs(), and print().

◆ print()

void CudaInstallationDetector::print ( raw_ostream & OS) const

Print information about the detected CUDA installation.

Definition at line 337 of file Cuda.cpp.

References clang::CudaVersionToString(), and isValid().

◆ version()

CudaVersion clang::driver::CudaInstallationDetector::version ( ) const
inline

Get the detected Cuda install's version.

Definition at line 54 of file CudaInstallationDetector.h.

References clang::NEW, and clang::PARTIALLY_SUPPORTED.

Referenced by clang::driver::tools::NVPTX::getNVPTXTargetFeatures().

◆ WarnIfUnsupportedVersion()

void CudaInstallationDetector::WarnIfUnsupportedVersion ( ) const

The documentation for this class was generated from the following files: