/* * @Author: yangzilong * @Date: 2021-12-14 16:41:18 * @Last Modified by: yangzilong * @Email: yangzilong@objecteye.com * @Description: */ #pragma once #include #include #include "define.hpp" #include "logger.hpp" #define PRINT_CHECK(call) \ {\ const cudaError_t error_code = call;\ if (cudaSuccess != error_code)\ std::fprintf(stderr, "[%s:%d] %s error code: %d error reason: %s\n", __FILENAME__, __LINE__, __FUNCTION__, error_code, cudaGetErrorString(error_code));\ } #define CHECK(call) \ {\ const cudaError_t error_code = call;\ if (cudaSuccess != error_code)\ LOG_ERROR("CUDA error, code: {} reason: {}", error_code, cudaGetErrorString(error_code));\ }