CMakeLists.txt 1.2 KB
Newer Older
1 2 3 4
set(kernel_declare_file ${PADDLE_BINARY_DIR}/paddle/phi/kernels/declarations.h.tmp CACHE INTERNAL "declarations.h file")
set(kernel_declare_file_final ${PADDLE_BINARY_DIR}/paddle/phi/kernels/declarations.h)
file(WRITE ${kernel_declare_file} "// Generated by the paddle/phi/kernels/CMakeLists.txt.  DO NOT EDIT!\n\n#pragma once\n\n")
file(APPEND ${kernel_declare_file} "#include \"paddle/phi/core/kernel_registry.h\"\n\n")
5

C
Chen Weihang 已提交
6 7
# pten functors and functions called by kernels
add_subdirectory(funcs)
C
Chen Weihang 已提交
8

9 10 11
# pten depends all pten kernel targets
set_property(GLOBAL PROPERTY PTEN_KERNELS "")

12
set(COMMON_KERNEL_DEPS dense_tensor sparse_coo_tensor sparse_csr_tensor kernel_context kernel_factory arg_map_context convert_utils lod_utils)
L
Leo Chen 已提交
13
set(COMMON_KERNEL_DEPS ${COMMON_KERNEL_DEPS} eigen_function blas math_function im2col concat_and_split_functor)
14 15
# remove this dep after removing fluid deps on tensor creation
set(COMMON_KERNEL_DEPS ${COMMON_KERNEL_DEPS} pten_api_utils)
C
Chen Weihang 已提交
16
set(COMMON_KERNEL_DEPS ${COMMON_KERNEL_DEPS} infermeta)
17 18

# auto build kernel targets by cmake
19 20 21
register_kernels(DEPS ${COMMON_KERNEL_DEPS})

# pten sparse kernels
22
add_subdirectory(sparse)
23 24

copy_if_different(${kernel_declare_file} ${kernel_declare_file_final})