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())
 
bool hipCheck_ (const char *file, int line, const char *cmd, hipError_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

◆ 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