1 #ifndef HeterogeneousCore_CUDAUtilities_nvmlCheck_h 2 #define HeterogeneousCore_CUDAUtilities_nvmlCheck_h 25 std::string_view
description = std::string_view()) {
26 std::ostringstream
out;
29 out <<
"nvmlCheck(" <<
cmd <<
");\n";
30 out <<
error <<
": " << message <<
"\n";
33 throw std::runtime_error(
out.str());
40 std::string_view
description = std::string_view()) {
45 const char* message = nvmlErrorString(
result);
52 #define nvmlCheck(ARG, ...) (cms::cuda::nvmlCheck_(__FILE__, __LINE__, #ARG, (ARG), ##__VA_ARGS__)) 54 #endif // HeterogeneousCore_CUDAUtilities_nvmlCheck_h
void abortOnNvmlError(const char *file, int line, const char *cmd, const char *error, const char *message, std::string_view description=std::string_view())
std::string to_string(const V &value)
bool nvmlCheck_(const char *file, int line, const char *cmd, nvmlReturn_t result, std::string_view description=std::string_view())
Namespace of DDCMS conversion namespace.