clang 19.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.
 
bool checkCommonBitcodeLibs (StringRef GPUArch, StringRef LibDeviceFile, DeviceLibABIVersion ABIVer) const
 Check file paths of default bitcode libraries common to AMDGPU based toolchains.
 
bool hasHIPRuntime () const
 Check whether we detected a valid HIP runtime.
 
bool hasDeviceLibrary () const
 Check whether we detected a valid ROCm device library.
 
bool hasHIPStdParLibrary () const
 Check whether we detected a valid HIP STDPAR Acceleration library.
 
void print (raw_ostream &OS) const
 Print information about the detected ROCm installation.
 
StringRef getInstallPath () const
 Get the detected Rocm install's version.
 
StringRef getIncludePath () const
 Get the detected path to Rocm's bin directory.
 
StringRef getLibPath () const
 Get the detected Rocm library path.
 
StringRef getLibDevicePath () const
 Get the detected Rocm device library path.
 
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.
 
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.
 
void AddHIPIncludeArgs (const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
 
void detectDeviceLibrary ()
 
void detectHIPRuntime ()
 
ArrayRef< std::string > getRocmDeviceLibPathArg () const
 Get the values for –rocm-device-lib-path arguments.
 
StringRef getRocmPathArg () const
 Get the value for –rocm-path argument.
 
StringRef getHIPVersionArg () const
 Get the value for –hip-version argument.
 
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 952 of file AMDGPU.cpp.

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

◆ detectDeviceLibrary()

void RocmInstallationDetector::detectDeviceLibrary ( )

◆ detectHIPRuntime()

void RocmInstallationDetector::detectHIPRuntime ( )

◆ getABIVersionPath()

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

Definition at line 260 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 238 of file ROCm.h.

◆ 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 971 of file AMDGPU.cpp.

◆ getCorrectlyRoundedSqrtPath()

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

Definition at line 256 of file ROCm.h.

◆ getDenormalsAreZeroPath()

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

Definition at line 252 of file ROCm.h.

◆ getFiniteOnlyPath()

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

Definition at line 244 of file ROCm.h.

◆ getHIPPath()

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

Definition at line 232 of file ROCm.h.

References clang::HIP.

◆ getHIPVersion()

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

Definition at line 292 of file ROCm.h.

◆ getHIPVersionArg()

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

Get the value for –hip-version argument.

Definition at line 290 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 209 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 203 of file ROCm.h.

◆ getLibDeviceFile()

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

Get libdevice file for given architecture.

Definition at line 268 of file ROCm.h.

◆ getLibDevicePath()

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

Get the detected Rocm device library path.

Definition at line 215 of file ROCm.h.

◆ getLibPath()

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

Get the detected Rocm library path.

Definition at line 212 of file ROCm.h.

◆ getOCKLPath()

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

Definition at line 222 of file ROCm.h.

◆ getOCMLPath()

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

Definition at line 217 of file ROCm.h.

◆ getOpenCLPath()

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

Definition at line 227 of file ROCm.h.

References clang::OpenCL.

◆ getRocmDeviceLibPathArg()

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

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

Definition at line 282 of file ROCm.h.

◆ getRocmPathArg()

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

Get the value for –rocm-path argument.

Definition at line 287 of file ROCm.h.

◆ getUnsafeMathPath()

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

Definition at line 248 of file ROCm.h.

◆ getWavefrontSize64Path()

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

Definition at line 240 of file ROCm.h.

◆ hasDeviceLibrary()

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

Check whether we detected a valid ROCm device library.

Definition at line 191 of file ROCm.h.

◆ hasHIPRuntime()

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

Check whether we detected a valid HIP runtime.

Definition at line 188 of file ROCm.h.

Referenced by AddHIPIncludeArgs(), and print().

◆ hasHIPStdParLibrary()

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

Check whether we detected a valid HIP STDPAR Acceleration library.

Definition at line 194 of file ROCm.h.

Referenced by AddHIPIncludeArgs().

◆ print()

void RocmInstallationDetector::print ( raw_ostream &  OS) const

Print information about the detected ROCm installation.

Definition at line 520 of file AMDGPU.cpp.

References hasHIPRuntime().


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