mirror of
https://github.com/sgjzfzzf/triton-tvm-ffi.git
synced 2026-07-01 08:51:56 +08:00
@@ -1,8 +1,19 @@
|
||||
#ifndef TRITON_TVM_FFI_MACRO_H_
|
||||
#define TRITON_TVM_FFI_MACRO_H_
|
||||
|
||||
#include "exception.h"
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#define TRITON_TVM_FFI_INLINE __attribute__((always_inline)) inline
|
||||
#endif
|
||||
|
||||
#define UNLIKELY(cond) __builtin_expect((cond), 0)
|
||||
|
||||
#define CUDA_CHECK(code) \
|
||||
do { \
|
||||
if (UNLIKELY((code) != CUDA_SUCCESS)) { \
|
||||
throw triton_tvm_ffi::CUDAException(code); \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user