CMakeLists.txt 1.3 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 22 23
        COMMAND sh ${infrt_register_phi_kernels_gen_file}
        DEPENDS ${wrapped_infermeta_header_file} ${wrapped_infermeta_source_file}
        VERBATIM)
add_custom_target(infrt_register_phi_kernel
24
        COMMAND sh ${infrt_register_phi_kernels_gen_file}
W
Wilber 已提交
25
        DEPENDS ${wrapped_infermeta_header_file} ${wrapped_infermeta_source_file}
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)