CMakeLists.txt 1.1 KB
Newer Older
1
cc_library(subgraph_util SRCS subgraph_util.cc DEPS subgraph_detector)
2

Y
Yan Chunwei 已提交
3
if (WITH_GPU AND TENSORRT_FOUND)
4
  cc_library(tensorrt_subgraph_pass SRCS tensorrt_subgraph_pass.cc DEPS subgraph_util tensorrt_op_teller)
5 6

  set(analysis_deps ${analysis_deps}
7
          subgraph_util tensorrt_subgraph_pass
8 9 10 11 12 13
          CACHE INTERNAL "")

  set(pass_file ${PADDLE_BINARY_DIR}/paddle/fluid/inference/api/paddle_inference_pass.h)
  file(APPEND ${pass_file} "USE_PASS(tensorrt_subgraph_pass);\n")
  set(INFER_IR_PASSES ${INFER_IR_PASSES} tensorrt_subgraph_pass CACHE INTERNAL "")
endif()
14

石晓伟 已提交
15 16 17 18 19 20 21 22
if (WITH_LITE) 
  cc_library(lite_subgraph_pass SRCS lite_subgraph_pass.cc DEPS ${analysis_deps} subgraph_util lite_op_teller)
  set(analysis_deps ${analysis_deps} subgraph_util lite_subgraph_pass CACHE INTERNAL "")
  set(pass_file ${PADDLE_BINARY_DIR}/paddle/fluid/inference/api/paddle_inference_pass.h)
  file(APPEND ${pass_file} "USE_PASS(lite_subgraph_pass);\n")
  set(INFER_IR_PASSES ${INFER_IR_PASSES} lite_subgraph_pass CACHE INTERNAL "")
  cc_test(lite_subgraph_pass_tester SRCS lite_subgraph_pass_tester.cc DEPS lite_subgraph_pass gtest glog)
endif()