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

core_gather_headers()

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

14 15
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)
16 17
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 已提交
18 19

add_custom_command(
20 21
        OUTPUT ${infrt_register_phi_kernels_gen_source_file}
        COMMAND sh ${infrt_register_phi_kernels_gen_file}
W
Wilber 已提交
22
        DEPENDS ${wrapped_infermeta_header_file} ${wrapped_infermeta_source_file}
23
        COMMENT "infrt generate ${infrt_register_phi_kernels_gen_source_file}"
W
Wilber 已提交
24 25
        VERBATIM)

26 27
cc_library(infrt_naive SRCS infershaped/infershaped_kernel_launcher.cc
        infershaped/infershaped_kernel_launchers.cc
28
        DEPS phi wrapped_infermeta)
29 30 31

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