clang  13.0.0git
Classes | Public Member Functions | List of all members
clang::driver::RocmInstallationDetector Class Reference

A class to find a viable ROCM installation TODO: Generalize to handle libclc. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/Driver/ToolChains/ROCm.h"

Public Member Functions

 RocmInstallationDetector (const Driver &D, const llvm::Triple &HostTriple, const llvm::opt::ArgList &Args, bool DetectHIPRuntime=true, bool DetectDeviceLib=false)
 
llvm::SmallVector< std::string, 12 > getCommonBitcodeLibs (const llvm::opt::ArgList &DriverArgs, StringRef LibDeviceFile, bool Wave64, bool DAZ, bool FiniteOnly, bool UnsafeMathOpt, bool FastRelaxedMath, bool CorrectSqrt) const
 Get file paths of default bitcode libraries common to AMDGPU based toolchains. More...
 
bool hasHIPRuntime () const
 Check whether we detected a valid HIP runtime. More...
 
bool hasDeviceLibrary () const
 Check whether we detected a valid ROCm device library. More...
 
void print (raw_ostream &OS) const
 Print information about the detected ROCm installation. More...
 
StringRef getInstallPath () const
 Get the detected Rocm install's version. More...
 
StringRef getIncludePath () const
 Get the detected path to Rocm's bin directory. More...
 
StringRef getLibPath () const
 Get the detected Rocm library path. More...
 
StringRef getLibDevicePath () const
 Get the detected Rocm device library path. More...
 
StringRef getOCMLPath () const
 
StringRef getOCKLPath () const
 
StringRef getOpenCLPath () const
 
StringRef getHIPPath () const
 
StringRef getAsanRTLPath () const
 Returns empty string of Asan runtime library is not available. More...
 
StringRef getWavefrontSize64Path (bool Enabled) const
 
StringRef getFiniteOnlyPath (bool Enabled) const
 
StringRef getUnsafeMathPath (bool Enabled) const
 
StringRef getDenormalsAreZeroPath (bool Enabled) const
 
StringRef getCorrectlyRoundedSqrtPath (bool Enabled) const
 
std::string getLibDeviceFile (StringRef Gpu) const
 Get libdevice file for given architecture. More...
 
void AddHIPIncludeArgs (const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
 
void detectDeviceLibrary ()
 
void detectHIPRuntime ()
 
std::vector< std::stringgetRocmDeviceLibPathArg () const
 Get the values for –rocm-device-lib-path arguments. More...
 
StringRef getRocmPathArg () const
 Get the value for –rocm-path argument. More...
 
StringRef getHIPVersionArg () const
 Get the value for –hip-version argument. More...
 
std::string getHIPVersion () const
 

Detailed Description

A class to find a viable ROCM installation TODO: Generalize to handle libclc.

Definition at line 27 of file ROCm.h.

Constructor & Destructor Documentation

◆ RocmInstallationDetector()

RocmInstallationDetector::RocmInstallationDetector ( const Driver D,
const llvm::Triple &  HostTriple,
const llvm::opt::ArgList &  Args,
bool  DetectHIPRuntime = true,
bool  DetectDeviceLib = false 
)

Member Function Documentation

◆ AddHIPIncludeArgs()

void RocmInstallationDetector::AddHIPIncludeArgs ( const llvm::opt::ArgList &  DriverArgs,
llvm::opt::ArgStringList &  CC1Args 
) const

◆ detectDeviceLibrary()

void RocmInstallationDetector::detectDeviceLibrary ( )

◆ detectHIPRuntime()

void RocmInstallationDetector::detectHIPRuntime ( )

Definition at line 425 of file AMDGPU.cpp.

Referenced by RocmInstallationDetector().

◆ getAsanRTLPath()

StringRef clang::driver::RocmInstallationDetector::getAsanRTLPath ( ) const
inline

Returns empty string of Asan runtime library is not available.

Definition at line 194 of file ROCm.h.

Referenced by clang::driver::toolchains::HIPToolChain::getHIPDeviceLibs().

◆ getCommonBitcodeLibs()

llvm::SmallVector< std::string, 12 > RocmInstallationDetector::getCommonBitcodeLibs ( const llvm::opt::ArgList &  DriverArgs,
StringRef  LibDeviceFile,
bool  Wave64,
bool  DAZ,
bool  FiniteOnly,
bool  UnsafeMathOpt,
bool  FastRelaxedMath,
bool  CorrectSqrt 
) const

Get file paths of default bitcode libraries common to AMDGPU based toolchains.

Definition at line 778 of file AMDGPU.cpp.

Referenced by clang::driver::toolchains::ROCMToolChain::addClangTargetOptions(), and clang::driver::toolchains::HIPToolChain::getHIPDeviceLibs().

◆ getCorrectlyRoundedSqrtPath()

StringRef clang::driver::RocmInstallationDetector::getCorrectlyRoundedSqrtPath ( bool  Enabled) const
inline

Definition at line 212 of file ROCm.h.

◆ getDenormalsAreZeroPath()

StringRef clang::driver::RocmInstallationDetector::getDenormalsAreZeroPath ( bool  Enabled) const
inline

Definition at line 208 of file ROCm.h.

◆ getFiniteOnlyPath()

StringRef clang::driver::RocmInstallationDetector::getFiniteOnlyPath ( bool  Enabled) const
inline

Definition at line 200 of file ROCm.h.

◆ getHIPPath()

StringRef clang::driver::RocmInstallationDetector::getHIPPath ( ) const
inline

Definition at line 188 of file ROCm.h.

References clang::HIP.

Referenced by clang::driver::toolchains::HIPToolChain::getHIPDeviceLibs().

◆ getHIPVersion()

std::string clang::driver::RocmInstallationDetector::getHIPVersion ( ) const
inline

Definition at line 238 of file ROCm.h.

◆ getHIPVersionArg()

StringRef clang::driver::RocmInstallationDetector::getHIPVersionArg ( ) const
inline

Get the value for –hip-version argument.

Definition at line 236 of file ROCm.h.

◆ getIncludePath()

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

Get the detected path to Rocm's bin directory.

Get the detected Rocm Include path.

Definition at line 165 of file ROCm.h.

Referenced by AddHIPIncludeArgs().

◆ getInstallPath()

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

Get the detected Rocm install's version.

Get the detected Rocm installation path.

Definition at line 159 of file ROCm.h.

◆ getLibDeviceFile()

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

Get libdevice file for given architecture.

Definition at line 217 of file ROCm.h.

Referenced by clang::driver::toolchains::ROCMToolChain::addClangTargetOptions(), and clang::driver::toolchains::HIPToolChain::getHIPDeviceLibs().

◆ getLibDevicePath()

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

Get the detected Rocm device library path.

Definition at line 171 of file ROCm.h.

◆ getLibPath()

StringRef clang::driver::RocmInstallationDetector::getLibPath ( ) const
inline

Get the detected Rocm library path.

Definition at line 168 of file ROCm.h.

◆ getOCKLPath()

StringRef clang::driver::RocmInstallationDetector::getOCKLPath ( ) const
inline

Definition at line 178 of file ROCm.h.

◆ getOCMLPath()

StringRef clang::driver::RocmInstallationDetector::getOCMLPath ( ) const
inline

Definition at line 173 of file ROCm.h.

◆ getOpenCLPath()

StringRef clang::driver::RocmInstallationDetector::getOpenCLPath ( ) const
inline

Definition at line 183 of file ROCm.h.

References clang::OpenCL.

Referenced by clang::driver::toolchains::ROCMToolChain::addClangTargetOptions().

◆ getRocmDeviceLibPathArg()

std::vector<std::string> clang::driver::RocmInstallationDetector::getRocmDeviceLibPathArg ( ) const
inline

Get the values for –rocm-device-lib-path arguments.

Definition at line 228 of file ROCm.h.

Referenced by clang::driver::toolchains::HIPToolChain::getHIPDeviceLibs().

◆ getRocmPathArg()

StringRef clang::driver::RocmInstallationDetector::getRocmPathArg ( ) const
inline

Get the value for –rocm-path argument.

Definition at line 233 of file ROCm.h.

◆ getUnsafeMathPath()

StringRef clang::driver::RocmInstallationDetector::getUnsafeMathPath ( bool  Enabled) const
inline

Definition at line 204 of file ROCm.h.

◆ getWavefrontSize64Path()

StringRef clang::driver::RocmInstallationDetector::getWavefrontSize64Path ( bool  Enabled) const
inline

Definition at line 196 of file ROCm.h.

◆ hasDeviceLibrary()

bool clang::driver::RocmInstallationDetector::hasDeviceLibrary ( ) const
inline

Check whether we detected a valid ROCm device library.

Definition at line 150 of file ROCm.h.

Referenced by clang::driver::toolchains::ROCMToolChain::addClangTargetOptions(), and clang::driver::toolchains::HIPToolChain::getHIPDeviceLibs().

◆ hasHIPRuntime()

bool clang::driver::RocmInstallationDetector::hasHIPRuntime ( ) const
inline

Check whether we detected a valid HIP runtime.

Definition at line 147 of file ROCm.h.

Referenced by AddHIPIncludeArgs(), and print().

◆ print()

void RocmInstallationDetector::print ( raw_ostream &  OS) const

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