class RocmInstallationDetector

Declaration

class RocmInstallationDetector { /* full declaration omitted */ };

Description

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

Declared at: clang/lib/Driver/ToolChains/ROCm.h:47

Member Variables

private const clang::driver::Driver& D
private bool HasHIPRuntime = false
private bool HasDeviceLibrary = false
private const unsigned int DefaultVersionMajor = 3
private const unsigned int DefaultVersionMinor = 5
private const char* DefaultVersionPatch = "0"
private std::string DetectedVersion
private llvm::VersionTuple VersionMajorMinor
private std::string VersionPatch
private llvm::StringRef RocmPathArg
private std::vector<std::string> RocmDeviceLibPathArg
private llvm::StringRef HIPPathArg
private llvm::StringRef HIPVersionArg
private bool NoBuiltinLibs = false
private SmallString<0> InstallPath
private SmallString<0> BinPath
private SmallString<0> LibPath
private SmallString<0> LibDevicePath
private SmallString<0> IncludePath
private llvm::StringMap<std::string> LibDeviceMap
private SmallString<0> OCML
private SmallString<0> OCKL
private SmallString<0> OpenCL
private SmallString<0> HIP
private SmallString<0> AsanRTL
private clang::driver::RocmInstallationDetector:: ConditionalLibrary WavefrontSize64
private clang::driver::RocmInstallationDetector:: ConditionalLibrary FiniteOnly
private clang::driver::RocmInstallationDetector:: ConditionalLibrary UnsafeMath
private clang::driver::RocmInstallationDetector:: ConditionalLibrary DenormalsAreZero
private clang::driver::RocmInstallationDetector:: ConditionalLibrary CorrectlyRoundedSqrt
private std::map<unsigned int, std::string> ABIVersionMap
private SmallVector< clang::driver::RocmInstallationDetector:: Candidate, 4> ROCmSearchDirs
private bool PrintROCmSearchDirs
private bool Verbose

Method Overview

Methods

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

Declared at: clang/lib/Driver/ToolChains/ROCm.h:258

Parameters

const llvm::opt::ArgList& DriverArgs
llvm::opt::ArgStringList& CC1Args

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

Declared at: clang/lib/Driver/ToolChains/ROCm.h:158

Parameters

const clang::driver::Driver& D
const llvm::Triple& HostTriple
const llvm::opt::ArgList& Args
bool DetectHIPRuntime = true
bool DetectDeviceLib = false

bool allGenericLibsValid() const

Declared at: clang/lib/Driver/ToolChains/ROCm.h:139

bool checkCommonBitcodeLibs(
    llvm::StringRef GPUArch,
    llvm::StringRef LibDeviceFile,
    clang::driver::DeviceLibABIVersion ABIVer)
    const

Description

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

Declared at: clang/lib/Driver/ToolChains/ROCm.h:173

Parameters

llvm::StringRef GPUArch
llvm::StringRef LibDeviceFile
clang::driver::DeviceLibABIVersion ABIVer

Returns

false if there are invalid or missing files.

void detectDeviceLibrary()

Declared at: clang/lib/Driver/ToolChains/ROCm.h:261

void detectHIPRuntime()

Declared at: clang/lib/Driver/ToolChains/ROCm.h:262

llvm::SmallString<0> findSPACKPackage(
    const clang::driver::
        RocmInstallationDetector::Candidate& Cand,
    llvm::StringRef PackageName)

Description

Find the path to a SPACK package under the ROCm candidate installation directory if the candidate is a SPACK ROCm candidate.

Declared at: clang/lib/Driver/ToolChains/ROCm.h:154

Parameters

const clang::driver::RocmInstallationDetector:: Candidate& Cand
llvm::StringRef PackageName

Returns

empty string if the candidate is not SPACK ROCm candidate or the requested package is not found.

llvm::StringRef getABIVersionPath(
    clang::driver::DeviceLibABIVersion ABIVer)
    const

Declared at: clang/lib/Driver/ToolChains/ROCm.h:246

Parameters

clang::driver::DeviceLibABIVersion ABIVer

llvm::StringRef getAsanRTLPath() const

Description

Returns empty string of Asan runtime library is not available.

Declared at: clang/lib/Driver/ToolChains/ROCm.h:224

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

Description

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

Declared at: clang/lib/Driver/ToolChains/ROCm.h:166

Parameters

const llvm::opt::ArgList& DriverArgs
llvm::StringRef LibDeviceFile
bool Wave64
bool DAZ
bool FiniteOnly
bool UnsafeMathOpt
bool FastRelaxedMath
bool CorrectSqrt
clang::driver::DeviceLibABIVersion ABIVer
bool isOpenMP

llvm::StringRef getCorrectlyRoundedSqrtPath(
    bool Enabled) const

Declared at: clang/lib/Driver/ToolChains/ROCm.h:242

Parameters

bool Enabled

llvm::StringRef getDenormalsAreZeroPath(
    bool Enabled) const

Declared at: clang/lib/Driver/ToolChains/ROCm.h:238

Parameters

bool Enabled

llvm::StringRef getFiniteOnlyPath(
    bool Enabled) const

Declared at: clang/lib/Driver/ToolChains/ROCm.h:230

Parameters

bool Enabled

llvm::StringRef getHIPPath() const

Declared at: clang/lib/Driver/ToolChains/ROCm.h:218

std::string getHIPVersion() const

Declared at: clang/lib/Driver/ToolChains/ROCm.h:275

llvm::StringRef getHIPVersionArg() const

Description

Get the value for --hip-version argument

Declared at: clang/lib/Driver/ToolChains/ROCm.h:273

llvm::StringRef getIncludePath() const

Description

Get the detected Rocm Include path.

Declared at: clang/lib/Driver/ToolChains/ROCm.h:195

llvm::StringRef getInstallPath() const

Description

Get the detected Rocm installation path.

Declared at: clang/lib/Driver/ToolChains/ROCm.h:189

const SmallVectorImpl<
    clang::driver::RocmInstallationDetector::
        Candidate>&
getInstallationPathCandidates()

Declared at: clang/lib/Driver/ToolChains/ROCm.h:148

std::string getLibDeviceFile(
    llvm::StringRef Gpu) const

Description

Get libdevice file for given architecture

Declared at: clang/lib/Driver/ToolChains/ROCm.h:254

Parameters

llvm::StringRef Gpu

llvm::StringRef getLibDevicePath() const

Description

Get the detected Rocm device library path.

Declared at: clang/lib/Driver/ToolChains/ROCm.h:201

llvm::StringRef getLibPath() const

Description

Get the detected Rocm library path.

Declared at: clang/lib/Driver/ToolChains/ROCm.h:198

llvm::StringRef getOCKLPath() const

Declared at: clang/lib/Driver/ToolChains/ROCm.h:208

llvm::StringRef getOCMLPath() const

Declared at: clang/lib/Driver/ToolChains/ROCm.h:203

llvm::StringRef getOpenCLPath() const

Declared at: clang/lib/Driver/ToolChains/ROCm.h:213

std::vector<std::string> getRocmDeviceLibPathArg()
    const

Description

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

Declared at: clang/lib/Driver/ToolChains/ROCm.h:265

llvm::StringRef getRocmPathArg() const

Description

Get the value for --rocm-path argument

Declared at: clang/lib/Driver/ToolChains/ROCm.h:270

llvm::StringRef getUnsafeMathPath(
    bool Enabled) const

Declared at: clang/lib/Driver/ToolChains/ROCm.h:234

Parameters

bool Enabled

llvm::StringRef getWavefrontSize64Path(
    bool Enabled) const

Declared at: clang/lib/Driver/ToolChains/ROCm.h:226

Parameters

bool Enabled

bool hasDeviceLibrary() const

Description

Check whether we detected a valid ROCm device library.

Declared at: clang/lib/Driver/ToolChains/ROCm.h:180

bool hasHIPRuntime() const

Description

Check whether we detected a valid HIP runtime.

Declared at: clang/lib/Driver/ToolChains/ROCm.h:177

bool parseHIPVersionFile(llvm::StringRef V)

Declared at: clang/lib/Driver/ToolChains/ROCm.h:147

Parameters

llvm::StringRef V

void print(llvm::raw_ostream& OS) const

Description

Print information about the detected ROCm installation.

Declared at: clang/lib/Driver/ToolChains/ROCm.h:183

Parameters

llvm::raw_ostream& OS

void scanLibDevicePath(llvm::StringRef Path)

Declared at: clang/lib/Driver/ToolChains/ROCm.h:146

Parameters

llvm::StringRef Path