19 #error "CUDA_HOME must be defined"
23 #error "CUB_HOME must be defined"
30 #include <cuda_runtime.h>
32 #include <glog/logging.h>
34 #define TC_CUDA_DRIVERAPI_ENFORCE(condition) \
36 CUresult result = condition; \
37 if (result != CUDA_SUCCESS) { \
39 cuGetErrorName(result, &msg); \
40 std::stringstream ss; \
41 ss << "Error at: " << __FILE__ << ":" << __LINE__ << ": " << msg; \
42 LOG(WARNING) << ss.str(); \
43 throw std::runtime_error(ss.str().c_str()); \
47 #define TC_NVRTC_CHECK(condition) \
49 nvrtcResult result = condition; \
50 if (result != NVRTC_SUCCESS) { \
51 std::stringstream ss; \
52 ss << "Error at: " << __FILE__ << ":" << __LINE__ << ": " \
53 << nvrtcGetErrorString(result); \
54 LOG(WARNING) << ss.str(); \
55 throw std::runtime_error(ss.str().c_str()); \
59 #define TC_CUDA_RUNTIMEAPI_ENFORCE(condition) \
61 cudaError_t result = condition; \
62 if (result != cudaSuccess) { \
63 std::stringstream ss; \
64 ss << "Error at: " << __FILE__ << ":" << __LINE__ << ": " \
65 << cudaGetErrorString(result); \
66 LOG(WARNING) << ss.str(); \
67 throw std::runtime_error(ss.str().c_str()); \
WithDevice(size_t g)
Definition: cuda.h:74
size_t querySharedMemorySize()
size_t newGpu
Definition: cuda.h:84
#define TC_CUDA_RUNTIMEAPI_ENFORCE(condition)
Definition: cuda.h:59
size_t oldGpu
Definition: cuda.h:83
~WithDevice() noexcept(false)
Definition: cuda.h:80