Caffe2 - C++ API
A deep learning, cross platform ML framework
Exceptions.h
1 #pragma once
2 
3 #include <c10/util/Exception.h>
4 #include <c10/cuda/CUDAException.h>
5 
6 // See Note [CHECK macro]
7 #define AT_CUDNN_CHECK(EXPR) \
8  do { \
9  cudnnStatus_t status = EXPR; \
10  if (status != CUDNN_STATUS_SUCCESS) { \
11  if (status == CUDNN_STATUS_NOT_SUPPORTED) { \
12  AT_ERROR( \
13  "cuDNN error: ", \
14  cudnnGetErrorString(status), \
15  ". This error may appear if you passed in a non-contiguous input."); \
16  } else { \
17  AT_ERROR("cuDNN error: ", cudnnGetErrorString(status)); \
18  } \
19  } \
20  } while (0)
21 
22 #define AT_CUDA_CHECK(EXPR) C10_CUDA_CHECK(EXPR)