CMS 3D CMS Logo

Functions
cms::rocm Namespace Reference

Functions

void abortOnError (const char *file, int line, const char *cmd, const char *error, const char *message, std::string_view description=std::string_view())
 
void abortOnRsmiError (const char *file, int line, const char *cmd, const char *error, const char *message, std::string_view description=std::string_view())
 
bool hipCheck_ (const char *file, int line, const char *cmd, hipError_t result, std::string_view description=std::string_view())
 
bool rsmiCheck_ (const char *file, int line, const char *cmd, rsmi_status_t result, std::string_view description=std::string_view())
 

Function Documentation

◆ abortOnError()

void cms::rocm::abortOnError ( const char *  file,
int  line,
const char *  cmd,
const char *  error,
const char *  message,
std::string_view  description = std::string_view() 
)
inline

Definition at line 20 of file hipCheck.h.

References mps_setup::cmd, makeListRunsInFiles::description, relativeConstraints::error, geometryDiff::file, mps_splice::line, and MillePedeFileConverter_cfg::out.

Referenced by hipCheck_().

25  {
26  std::ostringstream out;
27  out << "\n";
28  out << file << ", line " << line << ":\n";
29  out << "hipCheck(" << cmd << ");\n";
30  out << error << ": " << message << "\n";
31  if (!description.empty())
32  out << description << "\n";
33  throw std::runtime_error(out.str());
34  }
list cmd
Definition: mps_setup.py:244

◆ abortOnRsmiError()

void cms::rocm::abortOnRsmiError ( const char *  file,
int  line,
const char *  cmd,
const char *  error,
const char *  message,
std::string_view  description = std::string_view() 
)
inline

Definition at line 20 of file rsmiCheck.h.

References mps_setup::cmd, makeListRunsInFiles::description, relativeConstraints::error, geometryDiff::file, mps_splice::line, and MillePedeFileConverter_cfg::out.

Referenced by rsmiCheck_().

25  {
26  std::ostringstream out;
27  out << "\n";
28  out << file << ", line " << line << ":\n";
29  out << "rsmiCheck(" << cmd << ");\n";
30  out << error << ": " << message << "\n";
31  if (!description.empty())
32  out << description << "\n";
33  throw std::runtime_error(out.str());
34  }
list cmd
Definition: mps_setup.py:244

◆ hipCheck_()

bool cms::rocm::hipCheck_ ( const char *  file,
int  line,
const char *  cmd,
hipError_t  result,
std::string_view  description = std::string_view() 
)
inline

Definition at line 36 of file hipCheck.h.

References abortOnError(), mps_setup::cmd, makeListRunsInFiles::description, relativeConstraints::error, geometryDiff::file, LIKELY, mps_splice::line, and mps_fire::result.

40  {
41  if (LIKELY(result == hipSuccess))
42  return true;
43 
44  const char* error = hipGetErrorName(result);
45  const char* message = hipGetErrorString(result);
46  abortOnError(file, line, cmd, error, message, description);
47  return false;
48  }
void abortOnError(const char *file, int line, const char *cmd, const char *error, const char *message, std::string_view description=std::string_view())
Definition: hipCheck.h:20
#define LIKELY(x)
Definition: Likely.h:20
list cmd
Definition: mps_setup.py:244

◆ rsmiCheck_()

bool cms::rocm::rsmiCheck_ ( const char *  file,
int  line,
const char *  cmd,
rsmi_status_t  result,
std::string_view  description = std::string_view() 
)
inline

Definition at line 36 of file rsmiCheck.h.

References abortOnRsmiError(), mps_setup::cmd, makeListRunsInFiles::description, relativeConstraints::error, geometryDiff::file, LIKELY, mps_splice::line, mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, and to_string().

40  {
41  if (LIKELY(result == RSMI_STATUS_SUCCESS))
42  return true;
43 
44  std::string error = "ROCm SMI Error " + std::to_string(result);
45  const char* message;
46  rsmi_status_string(result, &message);
47  abortOnRsmiError(file, line, cmd, error.c_str(), message, description);
48  return false;
49  }
#define LIKELY(x)
Definition: Likely.h:20
static std::string to_string(const XMLCh *ch)
void abortOnRsmiError(const char *file, int line, const char *cmd, const char *error, const char *message, std::string_view description=std::string_view())
Definition: rsmiCheck.h:20
list cmd
Definition: mps_setup.py:244