diff --git a/csrc/CMakeLists.txt b/csrc/CMakeLists.txt index b8e0cc2a9f26..67d2ed36ccf6 100644 --- a/csrc/CMakeLists.txt +++ b/csrc/CMakeLists.txt @@ -99,7 +99,12 @@ set_directory_properties(PROPERTIES ) # Suppress warnings from catlass/tla third-party headers for CANN kernel compilation +set(VLLM_ASCEND_CANN_COMPAT_HEADER "${OPS_TRANSFORMER_DIR}/common/include/cann_compat.h") list(APPEND OPS_COMPILE_OPTIONS -Wno-ignored-attributes) +list(APPEND OPS_COMPILE_OPTIONS -include${VLLM_ASCEND_CANN_COMPAT_HEADER}) +add_compile_options( + $<$:-include${VLLM_ASCEND_CANN_COMPAT_HEADER}> +) include(cmake/config.cmake) include(cmake/func.cmake) diff --git a/csrc/common/include/cann_compat.h b/csrc/common/include/cann_compat.h new file mode 100644 index 000000000000..c04c64d6ab32 --- /dev/null +++ b/csrc/common/include/cann_compat.h @@ -0,0 +1,30 @@ +#pragma once + +#include + +// B080 op_common/log/log.h stopped exposing the unqualified OP module id used +// by inherited ops-transformer tiling/error headers. Include the CANN log type +// header early so OP still comes from the active CANN version. +#if defined(__has_include) +#if __has_include("base/log_types.h") +#include "base/log_types.h" +#elif __has_include("toolchain/log_types.h") +#include "toolchain/log_types.h" +#endif +#endif + +#if !defined(LOG_TYPES_H_) && !defined(OP) +#define OP 63 +#endif + +#if defined(LOG_CPP) && !defined(DLOG_PUB_H_) +#ifdef __cplusplus +extern "C" { +#endif +int32_t CheckLogLevel(int32_t moduleId, int32_t logLevel); +void DlogRecord(int32_t moduleId, int32_t level, const char *fmt, ...); +#ifdef __cplusplus +} +#endif +#define DLOG_PUB_H_ +#endif