mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-11 17:00:18 +00:00
23 lines
1.1 KiB
C++
23 lines
1.1 KiB
C++
#ifndef _HIP_OLC_CHECK_HPP_
|
|
#define _HIP_OLC_CHECK_HPP_
|
|
|
|
#include <hip/hip_runtime.h>
|
|
#include <sstream>
|
|
#include <vector>
|
|
|
|
// Here flag can be a constant, variable or function call
|
|
#define MY_HIP_CHECK(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)
|
|
|
|
#endif
|