clang  12.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 "/opt/doxygen-docs/src/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)
 
void addCommonBitcodeLibCC1Args (const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, StringRef LibDeviceFile, bool Wave64, bool DAZ, bool FiniteOnly, bool UnsafeMathOpt, bool FastRelaxedMath, bool CorrectSqrt) const
 Add arguments needed to link default bitcode libraries. More...
 
void CheckRocmVersionSupportsArch (CudaArch Arch) const
 Emit an error if Version does not support the given Arch. 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 getWavefrontSize64Path (bool Enabled) const
 
StringRef getFiniteOnlyPath (bool Enabled) const
 
StringRef getUnsafeMathPath (bool Enabled) const
 
StringRef getDenormalsAreZeroPath (bool Enabled) const
 
StringRef getCorrectlyRoundedSqrtPath (bool Enabled) const
 
std::string 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 ()
 
std::vector< std::string > getRocmDeviceLibPathArg () 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...
 
std::string getHIPVersion () const
 

Detailed Description

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

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

◆ addCommonBitcodeLibCC1Args()

void RocmInstallationDetector::addCommonBitcodeLibCC1Args ( const llvm::opt::ArgList &  DriverArgs,
llvm::opt::ArgStringList &  CC1Args,
StringRef  LibDeviceFile,
bool  Wave64,
bool  DAZ,
bool  FiniteOnly,
bool  UnsafeMathOpt,
bool  FastRelaxedMath,
bool  CorrectSqrt 
) const

Add arguments needed to link default bitcode libraries.

Definition at line 564 of file AMDGPU.cpp.

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

◆ AddHIPIncludeArgs()

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

◆ CheckRocmVersionSupportsArch()

void clang::driver::RocmInstallationDetector::CheckRocmVersionSupportsArch ( CudaArch  Arch) const

Emit an error if Version does not support the given Arch.

If either Version or Arch is unknown, does not emit an error. Emits at most one error per Arch.

◆ detectDeviceLibrary()

void RocmInstallationDetector::detectDeviceLibrary ( )

◆ detectHIPRuntime()

void RocmInstallationDetector::detectHIPRuntime ( )

Definition at line 270 of file AMDGPU.cpp.

Referenced by getLibDeviceFile(), and RocmInstallationDetector().

◆ getCorrectlyRoundedSqrtPath()

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

Definition at line 196 of file ROCm.h.

◆ getDenormalsAreZeroPath()

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

Definition at line 192 of file ROCm.h.

◆ getFiniteOnlyPath()

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

Definition at line 184 of file ROCm.h.

◆ getHIPPath()

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

◆ getHIPVersion()

std::string clang::driver::RocmInstallationDetector::getHIPVersion ( ) const
inline

Definition at line 222 of file ROCm.h.

◆ getHIPVersionArg()

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

Get the value for –hip-version argument.

Definition at line 220 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 152 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 146 of file ROCm.h.

◆ getLibDeviceFile()

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

◆ getLibDevicePath()

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

Get the detected Rocm device library path.

Definition at line 158 of file ROCm.h.

◆ getLibPath()

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

Get the detected Rocm library path.

Definition at line 155 of file ROCm.h.

◆ getOCKLPath()

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

Definition at line 165 of file ROCm.h.

◆ getOCMLPath()

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

Definition at line 160 of file ROCm.h.

◆ getOpenCLPath()

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

◆ getRocmDeviceLibPathArg()

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

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

Definition at line 212 of file ROCm.h.

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

◆ getRocmPathArg()

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

Get the value for –rocm-path argument.

Definition at line 217 of file ROCm.h.

◆ getUnsafeMathPath()

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

Definition at line 188 of file ROCm.h.

◆ getWavefrontSize64Path()

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

Definition at line 180 of file ROCm.h.

◆ hasDeviceLibrary()

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

Check whether we detected a valid ROCm device library.

Definition at line 137 of file ROCm.h.

References print().

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

◆ hasHIPRuntime()

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

Check whether we detected a valid HIP runtime.

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