Macros | |
#define | CUDA_DRIVER_TRY(...) |
Error checking macro for CUDA driver API functions. More... | |
#define | CUFILE_TRY(...) |
Error checking macro for cuFile API functions. More... | |
#define | KVIKIO_EXPECT(...) GET_KVIKIO_EXPECT_MACRO(__VA_ARGS__, KVIKIO_EXPECT_3, KVIKIO_EXPECT_2)(__VA_ARGS__) |
Macro for checking pre-conditions or conditions that throws an exception when a condition is violated. More... | |
#define | KVIKIO_FAIL(...) GET_KVIKIO_FAIL_MACRO(__VA_ARGS__, KVIKIO_FAIL_2, KVIKIO_FAIL_1)(__VA_ARGS__) |
Indicates that an erroneous code path has been taken. More... | |
#define | SYSCALL_CHECK(...) |
Error checking macro for Linux system call. More... | |
#define CUDA_DRIVER_TRY | ( | ... | ) |
Error checking macro for CUDA driver API functions.
Invoke a CUDA driver API function call. If the call does not return CUDA_SUCCESS, throw an exception detailing the CUDA error that occurred.
Example:
... | This macro accepts either one or two arguments:
|
#define CUFILE_TRY | ( | ... | ) |
Error checking macro for cuFile API functions.
Invoke a cuFile API function call. If the call does not return CU_FILE_SUCCESS, throw an exception detailing the cuFile error that occurred.
Example:
... | This macro accepts either one or two arguments:
|
#define KVIKIO_EXPECT | ( | ... | ) | GET_KVIKIO_EXPECT_MACRO(__VA_ARGS__, KVIKIO_EXPECT_3, KVIKIO_EXPECT_2)(__VA_ARGS__) |
Macro for checking pre-conditions or conditions that throws an exception when a condition is violated.
Defaults to throwing kvikio::CUfileException, but a custom exception may also be specified.
Example:
... | This macro accepts either two or three arguments:
|
#define KVIKIO_FAIL | ( | ... | ) | GET_KVIKIO_FAIL_MACRO(__VA_ARGS__, KVIKIO_FAIL_2, KVIKIO_FAIL_1)(__VA_ARGS__) |
Indicates that an erroneous code path has been taken.
Example usage:
... | This macro accepts either one or two arguments:
|
#define SYSCALL_CHECK | ( | ... | ) |
Error checking macro for Linux system call.
Error checking for a Linux system call typically involves:
This macro is used to perform the steps above. A simple SYSCALL_CHECK(ret) is designed for the common cases where an integer of -1 indicates a failure, whereas a more complex SYSCALL_CHECK(ret, "extra msg", error_value) for the remaining rare cases, such as (void*)-1
for mmap. At any rate, if a failure occurs, this macro throws an exception (kvikio::GenericSystemError) with detailed error information.
Example:
... | This macro accepts the following arguments:
|