Skip to content
This repository was archived by the owner on Sep 30, 2026. It is now read-only.

Commit b41c790

Browse files
authored
[Kineto] Lints for upstreaming (#1569)
1 parent 853d99d commit b41c790

2 files changed

Lines changed: 17 additions & 15 deletions

File tree

‎libkineto/src/ThrowUtil.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
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__)

‎libkineto/stress_test/utils.h‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff 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())

0 commit comments

Comments
 (0)