File indexing completed on 2025-09-17 08:54:12
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include <sstream>
0010
0011 #include <hip/hip_runtime.h>
0012
0013 #define hipErrorCheck(r) \
0014 { \
0015 _hipErrorCheck((r), __FILE__, __LINE__); \
0016 }
0017
0018 inline void _hipErrorCheck(hipError_t code, const char * file, int line)
0019 {
0020 if (code != hipSuccess) {
0021 std::stringstream ss;
0022
0023 ss << "[" << file << ":" << line
0024 << "] HIP error: " << hipGetErrorString(code);
0025
0026 throw std::runtime_error(ss.str());
0027 }
0028 }