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
# phi (low level) api headers: include
# phi (high level) api
9
add_subdirectory(api)
10
# phi core components
11
add_subdirectory(core)
12
# phi components of specific backends
C
Chen Weihang 已提交
13
add_subdirectory(backends)
14
# phi kernels for diff device
15
add_subdirectory(kernels)
16
# phi infermeta
C
Chen Weihang 已提交
17
add_subdirectory(infermeta)
18
# phi operator definitions
C
Chen Weihang 已提交
19
add_subdirectory(ops)
20
# phi tools
21
add_subdirectory(tools)
22
# phi tests
23
add_subdirectory(tests)
24 25

# make an unity target for compile deps
26
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)
27
get_property(pten_kernels GLOBAL PROPERTY PTEN_KERNELS)
28 29
# keep this message for debug, remove it later if needless
message(STATUS "All standard pten kernels: ${pten_kernels}")
30
set(PTEN_DEPS ${PTEN_DEPS} ${pten_kernels})
31

32
cc_library(pten DEPS ${PTEN_DEPS})
33

34 35
set(pten_extension_header_file ${CMAKE_CURRENT_SOURCE_DIR}/extension.h CACHE INTERNAL "phi/extension.h file")
file(WRITE ${pten_extension_header_file} "// Header file generated by paddle/phi/CMakeLists.txt for external users,\n// DO NOT edit or include it within paddle.\n\n#pragma once\n\n")
36 37 38 39 40 41

# 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)