CMakeLists.txt 1.2 KB
Newer Older
1 2
if(NOT INFRT_WITH_PHI)
  return()
3 4 5 6
endif()

core_gather_headers()

7 8
gather_srcs(infrt_src SRCS registry.cc dense_tensor_kernels.cc
            context_kernels.cc)
9

10 11 12 13 14 15 16 17 18
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)
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 已提交
19 20

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

32 33 34 35 36
cc_library(
  infrt_naive
  SRCS infershaped/infershaped_kernel_launcher.cc
       infershaped/infershaped_kernel_launchers.cc
  DEPS phi wrapped_infermeta)
37 38

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