CMakeLists.txt 1.4 KB
Newer Older
1 2 3
# pten auto cmake utils
include(pten)

4 5 6
# paddle experimental common components
add_subdirectory(common)

7 8
# pten (low level) api headers: include
# pten (high level) api
9 10 11
add_subdirectory(api)
# pten core components
add_subdirectory(core)
C
Chen Weihang 已提交
12 13
# pten components of specific backends
add_subdirectory(backends)
14 15
# pten kernels for diff device
add_subdirectory(kernels)
C
Chen Weihang 已提交
16 17
# pten infermeta
add_subdirectory(infermeta)
C
Chen Weihang 已提交
18 19
# pten operator definitions
add_subdirectory(ops)
20 21
# pten tests
add_subdirectory(tests)
22 23

# make an unity target for compile deps
24
set(PTEN_DEPS convert_utils dense_tensor pten_context kernel_factory kernel_context arg_map_context infermeta lod_utils op_compat_infos sparse_csr_tensor sparse_coo_tensor)
25
get_property(pten_kernels GLOBAL PROPERTY PTEN_KERNELS)
26 27
# keep this message for debug, remove it later if needless
message(STATUS "All standard pten kernels: ${pten_kernels}")
28
set(PTEN_DEPS ${PTEN_DEPS} ${pten_kernels})
29

30
cc_library(pten DEPS ${PTEN_DEPS})
31 32 33 34 35 36 37 38 39

set(pten_extension_header_file ${CMAKE_CURRENT_SOURCE_DIR}/extension.h CACHE INTERNAL "pten/extension.h file")
file(WRITE ${pten_extension_header_file} "// Header file generated by paddle/pten/CMakeLists.txt for external users,\n// DO NOT edit or include it within paddle.\n\n#pragma once\n\n")

# generate inner headers include dir for users
generate_unify_header(backends)
generate_unify_header(core)
generate_unify_header(infermeta)
generate_unify_header(kernels SKIP_SUFFIX grad_kernel)