CMakeLists.txt 1.2 KB
Newer Older
1
if (NOT INFRT_WITH_PHI)
2 3 4 5 6 7 8 9 10 11 12
    return()
endif()

core_gather_headers()

gather_srcs(infrt_src SRCS
    registry.cc
    dense_tensor_kernels.cc
    context_kernels.cc
)

13 14
set(infrt_register_phi_kernels_gen_source_file ${CMAKE_SOURCE_DIR}/paddle/infrt/kernel/phi/infershaped/infershaped_kernel_launchers.cc)
set(infrt_register_phi_kernels_gen_file ${CMAKE_SOURCE_DIR}/tools/infrt/get_phi_kernel_function.sh)
15 16
set(wrapped_infermeta_header_file ${CMAKE_SOURCE_DIR}/paddle/phi/infermeta/generated.h)
set(wrapped_infermeta_source_file ${CMAKE_SOURCE_DIR}/paddle/phi/infermeta/generated.cc)
W
Wilber 已提交
17 18

add_custom_command(
19
        OUTPUT ${infrt_register_phi_kernels_gen_source_file}
W
Wilber 已提交
20 21
        COMMAND bash ${infrt_register_phi_kernels_gen_file}
        DEPENDS wrapped_infermeta
W
Wilber 已提交
22 23
        VERBATIM)
add_custom_target(infrt_register_phi_kernel
W
Wilber 已提交
24 25
        COMMAND bash ${infrt_register_phi_kernels_gen_file}
        DEPENDS wrapped_infermeta
26
        COMMENT "infrt generate ${infrt_register_phi_kernels_gen_source_file}"
W
Wilber 已提交
27 28
        VERBATIM)

29 30
cc_library(infrt_naive SRCS infershaped/infershaped_kernel_launcher.cc
        infershaped/infershaped_kernel_launchers.cc
31
        DEPS phi wrapped_infermeta)
32 33 34

cc_test_tiny(test_infrt_infershape_launchers SRCS
infershaped/infershape_launchers_test.cc DEPS infrt)