• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From d78e79cffba557e7050bfea1a602821099d77cdd Mon Sep 17 00:00:00 2001
2From: Zhu Guodong <zhuguodong0001@163.com>
3Date: Fri, 26 May 2023 10:03:43 +0800
4Subject: [PATCH] auto-apply 0017-support-build-training-lib.patch
5
6---
7 .../plugin/device/cpu/kernel/nnacl/BUILD.gn   |  19 +-
8 mindspore/lite/BUILD.gn                       | 230 +++++++++++++++++-
9 .../lite/src/runtime/kernel/cpu/BUILD.gn      | 226 -----------------
10 3 files changed, 243 insertions(+), 232 deletions(-)
11 delete mode 100644 mindspore/lite/src/runtime/kernel/cpu/BUILD.gn
12
13diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/BUILD.gn b/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/BUILD.gn
14index 1156f33d..9acc5b76 100644
15--- a/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/BUILD.gn
16+++ b/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/BUILD.gn
17@@ -197,6 +197,7 @@ fp32_kernel_sources = [
18   "fp32/winograd_avx.c",
19   "fp32/winograd_transform.c",
20   "fp32/winograd_utils.c",
21+  "fp32/custom_gru_fp32.c",
22 ]
23
24 no_fast_math_fp32_kernel_sources = [
25@@ -282,6 +283,7 @@ fp16_kernel_sources = [
26   "fp16/where_fp16.c",
27   "fp16/winograd_transform_fp16.c",
28   "fp16/winograd_utils_fp16.c",
29+  "fp16/custom_gru_fp16.c",
30 ]
31
32 fp16_grad_sources = [
33@@ -480,6 +482,7 @@ infer_shape_sources = [
34   "infer/unsqueeze_infer.c",
35   "infer/unstack_infer.c",
36   "infer/where_infer.c",
37+  "infer/custom_gru_infer.c",
38 ]
39
40 infer_string_sources = [
41@@ -582,7 +585,17 @@ arm32_assembly_sources = [
42   "assembly/arm32/WinogradTransRight.S",
43 ]
44
45-fp16_assembly_sources = [
46+arm32_fp16_assembly_sources = [
47+  "assembly/arm82_aarch32_fp16/Float16Tofloat32.S",
48+  "assembly/arm82_aarch32_fp16/Float32ToFloat16.S",
49+  "assembly/arm82_aarch32_fp16/Matmul12x8Fp16.S",
50+  "assembly/arm82_aarch32_fp16/MatVecMulFp16.S",
51+  "assembly/arm82_aarch32_fp16/TiledC4MatmulFp16.S",
52+  "assembly/arm82_aarch32_fp16/WinogradTransLeft.S",
53+  "assembly/arm82_aarch32_fp16/WinogradTransRight.S",
54+]
55+
56+arm64_fp16_assembly_sources = [
57   "assembly/fp16/ConvDwFp16Border.S",
58   "assembly/fp16/ConvDwFp16Center.S",
59   "assembly/fp16/ConvDwFp16Row.S",
60@@ -702,11 +715,13 @@ nnacl_sources += infer_control_sources
61
62 # source files on arm32
63 arm_only_sources = arm32_assembly_sources
64+#arm_only_sources += arm32_fp16_assembly_sources
65+not_needed(arm32_fp16_assembly_sources)
66
67 # source files on arm64
68 arm64_only_sources = fp16_kernel_sources
69 arm64_only_sources += fp16_grad_sources
70-arm64_only_sources += fp16_assembly_sources
71+arm64_only_sources += arm64_fp16_assembly_sources
72 arm64_only_sources += arm64_assembly_sources
73 arm64_only_sources += optimizing_assembly_sources
74
75diff --git a/mindspore/lite/BUILD.gn b/mindspore/lite/BUILD.gn
76index 4d4af7f6..edb2115e 100644
77--- a/mindspore/lite/BUILD.gn
78+++ b/mindspore/lite/BUILD.gn
79@@ -68,11 +68,13 @@ import("//build/ohos.gni")
80 ohos_group("mindspore") {
81   deps = [
82     ":mindspore_lib",
83+    ":mindspore_train_lib",
84     "mindir:mindir_lib",
85     "src/runtime/js_api:mslite"
86   ]
87 }
88
89+# Inference library
90 cxx_api_sources = [
91   "src/runtime/cxx_api/cell.cc",
92   "src/runtime/cxx_api/context.cc",
93@@ -318,6 +320,8 @@ cpu_kernel_sources = [
94   "src/runtime/kernel/cpu/fp32/unstack_fp32.cc",
95   "src/runtime/kernel/cpu/fp32/where_fp32.cc",
96   "src/runtime/kernel/cpu/fp32/zeroslike_fp32.cc",
97+  "src/runtime/kernel/cpu/fp32/oneslike_fp32.cc",
98+  "src/runtime/kernel/cpu/fp32/custom_gru_fp32.cc",
99 ]
100
101 int8_kernel_sources = [
102@@ -430,8 +434,6 @@ basic_populate_sources = [
103   "src/common/ops/populate/batch_norm_populate.cc",
104   "src/common/ops/populate/batch_to_space_populate.cc",
105   "src/common/ops/populate/bias_add_populate.cc",
106-  "src/common/ops/populate/binary_cross_entropy_grad_populate.cc",
107-  "src/common/ops/populate/binary_cross_entropy_populate.cc",
108   "src/common/ops/populate/broadcast_to_populate.cc",
109   "src/common/ops/populate/call_populate.cc",
110   "src/common/ops/populate/cast_populate.cc",
111@@ -639,7 +641,6 @@ ohos_shared_library("mindspore_lib") {
112   SUPPORT_NNRT = true
113   if (SUPPORT_NNRT) {
114     sources += [
115-      # "mindir/src/mindir_nnrt_lite_graph.cc",
116       "src/runtime/delegate/nnrt/checker/primitive_check.cc",
117       "src/runtime/delegate/nnrt/nnrt_delegate.cc",
118       "src/runtime/delegate/nnrt/nnrt_model_kernel.cc",
119@@ -654,8 +655,9 @@ ohos_shared_library("mindspore_lib") {
120     external_deps += [ "neural_network_runtime:nnrt_target" ]
121     deps += [ "mindir:mindir_lib" ]
122     defines += [ "SUPPORT_NNRT" ]
123-    defines += [ "MSLITE_ENABLE_EXPERIMENTAL_KERNEL" ]
124   }
125+  defines += [ "MSLITE_ENABLE_EXPERIMENTAL_KERNEL" ]
126+  defines += [ "SUPPORT_TRAIN" ]
127   cflags_cc = [
128     "-Wno-ignored-qualifiers",
129     "-Wunused-private-field",
130@@ -667,6 +669,222 @@ ohos_shared_library("mindspore_lib") {
131   part_name = "mindspore"
132 }
133
134+# Train library
135+expression_cxx_api_sources = [
136+  "src/runtime/cxx_api/expression/net.cc",
137+  "src/runtime/cxx_api/expression/net_impl.cc",
138+  "src/runtime/cxx_api/expression/node_impl.cc",
139+]
140+
141+expression_op_sources = [
142+  "src/expression/ops/activation.cc",
143+  "src/expression/ops/adam.cc",
144+  "src/expression/ops/addn.cc",
145+  "src/expression/ops/arithmetic.cc",
146+  "src/expression/ops/arithmetic_self.cc",
147+  "src/expression/ops/assign.cc",
148+  "src/expression/ops/batchnorm.cc",
149+  "src/expression/ops/biasadd.cc",
150+  "src/expression/ops/conv.cc",
151+  "src/expression/ops/dense.cc",
152+  "src/expression/ops/depend.cc",
153+  "src/expression/ops/dropout.cc",
154+  "src/expression/ops/flatten.cc",
155+  "src/expression/ops/pooling.cc",
156+  "src/expression/ops/reduce.cc",
157+  "src/expression/ops/reshape.cc",
158+  "src/expression/ops/softmax.cc",
159+  "src/expression/ops/softmaxCE.cc",
160+  "src/expression/ops/tile.cc",
161+  "src/expression/ops/transpose.cc",
162+]
163+
164+all_expression_sources = [
165+  "src/expression/export.cc",
166+  "src/expression/expr.cc",
167+  "src/expression/import.cc",
168+  "src/expression/net.cc",
169+  "src/expression/node.cc",
170+  "src/expression/ops.cc",
171+  "src/expression/ops_utils.cc",
172+  "src/expression/param.cc",
173+  "src/expression/sequential.cc",
174+]
175+
176+all_expression_sources += expression_cxx_api_sources
177+all_expression_sources += expression_op_sources
178+
179+all_train_sources = [
180+  # ${API_TRAIN_SRC} is empty.
181+  # ${TRAIN_SRC_WITH_MD} is empty.
182+  "src/common/quant_utils.cc",
183+  "src/runtime/cxx_api/metrics/accuracy.cc",
184+  "src/runtime/cxx_api/train/model_build.cc",
185+  "src/runtime/cxx_api/train/model_build_impl.cc",
186+  "src/runtime/cxx_api/train/converters.cc",
187+  "src/runtime/cxx_api/train/train_support.cc",
188+  "src/train/train_populate_parameter.cc",
189+  "src/train/train_session.cc",
190+  "src/train/graph_fusion.cc",
191+  "src/train/graph_dropout.cc",
192+  "src/train/transfer_session.cc",
193+  "src/train/train_utils.cc",
194+  "src/train/loss_monitor.cc",
195+  "src/train/lr_scheduler.cc",
196+  "src/train/accuracy_metrics.cc",
197+#  "src/train/accuracy_monitor.cc", # depends on minddata header, not compiled
198+  "src/train/classification_train_accuracy_monitor.cc",
199+  "src/train/train_export.cc",
200+  "src/train/opt_allocator.cc",
201+  "src/train/optimizer/common/fusion_utils.cc",
202+  "src/train/optimizer/fusion/matmul_activation_fusion_pass.cc",
203+  "src/train/optimizer/fusion/reshape_gather_reshape_fusion_pass.cc",
204+  "src/train/optimizer/fusion/gru_fusion_pass.cc",
205+  "src/common/storage.cc",
206+  "tools/converter/optimizer.cc",
207+  "tools/converter/legacy_optimizer/fusion/fusion_pass.cc",
208+  "tools/converter/legacy_optimizer/fusion/fusion_pattern.cc",
209+  "tools/common/meta_graph_utils.cc",
210+  "tools/converter/legacy_optimizer/fusion/matmul_biasadd_fusion_pass.cc",
211+  "tools/converter/legacy_optimizer/graph/dropout_node_remove_pass.cc",
212+  "tools/converter/legacy_optimizer/graph/isolated_node_remove_pass.cc",
213+  "tools/converter/legacy_optimizer/graph/subgraph_node_pass.cc",
214+]
215+
216+all_train_sources += all_expression_sources
217+
218+fp16_train_kernel_sources = [
219+  "src/runtime/kernel/cpu/fp16_grad/activation_fp16_grad.cc",
220+  "src/runtime/kernel/cpu/fp16_grad/arithmetic_fp16_grad.cc",
221+  "src/runtime/kernel/cpu/fp16_grad/arithmetic_fp16_self_grad.cc",
222+  "src/runtime/kernel/cpu/fp16_grad/bias_fp16_grad.cc",
223+  "src/runtime/kernel/cpu/fp16_grad/bn_fp16_grad.cc",
224+  "src/runtime/kernel/cpu/fp16_grad/convolution_fp16_grad_filter.cc",
225+  "src/runtime/kernel/cpu/fp16_grad/convolution_fp16_grad_input.cc",
226+  "src/runtime/kernel/cpu/fp16_grad/dropout_fp16_grad.cc",
227+  "src/runtime/kernel/cpu/fp16_grad/layernorm_fp16_grad.cc",
228+  "src/runtime/kernel/cpu/fp16_grad/neg_fp16_grad.cc",
229+  "src/runtime/kernel/cpu/fp16_grad/pooling_fp16_grad.cc",
230+  "src/runtime/kernel/cpu/fp16_grad/resize_fp16_grad.cc",
231+  "src/runtime/kernel/cpu/fp16_grad/strided_slice_fp16_grad.cc",
232+  "src/runtime/kernel/cpu/fp16_grad/unsorted_segment_sum_fp16.cc",
233+]
234+
235+fp32_train_kernel_sources = [
236+  "src/runtime/kernel/cpu/fp32_grad/activation_grad.cc",
237+  "src/runtime/kernel/cpu/fp32_grad/adam.cc",
238+  "src/runtime/kernel/cpu/fp32_grad/apply_momentum.cc",
239+  "src/runtime/kernel/cpu/fp32_grad/arithmetic_grad.cc",
240+  "src/runtime/kernel/cpu/fp32_grad/arithmetic_self_grad.cc",
241+  "src/runtime/kernel/cpu/fp32_grad/assign.cc",
242+  "src/runtime/kernel/cpu/fp32_grad/bias_grad.cc",
243+  "src/runtime/kernel/cpu/fp32_grad/bn_grad.cc",
244+  "src/runtime/kernel/cpu/fp32_grad/convolution.cc",
245+  "src/runtime/kernel/cpu/fp32_grad/convolution_grad_filter.cc",
246+  "src/runtime/kernel/cpu/fp32_grad/convolution_grad_input.cc",
247+  "src/runtime/kernel/cpu/fp32_grad/deconvolution_grad_filter.cc",
248+  "src/runtime/kernel/cpu/fp32_grad/dropout.cc",
249+  "src/runtime/kernel/cpu/fp32_grad/dropout_grad.cc",
250+  "src/runtime/kernel/cpu/fp32_grad/layernorm_grad.cc",
251+  "src/runtime/kernel/cpu/fp32_grad/lstm_grad_data_fp32.cc",
252+  "src/runtime/kernel/cpu/fp32_grad/lstm_grad_fp32.cc",
253+  "src/runtime/kernel/cpu/fp32_grad/lstm_grad_weight_fp32.cc",
254+  "src/runtime/kernel/cpu/fp32_grad/neg_grad.cc",
255+  "src/runtime/kernel/cpu/fp32_grad/nllloss_grad.cc",
256+  "src/runtime/kernel/cpu/fp32_grad/pooling_grad.cc",
257+  "src/runtime/kernel/cpu/fp32_grad/power_grad.cc",
258+  "src/runtime/kernel/cpu/fp32_grad/resize_grad.cc",
259+  "src/runtime/kernel/cpu/fp32_grad/sgd.cc",
260+  "src/runtime/kernel/cpu/fp32_grad/sigmoid_cross_entropy_with_logits.cc",
261+  "src/runtime/kernel/cpu/fp32_grad/sigmoid_cross_entropy_with_logits_grad.cc",
262+  "src/runtime/kernel/cpu/fp32_grad/smooth_l1_loss.cc",
263+  "src/runtime/kernel/cpu/fp32_grad/smooth_l1_loss_grad.cc",
264+  "src/runtime/kernel/cpu/fp32_grad/softmax_cross_entropy_with_logits.cc",
265+  "src/runtime/kernel/cpu/fp32_grad/softmax_grad.cc",
266+  "src/runtime/kernel/cpu/fp32_grad/sparse_softmax_cross_entropy_with_logits.cc",
267+  "src/runtime/kernel/cpu/fp32_grad/strided_slice_grad.cc",
268+  "src/runtime/kernel/cpu/fp32_grad/unsorted_segment_sum.cc",
269+  "src/runtime/kernel/cpu/fp32_grad/binary_cross_entropy.cc",
270+  "src/runtime/kernel/cpu/fp32_grad/binary_cross_entropy_grad.cc",
271+]
272+
273+#all_train_sources += fp16_train_kernel_sources
274+not_needed(fp16_train_kernel_sources)
275+all_train_sources += fp32_train_kernel_sources
276+
277+ohos_shared_library("mindspore_train_lib") {
278+  deps = [
279+    ":mindspore_lib",
280+  ]
281+
282+  sources = all_train_sources
283+
284+  include_dirs = [
285+    "//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
286+    "//third_party/flatbuffers/include",
287+    "./",
288+    "../",
289+    "../../",
290+    "../core",
291+    "src",
292+    "src/c_api/",
293+    "../ccsrc/plugin/device/cpu/kernel/",
294+    "../core/mindrt/src/",
295+    "../core/mindrt/include/",
296+    "../../third_party/",
297+    "./schema/",
298+    "../ccsrc/",
299+  ]
300+
301+  defines = [
302+    "ENABLE_MINDRT",
303+    "MS_COMPILE_OHOS",
304+    "PRIMITIVE_WRITEABLE",
305+    "VERSION_STR=\"1.8.1\"",
306+  ]
307+
308+  if (target_cpu == "arm") {
309+    defines += [
310+      "ENABLE_ARM",
311+      "ENABLE_ARM32",
312+      "ENABLE_NEON",
313+    ]
314+  } else if (target_cpu == "arm64") {
315+    defines += [
316+      "ENABLE_ARM",
317+      "ENABLE_ARM64",
318+      "ENABLE_NEON",
319+      "ENABLE_FP16",
320+      "USE_OPENCL_WRAPPER",
321+      "MS_OPENCL_PROFILE=false",
322+      "CL_TARGET_OPENCL_VERSION=200",
323+      "CL_HPP_TARGET_OPENCL_VERSION=120",
324+      "CL_HPP_MINIMUM_OPENCL_VERSION=120",
325+    ]
326+  }
327+  configs = [
328+    ":mindspore_api",
329+    ":disable_android",
330+    ":train_kernel_option",
331+  ]
332+
333+  remove_configs = [ "//build/config/compiler:no_rtti" ]
334+  external_deps = [ "hilog_native:libhilog" ]
335+  output_name = "libmindspore-lite-train"
336+  output_extension = "so"
337+  defines += [ "SUPPORT_TRAIN" ]
338+  cflags_cc = [
339+    "-Wno-ignored-qualifiers",
340+    "-Wunused-private-field",
341+    "-Wno-unused-private-field",
342+    "-Wno-inconsistent-missing-override",
343+    "-Wno-macro-redefined",
344+    "-Wno-constant-conversion",
345+  ]
346+  part_name = "mindspore"
347+}
348+
349+# Build configurations
350 config("opencl_option") {
351   cflags_cc = [ "-Wno-missing-braces" ]
352 }
353@@ -691,3 +909,7 @@ config("disable_android") {
354 config("secure_option") {
355   cflags = [ "-fstack-protector-all" ]
356 }
357+
358+config("train_kernel_option") {
359+  cflags_cc = [ "-fno-finite-math-only" ]
360+}
361diff --git a/mindspore/lite/src/runtime/kernel/cpu/BUILD.gn b/mindspore/lite/src/runtime/kernel/cpu/BUILD.gn
362deleted file mode 100644
363index fa20755f..00000000
364--- a/mindspore/lite/src/runtime/kernel/cpu/BUILD.gn
365+++ /dev/null
366@@ -1,226 +0,0 @@
367-import("//build/ohos.gni")
368-
369-cpu_kernel_sources = [
370-    "cpu_kernel.cc",
371-    "base/argminmax_base.cc",
372-    "base/arithmetic_base.cc",
373-    "base/assert.cc",
374-    "base/call.cc",
375-    "base/concat_base.cc",
376-    "base/constant_of_shape.cc",
377-    "base/convolution_base.cc",
378-    "base/crop_base.cc",
379-    "base/custom_base.cc",
380-    "base/detection_post_process_base.cc",
381-    "base/format_transpose.cc",
382-    "base/gather_base.cc",
383-    "base/group_convolution_base.cc",
384-    "base/group_convolution_creator.cc",
385-    "base/layout_transform.cc",
386-    "base/one_hot_base.cc",
387-    "base/partial_fusion.cc",
388-    "base/pooling_base.cc",
389-    "base/prior_box.cc",
390-    "base/quant_dtype_cast.cc",
391-    "base/random_normal.cc",
392-    "base/reduce_base.cc",
393-    "base/reshape_base.cc",
394-    "base/resize_base.cc",
395-    "base/scatter_nd_base.cc",
396-    "base/select.cc",
397-    "base/slice_base.cc",
398-    "base/softmax_base.cc",
399-    "base/split_base.cc",
400-    "base/split_with_over_lap_base.cc",
401-    "base/stack_base.cc",
402-    "base/strided_slice.cc",
403-    "base/tile_base.cc",
404-    "base/transpose_base.cc",
405-    "fp32/activation_fp32.cc",
406-    "fp32/adder_fp32.cc",
407-    "fp32/addn_fp32.cc",
408-    "fp32/affine_fp32.cc",
409-    "fp32/all_gather_fp32.cc",
410-    "fp32/arithmetic_compare_fp32.cc",
411-    "fp32/arithmetic_fp32.cc",
412-    "fp32/arithmetic_self_fp32.cc",
413-    "fp32/batchnorm_fp32.cc",
414-    "fp32/batch_to_space_fp32.cc",
415-    "fp32/bias_fp32.cc",
416-    "fp32/broadcast_to_fp32.cc",
417-    "fp32/cast_for_x86_fp16.cc",
418-    "fp32/cast_fp32.cc",
419-    "fp32/convolution_1x1_fp32.cc",
420-    "fp32/convolution_delegate_fp32.cc",
421-    "fp32/convolution_depthwise_3x3_fp32.cc",
422-    "fp32/convolution_depthwise_fp32.cc",
423-    "fp32/convolution_depthwise_indirect_fp32.cc",
424-    "fp32/convolution_depthwise_slidewindow_fp32.cc",
425-    "fp32/convolution_depthwise_slidewindow_x86_fp32.cc",
426-    "fp32/convolution_fp32.cc",
427-    "fp32/convolution_slidewindow_avx_fp32.cc",
428-    "fp32/convolution_slidewindow_fp32.cc",
429-    "fp32/convolution_sw_1x1_fp32.cc",
430-    "fp32/convolution_winograd_fp32.cc",
431-    "fp32/crop_and_resize_fp32.cc",
432-    "fp32/crop_fp32.cc",
433-    "fp32/cumsum_fp32.cc",
434-    "fp32/deconvolution_depthwise_fp32.cc",
435-    "fp32/deconvolution_fp32.cc",
436-    "fp32/deconvolution_winograd_fp32.cc",
437-    "fp32/depth_to_space_fp32.cc",
438-    "fp32/detection_post_process_fp32.cc",
439-    "fp32/embedding_lookup_fp32.cc",
440-    "fp32/fill_fp32.cc",
441-    "fp32/fullconnection_fp32.cc",
442-    "fp32/fused_batchnorm_fp32.cc",
443-    "fp32/gather_d_fp32.cc",
444-    "fp32/gather_fp32.cc",
445-    "fp32/gatherNd_fp32.cc",
446-    "fp32/glu_fp32.cc",
447-    "fp32/group_convolution_fp32.cc",
448-    "fp32/groupnorm_fp32.cc",
449-    "fp32/gru_fp32.cc",
450-    "fp32/instance_norm_fp32.cc",
451-    "fp32/invert_permutation_fp32.cc",
452-    "fp32/l2_norm_fp32.cc",
453-    "fp32/layer_norm_fp32.cc",
454-    "fp32/local_response_norm_fp32.cc",
455-    "fp32/log_softmax_fp32.cc",
456-    "fp32/lstm_fp32.cc",
457-    "fp32/matmul_fp32_arm32.cc",
458-    "fp32/matmul_fp32_arm64.cc",
459-    "fp32/matmul_fp32_avx512.cc",
460-    "fp32/matmul_fp32_avx.cc",
461-    "fp32/matmul_fp32_base.cc",
462-    "fp32/matmul_fp32.cc",
463-    "fp32/matmul_fp32_sse.cc",
464-    "fp32/nllloss_fp32.cc",
465-    "fp32/non_max_suppression_fp32.cc",
466-    "fp32/nonzero_fp32.cc",
467-    "fp32/pad_fp32.cc",
468-    "fp32/pooling_fp32.cc",
469-    "fp32/power_fp32.cc",
470-    "fp32/prelu_fp32.cc",
471-    "fp32/ragged_range_fp32.cc",
472-    "fp32/range_fp32.cc",
473-    "fp32/rank_fp32.cc",
474-    "fp32/reduce_fp32.cc",
475-    "fp32/reduce_scatter_fp32.cc",
476-    "fp32/relative_position_attention_fp32.cc",
477-    "fp32/resize_fp32.cc",
478-    "fp32/reverse_fp32.cc",
479-    "fp32/reverse_sequence_fp32.cc",
480-    "fp32/roi_pooling_fp32.cc",
481-    "fp32/scale_fp32.cc",
482-    "fp32/scatter_nd_update_fp32.cc",
483-    "fp32/shape_fp32.cc",
484-    "fp32/shape_fusion_fp32.cc",
485-    "fp32/size_fp32.cc",
486-    "fp32/softmax_fp32.cc",
487-    "fp32/space_to_batch_fp32.cc",
488-    "fp32/space_to_depth_fp32.cc",
489-    "fp32/sparse_to_dense_fp32.cc",
490-    "fp32/splice_fp32.cc",
491-    "fp32/topk_fp32.cc",
492-    "fp32/transpose_fp32.cc",
493-    "fp32/transpose_server_fp32.cc",
494-    "fp32/uniform_real_fp32.cc",
495-    "fp32/unique_fp32.cc",
496-    "fp32/unstack_fp32.cc",
497-    "fp32/where_fp32.cc",
498-    "fp32/zeroslike_fp32.cc",
499-]
500-
501-int8_kernel_sources = [
502-    "int8/activation_int8.cc",
503-    "int8/add_int8.cc",
504-    "int8/argminmax_int8.cc",
505-    "int8/arithmetic_int8.cc",
506-    "int8/arithmetic_self_int8.cc",
507-    "int8/batchnorm_int8.cc",
508-    "int8/batch_to_space_int8.cc",
509-    "int8/concat_int8.cc",
510-    "int8/convolution_1x1_int8.cc",
511-    "int8/convolution_3x3_int8.cc",
512-    "int8/convolution_depthwise_3x3_int8.cc",
513-    "int8/convolution_depthwise_int8.cc",
514-    "int8/convolution_depthwise_slidewindow_int8.cc",
515-    "int8/convolution_int8.cc",
516-    "int8/convolution_int8_creator.cc",
517-    "int8/crop_int8.cc",
518-    "int8/deconvolution_depthwise_int8.cc",
519-    "int8/deconvolution_int8.cc",
520-    "int8/depth_to_space_int8.cc",
521-    "int8/detection_post_process_int8.cc",
522-    "int8/div_int8.cc",
523-    "int8/dynamic_gather_int8.cc",
524-    "int8/dynamic_quant.cc",
525-    "int8/fullconnection_int8.cc",
526-    "int8/gather_int8.cc",
527-    "int8/gatherNd_int8.cc",
528-    "int8/group_convolution_int8.cc",
529-    "int8/hswish_int8.cc",
530-    "int8/l2_norm_int8.cc",
531-    "int8/layer_norm_int8.cc",
532-    "int8/leaky_relu_int8.cc",
533-    "int8/matmul_base_int8.cc",
534-    "int8/matmul_dynamic_base_int8.cc",
535-    "int8/matmul_dynamic_int8.cc",
536-    "int8/matmul_dynamic_sdot_int8.cc",
537-    "int8/matmul_int8.cc",
538-    "int8/mul_int8.cc",
539-    "int8/opt_op_handler.cc",
540-    "int8/pad_int8.cc",
541-    "int8/pooling_int8.cc",
542-    "int8/power_int8.cc",
543-    "int8/reduce_int8.cc",
544-    "int8/relux_int8.cc",
545-    "int8/reshape_int8.cc",
546-    "int8/resize_int8.cc",
547-    "int8/scale_int8.cc",
548-    "int8/sigmoid_int8.cc",
549-    "int8/slice_int8.cc",
550-    "int8/softmax_int8.cc",
551-    "int8/space_to_batch_int8.cc",
552-    "int8/split_int8.cc",
553-    "int8/squeeze_int8.cc",
554-    "int8/sub_int8.cc",
555-    "int8/tanh_int8.cc",
556-    "int8/topk_int8.cc",
557-    "int8/transpose_int8.cc",
558-    "int8/unsqueeze_int8.cc",
559-]
560-
561-int8_kernel_sources -= [
562-    "int8/opt_op_handler.cc"
563-]
564-
565-string_kernel_sources = [
566-    "string/extract_feature.cc",
567-    "string/hashtable_lookup.cc",
568-    "string/lsh_projection.cc",
569-    "string/normalize.cc",
570-    "string/predict.cc",
571-    "string/skip_gram.cc",
572-]
573-
574-control_kernel_sources = [
575-    "control/switch.cc",
576-    "control/switch_layer.cc",
577-    "control/tensor_array.cc",
578-    "control/tensorlist_fromtensor.cc",
579-    "control/tensorlist_getitem.cc",
580-    "control/tensorlist_reserve.cc",
581-    "control/tensorlist_setitem.cc",
582-    "control/tensorlist_stack.cc",
583-]
584-
585-all_cpu_kernel_sources = cpu_kernel_sources
586-all_cpu_kernel_sources += int8_kernel_sources
587-all_cpu_kernel_sources += string_kernel_sources
588-all_cpu_kernel_sources += control_kernel_sources
589-
590-ohos_source_set("cpu_kernel_obj") {
591-    sources = all_cpu_kernel_sources,
592-}
593--
5942.34.1
595
596