mirror of
https://github.com/sgjzfzzf/triton-tvm-ffi.git
synced 2026-07-01 00:42:05 +08:00
524cf83708
Signed-off-by: Jinjie Liu <jjliu@baai.ac.cn>
20 lines
692 B
C
20 lines
692 B
C
#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
|