From 767efaca7ac6ada90b70eff8d876a1baf373f47c Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Thu, 16 Jun 2022 14:19:34 +0800 Subject: [PATCH] fix xpu kp compilation (#43496) * fix xpu kp compilation * add depends --- paddle/phi/kernels/CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/paddle/phi/kernels/CMakeLists.txt b/paddle/phi/kernels/CMakeLists.txt index acfeaf21d07..7cddacb7e39 100644 --- a/paddle/phi/kernels/CMakeLists.txt +++ b/paddle/phi/kernels/CMakeLists.txt @@ -133,8 +133,16 @@ endif() if(WITH_XPU) if(WITH_XPU_KP) - file(GLOB kernel_xpu_kps "kps/*.cu") - xpu_add_library(phi_xpu STATIC ${kernel_xpu} ${kernel_xpu_kps}) + file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/kps/ + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/kps/) + file(GLOB kernel_xpu_kps "${CMAKE_CURRENT_BINARY_DIR}/kps/*.cu") + foreach(kernel ${kernel_xpu_kps}) + get_filename_component(name ${kernel} NAME_WE) + file(RENAME ${kernel} "${CMAKE_CURRENT_BINARY_DIR}/kps/${name}.kps") + endforeach() + file(GLOB kernel_xpu_kps "${CMAKE_CURRENT_BINARY_DIR}/kps/*.kps") + xpu_add_library(phi_xpu STATIC ${kernel_xpu} ${kernel_xpu_kps} DEPENDS + ${COMMON_KERNEL_DEPS}) else() add_library(phi_xpu ${kernel_xpu}) endif() -- GitLab