未验证 提交 5a9d59c5 编写于 作者: R ronnywang 提交者: GitHub

auto generate a phi config header (#52224)

上级 4f74656d
......@@ -28,6 +28,7 @@ paddle/phi/api/lib/sparse_bw_api.cc
paddle/phi/api/lib/tensor_api.cc
paddle/phi/api/lib/tensor_operants.cc
paddle/phi/extension.h
paddle/phi/config.h
paddle/phi/include/*
paddle/phi/infermeta/generated.*
paddle/fluid/prim/api/generated_prim/*.cc
......
configure_file(config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
# phi auto cmake utils
include(phi)
......@@ -52,6 +54,7 @@ file(
"// Header file generated by paddle/phi/CMakeLists.txt for external users,\n// DO NOT edit or include it within paddle.\n\n#pragma once\n\n"
)
file(APPEND ${phi_extension_header_file} "#include \"paddle/phi/config.h\"\n\n")
# generate inner headers include dir for users
generate_unify_header(backends EXCLUDES context_pool_utils.h)
generate_unify_header(core EXCLUDES cuda_stream.h)
......
// Header file generated by paddle/phi/CMakeLists.txt
// Generate a compilation configuration to avoid compilation errors or
// incompatibilities caused by using phi without defining a phi compilation
// macro. At the same time, configuration file definition macros are more
// readable than those defined through the compilation option `-D`.
#pragma once
#undef ON
#undef OFF
#define ON 1
#define OFF 0
// WITH_MKLDNN
#if @WITH_MKLDNN@
#undef PADDLE_WITH_MKLDNN
#define PADDLE_WITH_MKLDNN
#endif
// WITH_CUSTOM_DEVICE
#if @WITH_CUSTOM_DEVICE@
#undef PADDLE_WITH_CUSTOM_DEVICE
#undef PADDLE_WITH_CUSTOM_KERNEL
#define PADDLE_WITH_CUSTOM_DEVICE
#define PADDLE_WITH_CUSTOM_KERNEL
#endif
// WITH_ARM
#if @WITH_ARM@
#undef PADDLE_WITH_ARM
#define PADDLE_WITH_ARM
#endif
#undef ON
#undef OFF
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册