Gromacs  2025-dev-20240910-a7e2421
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
gmx::anonymous_namespace{hiputils.h} Namespace Reference

Functions

std::string getDeviceErrorString (const hipError_t deviceError)
 Add the API information on the specific error to the error message. More...
 
void checkDeviceError (const hipError_t deviceError, const std::string &errorMessage)
 Check if API returned an error and throw an exception with information on it. More...
 
void ensureNoPendingDeviceError (const std::string &errorMessage)
 Helper function to ensure no pending error silently disrupts error handling. More...
 

Function Documentation

void gmx::anonymous_namespace{hiputils.h}::checkDeviceError ( const hipError_t  deviceError,
const std::string &  errorMessage 
)
inline

Check if API returned an error and throw an exception with information on it.

Parameters
[in]deviceErrorThe error to assert hipSuccess on.
[in]errorMessageUndecorated error message.
Exceptions
InternalErrorif deviceError is not a success.
void gmx::anonymous_namespace{hiputils.h}::ensureNoPendingDeviceError ( const std::string &  errorMessage)
inline

Helper function to ensure no pending error silently disrupts error handling.

Asserts in a debug build if an unhandled error is present. Issues a warning at run time otherwise.

Parameters
[in]errorMessageUndecorated error message.
std::string gmx::anonymous_namespace{hiputils.h}::getDeviceErrorString ( const hipError_t  deviceError)
inline

Add the API information on the specific error to the error message.

Parameters
[in]deviceErrorThe error to assert hipSuccess on.
Returns
A description of the API error. Returns '(HIP error #0 (hipSuccess): no error)' in case deviceError is hipSuccess.