Rate this Page

Define STD_CUDA_CHECK#

Define Documentation#

STD_CUDA_CHECK(EXPR)

do {                                            \

const cudaError_t __err = EXPR;               \

char* __error_msg = nullptr;                  \

torch_c10_cuda_check_msg(                     \

static_cast<int32_t>(__err),              \

__FILE__,                                 \

__func__,                                 \

static_cast<uint32_t>(__LINE__),          \

true,                                     \

&__error_msg);                            \

if (__error_msg != nullptr) {                 \

std::string __msg(__error_msg);             \

torch_c10_cuda_free_error_msg(__error_msg); \

throw std::runtime_error(__msg);            \

}                                             \

} while (0)

#