clang  17.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, DeviceLibABIVersion ABIVer, bool isOpenMP) const
 Get file paths of default bitcode libraries common to AMDGPU based toolchains. More...
 
bool checkCommonBitcodeLibs (StringRef GPUArch, StringRef LibDeviceFile, DeviceLibABIVersion ABIVer) const
 Check 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
 
StringRef getABIVersionPath (DeviceLibABIVersion ABIVer) const
 
StringRef 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 ()
 
ArrayRef< 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...
 
StringRef getHIPVersion () const
 

Detailed Description

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

Definition at line 47 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

◆ checkCommonBitcodeLibs()

bool RocmInstallationDetector::checkCommonBitcodeLibs ( StringRef  GPUArch,
StringRef  LibDeviceFile,
DeviceLibABIVersion  ABIVer 
) const

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

Returns
false if there are invalid or missing files.

Definition at line 831 of file AMDGPU.cpp.

References clang::driver::DeviceLibABIVersion::requiresLibrary(), and clang::driver::DeviceLibABIVersion::toString().

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

◆ detectDeviceLibrary()

void RocmInstallationDetector::detectDeviceLibrary ( )

◆ detectHIPRuntime()

void RocmInstallationDetector::detectHIPRuntime ( )

Definition at line 436 of file AMDGPU.cpp.

Referenced by RocmInstallationDetector().

◆ getABIVersionPath()

StringRef clang::driver::RocmInstallationDetector::getABIVersionPath ( DeviceLibABIVersion  ABIVer) const
inline

Definition at line 247 of file ROCm.h.

References clang::driver::DeviceLibABIVersion::ABIVersion.

◆ getAsanRTLPath()

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

Returns empty string of Asan runtime library is not available.

Definition at line 225 of file ROCm.h.

Referenced by clang::driver::toolchains::HIPAMDToolChain::getDeviceLibs().

◆ 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,
DeviceLibABIVersion  ABIVer,
bool  isOpenMP = false 
) const

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

Definition at line 850 of file AMDGPU.cpp.

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

◆ getCorrectlyRoundedSqrtPath()

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

Definition at line 243 of file ROCm.h.

◆ getDenormalsAreZeroPath()

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

Definition at line 239 of file ROCm.h.

◆ getFiniteOnlyPath()

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

Definition at line 231 of file ROCm.h.

◆ getHIPPath()

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

Definition at line 219 of file ROCm.h.

References clang::HIP.

Referenced by clang::driver::toolchains::HIPAMDToolChain::getDeviceLibs().

◆ getHIPVersion()

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

Definition at line 279 of file ROCm.h.

◆ getHIPVersionArg()

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

Get the value for –hip-version argument.

Definition at line 277 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 196 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 190 of file ROCm.h.

◆ getLibDeviceFile()

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

Get libdevice file for given architecture.

Definition at line 255 of file ROCm.h.

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

◆ getLibDevicePath()

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

Get the detected Rocm device library path.

Definition at line 202 of file ROCm.h.

◆ getLibPath()

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

Get the detected Rocm library path.

Definition at line 199 of file ROCm.h.

Referenced by clang::driver::toolchains::Linux::AddHIPRuntimeLibArgs(), and clang::driver::toolchains::MSVCToolChain::AddHIPRuntimeLibArgs().

◆ getOCKLPath()

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

Definition at line 209 of file ROCm.h.

◆ getOCMLPath()

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

Definition at line 204 of file ROCm.h.

◆ getOpenCLPath()

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

Definition at line 214 of file ROCm.h.

References clang::OpenCL.

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

◆ getRocmDeviceLibPathArg()

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

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

Definition at line 269 of file ROCm.h.

Referenced by clang::driver::toolchains::HIPAMDToolChain::getDeviceLibs().

◆ getRocmPathArg()

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

Get the value for –rocm-path argument.

Definition at line 274 of file ROCm.h.

◆ getUnsafeMathPath()

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

Definition at line 235 of file ROCm.h.

◆ getWavefrontSize64Path()

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

Definition at line 227 of file ROCm.h.

◆ hasDeviceLibrary()

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

Check whether we detected a valid ROCm device library.

Definition at line 181 of file ROCm.h.

Referenced by clang::driver::toolchains::AMDGPUOpenMPToolChain::getDeviceLibs(), and clang::driver::toolchains::HIPAMDToolChain::getDeviceLibs().

◆ hasHIPRuntime()

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

Check whether we detected a valid HIP runtime.

Definition at line 178 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: