未验证 提交 16506d8e 编写于 作者: N niuliling123 提交者: GitHub

Replaced add_custom_command with add_custom_target in xpu_kp_cmake (#44619)

* Replaced add_custom_command with add_custom_target in xpu_kp_cmake
上级 2bf57450
...@@ -168,11 +168,13 @@ macro(compile_kernel COMPILE_ARGS) ...@@ -168,11 +168,13 @@ macro(compile_kernel COMPILE_ARGS)
else() else()
set(ABI_VERSION "-D_GLIBCXX_USE_CXX11_ABI=1") set(ABI_VERSION "-D_GLIBCXX_USE_CXX11_ABI=1")
endif() endif()
add_custom_target(
${kernel_name}.xpu ALL
COMMAND ${CMAKE_COMMAND} -E copy ${kernel_path}/${kernel_name}.kps
kernel_build/${kernel_name}.xpu)
add_custom_command( add_custom_command(
OUTPUT kernel_build/${kernel_name}.bin.o OUTPUT kernel_build/${kernel_name}.bin.o
COMMAND ${CMAKE_COMMAND} -E make_directory kernel_build COMMAND ${CMAKE_COMMAND} -E make_directory kernel_build
COMMAND ${CMAKE_COMMAND} -E copy ${kernel_path}/${kernel_name}.kps
kernel_build/${kernel_name}.xpu
COMMAND COMMAND
${XPU_CLANG} --sysroot=${CXX_DIR} -std=c++11 ${ABI_VERSION} ${OPT_LEVEL} ${XPU_CLANG} --sysroot=${CXX_DIR} -std=c++11 ${ABI_VERSION} ${OPT_LEVEL}
-fno-builtin -mcpu=xpu2 -fPIC ${XPU_CXX_DEFINES} ${XPU_CXX_FLAGS} -fno-builtin -mcpu=xpu2 -fPIC ${XPU_CXX_DEFINES} ${XPU_CXX_FLAGS}
...@@ -189,8 +191,6 @@ macro(compile_kernel COMPILE_ARGS) ...@@ -189,8 +191,6 @@ macro(compile_kernel COMPILE_ARGS)
add_custom_command( add_custom_command(
OUTPUT kernel_build/${kernel_name}.host.o OUTPUT kernel_build/${kernel_name}.host.o
COMMAND ${CMAKE_COMMAND} -E make_directory kernel_build COMMAND ${CMAKE_COMMAND} -E make_directory kernel_build
COMMAND ${CMAKE_COMMAND} -E copy ${kernel_path}/${kernel_name}.kps
kernel_build/${kernel_name}.xpu
COMMAND COMMAND
${XPU_CLANG} --sysroot=${CXX_DIR} -std=c++11 ${ABI_VERSION} ${OPT_LEVEL} ${XPU_CLANG} --sysroot=${CXX_DIR} -std=c++11 ${ABI_VERSION} ${OPT_LEVEL}
-fno-builtin -mcpu=xpu2 -fPIC ${XPU_CXX_DEFINES} ${XPU_CXX_FLAGS} -fno-builtin -mcpu=xpu2 -fPIC ${XPU_CXX_DEFINES} ${XPU_CXX_FLAGS}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册