"ml/backend/git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "40b8fdbdcacb41b9cf42869051df765f66750036"
Commit 299ac0a3 authored by Qianfeng Zhang's avatar Qianfeng Zhang
Browse files

Add HIP_CHECK_ERROR for hip error checking since hip_check_error() does not really work

parent d5832ed4
...@@ -15,3 +15,16 @@ inline void hip_check_error(hipError_t x) ...@@ -15,3 +15,16 @@ inline void hip_check_error(hipError_t x)
throw std::runtime_error(ss.str()); throw std::runtime_error(ss.str());
} }
} }
#define HIP_CHECK_ERROR(flag) \
do \
{ \
hipError_t _tmpVal; \
if((_tmpVal = flag) != hipSuccess) \
{ \
std::ostringstream ostr; \
ostr << "HIP Function Failed (" << __FILE__ << "," << __LINE__ << ") " \
<< hipGetErrorString(_tmpVal); \
throw std::runtime_error(ostr.str()); \
} \
} while(0)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment