clang 22.0.0git
|
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, bool DetectDeviceLib=false) | |
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 | 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 |
A class to find a viable ROCM installation TODO: Generalize to handle libclc.
Definition at line 41 of file RocmInstallationDetector.h.
RocmInstallationDetector::RocmInstallationDetector | ( | const Driver & | D, |
const llvm::Triple & | HostTriple, | ||
const llvm::opt::ArgList & | Args, | ||
bool | DetectHIPRuntime = true, | ||
bool | DetectDeviceLib = false ) |
Definition at line 320 of file AMDGPU.cpp.
References detectDeviceLibrary(), detectHIPRuntime(), and clang::if().
void RocmInstallationDetector::AddHIPIncludeArgs | ( | const llvm::opt::ArgList & | DriverArgs, |
llvm::opt::ArgStringList & | CC1Args ) const |
Definition at line 521 of file AMDGPU.cpp.
References getIncludePath(), hasHIPRuntime(), and hasHIPStdParLibrary().
bool RocmInstallationDetector::checkCommonBitcodeLibs | ( | StringRef | GPUArch, |
StringRef | LibDeviceFile, | ||
DeviceLibABIVersion | ABIVer ) const |
Check file paths of default bitcode libraries common to AMDGPU based toolchains.
Definition at line 970 of file AMDGPU.cpp.
References getABIVersionPath(), clang::driver::DeviceLibABIVersion::getAsCodeObjectVersion(), hasDeviceLibrary(), clang::driver::DeviceLibABIVersion::requiresLibrary(), and clang::driver::DeviceLibABIVersion::toString().
void RocmInstallationDetector::detectDeviceLibrary | ( | ) |
Definition at line 383 of file AMDGPU.cpp.
Referenced by RocmInstallationDetector().
void RocmInstallationDetector::detectHIPRuntime | ( | ) |
Definition at line 446 of file AMDGPU.cpp.
References Append(), b, and c.
Referenced by RocmInstallationDetector().
|
inline |
Definition at line 265 of file RocmInstallationDetector.h.
References clang::driver::DeviceLibABIVersion::ABIVersion.
Referenced by checkCommonBitcodeLibs(), and getCommonBitcodeLibs().
|
inline |
Returns empty string of Asan runtime library is not available.
Definition at line 243 of file RocmInstallationDetector.h.
Referenced by 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 |
Get file paths of default bitcode libraries common to AMDGPU based toolchains.
Definition at line 995 of file AMDGPU.cpp.
References getABIVersionPath(), getAsanRTLPath(), getCorrectlyRoundedSqrtPath(), getDenormalsAreZeroPath(), getFiniteOnlyPath(), getOCKLPath(), getOCMLPath(), getUnsafeMathPath(), getWavefrontSize64Path(), and clang::driver::ToolChain::BitCodeLibraryInfo::ShouldInternalize.
|
inline |
Definition at line 261 of file RocmInstallationDetector.h.
Referenced by getCommonBitcodeLibs().
|
inline |
Definition at line 257 of file RocmInstallationDetector.h.
Referenced by getCommonBitcodeLibs().
|
inline |
Definition at line 249 of file RocmInstallationDetector.h.
Referenced by getCommonBitcodeLibs().
|
inline |
Definition at line 297 of file RocmInstallationDetector.h.
|
inline |
Get the value for –hip-version argument.
Definition at line 295 of file RocmInstallationDetector.h.
|
inline |
Get the detected path to Rocm's bin directory.
Get the detected Rocm Include path.
Definition at line 219 of file RocmInstallationDetector.h.
Referenced by AddHIPIncludeArgs().
|
inline |
Get the detected Rocm install's version.
Get the detected Rocm installation path.
Definition at line 213 of file RocmInstallationDetector.h.
|
inline |
Get libdevice file for given architecture.
Definition at line 273 of file RocmInstallationDetector.h.
|
inline |
Get the detected Rocm device library path.
Definition at line 225 of file RocmInstallationDetector.h.
|
inline |
Get the detected Rocm library path.
Definition at line 222 of file RocmInstallationDetector.h.
|
inline |
Definition at line 232 of file RocmInstallationDetector.h.
Referenced by getCommonBitcodeLibs().
|
inline |
Definition at line 227 of file RocmInstallationDetector.h.
Referenced by getCommonBitcodeLibs().
|
inline |
Definition at line 237 of file RocmInstallationDetector.h.
|
inline |
Get the values for –rocm-device-lib-path arguments.
Definition at line 287 of file RocmInstallationDetector.h.
|
inline |
Get the value for –rocm-path argument.
Definition at line 292 of file RocmInstallationDetector.h.
|
inline |
Definition at line 253 of file RocmInstallationDetector.h.
Referenced by getCommonBitcodeLibs().
|
inline |
Definition at line 245 of file RocmInstallationDetector.h.
Referenced by getCommonBitcodeLibs().
|
inline |
Check whether we detected a valid ROCm device library.
Definition at line 201 of file RocmInstallationDetector.h.
Referenced by checkCommonBitcodeLibs().
|
inline |
Check whether we detected a valid HIP runtime.
Definition at line 198 of file RocmInstallationDetector.h.
Referenced by AddHIPIncludeArgs(), and print().
|
inline |
Check whether we detected a valid HIP STDPAR Acceleration library.
Definition at line 204 of file RocmInstallationDetector.h.
Referenced by AddHIPIncludeArgs().
void RocmInstallationDetector::print | ( | raw_ostream & | OS | ) | const |
Print information about the detected ROCm installation.
Definition at line 515 of file AMDGPU.cpp.
References hasHIPRuntime().