CMakeLists.txt 1.5 KB
Newer Older
Y
Yan Chunwei 已提交
1 2 3 4
if (NOT LITE_WITH_FPGA)
    return()
endif()

5
set(LITE_FPGA_KD_PATH "${PADDLE_SOURCE_DIR}/lite/backends/fpga/KD")
M
MyPandaShaoxiang 已提交
6 7
set(LITE_FPGA_KD_LLAPI_PATH "${PADDLE_SOURCE_DIR}/lite/backends/fpga/KD/llapi")
set(LITE_FPGA_KD_PE_PATH "${PADDLE_SOURCE_DIR}/lite/backends/fpga/KD/pes")
8
set(LITE_FPGA_PATH "${PADDLE_SOURCE_DIR}/lite/backends/fpga")
Y
Yan Chunwei 已提交
9 10 11

message("fpga_kd_path ${LITE_FPGA_KD_PATH}")
message("fpga_path ${LITE_FPGA_PATH}")
M
MyPandaShaoxiang 已提交
12 13 14
file(GLOB KD_CPP "${LITE_FPGA_KD_PATH}/*.cpp")
file(GLOB PE_CPP "${LITE_FPGA_KD_PE_PATH}/*.cpp")
file(GLOB LLAPI_CPP "${LITE_FPGA_KD_LLAPI_PATH}/*.cpp")
Y
Yan Chunwei 已提交
15
file(GLOB FPGA_CPP "${LITE_FPGA_PATH}/*.cc")
M
MyPandaShaoxiang 已提交
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
set(FPGA_ALL_CPP "")
FOREACH(FILE_PATH ${KD_CPP})
    STRING(REGEX REPLACE ".+/(.+\\..*)" "\\1" FILE_NAME ${FILE_PATH})
    list(APPEND FPGA_ALL_CPP KD/${FILE_NAME})
ENDFOREACH(FILE_PATH)
FOREACH(FILE_PATH ${PE_CPP})
    STRING(REGEX REPLACE ".+/(.+\\..*)" "\\1" FILE_NAME ${FILE_PATH})
    list(APPEND FPGA_ALL_CPP KD/pes/${FILE_NAME})
ENDFOREACH(FILE_PATH)
FOREACH(FILE_PATH ${LLAPI_CPP})
    STRING(REGEX REPLACE ".+/(.+\\..*)" "\\1" FILE_NAME ${FILE_PATH})
    list(APPEND FPGA_ALL_CPP KD/llapi/${FILE_NAME})
ENDFOREACH(FILE_PATH)
FOREACH(FILE_PATH ${FPGA_CPP})
    STRING(REGEX REPLACE ".+/(.+\\..*)" "\\1" FILE_NAME ${FILE_PATH})
    list( APPEND FPGA_ALL_CPP ${FILE_NAME})
ENDFOREACH(FILE_PATH)
message("fpga kd: ${FPGA_ALL_CPP}")
cc_library(kernel_fpga SRCS ${FPGA_ALL_CPP})
#cc_library(kernel_fpga SRCS ${KD_CPP} ${FPGA_CPP})
Y
Yan Chunwei 已提交
36
cc_library(lite_tensor_fpga SRCS lite_tensor.cc DEPS memory)
M
MyPandaShaoxiang 已提交
37
cc_library(fpga_target_wrapper SRCS target_wrapper.cc DEPS kernel_fpga)