CMakeLists.txt 4.2 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/reshape_fuse_pass.cc
27
      fusion/__xpu__resnet_fuse_pass.cc
28
      fusion/__xpu__resnet_cbam_fuse_pass.cc
29
      fusion/__xpu__multi_encoder_fuse_pass.cc
C
Cwndmiao 已提交
30 31
      fusion/__xpu__embedding_with_eltwise_add_fuse_pass.cc
      fusion/__xpu__fc_fuse_pass.cc
32
      fusion/__xpu__mmdnn_fuse_pass.cc
33 34 35 36
      fusion/__xpu__conv2d_fuse_pass.cc
      fusion/__xpu__conv2d_link_previous_out_max_pass.cc
      fusion/__xpu__sfa_head_meanstd_fuse_pass.cc
      fusion/__xpu__sfa_head_moment_fuse_pass.cc
W
Wilber 已提交
37
      fusion/match_matrix_activation_fuse_pass.cc
W
Wilber 已提交
38
      fusion/scales_fuse_pass.cc
39
      fusion/sequence_reverse_embedding_fuse_pass.cc
Y
Yan Chunwei 已提交
40
      elimination/identity_scale_eliminate_pass.cc
C
Cwndmiao 已提交
41
      elimination/identity_dropout_eliminate_pass.cc
H
HappyAngel 已提交
42
      elimination/elementwise_mul_constant_eliminate_pass.cc
43
      elimination/remove_tf_redundant_ops_pass.cc
44
      elimination/control_flow_op_unused_inputs_and_outputs_eliminate_pass.cc
Y
Yan Chunwei 已提交
45 46 47 48 49 50 51 52 53 54 55
      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
56
      memory_optimize_pass.cc
57
      multi_stream_analysis_pass.cc
58
      mlu_postprocess_pass.cc
J
juncaipeng 已提交
59
      weight_quantization_preprocess_pass.cc
60
      quantized_op_attributes_inference_pass.cc
61
  DEPS mir_pass types context ${mir_fusers} ${mir_subgraphs})
Y
Yan Chunwei 已提交
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92

# 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()
93
lite_cc_library(pattern_matcher SRCS pattern_matcher.cc xpu_pattern_matcher.cc DEPS ${pattern_deps})
Y
Yan Chunwei 已提交
94 95
lite_cc_test(test_pattern_matcher SRCS pattern_matcher_test.cc DEPS pattern_matcher)

96
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 已提交
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113


# 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()