3 #include "cuda_runtime_api.h" 9 void error(
const char *error_string,
const char *
file,
const int line,
const char *func);
14 #define cudaSafeCall(expr) kfusion::cuda::___cudaSafeCall(expr, __FILE__, __LINE__, __func__) 16 #define cudaSafeCall(expr) kfusion::cuda::___cudaSafeCall(expr, __FILE__, __LINE__) 23 static inline void ___cudaSafeCall(cudaError_t err,
const char *
file,
const int line,
const char *func =
"")
25 if (cudaSuccess != err)
26 error(cudaGetErrorString(err), file, line, func);
29 static inline int divUp(
int total,
int grain) {
return (total + grain - 1) / grain; }
KF_EXPORTS void error(const char *error_string, const char *file, const int line, const char *func="")
Error handler. All GPU functions from this subsystem call the function to report an error...
static int divUp(int total, int grain)
static void ___cudaSafeCall(cudaError_t err, const char *file, const int line, const char *func="")