Add file and line to CUDA_CHECK and CUDNN_CHECK#8836
Conversation
|
Worth noting that CUDA_CHECK is now a macro not a function, so potentially redefines CUDA_CHECK from caffe2 if you include both headers at the same time. Could potentially rename something like |
Yes please :) |
|
It might be better to just change those functions to use Is this custom |
|
No, I don't think it is. |
|
Ok. If that's the case, I'll rewrite both of those checks as just defines that utilize I like that AT_ERROR includes the function name in the error report as well. That is missing, for example, in TORCH_CUDA_CHECK. https://github.com/pytorch/pytorch/blob/master/torch/csrc/cuda/cuda_check.h |
|
@ssnl Great idea! AT_ERROR prints way better error messages than Exceptions.h was printing. Has function name, line, c stack and everything. |
|
looks great, thanks Ben! |
Add file and line to messages from
CUDA_CHECKandCUDNN_CHECK. Renamed original functions tocudaCheckandcudnnCheckand made macros with the original names. Should make debugging slightly friendlier.Also ran clang-format on the file.
Cheers