From b419fb79646a0a3881ea16d112be8df55c3f132b Mon Sep 17 00:00:00 2001 From: crapromer Date: Fri, 12 Sep 2025 02:53:49 +0000 Subject: [PATCH 1/4] initial add mc support for meta --- src/infiniop/devices/metax/metax_common.h | 11 +++- src/infiniop/devices/metax/metax_ht2mc.h | 67 +++++++++++++++++++++++ src/infinirt/metax/infinirt_metax.cc | 9 ++- src/infinirt/metax/infinirt_metax.h | 1 + xmake.lua | 9 +++ xmake/metax.lua | 25 +++++++-- 6 files changed, 112 insertions(+), 10 deletions(-) create mode 100644 src/infiniop/devices/metax/metax_ht2mc.h diff --git a/src/infiniop/devices/metax/metax_common.h b/src/infiniop/devices/metax/metax_common.h index 225ce74e1..35453aa1e 100644 --- a/src/infiniop/devices/metax/metax_common.h +++ b/src/infiniop/devices/metax/metax_common.h @@ -1,8 +1,15 @@ #include "../../../utils.h" #include "../pool.h" +#include "metax_ht2mc.h" #include "metax_handle.h" -#include -#include + +#ifdef ENABLE_METAX_MC_API + #include + #include +#else + #include + #include +#endif #include #define CHECK_MCBLAS(API) CHECK_INTERNAL(API, HCBLAS_STATUS_SUCCESS) diff --git a/src/infiniop/devices/metax/metax_ht2mc.h b/src/infiniop/devices/metax/metax_ht2mc.h new file mode 100644 index 000000000..313c21a81 --- /dev/null +++ b/src/infiniop/devices/metax/metax_ht2mc.h @@ -0,0 +1,67 @@ +#ifdef ENABLE_METAX_MC_API + #define hcblasHandle_t mcblasHandle_t + #define hcdnnHandle_t mcdnnHandle_t + #define hcStream_t mcStream_t + #define hcdnnDataType_t mcdnnDataType_t + #define hpcc_bfloat16 maca_bfloat16 + #define hpcc_bfloat162 maca_bfloat162 + #define __hpcc_bfloat16 __maca_bfloat16 + #define __hpcc_bfloat16 __maca_bfloat16 + #define hcError_t mcError_t + #define hcSuccess mcSuccess + #define hcDeviceProp_t mcDeviceProp_t + #define hcGetDeviceProperties mcGetDeviceProperties + #define HCBLAS_STATUS_SUCCESS MCBLAS_STATUS_SUCCESS + #define HCDNN_STATUS_SUCCESS MCDNN_STATUS_SUCCESS + #define hcblasCreate mcblasCreate + #define hcblasSetStream mcblasSetStream + #define hcGetDeviceCount mcGetDeviceCount + #define hcSetDevice mcSetDevice + #define hcDeviceSynchronize mcDeviceSynchronize + #define hcStreamCreate mcStreamCreate + #define hcStreamDestroy mcStreamDestroy + #define hcStreamSynchronize mcStreamSynchronize + #define hcdnnCreate mcdnnCreate + #define hcdnnSetStream mcdnnSetStream + #define hcEvent_t mcEvent_t + #define hcStreamWaitEvent mcStreamWaitEvent + #define HCDNN_DATA_HALF MCDNN_DATA_HALF + #define HCDNN_DATA_FLOAT MCDNN_DATA_FLOAT + #define HCDNN_DATA_DOUBLE MCDNN_DATA_DOUBLE + #define HCDNN_DATA_BFLOAT16 MCDNN_DATA_BFLOAT16 + #define HCDNN_DATA_INT8 MCDNN_DATA_INT8 + #define HCDNN_DATA_INT32 MCDNN_DATA_INT32 + #define HCDNN_DATA_INT64 MCDNN_DATA_INT64 + #define HCDNN_DATA_UINT8 MCDNN_DATA_UINT8 + #define hcEventCreate mcEventCreate + #define hcEventRecord mcEventRecord + #define hcEventQuery mcEventQuery + #define hcEventSynchronize mcEventSynchronize + #define hcEventDestroy mcEventDestroy + #define hcMalloc mcMalloc + #define hpccDataType macaDataType + #define hcblasComputeType_t mcblasComputeType_t + #define hcMallocHost mcMallocHost + #define hcFree mcFree + #define hcFreeHost mcFreeHost + #define hcMemcpyKind mcMemcpyKind + #define hcMemcpyHostToDevice mcMemcpyHostToDevice + #define hcMemcpyDeviceToHost mcMemcpyDeviceToHost + #define hcMemcpyDeviceToDevice mcMemcpyDeviceToDevice + #define hcMemcpyHostToHost mcMemcpyHostToHost + #define hcMemcpyDefault mcMemcpyDefault + #define hcMemcpy mcMemcpy + #define hcMemcpyAsync mcMemcpyAsync + #define hcMallocAsync mcMallocAsync + #define hcFreeAsync mcFreeAsync + #define HPCC_R_16F MACA_R_16F + #define HPCC_R_16BF MACA_R_16BF + #define HPCC_R_32F MACA_R_32F + #define HCBLAS_COMPUTE_32F MCBLAS_COMPUTE_32F + #define HCBLAS_COMPUTE_32F_FAST_TF32 MCBLAS_COMPUTE_32F_FAST_TF32 + #define HCBLAS_OP_N MCBLAS_OP_N + #define HCBLAS_OP_T MCBLAS_OP_T + #define HCBLAS_GEMM_DEFAULT_TENSOR_OP MCBLAS_GEMM_DEFAULT_TENSOR_OP + #define hcblasGemmStridedBatchedEx mcblasGemmStridedBatchedEx + #define hcLaunchKernel mcLaunchKernel +#endif \ No newline at end of file diff --git a/src/infinirt/metax/infinirt_metax.cc b/src/infinirt/metax/infinirt_metax.cc index 362a7d7ca..e9276584b 100644 --- a/src/infinirt/metax/infinirt_metax.cc +++ b/src/infinirt/metax/infinirt_metax.cc @@ -1,7 +1,12 @@ #include "infinirt_metax.h" #include "../../utils.h" -#include -#include +#ifdef ENABLE_METAX_MC_API + #include + #include +#else + #include + #include +#endif #define CHECK_MACART(RT_API) CHECK_INTERNAL(RT_API, hcSuccess) diff --git a/src/infinirt/metax/infinirt_metax.h b/src/infinirt/metax/infinirt_metax.h index 045fc3b7a..233891758 100644 --- a/src/infinirt/metax/infinirt_metax.h +++ b/src/infinirt/metax/infinirt_metax.h @@ -1,5 +1,6 @@ #ifndef __INFINIRT_MACA_H__ #define __INFINIRT_MACA_H__ +#include "../../infiniop/devices/metax/metax_ht2mc.h" #include "../infinirt_impl.h" namespace infinirt::metax { diff --git a/xmake.lua b/xmake.lua index ac3fad2ca..968160c62 100644 --- a/xmake.lua +++ b/xmake.lua @@ -109,8 +109,17 @@ option("metax-gpu") set_description("Whether to compile implementations for MetaX GPU") option_end() +option("use_mc") + set_default(false) + set_showmenu(true) + set_description("Use MC version") +option_end() + if has_config("metax-gpu") then add_defines("ENABLE_METAX_API") + if has_config("use_mc") then + add_defines("ENABLE_METAX_MC_API") + end includes("xmake/metax.lua") end diff --git a/xmake/metax.lua b/xmake/metax.lua index 474a50b48..afe63e674 100644 --- a/xmake/metax.lua +++ b/xmake/metax.lua @@ -2,7 +2,11 @@ local MACA_ROOT = os.getenv("MACA_PATH") or os.getenv("MACA_HOME") or os.getenv("MACA_ROOT") add_includedirs(MACA_ROOT .. "/include") add_linkdirs(MACA_ROOT .. "/lib") -add_links("hcdnn", "hcblas", "hcruntime") +if has_config("use_mc") then + add_links("mcdnn", "mcblas", "mcruntime") +else + add_links("hcdnn", "hcblas", "hcruntime") +end rule("maca") set_extensions(".maca") @@ -14,11 +18,16 @@ rule("maca") on_build_file(function (target, sourcefile) local objectfile = target:objectfile(sourcefile) os.mkdir(path.directory(objectfile)) - local htcc = path.join(MACA_ROOT, "htgpu_llvm/bin/htcc") + local args + local htcc + if has_config("use_mc") then + htcc = path.join(MACA_ROOT, "mxgpu_llvm/bin/mxcc") + args = { "-x", "maca", "-c", sourcefile, "-o", objectfile, "-I" .. MACA_ROOT .. "/include", "-O3", "-fPIC", "-Werror", "-std=c++17"} + else + htcc = path.join(MACA_ROOT, "htgpu_llvm/bin/htcc") + args = { "-x", "hpcc", "-c", sourcefile, "-o", objectfile, "-I" .. MACA_ROOT .. "/include", "-O3", "-fPIC", "-Werror", "-std=c++17"} + end local includedirs = table.concat(target:get("includedirs"), " ") - - local args = { "-x", "hpcc", "-c", sourcefile, "-o", objectfile, "-I" .. MACA_ROOT .. "/include", "-O3", "-fPIC", "-Werror", "-std=c++17"} - for _, includedir in ipairs(target:get("includedirs")) do table.insert(args, "-I" .. includedir) end @@ -66,7 +75,11 @@ target("infiniccl-metax") add_cxflags("-fPIC") end if has_config("ccl") then - add_links("libhccl.so") + if has_config("use_mc") then + add_links("libmccl.so") + else + add_links("libhccl.so") + end add_files("../src/infiniccl/metax/*.cc") end set_languages("cxx17") From 0c3c5c7a04d25981d8ad17cfb62201b479af86ac Mon Sep 17 00:00:00 2001 From: crapromer Date: Sat, 13 Sep 2025 09:01:48 +0000 Subject: [PATCH 2/4] add command description for maca compilation --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a97a71c36..12c2a72b1 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ python scripts/install.py [XMAKE_CONFIG_FLAGS] | `--ascend-npu=[y\|n]` | 是否编译昇腾 NPU 接口实现 | n | `--cambricon-mlu=[y\|n]` | 是否编译寒武纪 MLU 接口实现 | n | `--metax-gpu=[y\|n]` | 是否编译沐曦 GPU 接口实现 | n +| `--use_mc=[y\|n]` | 是否沐曦 GPU 接口实现使用maca SDK | n | `--moore-gpu=[y\|n]` | 是否编译摩尔线程 GPU 接口实现 | n | `--iluvatar-gpu=[y\|n]` | 是否编译沐曦 GPU 接口实现 | n | `--hygon-dcu=[y\|n]` | 是否编译海光 DCU 接口实现 | n From e023ad363683caf6a840b5d558d1df5c34ff4163 Mon Sep 17 00:00:00 2001 From: crapromer Date: Sun, 14 Sep 2025 18:48:20 +0800 Subject: [PATCH 3/4] rebase metax maca support to main --- .../causal_softmax/metax/causal_softmax_metax.maca | 6 +++++- .../ops/random_sample/metax/random_sample_kernel.h | 13 ++++++++++--- .../ops/random_sample/metax/random_sample_metax.h | 1 - .../random_sample/metax/random_sample_metax.maca | 1 + src/infiniop/ops/softplus/operator.cc | 3 --- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/infiniop/ops/causal_softmax/metax/causal_softmax_metax.maca b/src/infiniop/ops/causal_softmax/metax/causal_softmax_metax.maca index 670666ef4..cde4009fe 100644 --- a/src/infiniop/ops/causal_softmax/metax/causal_softmax_metax.maca +++ b/src/infiniop/ops/causal_softmax/metax/causal_softmax_metax.maca @@ -1,7 +1,11 @@ #include "../../../devices/metax/metax_common.h" #include "causal_softmax_metax.h" -#include +#ifdef ENABLE_METAX_MC_API + #include +#else + #include +#endif #include "../../../devices/metax/metax_kernel_common.h" #include "../../../reduce/cuda/reduce.cuh" diff --git a/src/infiniop/ops/random_sample/metax/random_sample_kernel.h b/src/infiniop/ops/random_sample/metax/random_sample_kernel.h index a0e6ba2b3..e3b8fe2f0 100644 --- a/src/infiniop/ops/random_sample/metax/random_sample_kernel.h +++ b/src/infiniop/ops/random_sample/metax/random_sample_kernel.h @@ -1,8 +1,15 @@ #include "../../../devices/metax/metax_kernel_common.h" #include "infinicore.h" -#include -#include -#include + +#ifdef ENABLE_METAX_MC_API + #include + #include + #include +#else + #include + #include + #include +#endif namespace op::random_sample::metax { diff --git a/src/infiniop/ops/random_sample/metax/random_sample_metax.h b/src/infiniop/ops/random_sample/metax/random_sample_metax.h index a6df5c95f..f3bc52aae 100644 --- a/src/infiniop/ops/random_sample/metax/random_sample_metax.h +++ b/src/infiniop/ops/random_sample/metax/random_sample_metax.h @@ -1,6 +1,5 @@ #ifndef __RANDOM_SAMPLE_METAX_H__ #define __RANDOM_SAMPLE_METAX_H__ - #include "../random_sample.h" DESCRIPTOR(metax) diff --git a/src/infiniop/ops/random_sample/metax/random_sample_metax.maca b/src/infiniop/ops/random_sample/metax/random_sample_metax.maca index eed593ed8..b41241848 100644 --- a/src/infiniop/ops/random_sample/metax/random_sample_metax.maca +++ b/src/infiniop/ops/random_sample/metax/random_sample_metax.maca @@ -1,3 +1,4 @@ +#include "../../../devices/metax/metax_ht2mc.h" #include "../../../devices/metax/metax_common.h" #include "../../../devices/metax/metax_handle.h" #include "../info.h" diff --git a/src/infiniop/ops/softplus/operator.cc b/src/infiniop/ops/softplus/operator.cc index 2548f7d34..c344ba6d5 100644 --- a/src/infiniop/ops/softplus/operator.cc +++ b/src/infiniop/ops/softplus/operator.cc @@ -8,9 +8,6 @@ #if defined(ENABLE_NVIDIA_API) || defined(ENABLE_ILUVATAR_API) #include "nvidia/softplus_nvidia.cuh" #endif -#ifdef ENABLE_METAX_API -#include "metax/softplus_metax.h" -#endif __C infiniStatus_t infiniopCreateSoftplusDescriptor( infiniopHandle_t handle, From 059976589138495a3faa0c4bd5279056fd8f8299 Mon Sep 17 00:00:00 2001 From: crapromer Date: Fri, 7 Nov 2025 15:31:07 +0800 Subject: [PATCH 4/4] issue/445 - clang format code on ubuntu --- src/infiniop/devices/metax/metax_common.h | 10 +- src/infiniop/devices/metax/metax_ht2mc.h | 130 +++++++++--------- .../metax/random_sample_kernel.h | 12 +- src/infinirt/metax/infinirt_metax.cc | 8 +- 4 files changed, 80 insertions(+), 80 deletions(-) diff --git a/src/infiniop/devices/metax/metax_common.h b/src/infiniop/devices/metax/metax_common.h index 35453aa1e..b4275e2a6 100644 --- a/src/infiniop/devices/metax/metax_common.h +++ b/src/infiniop/devices/metax/metax_common.h @@ -1,14 +1,14 @@ #include "../../../utils.h" #include "../pool.h" -#include "metax_ht2mc.h" #include "metax_handle.h" +#include "metax_ht2mc.h" #ifdef ENABLE_METAX_MC_API - #include - #include +#include +#include #else - #include - #include +#include +#include #endif #include diff --git a/src/infiniop/devices/metax/metax_ht2mc.h b/src/infiniop/devices/metax/metax_ht2mc.h index 313c21a81..49ee57b7a 100644 --- a/src/infiniop/devices/metax/metax_ht2mc.h +++ b/src/infiniop/devices/metax/metax_ht2mc.h @@ -1,67 +1,67 @@ #ifdef ENABLE_METAX_MC_API - #define hcblasHandle_t mcblasHandle_t - #define hcdnnHandle_t mcdnnHandle_t - #define hcStream_t mcStream_t - #define hcdnnDataType_t mcdnnDataType_t - #define hpcc_bfloat16 maca_bfloat16 - #define hpcc_bfloat162 maca_bfloat162 - #define __hpcc_bfloat16 __maca_bfloat16 - #define __hpcc_bfloat16 __maca_bfloat16 - #define hcError_t mcError_t - #define hcSuccess mcSuccess - #define hcDeviceProp_t mcDeviceProp_t - #define hcGetDeviceProperties mcGetDeviceProperties - #define HCBLAS_STATUS_SUCCESS MCBLAS_STATUS_SUCCESS - #define HCDNN_STATUS_SUCCESS MCDNN_STATUS_SUCCESS - #define hcblasCreate mcblasCreate - #define hcblasSetStream mcblasSetStream - #define hcGetDeviceCount mcGetDeviceCount - #define hcSetDevice mcSetDevice - #define hcDeviceSynchronize mcDeviceSynchronize - #define hcStreamCreate mcStreamCreate - #define hcStreamDestroy mcStreamDestroy - #define hcStreamSynchronize mcStreamSynchronize - #define hcdnnCreate mcdnnCreate - #define hcdnnSetStream mcdnnSetStream - #define hcEvent_t mcEvent_t - #define hcStreamWaitEvent mcStreamWaitEvent - #define HCDNN_DATA_HALF MCDNN_DATA_HALF - #define HCDNN_DATA_FLOAT MCDNN_DATA_FLOAT - #define HCDNN_DATA_DOUBLE MCDNN_DATA_DOUBLE - #define HCDNN_DATA_BFLOAT16 MCDNN_DATA_BFLOAT16 - #define HCDNN_DATA_INT8 MCDNN_DATA_INT8 - #define HCDNN_DATA_INT32 MCDNN_DATA_INT32 - #define HCDNN_DATA_INT64 MCDNN_DATA_INT64 - #define HCDNN_DATA_UINT8 MCDNN_DATA_UINT8 - #define hcEventCreate mcEventCreate - #define hcEventRecord mcEventRecord - #define hcEventQuery mcEventQuery - #define hcEventSynchronize mcEventSynchronize - #define hcEventDestroy mcEventDestroy - #define hcMalloc mcMalloc - #define hpccDataType macaDataType - #define hcblasComputeType_t mcblasComputeType_t - #define hcMallocHost mcMallocHost - #define hcFree mcFree - #define hcFreeHost mcFreeHost - #define hcMemcpyKind mcMemcpyKind - #define hcMemcpyHostToDevice mcMemcpyHostToDevice - #define hcMemcpyDeviceToHost mcMemcpyDeviceToHost - #define hcMemcpyDeviceToDevice mcMemcpyDeviceToDevice - #define hcMemcpyHostToHost mcMemcpyHostToHost - #define hcMemcpyDefault mcMemcpyDefault - #define hcMemcpy mcMemcpy - #define hcMemcpyAsync mcMemcpyAsync - #define hcMallocAsync mcMallocAsync - #define hcFreeAsync mcFreeAsync - #define HPCC_R_16F MACA_R_16F - #define HPCC_R_16BF MACA_R_16BF - #define HPCC_R_32F MACA_R_32F - #define HCBLAS_COMPUTE_32F MCBLAS_COMPUTE_32F - #define HCBLAS_COMPUTE_32F_FAST_TF32 MCBLAS_COMPUTE_32F_FAST_TF32 - #define HCBLAS_OP_N MCBLAS_OP_N - #define HCBLAS_OP_T MCBLAS_OP_T - #define HCBLAS_GEMM_DEFAULT_TENSOR_OP MCBLAS_GEMM_DEFAULT_TENSOR_OP - #define hcblasGemmStridedBatchedEx mcblasGemmStridedBatchedEx - #define hcLaunchKernel mcLaunchKernel +#define hcblasHandle_t mcblasHandle_t +#define hcdnnHandle_t mcdnnHandle_t +#define hcStream_t mcStream_t +#define hcdnnDataType_t mcdnnDataType_t +#define hpcc_bfloat16 maca_bfloat16 +#define hpcc_bfloat162 maca_bfloat162 +#define __hpcc_bfloat16 __maca_bfloat16 +#define __hpcc_bfloat16 __maca_bfloat16 +#define hcError_t mcError_t +#define hcSuccess mcSuccess +#define hcDeviceProp_t mcDeviceProp_t +#define hcGetDeviceProperties mcGetDeviceProperties +#define HCBLAS_STATUS_SUCCESS MCBLAS_STATUS_SUCCESS +#define HCDNN_STATUS_SUCCESS MCDNN_STATUS_SUCCESS +#define hcblasCreate mcblasCreate +#define hcblasSetStream mcblasSetStream +#define hcGetDeviceCount mcGetDeviceCount +#define hcSetDevice mcSetDevice +#define hcDeviceSynchronize mcDeviceSynchronize +#define hcStreamCreate mcStreamCreate +#define hcStreamDestroy mcStreamDestroy +#define hcStreamSynchronize mcStreamSynchronize +#define hcdnnCreate mcdnnCreate +#define hcdnnSetStream mcdnnSetStream +#define hcEvent_t mcEvent_t +#define hcStreamWaitEvent mcStreamWaitEvent +#define HCDNN_DATA_HALF MCDNN_DATA_HALF +#define HCDNN_DATA_FLOAT MCDNN_DATA_FLOAT +#define HCDNN_DATA_DOUBLE MCDNN_DATA_DOUBLE +#define HCDNN_DATA_BFLOAT16 MCDNN_DATA_BFLOAT16 +#define HCDNN_DATA_INT8 MCDNN_DATA_INT8 +#define HCDNN_DATA_INT32 MCDNN_DATA_INT32 +#define HCDNN_DATA_INT64 MCDNN_DATA_INT64 +#define HCDNN_DATA_UINT8 MCDNN_DATA_UINT8 +#define hcEventCreate mcEventCreate +#define hcEventRecord mcEventRecord +#define hcEventQuery mcEventQuery +#define hcEventSynchronize mcEventSynchronize +#define hcEventDestroy mcEventDestroy +#define hcMalloc mcMalloc +#define hpccDataType macaDataType +#define hcblasComputeType_t mcblasComputeType_t +#define hcMallocHost mcMallocHost +#define hcFree mcFree +#define hcFreeHost mcFreeHost +#define hcMemcpyKind mcMemcpyKind +#define hcMemcpyHostToDevice mcMemcpyHostToDevice +#define hcMemcpyDeviceToHost mcMemcpyDeviceToHost +#define hcMemcpyDeviceToDevice mcMemcpyDeviceToDevice +#define hcMemcpyHostToHost mcMemcpyHostToHost +#define hcMemcpyDefault mcMemcpyDefault +#define hcMemcpy mcMemcpy +#define hcMemcpyAsync mcMemcpyAsync +#define hcMallocAsync mcMallocAsync +#define hcFreeAsync mcFreeAsync +#define HPCC_R_16F MACA_R_16F +#define HPCC_R_16BF MACA_R_16BF +#define HPCC_R_32F MACA_R_32F +#define HCBLAS_COMPUTE_32F MCBLAS_COMPUTE_32F +#define HCBLAS_COMPUTE_32F_FAST_TF32 MCBLAS_COMPUTE_32F_FAST_TF32 +#define HCBLAS_OP_N MCBLAS_OP_N +#define HCBLAS_OP_T MCBLAS_OP_T +#define HCBLAS_GEMM_DEFAULT_TENSOR_OP MCBLAS_GEMM_DEFAULT_TENSOR_OP +#define hcblasGemmStridedBatchedEx mcblasGemmStridedBatchedEx +#define hcLaunchKernel mcLaunchKernel #endif \ No newline at end of file diff --git a/src/infiniop/ops/random_sample/metax/random_sample_kernel.h b/src/infiniop/ops/random_sample/metax/random_sample_kernel.h index e3b8fe2f0..204f0b61a 100644 --- a/src/infiniop/ops/random_sample/metax/random_sample_kernel.h +++ b/src/infiniop/ops/random_sample/metax/random_sample_kernel.h @@ -2,13 +2,13 @@ #include "infinicore.h" #ifdef ENABLE_METAX_MC_API - #include - #include - #include +#include +#include +#include #else - #include - #include - #include +#include +#include +#include #endif namespace op::random_sample::metax { diff --git a/src/infinirt/metax/infinirt_metax.cc b/src/infinirt/metax/infinirt_metax.cc index e9276584b..eaf768532 100644 --- a/src/infinirt/metax/infinirt_metax.cc +++ b/src/infinirt/metax/infinirt_metax.cc @@ -1,11 +1,11 @@ #include "infinirt_metax.h" #include "../../utils.h" #ifdef ENABLE_METAX_MC_API - #include - #include +#include +#include #else - #include - #include +#include +#include #endif #define CHECK_MACART(RT_API) CHECK_INTERNAL(RT_API, hcSuccess)