clang 23.0.0git
clang::driver::RocmInstallationDetector Class Reference

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

#include "clang/Driver/RocmInstallationDetector.h"

Public Member Functions

 RocmInstallationDetector (const Driver &D, const llvm::Triple &HostTriple, const llvm::opt::ArgList &Args, bool DetectHIPRuntime=true)
llvm::SmallVector< ToolChain::BitCodeLibraryInfo, 12 > getCommonBitcodeLibs (const llvm::opt::ArgList &DriverArgs, StringRef LibDeviceFile, StringRef GPUArch, const Action::OffloadKind DeviceOffloadingKind, const bool NeedsASanRT) 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 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 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 41 of file RocmInstallationDetector.h.

Constructor & Destructor Documentation

◆ RocmInstallationDetector()

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

Definition at line 314 of file AMDGPU.cpp.

References detectHIPRuntime(), and clang::if().

Member Function Documentation

◆ AddHIPIncludeArgs()

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

Definition at line 510 of file AMDGPU.cpp.

References getIncludePath(), hasHIPRuntime(), and hasHIPStdParLibrary().

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

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

◆ detectDeviceLibrary()

void RocmInstallationDetector::detectDeviceLibrary ( )

Definition at line 372 of file AMDGPU.cpp.

◆ detectHIPRuntime()

void RocmInstallationDetector::detectHIPRuntime ( )

Definition at line 435 of file AMDGPU.cpp.

References Append(), b, and c.

Referenced by RocmInstallationDetector().

◆ getABIVersionPath()

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

◆ getAsanRTLPath()

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

Returns empty string of Asan runtime library is not available.

Definition at line 237 of file RocmInstallationDetector.h.

Referenced by getCommonBitcodeLibs().

◆ getCommonBitcodeLibs()

llvm::SmallVector< ToolChain::BitCodeLibraryInfo, 12 > RocmInstallationDetector::getCommonBitcodeLibs ( const llvm::opt::ArgList & DriverArgs,
StringRef LibDeviceFile,
StringRef GPUArch,
const Action::OffloadKind DeviceOffloadingKind,
const bool NeedsASanRT ) const

◆ getFiniteOnlyPath()

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

Definition at line 243 of file RocmInstallationDetector.h.

Referenced by getCommonBitcodeLibs().

◆ getHIPVersion()

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

Definition at line 283 of file RocmInstallationDetector.h.

◆ getHIPVersionArg()

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

Get the value for –hip-version argument.

Definition at line 281 of file RocmInstallationDetector.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 213 of file RocmInstallationDetector.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 207 of file RocmInstallationDetector.h.

◆ getLibDeviceFile()

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

Get libdevice file for given architecture.

Definition at line 259 of file RocmInstallationDetector.h.

◆ getLibDevicePath()

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

Get the detected Rocm device library path.

Definition at line 219 of file RocmInstallationDetector.h.

◆ getLibPath()

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

Get the detected Rocm library path.

Definition at line 216 of file RocmInstallationDetector.h.

◆ getOCKLPath()

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

Definition at line 226 of file RocmInstallationDetector.h.

Referenced by getCommonBitcodeLibs().

◆ getOCMLPath()

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

Definition at line 221 of file RocmInstallationDetector.h.

Referenced by getCommonBitcodeLibs().

◆ getOpenCLPath()

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

Definition at line 231 of file RocmInstallationDetector.h.

◆ getRocmDeviceLibPathArg()

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

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

Definition at line 273 of file RocmInstallationDetector.h.

◆ getRocmPathArg()

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

Get the value for –rocm-path argument.

Definition at line 278 of file RocmInstallationDetector.h.

◆ getUnsafeMathPath()

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

Definition at line 247 of file RocmInstallationDetector.h.

Referenced by getCommonBitcodeLibs().

◆ getWavefrontSize64Path()

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

Definition at line 239 of file RocmInstallationDetector.h.

Referenced by getCommonBitcodeLibs().

◆ hasDeviceLibrary()

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

Check whether we detected a valid ROCm device library.

Definition at line 195 of file RocmInstallationDetector.h.

Referenced by checkCommonBitcodeLibs().

◆ hasHIPRuntime()

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

Check whether we detected a valid HIP runtime.

Definition at line 192 of file RocmInstallationDetector.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 198 of file RocmInstallationDetector.h.

Referenced by AddHIPIncludeArgs().

◆ print()

void RocmInstallationDetector::print ( raw_ostream & OS) const

Print information about the detected ROCm installation.

Definition at line 504 of file AMDGPU.cpp.

References hasHIPRuntime().


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