CMakeLists.txt 4.9 KB
Newer Older
Y
Yan Chunwei 已提交
1 2
lite_cc_library(mir_node SRCS node.cc DEPS kernel)
lite_cc_library(mir_ssa_graph SRCS ssa_graph.cc DEPS mir_node program)
3
lite_cc_library(mir_pass SRCS pass.cc pass_utils.cc DEPS mir_ssa_graph)
Y
Yan Chunwei 已提交
4 5 6 7 8 9 10 11 12 13
lite_cc_library(mir_pass_manager SRCS pass_manager.cc DEPS mir_pass mir_ssa_graph mir_passes)
lite_cc_library(mir_pass_registry SRCS pass_registry.cc DEPS mir_pass_manager)

add_subdirectory(fusion)
add_subdirectory(elimination)
add_subdirectory(subgraph)

lite_cc_library(mir_passes
  SRCS
      fusion/fc_fuse_pass.cc
14
      fusion/shuffle_channel_fuse_pass.cc
15
      fusion/transpose_softmax_transpose_fuse_pass.cc
Z
zhupengyang 已提交
16
      fusion/interpolate_fuse_pass.cc
Y
Yan Chunwei 已提交
17 18
      fusion/conv_elementwise_fuse_pass.cc
      fusion/conv_activation_fuse_pass.cc
19
      fusion/var_conv_2d_activation_fuse_pass.cc
Y
Yan Chunwei 已提交
20
      fusion/conv_bn_fuse_pass.cc
H
HappyAngel 已提交
21
      fusion/conv_conv_fuse_pass.cc
Y
Yan Chunwei 已提交
22 23
      fusion/elementwise_add_activation_fuse_pass.cc
      fusion/quant_dequant_fuse_pass.cc
24
      fusion/sequence_pool_concat_fuse_pass.cc
25
      fusion/scale_activation_fuse_pass.cc
26
      fusion/__xpu__resnet_fuse_pass.cc
27
      fusion/__xpu__resnet_cbam_fuse_pass.cc
28
      fusion/__xpu__multi_encoder_fuse_pass.cc
C
Cwndmiao 已提交
29 30
      fusion/__xpu__embedding_with_eltwise_add_fuse_pass.cc
      fusion/__xpu__fc_fuse_pass.cc
31
      fusion/__xpu__mmdnn_fuse_pass.cc
Y
Yan Chunwei 已提交
32
      elimination/identity_scale_eliminate_pass.cc
C
Cwndmiao 已提交
33
      elimination/identity_dropout_eliminate_pass.cc
H
HappyAngel 已提交
34
      elimination/elementwise_mul_constant_eliminate_pass.cc
35
      elimination/remove_tf_redundant_ops_pass.cc
36
      elimination/control_flow_op_unused_inputs_and_outputs_eliminate_pass.cc
Y
Yan Chunwei 已提交
37 38 39 40 41 42 43 44 45 46 47
      static_kernel_pick_pass.cc
      variable_place_inference_pass.cc
      type_target_cast_pass.cc
      type_layout_cast_pass.cc
      type_precision_cast_pass.cc
      io_copy_kernel_pick_pass.cc
      graph_visualize_pass.cc
      generate_program_pass.cc
      argument_type_display_pass.cc
      demo_pass.cc
      runtime_context_assign_pass.cc
48
      memory_optimize_pass.cc
49
      multi_stream_analysis_pass.cc
50
      mlu_postprocess_pass.cc
J
juncaipeng 已提交
51
      weight_quantization_preprocess_pass.cc
52
      quantized_op_attributes_inference_pass.cc
53
  DEPS mir_pass types context ${mir_fusers} ${mir_subgraphs})
Y
Yan Chunwei 已提交
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84

# lite_cc_test(test_ssa_graph SRCS ssa_graph_test.cc DEPS
        #mir_ssa_graph scope op
        #fc_op
        #${host_kernels}
        #mir_passes
        #mir_pass_manager
        #program_fake_utils
        #)
# lite_cc_test(test_variable_place_infrence_pass SRCS variable_place_inference_pass_test.cc
#   DEPS
#       mul_op
#       feed_op
#       fetch_op
#       io_copy_op
#       ${host_kernels}
#       mir_passes
#       mir_pass_manager
#       optimizer
#       program_fake_utils
#       target_wrapper_host
#   PROFILE_DEPS basic_profiler
#   CUDA_DEPS target_wrapper_cuda kernels_cuda
#   ARM_DEPS mul_compute_arm
#   X86_DEPS mul_compute_x86
# )

set(pattern_deps mir_node mir_ssa_graph op)
if (WITH_TESTING)
  list(APPEND pattern_deps gtest)
endif()
85
lite_cc_library(pattern_matcher SRCS pattern_matcher.cc xpu_pattern_matcher.cc DEPS ${pattern_deps})
Y
Yan Chunwei 已提交
86 87
lite_cc_test(test_pattern_matcher SRCS pattern_matcher_test.cc DEPS pattern_matcher)

88
lite_cc_library(pattern_matcher_high_api SRCS pattern_matcher_high_api.cc xpu_pattern_matcher_high_api.cc DEPS pattern_matcher)
Y
Yan Chunwei 已提交
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128


# for mobile, unnecessary to compile the following testings.
if (LITE_WITH_LIGHT_WEIGHT_FRAMEWORK)
    return()
endif()
lite_cc_test(test_mir_pass_manager SRCS pass_manager_test.cc DEPS mir_pass_manager mir_passes)


# TODO(wz) replace framework/proto to lite proto.
if (NOT LITE_WITH_LIGHT_WEIGHT_FRAMEWORK)
    # it depends on the fluid/framework/proto, that is too heavy for mobile execution.
    # TODO(wz) enable it latter.
    # lite_cc_test(test_pattern_matcher_high_api SRCS pattern_matcher_high_api_test.cc DEPS
    #     pattern_matcher_high_api proto_desc mir_pass_manager fc_op mul_op elementwise_ops
    #     mir_passes compatible_pb program ${ops})
endif()

message(STATUS "----> Ops lite: ${ops}")
message(STATUS "----> Host kernels: ${host_kernels}")
message(STATUS "----> X86 kernels: ${x86_kernels}")

# lite_cc_test(test_lite_fc_fuse SRCS fusion/fc_fuse_pass_test.cc
#    DEPS cxx_api mir_passes
#    ${ops} ${host_kernels} ${x86_kernels} ${arm_kernels}
#    ARGS --model_dir=${LITE_MODEL_DIR}/lite_fc_model
#         --optimized_model=${LITE_MODEL_DIR}/lite_fc_model_opt SERIAL)

# lite_download_and_uncompress(${LITE_MODEL_DIR} ${LITE_URL} "lite_fc_model.tar.gz")
# add_dependencies(test_lite_fc_fuse extern_lite_download_lite_fc_model_tar_gz)


# lite_cc_test(test_lite_conv_elementwise_add_activation_fuse
#              SRCS fusion/conv_elementwise_add_activation_fuse_pass_test.cc
#              DEPS cxx_api mir_passes
#              ${ops} ${host_kernels} ${x86_kernels})
# lite_cc_test(test_lite_elementwise_add_activation_fuse
#              SRCS fusion/elementwise_add_activation_fuse_pass_test.cc
#              DEPS cxx_api mir_passes
#              ${ops} ${host_kernels} ${x86_kernels})