This repository was archived by the owner on Sep 30, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121// expression -- a string literal, a std::string, a concatenation, or a
2222// fmt::format(...) call -- carries over unchanged and the thrown type is
2323// preserved. Callers keep whatever headers those arguments require.
24- #define KINETO_THROW (ExceptionType, ...) \
25- throw ExceptionType (__VA_ARGS__) // @allow-raw-throw
24+ #define KINETO_THROW (ExceptionType, ...) \
25+ /* @allow-raw-throw: every Kineto throw funnels through here. */ \
26+ throw ExceptionType (__VA_ARGS__)
Original file line number Diff line number Diff line change @@ -30,19 +30,20 @@ inline void checkCudaStatus(cudaError_t status, int lineNumber = -1) {
3030 }
3131}
3232
33- #define CUDA_CHECK (EXPR ) \
34- do { \
35- const cudaError_t err = EXPR ; \
36- if (err == cudaSuccess) { \
37- break ; \
38- } \
39- std::string error_message; \
40- error_message.append (__FILE__); \
41- error_message.append (" :" ); \
42- error_message.append (std::to_string (__LINE__)); \
43- error_message.append (" CUDA error: " ); \
44- error_message.append (cudaGetErrorString (err)); \
45- throw std::runtime_error (error_message); \
33+ #define CUDA_CHECK (EXPR ) \
34+ do { \
35+ const cudaError_t err = EXPR ; \
36+ if (err == cudaSuccess) { \
37+ break ; \
38+ } \
39+ std::string error_message; \
40+ error_message.append (__FILE__); \
41+ error_message.append (" :" ); \
42+ error_message.append (std::to_string (__LINE__)); \
43+ error_message.append (" CUDA error: " ); \
44+ error_message.append (cudaGetErrorString (err)); \
45+ /* @allow-raw-throw: libkineto does not build this file. */ \
46+ throw std::runtime_error (error_message); \
4647 } while (0 )
4748
4849#define CUDA_KERNEL_LAUNCH_CHECK () CUDA_CHECK (cudaGetLastError())
You can’t perform that action at this time.
0 commit comments