Skip to content

Commit 30f1789

Browse files
DannyIsFunnySuperjomn
authored andcommitted
move some basic ops into extra type to reduce library size test=develop (#2347)
1 parent a6f2c13 commit 30f1789

File tree

4 files changed

+38
-37
lines changed

4 files changed

+38
-37
lines changed

lite/kernels/arm/CMakeLists.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# for conv op
2-
add_kernel(conv_depthwise ARM basic SRCS conv_depthwise.cc DEPS ${lite_kernel_deps} math_arm)
3-
add_kernel(conv_direct ARM basic SRCS conv_direct.cc DEPS ${lite_kernel_deps} math_arm)
4-
add_kernel(conv_gemmlike ARM basic SRCS conv_gemmlike.cc DEPS ${lite_kernel_deps} math_arm)
5-
add_kernel(conv_winograd ARM basic SRCS conv_winograd.cc DEPS ${lite_kernel_deps} math_arm)
6-
add_kernel(conv_compute_arm ARM basic SRCS conv_compute.cc DEPS ${lite_kernel_deps}
2+
add_kernel(conv_depthwise ARM extra SRCS conv_depthwise.cc DEPS ${lite_kernel_deps} math_arm)
3+
add_kernel(conv_direct ARM extra SRCS conv_direct.cc DEPS ${lite_kernel_deps} math_arm)
4+
add_kernel(conv_gemmlike ARM extra SRCS conv_gemmlike.cc DEPS ${lite_kernel_deps} math_arm)
5+
add_kernel(conv_winograd ARM extra SRCS conv_winograd.cc DEPS ${lite_kernel_deps} math_arm)
6+
add_kernel(conv_compute_arm ARM extra SRCS conv_compute.cc DEPS ${lite_kernel_deps}
77
conv_depthwise conv_direct conv_gemmlike conv_winograd)
88

99
add_kernel(fc_compute_arm ARM basic SRCS fc_compute.cc DEPS ${lite_kernel_deps} math_arm)
@@ -40,24 +40,24 @@ add_kernel(shape_compute_arm ARM basic SRCS shape_compute.cc DEPS ${lite_kernel_
4040
add_kernel(slice_compute_arm ARM basic SRCS slice_compute.cc DEPS ${lite_kernel_deps} math_arm)
4141
add_kernel(cast_compute_arm ARM basic SRCS cast_compute.cc DEPS ${lite_kernel_deps} math_arm)
4242
add_kernel(squeeze_compute_arm ARM basic SRCS squeeze_compute.cc DEPS ${lite_kernel_deps} math_arm)
43-
add_kernel(unsqueeze_compute_arm ARM basic SRCS unsqueeze_compute.cc DEPS ${lite_kernel_deps} math_arm)
43+
add_kernel(unsqueeze_compute_arm ARM extra SRCS unsqueeze_compute.cc DEPS ${lite_kernel_deps} math_arm)
4444
add_kernel(expand_compute_arm ARM basic SRCS expand_compute.cc DEPS ${lite_kernel_deps} math_arm)
4545
add_kernel(reduce_max_compute_arm ARM basic SRCS reduce_max_compute.cc DEPS ${lite_kernel_deps} math_arm)
4646
add_kernel(sequence_expand_compute_arm ARM basic SRCS sequence_expand_compute.cc DEPS ${lite_kernel_deps} math_arm)
4747
add_kernel(im2sequence_compute_arm ARM basic SRCS im2sequence_compute.cc DEPS ${lite_kernel_deps} math_arm)
4848
add_kernel(sequence_pool_compute_arm ARM basic SRCS sequence_pool_compute.cc DEPS ${lite_kernel_deps} math_arm)
49-
add_kernel(layer_norm_compute_arm ARM basic SRCS layer_norm_compute.cc DEPS ${lite_kernel_deps} math_arm)
50-
add_kernel(gather_compute_arm ARM basic SRCS gather_compute.cc DEPS ${lite_kernel_deps} math_arm)
51-
add_kernel(reduce_mean_compute_arm ARM basic SRCS reduce_mean_compute.cc DEPS ${lite_kernel_deps} math_arm)
52-
add_kernel(stack_compute_arm ARM basic SRCS stack_compute.cc DEPS ${lite_kernel_deps} math_arm)
53-
add_kernel(assign_compute_arm ARM basic SRCS assign_compute.cc DEPS ${lite_kernel_deps} math_arm)
54-
add_kernel(affine_channel_compute_arm ARM basic SRCS affine_channel_compute.cc DEPS ${lite_kernel_deps} math_arm)
55-
add_kernel(anchor_generator_compute_arm ARM basic SRCS anchor_generator_compute.cc DEPS ${lite_kernel_deps} math_arm)
56-
add_kernel(generate_proposals_compute_arm ARM basic SRCS generate_proposals_compute.cc DEPS ${lite_kernel_deps} math_arm)
57-
add_kernel(roi_align_compute_arm ARM basic SRCS roi_align_compute.cc DEPS ${lite_kernel_deps} math_arm)
58-
add_kernel(box_clip_compute_arm ARM basic SRCS box_clip_compute.cc DEPS ${lite_kernel_deps} math_arm)
59-
add_kernel(range_compute_arm ARM basic SRCS range_compute.cc DEPS ${lite_kernel_deps} math_arm)
60-
add_kernel(assign_value_compute_arm ARM basic SRCS assign_value_compute.cc DEPS ${lite_kernel_deps} math_arm)
49+
add_kernel(layer_norm_compute_arm ARM extra SRCS layer_norm_compute.cc DEPS ${lite_kernel_deps} math_arm)
50+
add_kernel(gather_compute_arm ARM extra SRCS gather_compute.cc DEPS ${lite_kernel_deps} math_arm)
51+
add_kernel(reduce_mean_compute_arm ARM extra SRCS reduce_mean_compute.cc DEPS ${lite_kernel_deps} math_arm)
52+
add_kernel(stack_compute_arm ARM extra SRCS stack_compute.cc DEPS ${lite_kernel_deps} math_arm)
53+
add_kernel(assign_compute_arm ARM extra SRCS assign_compute.cc DEPS ${lite_kernel_deps} math_arm)
54+
add_kernel(affine_channel_compute_arm ARM extra SRCS affine_channel_compute.cc DEPS ${lite_kernel_deps} math_arm)
55+
add_kernel(anchor_generator_compute_arm ARM extra SRCS anchor_generator_compute.cc DEPS ${lite_kernel_deps} math_arm)
56+
add_kernel(generate_proposals_compute_arm ARM extra SRCS generate_proposals_compute.cc DEPS ${lite_kernel_deps} math_arm)
57+
add_kernel(roi_align_compute_arm ARM extra SRCS roi_align_compute.cc DEPS ${lite_kernel_deps} math_arm)
58+
add_kernel(box_clip_compute_arm ARM extra SRCS box_clip_compute.cc DEPS ${lite_kernel_deps} math_arm)
59+
add_kernel(range_compute_arm ARM extra SRCS range_compute.cc DEPS ${lite_kernel_deps} math_arm)
60+
add_kernel(assign_value_compute_arm ARM extra SRCS assign_value_compute.cc DEPS ${lite_kernel_deps} math_arm)
6161

6262
# for OCR specific
6363
add_kernel(gru_unit_compute_arm ARM extra SRCS gru_unit_compute.cc DEPS ${lite_kernel_deps} math_arm)

lite/kernels/host/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ message(STATUS "compile with lite host kernels")
33
add_kernel(feed_compute_host Host basic SRCS feed_compute.cc DEPS ${lite_kernel_deps})
44
add_kernel(fetch_compute_host Host basic SRCS fetch_compute.cc DEPS ${lite_kernel_deps})
55
add_kernel(reshape_compute_host Host basic SRCS reshape_compute.cc DEPS ${lite_kernel_deps} reshape_op)
6-
add_kernel(multiclass_nms_compute_host Host basic SRCS multiclass_nms_compute.cc DEPS ${lite_kernel_deps})
6+
add_kernel(multiclass_nms_compute_host Host extra SRCS multiclass_nms_compute.cc DEPS ${lite_kernel_deps})
77

88
#lite_cc_test(test_reshape_compute_host SRCS reshape_compute_test.cc DEPS reshape_compute_host any)
99
#lite_cc_test(test_multiclass_nms_compute_host SRCS multiclass_nms_compute_test.cc DEPS multiclass_nms_compute_host any)

lite/operators/CMakeLists.txt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ lite_cc_library(op_params SRCS op_params.cc DEPS tensor any)
55
add_operator(conv_op basic SRCS conv_op.cc DEPS ${op_DEPS})
66
add_operator(pool_op basic SRCS pool_op.cc DEPS ${op_DEPS})
77
add_operator(fc_op basic SRCS fc_op.cc DEPS ${op_DEPS})
8-
add_operator(assign_op basic SRCS assign_op.cc DEPS ${op_DEPS})
8+
add_operator(assign_op extra SRCS assign_op.cc DEPS ${op_DEPS})
99
add_operator(relu_op basic SRCS relu_op.cc DEPS ${op_DEPS})
1010
add_operator(mul_op basic SRCS mul_op.cc DEPS ${op_DEPS})
1111
add_operator(matmul_op basic SRCS matmul_op.cc DEPS ${op_DEPS})
@@ -59,23 +59,23 @@ add_operator(norm_op basic SRCS norm_op.cc DEPS ${op_DEPS})
5959
add_operator(shape_op_lite basic SRCS shape_op.cc DEPS ${op_DEPS})
6060
add_operator(sequence_expand_op_lite basic SRCS sequence_expand_op.cc DEPS ${op_DEPS})
6161
add_operator(squeeze_op_lite basic SRCS squeeze_op.cc DEPS ${op_DEPS})
62-
add_operator(unsqueeze_op_lite basic SRCS unsqueeze_op.cc DEPS ${op_DEPS})
62+
add_operator(unsqueeze_op_lite extra SRCS unsqueeze_op.cc DEPS ${op_DEPS})
6363
add_operator(im2sequence_op basic SRCS im2sequence_op.cc DEPS ${op_DEPS})
64-
add_operator(gather_op basic SRCS gather_op.cc DEPS ${op_DEPS})
65-
add_operator(reduce_mean_op basic SRCS reduce_mean_op.cc DEPS ${op_DEPS})
66-
add_operator(stack_op basic SRCS stack_op.cc DEPS ${op_DEPS})
67-
add_operator(cast_op_lite basic SRCS cast_op.cc DEPS ${op_DEPS})
68-
add_operator(affine_channel_op basic SRCS affine_channel_op.cc DEPS ${op_DEPS})
69-
add_operator(anchor_generator_op basic SRCS anchor_generator_op.cc DEPS ${op_DEPS})
70-
add_operator(generate_proposals_op basic SRCS generate_proposals_op.cc DEPS ${op_DEPS})
71-
add_operator(roi_align_op basic SRCS roi_align_op.cc DEPS ${op_DEPS})
72-
add_operator(box_clip_op basic SRCS box_clip_op.cc DEPS ${op_DEPS})
73-
add_operator(flatten_op basic SRCS flatten_op.cc DEPS ${op_DEPS})
74-
add_operator(fake_quantize_range_abs_max_op basic SRCS fake_quantize_range_abs_max.cc DEPS ${op_DEPS})
75-
add_operator(sequence_expand_as_op_lite basic SRCS sequence_expand_as_op.cc DEPS ${op_DEPS})
76-
add_operator(range_op basic SRCS range_op.cc DEPS ${op_DEPS})
77-
add_operator(assign_value_op basic SRCS assign_value_op.cc DEPS ${op_DEPS})
78-
add_operator(fake_quantize_dequantize_moving_avg_abs_max_op basic SRCS fake_quantize_dequantize_moving_avg_max_abs.cc DEPS ${op_DEPS})
64+
add_operator(gather_op extra SRCS gather_op.cc DEPS ${op_DEPS})
65+
add_operator(reduce_mean_op extra SRCS reduce_mean_op.cc DEPS ${op_DEPS})
66+
add_operator(stack_op extra SRCS stack_op.cc DEPS ${op_DEPS})
67+
add_operator(cast_op_lite extra SRCS cast_op.cc DEPS ${op_DEPS})
68+
add_operator(affine_channel_op extra SRCS affine_channel_op.cc DEPS ${op_DEPS})
69+
add_operator(anchor_generator_op extra SRCS anchor_generator_op.cc DEPS ${op_DEPS})
70+
add_operator(generate_proposals_op extra SRCS generate_proposals_op.cc DEPS ${op_DEPS})
71+
add_operator(roi_align_op extra SRCS roi_align_op.cc DEPS ${op_DEPS})
72+
add_operator(box_clip_op extra SRCS box_clip_op.cc DEPS ${op_DEPS})
73+
add_operator(flatten_op extra SRCS flatten_op.cc DEPS ${op_DEPS})
74+
add_operator(fake_quantize_range_abs_max_op extra SRCS fake_quantize_range_abs_max.cc DEPS ${op_DEPS})
75+
add_operator(sequence_expand_as_op_lite extra SRCS sequence_expand_as_op.cc DEPS ${op_DEPS})
76+
add_operator(range_op extra SRCS range_op.cc DEPS ${op_DEPS})
77+
add_operator(assign_value_op extra SRCS assign_value_op.cc DEPS ${op_DEPS})
78+
add_operator(fake_quantize_dequantize_moving_avg_abs_max_op extra SRCS fake_quantize_dequantize_moving_avg_max_abs.cc DEPS ${op_DEPS})
7979

8080
# for OCR specific
8181
add_operator(while_op extra SRCS while_op.cc DEPS ${op_DEPS})

lite/tools/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ function make_cuda {
231231
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=OFF \
232232
-DWITH_TESTING=OFF \
233233
-DLITE_WITH_ARM=OFF \
234-
-DLITE_WITH_PYTHON=ON
234+
-DLITE_WITH_PYTHON=ON \
235+
-DLITE_BUILD_EXTRA=ON
235236

236237
make publish_inference_python_lib -j8
237238
cd -

0 commit comments

Comments
 (0)