diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/BUILD.gn b/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..7bb3769d0b91a21af062af0d7eed58855a7148e5 --- /dev/null +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/BUILD.gn @@ -0,0 +1,306 @@ +# Copyright 2022 Huawei Technologies Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ + +import("//build/ohos.gni") +ohos_source_set("nnacl_o") { + sources = [ + "common_func.c", + "kernel.c", + "nnacl_common.c", + "nnacl_utils.c", + "base/arithmetic_base.c", + "base/batch_to_space_base.c", + "base/broadcast_to.c", + "base/concat_base.c", + "base/conv1x1_base.c", + "base/conv_common_base.c", + "base/depth_to_space_base.c", + "base/fill_base.c", + "base/gather_base.c", + "base/minimal_filtering_generator.c", + "base/slice_base.c", + "base/space_to_depth_base.c", + "base/split_base.c", + "base/split_with_over_lap_base.c", + "base/stack_base.c", + "base/tile_base.c", + "base/transpose_base.c", + "base/unsorted_segment_sum_base.c", + "base/unstack_base.c", + "fp32/activation_fp32.c", + "fp32/adam_fp32.c", + "fp32/adder_fp32.c", + "fp32/add_fp32.c", + "fp32/arg_min_max_fp32.c", + "fp32/arithmetic_compare_fp32.c", + "fp32/arithmetic_fp32.c", + "fp32/arithmetic_self_fp32.c", + "fp32/attention_fp32.c", + "fp32/batchnorm_fp32.c", + "fp32/common_func_fp32.c", + "fp32/conv_1x1_x86_fp32.c", + "fp32/conv_common_fp32.c", + "fp32/conv_depthwise_fp32.c", + "fp32/conv_winograd_fp32.c", + "fp32/crop_fp32.c", + "fp32/cumsum_fp32.c", + "fp32/deconv_fp32.c", + "fp32/deconv_winograd_fp32.c", + "fp32/detection_post_process_fp32.c", + "fp32/div_fp32.c", + "fp32/embedding_lookup_fp32.c", + "fp32/exp_fp32.c", + "fp32/gatherNd_fp32.c", + "fp32/gru_fp32.c", + "fp32/instance_norm_fp32.c", + "fp32/invert_permutation_fp32.c", + "fp32/l2_norm_fp32.c", + "fp32/layer_norm_fp32.c", + "fp32/local_response_norm_fp32.c", + "fp32/log_softmax_fp32.c", + "fp32/lstm_fp32.c", + "fp32/matmul_avx512_fp32.c", + "fp32/matmul_fp32.c", + "fp32/mul_fp32.c", + "fp32/one_hot_fp32.c", + "fp32/pack_fp32.c", + "fp32/pad_fp32.c", + "fp32/pooling_fp32.c", + "fp32/power_fp32.c", + "fp32/prelu_fp32.c", + "fp32/ragged_range_fp32.c", + "fp32/reduce_fp32.c", + "fp32/resize_fp32.c", + "fp32/reverse_fp32.c", + "fp32/reverse_sequence_fp32.c", + "fp32/rmsprop_fp32.c", + "fp32/roi_pooling_fp32.c", + "fp32/scale_fp32.c", + "fp32/scatter_nd_fp32.c", + "fp32/softmax_fp32.c", + "fp32/space_to_batch_fp32.c", + "fp32/sparse_to_dense_fp32.c", + "fp32/splice_fp32.c", + "fp32/squared_difference.c", + "fp32/strided_slice_fp32.c", + "fp32/sub_fp32.c", + "fp32/topk_fp32.c", + "fp32/transpose_fp32.c", + "fp32/unique_fp32.c", + "fp32/where_fp32.c", + "fp32/winograd_avx.c", + "fp32/winograd_transform.c", + "fp32/winograd_utils.c", + "fp32_grad/activation_grad.c", + "fp32_grad/arithmetic_grad.c", + "fp32_grad/batch_norm.c", + "fp32_grad/binary_cross_entropy.c", + "fp32_grad/binary_cross_entropy_grad.c", + "fp32_grad/convolution_grad_filter.c", + "fp32_grad/convolution_grad_input.c", + "fp32_grad/dropout_grad.c", + "fp32_grad/gemm.c", + "fp32_grad/layernorm_grad.c", + "fp32_grad/lstm_grad_fp32.c", + "fp32_grad/pack_ext.c", + "fp32_grad/pooling_grad.c", + "fp32_grad/reduce_grad.c", + "fp32_grad/resize_grad.c", + "fp32_grad/softmax.c", + "fp32_grad/softmax_grad.c", + "fp32_grad/strided_slice_grad.c", + "fp32_sparse/matmul_sparse_x1_fp32.c", + "infer/control/tensor_array_infer.c", + "infer/control/tensor_array_read_infer.c", + "infer/control/tensor_array_write_infer.c", + "infer/control/tensorlist_fromtensor_infer.c", + "infer/control/tensorlist_getitem_infer.c", + "infer/control/tensorlist_reserve_infer.c", + "infer/control/tensorlist_setitem_infer.c", + "infer/control/tensorlist_stack_infer.c", + "infer/string/custom_extract_features_infer.c", + "infer/string/custom_normalize_infer.c", + "infer/string/custom_predict_infer.c", + "infer/string/hashtable_lookup_infer.c", + "infer/string/lsh_projection_infer.c", + "infer/string/skip_gram_infer.c", + "infer/adam_infer.c", + "infer/addn_infer.c", + "infer/add_sub_grad_infer.c", + "infer/affine_infer.c", + "infer/all_gather.c", + "infer/apply_momentum_infer.c", + "infer/argmin_max_infer.c", + "infer/arithmetic_compare_infer.c", + "infer/arithmetic_grad_infer.c", + "infer/arithmetic_infer.c", + "infer/assert_op_infer.c", + "infer/assign_add_infer.c", + "infer/assign_infer.c", + "infer/attention_infer.c", + "infer/audio_spectrogram_infer.c", + "infer/batch_to_space_infer.c", + "infer/bias_grad_infer.c", + "infer/binary_cross_entropy_infer.c", + "infer/bn_grad_infer.c", + "infer/broadcast_to_infer.c", + "infer/cast_infer.c", + "infer/common_infer.c", + "infer/concat_infer.c", + "infer/constant_of_shape_infer.c", + "infer/conv2d_grad_filter_infer.c", + "infer/conv2d_grad_input_infer.c", + "infer/conv2d_infer.c", + "infer/crop_and_resize_infer.c", + "infer/crop_infer.c", + "infer/cumsum_infer.c", + "infer/deconv2d_infer.c", + "infer/depth_to_space_infer.c", + "infer/depthwise_conv2d_infer.c", + "infer/detection_post_process_infer.c", + "infer/dropout_grad_infer.c", + "infer/dropout_infer.c", + "infer/embedding_lookup_infer.c", + "infer/expand_dims_infer.c", + "infer/fft_imag_infer.c", + "infer/fft_real_infer.c", + "infer/fill_infer.c", + "infer/flatten_grad_infer.c", + "infer/flatten_infer.c", + "infer/full_connection_infer.c", + "infer/fused_batchnorm_infer.c", + "infer/gather_infer.c", + "infer/gather_nd_infer.c", + "infer/glu_infer.c", + "infer/group_conv2d_grad_input_infer.c", + "infer/gru_infer.c", + "infer/infer_register.c", + "infer/instance_norm_infer.c", + "infer/invert_permutation_infer.c", + "infer/layer_norm_grad_infer.c", + "infer/layer_norm_infer.c", + "infer/lin_space_infer.c", + "infer/log_softmax_infer.c", + "infer/lstm_grad_infer.c", + "infer/lstm_infer.c", + "infer/matmul_infer.c", + "infer/max_min_grad_infer.c", + "infer/mean_infer.c", + "infer/mfcc_infer.c", + "infer/non_max_suppression_infer.c", + "infer/one_hot_infer.c", + "infer/pad_infer.c", + "infer/partial_infer.c", + "infer/pooling_grad_infer.c", + "infer/pooling_infer.c", + "infer/power_infer.c", + "infer/prior_box_infer.c", + "infer/quant_dtype_cast_infer.c", + "infer/ragged_range_infer.c", + "infer/random_standard_normal_infer.c", + "infer/range_infer.c", + "infer/rank_infer.c", + "infer/reduce_infer.c", + "infer/reduce_scatter.c", + "infer/reshape_infer.c", + "infer/resize_grad_infer.c", + "infer/resize_infer.c", + "infer/rfft_infer.c", + "infer/roi_pooling_infer.c", + "infer/scatter_nd_infer.c", + "infer/scatter_nd_update_infer.c", + "infer/select_infer.c", + "infer/sgd_infer.c", + "infer/shape_infer.c", + "infer/size_infer.c", + "infer/slice_infer.c", + "infer/softmax_cross_entropy_infer.c", + "infer/softmax_infer.c", + "infer/space_to_batch_infer.c", + "infer/space_to_batch_nd_infer.c", + "infer/space_to_depth_infer.c", + "infer/sparse_softmax_cross_entropy_with_logits_infer.c", + "infer/sparse_to_dense_infer.c", + "infer/splice_infer.c", + "infer/split_infer.c", + "infer/split_with_over_lap_infer.c", + "infer/squeeze_infer.c", + "infer/stack_infer.c", + "infer/strided_slice_grad_infer.c", + "infer/strided_slice_infer.c", + "infer/tile_infer.c", + "infer/topk_infer.c", + "infer/transpose_infer.c", + "infer/uniform_real_infer.c", + "infer/unique_infer.c", + "infer/unsorted_segment_sum_infer.c", + "infer/unsqueeze_infer.c", + "infer/unstack_infer.c", + "infer/where_infer.c", + "int8/add_int8.c", + "int8/arg_min_max_int8.c", + "int8/arithmetic_int8.c", + "int8/arithmetic_self_int8.c", + "int8/batchnorm_int8.c", + "int8/batch_to_space_int8.c", + "int8/common_func_int8.c", + "int8/concat_int8.c", + "int8/conv1x1_int8.c", + "int8/conv3x3_int8.c", + "int8/conv_depthwise_int8.c", + "int8/conv_int8.c", + "int8/crop_int8.c", + "int8/deconv_int8.c", + "int8/depth_to_space_int8.c", + "int8/div_int8.c", + "int8/fixed_point.c", + "int8/gather_int8.c", + "int8/gatherNd_int8.c", + "int8/hswish_int8.c", + "int8/l2_norm_int8.c", + "int8/layer_norm_int8.c", + "int8/leaky_relu_int8.c", + "int8/matmul_int8.c", + "int8/mul_int8.c", + "int8/pack_int8.c", + "int8/pad_int8.c", + "int8/pooling_int8.c", + "int8/power_int8.c", + "int8/quant_dtype_cast_int8.c", + "int8/quantize.c", + "int8/reduce_int8.c", + "int8/relux_int8.c", + "int8/reshape_int8.c", + "int8/resize_int8.c", + "int8/scale_int8.c", + "int8/sigmoid_int8.c", + "int8/slice_int8.c", + "int8/softmax_int8.c", + "int8/space_to_batch_int8.c", + "int8/split_int8.c", + "int8/squeeze_int8.c", + "int8/sub_int8.c", + "int8/tanh_int8.c", + "int8/topk_int8.c", + "int8/transpose_int8.c", + "int8/unsqueeze_int8.c", + ] + + include_dirs = [ + "../", + ] + + part_name = "mindspore" +} diff --git a/mindspore/lite/BUILD.gn b/mindspore/lite/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..801db83f36b49b3212871560d95595c8293589e8 --- /dev/null +++ b/mindspore/lite/BUILD.gn @@ -0,0 +1,721 @@ +# Copyright 2022 Huawei Technologies Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ + +import("//build/ohos.gni") + +ohos_group("mindspore") { + deps = [ + ":mindspore_lib", + "tools/benchmark:benchmark_bin", + ] +} + +ohos_shared_library("mindspore_lib") { + sources = [ + "../core/utils/status.cc", + "src/c_api/context_c.cc", + "src/c_api/model_c.cc", + "src/c_api/tensor_c.cc", + "src/common/config_file.cc", + "src/common/context_util.cc", + "src/common/dynamic_library_loader.cc", + "src/common/file_utils.cc", + "src/common/graph_util.cc", + "src/common/lite_utils.cc", + "src/common/log.cc", + "src/common/prim_util.cc", + "src/common/quant_utils.cc", + "src/common/string_util.cc", + "src/common/tensor_util.cc", + "src/common/utils.cc", + "src/control_flow/actor/entrance_actor.cc", + "src/control_flow/actor/exit_actor.cc", + "src/control_flow/actor/switch_actor.cc", + "src/control_flow/control_flow_scheduler.cc", + "src/control_flow/entrance_subgraph_kernel.cc", + "src/control_flow/exit_subgraph_kernel.cc", + "src/control_flow/identity_kernel.cc", + "src/cpu_info.cc", + "src/cxx_api/cell.cc", + "src/cxx_api/context.cc", + "src/cxx_api/converters.cc", + "src/cxx_api/graph/graph.cc", + "src/cxx_api/kernel.cc", + "src/cxx_api/model/model.cc", + "src/cxx_api/model/model_impl.cc", + "src/cxx_api/serialization.cc", + "src/cxx_api/tensor/tensor_impl.cc", + "src/cxx_api/tensor_utils.cc", + "src/cxx_api/types.cc", + "src/delegate/tensorrt/distribution/distribution_base.cc", + "src/errorcode.cc", + "src/executor.cc", + "src/huffman_decode.cc", + "src/inner_context.cc", + "src/inner_kernel.cc", + "src/kernel_registry.cc", + "src/lite_kernel.cc", + "src/lite_kernel_util.cc", + "src/lite_mindrt.cc", + "src/lite_model.cc", + "src/lite_session.cc", + "src/mindrt_executor.cc", + "src/ms_tensor.cc", + "src/ops/compat/attr_transfer_common.cc", + "src/ops/compat/v0/broadcast_to_compat_v0.cc", + "src/ops/compat/v0/cast_compat_v0.cc", + "src/ops/compat/v0/expand_dims_compat_v0.cc", + "src/ops/compat/v0/fill_compat_v0.cc", + "src/ops/compat/v0/gather_compat_v0.cc", + "src/ops/compat/v0/nchw2nhwc_compat_v0.cc", + "src/ops/compat/v0/nhwc2nchw_compat_v0.cc", + "src/ops/compat/v0/pad_compat_v0.cc", + "src/ops/compat/v0/permute_compat_v0.cc", + "src/ops/compat/v0/power_compat_v0.cc", + "src/ops/compat/v0/reduce_compat_v0.cc", + "src/ops/compat/v0/reshape_compat_v0.cc", + "src/ops/compat/v0/slice_compat_v0.cc", + "src/ops/compat/v0/strided_slice_compat_v0.cc", + "src/ops/compat/v0/tile_compat_v0.cc", + "src/ops/compat/v0/topk_compat_v0.cc", + "src/ops/compat/v0/transpose_compat_v0.cc", + "src/ops/ops_def.cc", + "src/ops/ops_utils.cc", + "src/ops/populate/activation_grad_populate.cc", + "src/ops/populate/activation_populate.cc", + "src/ops/populate/adam_populate.cc", + "src/ops/populate/add_populate.cc", + "src/ops/populate/adder_populate.cc", + "src/ops/populate/affine_populate.cc", + "src/ops/populate/all_gather.cc", + "src/ops/populate/argmax_populate.cc", + "src/ops/populate/argmin_populate.cc", + "src/ops/populate/arithmetic_populate.cc", + "src/ops/populate/arithmetic_self_populate.cc", + "src/ops/populate/assert_populate.cc", + "src/ops/populate/assign_add_populate.cc", + "src/ops/populate/assign_populate.cc", + "src/ops/populate/audio_spectrogram_populate.cc", + "src/ops/populate/batch_norm_populate.cc", + "src/ops/populate/batch_to_space_populate.cc", + "src/ops/populate/bias_add_populate.cc", + "src/ops/populate/binary_cross_entropy_grad_populate.cc", + "src/ops/populate/binary_cross_entropy_populate.cc", + "src/ops/populate/broadcast_to_populate.cc", + "src/ops/populate/call_populate.cc", + "src/ops/populate/cast_populate.cc", + "src/ops/populate/clip_populate.cc", + "src/ops/populate/common_populate.cc", + "src/ops/populate/concat_populate.cc", + "src/ops/populate/constant_of_shape_populate.cc", + "src/ops/populate/control/switch_populate.cc", + "src/ops/populate/control/tensor_array_populate.cc", + "src/ops/populate/control/tensorlistfromtensor_populate.cc", + "src/ops/populate/control/tensorlistgetitem_populate.cc", + "src/ops/populate/control/tensorlistreserve_populate.cc", + "src/ops/populate/control/tensorlistsetlitem_populate.cc", + "src/ops/populate/control/tensorliststack_populate.cc", + "src/ops/populate/conv2d_populate.cc", + "src/ops/populate/crop_and_resize_populate.cc", + "src/ops/populate/crop_populate.cc", + "src/ops/populate/cumsum_populate.cc", + "src/ops/populate/deconv2d_populate.cc", + "src/ops/populate/default_populate.cc", + "src/ops/populate/depth_to_space_populate.cc", + "src/ops/populate/detection_post_process_populate.cc", + "src/ops/populate/div_populate.cc", + "src/ops/populate/eltwise_populate.cc", + "src/ops/populate/embedding_lookup_populate.cc", + "src/ops/populate/erf_populate.cc", + "src/ops/populate/exp_populate.cc", + "src/ops/populate/expand_dims_populate.cc", + "src/ops/populate/fill_populate.cc", + "src/ops/populate/flatten_populate.cc", + "src/ops/populate/full_connection_populate.cc", + "src/ops/populate/fused_batchnorm_populate.cc", + "src/ops/populate/gather_nd_populate.cc", + "src/ops/populate/gather_populate.cc", + "src/ops/populate/glu_populate.cc", + "src/ops/populate/gru_populate.cc", + "src/ops/populate/instance_norm_populate.cc", + "src/ops/populate/invert_permutation_populate.cc", + "src/ops/populate/isfinite_populate.cc", + "src/ops/populate/l2_norm_populate.cc", + "src/ops/populate/layer_norm_grad_populate.cc", + "src/ops/populate/layer_norm_populate.cc", + "src/ops/populate/lin_space_populate.cc", + "src/ops/populate/local_response_normalization_populate.cc", + "src/ops/populate/log_softmax_populate.cc", + "src/ops/populate/lstm_populate.cc", + "src/ops/populate/matmul_populate.cc", + "src/ops/populate/mfcc_populate.cc", + "src/ops/populate/mul_populate.cc", + "src/ops/populate/non_max_suppression_populate.cc", + "src/ops/populate/nonzero_populate.cc", + "src/ops/populate/one_hot_populate.cc", + "src/ops/populate/oneslike_populate.cc", + "src/ops/populate/p_relu_populate.cc", + "src/ops/populate/pad_populate.cc", + "src/ops/populate/partial_populate.cc", + "src/ops/populate/pooling_populate.cc", + "src/ops/populate/populate_register.cc", + "src/ops/populate/power_populate.cc", + "src/ops/populate/prior_box_populate.cc", + "src/ops/populate/quant_dtype_cast_populate.cc", + "src/ops/populate/ragged_range_populate.cc", + "src/ops/populate/random_standard_normal_populate.cc", + "src/ops/populate/range_populate.cc", + "src/ops/populate/rank_populate.cc", + "src/ops/populate/reduce_populate.cc", + "src/ops/populate/reduce_scatter.cc", + "src/ops/populate/reshape_populate.cc", + "src/ops/populate/resize_populate.cc", + "src/ops/populate/reverse_populate.cc", + "src/ops/populate/reverse_sequence_populate.cc", + "src/ops/populate/roi_pooling_populate.cc", + "src/ops/populate/scale_populate.cc", + "src/ops/populate/scatter_nd_populate.cc", + "src/ops/populate/scatter_nd_update_populate.cc", + "src/ops/populate/select_populate.cc", + "src/ops/populate/shape_populate.cc", + "src/ops/populate/size_populate.cc", + "src/ops/populate/slice_populate.cc", + "src/ops/populate/softmax_populate.cc", + "src/ops/populate/space_to_batch_nd_populate.cc", + "src/ops/populate/space_to_batch_populate.cc", + "src/ops/populate/space_to_depth_populate.cc", + "src/ops/populate/sparse_softmax_cross_entropy_with_logits.cc", + "src/ops/populate/sparse_to_dense_populate.cc", + "src/ops/populate/splice_populate.cc", + "src/ops/populate/split_populate.cc", + "src/ops/populate/split_with_overlap_populate.cc", + "src/ops/populate/squeeze_populate.cc", + "src/ops/populate/stack_populate.cc", + "src/ops/populate/strided_slice_grad_populate.cc", + "src/ops/populate/strided_slice_populate.cc", + "src/ops/populate/string/custom_extract_features_populate.cc", + "src/ops/populate/string/custom_normalize_populate.cc", + "src/ops/populate/string/custom_predict_populate.cc", + "src/ops/populate/string/hashtable_lookup_populate.cc", + "src/ops/populate/string/lsh_projection_populate.cc", + "src/ops/populate/string/skip_gram_populate.cc", + "src/ops/populate/sub_populate.cc", + "src/ops/populate/tile_populate.cc", + "src/ops/populate/topk_populate.cc", + "src/ops/populate/transpose_populate.cc", + "src/ops/populate/uniform_real_populate.cc", + "src/ops/populate/unique_populate.cc", + "src/ops/populate/unsorted_segment_sum_populate.cc", + "src/ops/populate/unsqueeze_populate.cc", + "src/ops/populate/unstack_populate.cc", + "src/ops/populate/v0/activation_grad_populate_v0.cc", + "src/ops/populate/v0/activation_populate_v0.cc", + "src/ops/populate/v0/adam_populate_v0.cc", + "src/ops/populate/v0/add_populate_v0.cc", + "src/ops/populate/v0/addn_populate_v0.cc", + "src/ops/populate/v0/argmax_populate_v0.cc", + "src/ops/populate/v0/argmin_populate_v0.cc", + "src/ops/populate/v0/arithmetic_populate_v0.cc", + "src/ops/populate/v0/arithmetic_self_populate_v0.cc", + "src/ops/populate/v0/assert_populate_v0.cc", + "src/ops/populate/v0/assign_add_populate_v0.cc", + "src/ops/populate/v0/assign_populate_v0.cc", + "src/ops/populate/v0/batch_norm_populate_v0.cc", + "src/ops/populate/v0/batch_to_space_populate_v0.cc", + "src/ops/populate/v0/bias_add_populate_v0.cc", + "src/ops/populate/v0/bias_grad_populate_v0.cc", + "src/ops/populate/v0/binary_cross_entropy_grad_populate_v0.cc", + "src/ops/populate/v0/binary_cross_entropy_populate_v0.cc", + "src/ops/populate/v0/broadcast_to_populate_v0.cc", + "src/ops/populate/v0/cast_populate_v0.cc", + "src/ops/populate/v0/clip_populate_v0.cc", + "src/ops/populate/v0/common_populate_v0.cc", + "src/ops/populate/v0/concat_populate_v0.cc", + "src/ops/populate/v0/constant_of_shape_populate_v0.cc", + "src/ops/populate/v0/control/switch_populate_v0.cc", + "src/ops/populate/v0/control/tensorlistfromtensor_populate_v0.cc", + "src/ops/populate/v0/control/tensorlistgetitem_populate_v0.cc", + "src/ops/populate/v0/control/tensorlistreserve_populate_v0.cc", + "src/ops/populate/v0/control/tensorlistsetlitem_populate_v0.cc", + "src/ops/populate/v0/control/tensorliststack_populate_v0.cc", + "src/ops/populate/v0/conv2d_populate_v0.cc", + "src/ops/populate/v0/crop_populate_v0.cc", + "src/ops/populate/v0/deconv2d_populate_v0.cc", + "src/ops/populate/v0/dedepthwise_conv2d_populate_v0.cc", + "src/ops/populate/v0/depth_to_space_populate_v0.cc", + "src/ops/populate/v0/depthwise_conv2d_populate_v0.cc", + "src/ops/populate/v0/detection_post_process_populate_v0.cc", + "src/ops/populate/v0/div_populate_v0.cc", + "src/ops/populate/v0/eltwise_populate_v0.cc", + "src/ops/populate/v0/embedding_lookup_populate_v0.cc", + "src/ops/populate/v0/exp_populate_v0.cc", + "src/ops/populate/v0/expand_dims_populate_v0.cc", + "src/ops/populate/v0/fill_populate_v0.cc", + "src/ops/populate/v0/flatten_populate_v0.cc", + "src/ops/populate/v0/full_connection_populate_v0.cc", + "src/ops/populate/v0/fused_batchnorm_populate_v0.cc", + "src/ops/populate/v0/gather_nd_populate_v0.cc", + "src/ops/populate/v0/gather_populate_v0.cc", + "src/ops/populate/v0/gelu_populate_v0.cc", + "src/ops/populate/v0/instance_norm_populate_v0.cc", + "src/ops/populate/v0/l2_norm_populate_v0.cc", + "src/ops/populate/v0/layer_norm_populate_v0.cc", + "src/ops/populate/v0/local_response_normalization_populate_v0.cc", + "src/ops/populate/v0/lstm_populate_v0.cc", + "src/ops/populate/v0/matmul_populate_v0.cc", + "src/ops/populate/v0/mul_populate_v0.cc", + "src/ops/populate/v0/nchw2nhwc_populate_v0.cc", + "src/ops/populate/v0/nhwc2nchw_populate_v0.cc", + "src/ops/populate/v0/non_max_suppression_populate_v0.cc", + "src/ops/populate/v0/one_hot_populate_v0.cc", + "src/ops/populate/v0/oneslike_populate_v0.cc", + "src/ops/populate/v0/p_relu_populate_v0.cc", + "src/ops/populate/v0/pad_populate_v0.cc", + "src/ops/populate/v0/partial_populate_v0.cc", + "src/ops/populate/v0/pooling_populate_v0.cc", + "src/ops/populate/v0/power_populate_v0.cc", + "src/ops/populate/v0/prior_box_populate_v0.cc", + "src/ops/populate/v0/quant_dtype_cast_populate_v0.cc", + "src/ops/populate/v0/range_populate_v0.cc", + "src/ops/populate/v0/rank_populate_v0.cc", + "src/ops/populate/v0/reduce_populate_v0.cc", + "src/ops/populate/v0/reshape_populate_v0.cc", + "src/ops/populate/v0/resize_populate_v0.cc", + "src/ops/populate/v0/reverse_populate_v0.cc", + "src/ops/populate/v0/reverse_sequence_populate_v0.cc", + "src/ops/populate/v0/roi_pooling_populate_v0.cc", + "src/ops/populate/v0/scale_populate_v0.cc", + "src/ops/populate/v0/scatter_nd_populate_v0.cc", + "src/ops/populate/v0/shape_populate_v0.cc", + "src/ops/populate/v0/slice_populate_v0.cc", + "src/ops/populate/v0/softmax_populate_v0.cc", + "src/ops/populate/v0/space_to_batch_nd_populate_v0.cc", + "src/ops/populate/v0/space_to_batch_populate_v0.cc", + "src/ops/populate/v0/space_to_depth_populate_v0.cc", + "src/ops/populate/v0/sparse_to_dense_populate_v0.cc", + "src/ops/populate/v0/split_populate_v0.cc", + "src/ops/populate/v0/squared_difference_populate_v0.cc", + "src/ops/populate/v0/squeeze_populate_v0.cc", + "src/ops/populate/v0/stack_populate_v0.cc", + "src/ops/populate/v0/strided_slice_populate_v0.cc", + "src/ops/populate/v0/string/custom_extract_features_populate_v0.cc", + "src/ops/populate/v0/string/custom_normalize_populate_v0.cc", + "src/ops/populate/v0/string/custom_predict_populate_v0.cc", + "src/ops/populate/v0/string/hashtable_lookup_populate_v0.cc", + "src/ops/populate/v0/string/lsh_projection_populate_v0.cc", + "src/ops/populate/v0/string/skip_gram_populate_v0.cc", + "src/ops/populate/v0/sub_populate_v0.cc", + "src/ops/populate/v0/tile_populate_v0.cc", + "src/ops/populate/v0/topk_populate_v0.cc", + "src/ops/populate/v0/transpose_populate_v0.cc", + "src/ops/populate/v0/unique_populate_v0.cc", + "src/ops/populate/v0/unsorted_segment_sum_populate_v0.cc", + "src/ops/populate/v0/unsqueeze_populate_v0.cc", + "src/ops/populate/v0/unstack_populate_v0.cc", + "src/ops/populate/v0/where_populate_v0.cc", + "src/ops/populate/where_populate.cc", + "src/registry/kernel_interface_registry.cc", + "src/registry/register_kernel.cc", + "src/registry/register_kernel_impl.cc", + "src/registry/register_kernel_interface.cc", + "src/runtime/infer_manager.cc", + "src/runtime/inner_allocator.cc", + "src/runtime/kernel/arm/base/argminmax_base.cc", + "src/runtime/kernel/arm/base/assert.cc", + "src/runtime/kernel/arm/base/call.cc", + "src/runtime/kernel/arm/base/constant_of_shape.cc", + "src/runtime/kernel/arm/base/convolution_base.cc", + "src/runtime/kernel/arm/base/crop_base.cc", + "src/runtime/kernel/arm/base/detection_post_process_base.cc", + "src/runtime/kernel/arm/base/group_convolution_base.cc", + "src/runtime/kernel/arm/base/group_convolution_creator.cc", + "src/runtime/kernel/arm/base/layout_transform.cc", + "src/runtime/kernel/arm/base/one_hot_base.cc", + "src/runtime/kernel/arm/base/partial_fusion.cc", + "src/runtime/kernel/arm/base/pooling_base.cc", + "src/runtime/kernel/arm/base/prior_box.cc", + "src/runtime/kernel/arm/base/quant_dtype_cast.cc", + "src/runtime/kernel/arm/base/random_standard_normal.cc", + "src/runtime/kernel/arm/base/reduce_base.cc", + "src/runtime/kernel/arm/base/reshape_base.cc", + "src/runtime/kernel/arm/base/resize_base.cc", + "src/runtime/kernel/arm/base/select.cc", + "src/runtime/kernel/arm/base/slice_base.cc", + "src/runtime/kernel/arm/base/softmax_base.cc", + "src/runtime/kernel/arm/base/split_base.cc", + "src/runtime/kernel/arm/base/split_with_over_lap_base.cc", + "src/runtime/kernel/arm/base/stack_base.cc", + "src/runtime/kernel/arm/base/strided_slice.cc", + "src/runtime/kernel/arm/base/tile_base.cc", + "src/runtime/kernel/arm/control/switch.cc", + "src/runtime/kernel/arm/control/switch_layer.cc", + "src/runtime/kernel/arm/control/tensor_array.cc", + "src/runtime/kernel/arm/control/tensorlist_fromtensor.cc", + "src/runtime/kernel/arm/control/tensorlist_getitem.cc", + "src/runtime/kernel/arm/control/tensorlist_reserve.cc", + "src/runtime/kernel/arm/control/tensorlist_setitem.cc", + "src/runtime/kernel/arm/control/tensorlist_stack.cc", + "src/runtime/kernel/arm/fp32/activation_fp32.cc", + "src/runtime/kernel/arm/fp32/adder_fp32.cc", + "src/runtime/kernel/arm/fp32/addn_fp32.cc", + "src/runtime/kernel/arm/fp32/affine_fp32.cc", + "src/runtime/kernel/arm/fp32/all_gather_fp32.cc", + "src/runtime/kernel/arm/fp32/arithmetic_compare_fp32.cc", + "src/runtime/kernel/arm/fp32/arithmetic_fp32.cc", + "src/runtime/kernel/arm/fp32/arithmetic_self_fp32.cc", + "src/runtime/kernel/arm/fp32/batch_to_space_fp32.cc", + "src/runtime/kernel/arm/fp32/batchnorm_fp32.cc", + "src/runtime/kernel/arm/fp32/bias_fp32.cc", + "src/runtime/kernel/arm/fp32/broadcast_to_fp32.cc", + "src/runtime/kernel/arm/fp32/cast_fp32.cc", + "src/runtime/kernel/arm/fp32/concat_fp32.cc", + "src/runtime/kernel/arm/fp32/convolution_1x1_fp32.cc", + "src/runtime/kernel/arm/fp32/convolution_delegate_fp32.cc", + "src/runtime/kernel/arm/fp32/convolution_depthwise_3x3_fp32.cc", + "src/runtime/kernel/arm/fp32/convolution_depthwise_fp32.cc", + "src/runtime/kernel/arm/fp32/convolution_depthwise_indirect_fp32.cc", + "src/runtime/kernel/arm/fp32/convolution_depthwise_slidewindow_fp32.cc", + "src/runtime/kernel/arm/fp32/convolution_depthwise_slidewindow_x86_fp32.cc", + "src/runtime/kernel/arm/fp32/convolution_fp32.cc", + "src/runtime/kernel/arm/fp32/convolution_slidewindow_fp32.cc", + "src/runtime/kernel/arm/fp32/convolution_winograd_fp32.cc", + "src/runtime/kernel/arm/fp32/crop_and_resize_fp32.cc", + "src/runtime/kernel/arm/fp32/crop_fp32.cc", + "src/runtime/kernel/arm/fp32/cumsum_fp32.cc", + "src/runtime/kernel/arm/fp32/deconvolution_depthwise_fp32.cc", + "src/runtime/kernel/arm/fp32/deconvolution_fp32.cc", + "src/runtime/kernel/arm/fp32/deconvolution_winograd_fp32.cc", + "src/runtime/kernel/arm/fp32/depth_to_space_fp32.cc", + "src/runtime/kernel/arm/fp32/detection_post_process_fp32.cc", + "src/runtime/kernel/arm/fp32/embedding_lookup_fp32.cc", + "src/runtime/kernel/arm/fp32/exp_fp32.cc", + "src/runtime/kernel/arm/fp32/fill_fp32.cc", + "src/runtime/kernel/arm/fp32/fullconnection_fp32.cc", + "src/runtime/kernel/arm/fp32/fused_batchnorm_fp32.cc", + "src/runtime/kernel/arm/fp32/gatherNd_fp32.cc", + "src/runtime/kernel/arm/fp32/gather_fp32.cc", + "src/runtime/kernel/arm/fp32/glu_fp32.cc", + "src/runtime/kernel/arm/fp32/group_convolution_fp32.cc", + "src/runtime/kernel/arm/fp32/gru_fp32.cc", + "src/runtime/kernel/arm/fp32/instance_norm_fp32.cc", + "src/runtime/kernel/arm/fp32/invert_permutation_fp32.cc", + "src/runtime/kernel/arm/fp32/l2_norm_fp32.cc", + "src/runtime/kernel/arm/fp32/layer_norm_fp32.cc", + "src/runtime/kernel/arm/fp32/local_response_norm_fp32.cc", + "src/runtime/kernel/arm/fp32/log_softmax_fp32.cc", + "src/runtime/kernel/arm/fp32/lstm_fp32.cc", + "src/runtime/kernel/arm/fp32/matmul_fp32.cc", + "src/runtime/kernel/arm/fp32/matmul_fp32_base.cc", + "src/runtime/kernel/arm/fp32/non_max_suppression_fp32.cc", + "src/runtime/kernel/arm/fp32/nonzero_fp32.cc", + "src/runtime/kernel/arm/fp32/pad_fp32.cc", + "src/runtime/kernel/arm/fp32/pooling_fp32.cc", + "src/runtime/kernel/arm/fp32/power_fp32.cc", + "src/runtime/kernel/arm/fp32/prelu_fp32.cc", + "src/runtime/kernel/arm/fp32/ragged_range_fp32.cc", + "src/runtime/kernel/arm/fp32/range_fp32.cc", + "src/runtime/kernel/arm/fp32/rank_fp32.cc", + "src/runtime/kernel/arm/fp32/reduce_fp32.cc", + "src/runtime/kernel/arm/fp32/reduce_scatter_fp32.cc", + "src/runtime/kernel/arm/fp32/relative_position_attention_fp32.cc", + "src/runtime/kernel/arm/fp32/resize_fp32.cc", + "src/runtime/kernel/arm/fp32/reverse_fp32.cc", + "src/runtime/kernel/arm/fp32/reverse_sequence_fp32.cc", + "src/runtime/kernel/arm/fp32/roi_pooling_fp32.cc", + "src/runtime/kernel/arm/fp32/scale_fp32.cc", + "src/runtime/kernel/arm/fp32/scatter_nd_fp32.cc", + "src/runtime/kernel/arm/fp32/scatter_nd_update_fp32.cc", + "src/runtime/kernel/arm/fp32/shape_fp32.cc", + "src/runtime/kernel/arm/fp32/size_fp32.cc", + "src/runtime/kernel/arm/fp32/softmax_fp32.cc", + "src/runtime/kernel/arm/fp32/space_to_batch_fp32.cc", + "src/runtime/kernel/arm/fp32/space_to_depth_fp32.cc", + "src/runtime/kernel/arm/fp32/sparse_to_dense_fp32.cc", + "src/runtime/kernel/arm/fp32/splice_fp32.cc", + "src/runtime/kernel/arm/fp32/topk_fp32.cc", + "src/runtime/kernel/arm/fp32/transpose_fp32.cc", + "src/runtime/kernel/arm/fp32/uniform_real_fp32.cc", + "src/runtime/kernel/arm/fp32/unique_fp32.cc", + "src/runtime/kernel/arm/fp32/unstack_fp32.cc", + "src/runtime/kernel/arm/fp32/where_fp32.cc", + "src/runtime/kernel/arm/fp32/zeroslike_fp32.cc", + "src/runtime/kernel/arm/fp32_sparse/matmul_sparse_fp32.cc", + "src/runtime/kernel/arm/int8/activation_int8.cc", + "src/runtime/kernel/arm/int8/add_int8.cc", + "src/runtime/kernel/arm/int8/argminmax_int8.cc", + "src/runtime/kernel/arm/int8/arithmetic_int8.cc", + "src/runtime/kernel/arm/int8/arithmetic_self_int8.cc", + "src/runtime/kernel/arm/int8/batch_to_space_int8.cc", + "src/runtime/kernel/arm/int8/batchnorm_int8.cc", + "src/runtime/kernel/arm/int8/bias_add_int8.cc", + "src/runtime/kernel/arm/int8/concat_int8.cc", + "src/runtime/kernel/arm/int8/convolution_1x1_int8.cc", + "src/runtime/kernel/arm/int8/convolution_3x3_int8.cc", + "src/runtime/kernel/arm/int8/convolution_depthwise_3x3_int8.cc", + "src/runtime/kernel/arm/int8/convolution_depthwise_int8.cc", + "src/runtime/kernel/arm/int8/convolution_depthwise_slidewindow_int8.cc", + "src/runtime/kernel/arm/int8/convolution_int8.cc", + "src/runtime/kernel/arm/int8/convolution_int8_creator.cc", + "src/runtime/kernel/arm/int8/crop_int8.cc", + "src/runtime/kernel/arm/int8/deconvolution_depthwise_int8.cc", + "src/runtime/kernel/arm/int8/deconvolution_int8.cc", + "src/runtime/kernel/arm/int8/depth_to_space_int8.cc", + "src/runtime/kernel/arm/int8/detection_post_process_int8.cc", + "src/runtime/kernel/arm/int8/div_int8.cc", + "src/runtime/kernel/arm/int8/fullconnection_int8.cc", + "src/runtime/kernel/arm/int8/gatherNd_int8.cc", + "src/runtime/kernel/arm/int8/gather_int8.cc", + "src/runtime/kernel/arm/int8/group_convolution_int8.cc", + "src/runtime/kernel/arm/int8/hswish_int8.cc", + "src/runtime/kernel/arm/int8/l2_norm_int8.cc", + "src/runtime/kernel/arm/int8/layer_norm_int8.cc", + "src/runtime/kernel/arm/int8/leaky_relu_int8.cc", + "src/runtime/kernel/arm/int8/matmul_base_int8.cc", + "src/runtime/kernel/arm/int8/matmul_int8.cc", + "src/runtime/kernel/arm/int8/mul_int8.cc", + "src/runtime/kernel/arm/int8/opt_op_handler.cc", + "src/runtime/kernel/arm/int8/pad_int8.cc", + "src/runtime/kernel/arm/int8/pooling_int8.cc", + "src/runtime/kernel/arm/int8/power_int8.cc", + "src/runtime/kernel/arm/int8/reduce_int8.cc", + "src/runtime/kernel/arm/int8/relux_int8.cc", + "src/runtime/kernel/arm/int8/reshape_int8.cc", + "src/runtime/kernel/arm/int8/resize_int8.cc", + "src/runtime/kernel/arm/int8/scale_int8.cc", + "src/runtime/kernel/arm/int8/sigmoid_int8.cc", + "src/runtime/kernel/arm/int8/slice_int8.cc", + "src/runtime/kernel/arm/int8/softmax_int8.cc", + "src/runtime/kernel/arm/int8/space_to_batch_int8.cc", + "src/runtime/kernel/arm/int8/split_int8.cc", + "src/runtime/kernel/arm/int8/squeeze_int8.cc", + "src/runtime/kernel/arm/int8/sub_int8.cc", + "src/runtime/kernel/arm/int8/tanh_int8.cc", + "src/runtime/kernel/arm/int8/topk_int8.cc", + "src/runtime/kernel/arm/int8/transpose_int8.cc", + "src/runtime/kernel/arm/int8/unsqueeze_int8.cc", + "src/runtime/kernel/arm/string/extract_feature.cc", + "src/runtime/kernel/arm/string/hashtable_lookup.cc", + "src/runtime/kernel/arm/string/lsh_projection.cc", + "src/runtime/kernel/arm/string/normalize.cc", + "src/runtime/kernel/arm/string/predict.cc", + "src/runtime/kernel/arm/string/skip_gram.cc", + "src/runtime/runtime_allocator.cc", + "src/runtime/runtime_convert.cc", + "src/runtime/runtime_pass.cc", + "src/scheduler.cc", + "src/schema_tensor_wrapper.cc", + "src/sub_graph_kernel.cc", + "src/sub_graph_split.cc", + "src/tensor.cc", + "src/tensor_category.cc", + "src/tensorlist.cc", + "src/weight_decoder.cc", + "tools/converter/quantizer/fse_bit_stream.cc", + "tools/converter/quantizer/fse_decoder.cc", + ] + + if (target_cpu == "arm64") { + sources += [ + "src/runtime/kernel/arm/fp16/activation_fp16.cc", + "src/runtime/kernel/arm/fp16/addn_fp16.cc", + "src/runtime/kernel/arm/fp16/arithmetic_compare_fp16.cc", + "src/runtime/kernel/arm/fp16/arithmetic_fp16.cc", + "src/runtime/kernel/arm/fp16/arithmetic_self_fp16.cc", + "src/runtime/kernel/arm/fp16/batchnorm_fp16.cc", + "src/runtime/kernel/arm/fp16/biasadd_fp16.cc", + "src/runtime/kernel/arm/fp16/cast_fp16.cc", + "src/runtime/kernel/arm/fp16/common_fp16.cc", + "src/runtime/kernel/arm/fp16/concat_fp16.cc", + "src/runtime/kernel/arm/fp16/convolution_1x1_fp16.cc", + "src/runtime/kernel/arm/fp16/convolution_delegate_fp16.cc", + "src/runtime/kernel/arm/fp16/convolution_depthwise_3x3_fp16.cc", + "src/runtime/kernel/arm/fp16/convolution_depthwise_fp16.cc", + "src/runtime/kernel/arm/fp16/convolution_depthwise_slidewindow_fp16.cc", + "src/runtime/kernel/arm/fp16/convolution_fp16.cc", + "src/runtime/kernel/arm/fp16/convolution_winograd_fp16.cc", + "src/runtime/kernel/arm/fp16/crop_fp16.cc", + "src/runtime/kernel/arm/fp16/deconvolution_depthwise_fp16.cc", + "src/runtime/kernel/arm/fp16/deconvolution_fp16.cc", + "src/runtime/kernel/arm/fp16/deconvolution_winograd_fp16.cc", + "src/runtime/kernel/arm/fp16/depth_to_space_fp16.cc", + "src/runtime/kernel/arm/fp16/exp_fp16.cc", + "src/runtime/kernel/arm/fp16/fill_fp16.cc", + "src/runtime/kernel/arm/fp16/fullconnection_fp16.cc", + "src/runtime/kernel/arm/fp16/fused_batchnorm_fp16.cc", + "src/runtime/kernel/arm/fp16/gather_fp16.cc", + "src/runtime/kernel/arm/fp16/group_convolution_fp16.cc", + "src/runtime/kernel/arm/fp16/gru_fp16.cc", + "src/runtime/kernel/arm/fp16/instance_norm_fp16.cc", + "src/runtime/kernel/arm/fp16/layer_norm_fp16.cc", + "src/runtime/kernel/arm/fp16/layout_transform_fp16.cc", + "src/runtime/kernel/arm/fp16/log_softmax_fp16.cc", + "src/runtime/kernel/arm/fp16/lstm_fp16.cc", + "src/runtime/kernel/arm/fp16/matmul_base_fp16.cc", + "src/runtime/kernel/arm/fp16/matmul_fp16.cc", + "src/runtime/kernel/arm/fp16/pad_fp16.cc", + "src/runtime/kernel/arm/fp16/pooling_fp16.cc", + "src/runtime/kernel/arm/fp16/power_fp16.cc", + "src/runtime/kernel/arm/fp16/prelu_fp16.cc", + "src/runtime/kernel/arm/fp16/quant_dtype_cast_fp16.cc", + "src/runtime/kernel/arm/fp16/ragged_range_fp16.cc", + "src/runtime/kernel/arm/fp16/reduce_fp16.cc", + "src/runtime/kernel/arm/fp16/resize_fp16.cc", + "src/runtime/kernel/arm/fp16/scale_fp16.cc", + "src/runtime/kernel/arm/fp16/slice_fp16.cc", + "src/runtime/kernel/arm/fp16/softmax_fp16.cc", + "src/runtime/kernel/arm/fp16/stack_fp16.cc", + "src/runtime/kernel/arm/fp16/transpose_fp16.cc", + "src/runtime/kernel/arm/fp16/where_fp16.cc", + "src/runtime/kernel/arm/fp16_grad/activation_fp16_grad.cc", + "src/runtime/kernel/arm/fp16_grad/arithmetic_fp16_grad.cc", + "src/runtime/kernel/arm/fp16_grad/arithmetic_fp16_self_grad.cc", + "src/runtime/kernel/arm/fp16_grad/bias_fp16_grad.cc", + "src/runtime/kernel/arm/fp16_grad/bn_fp16_grad.cc", + "src/runtime/kernel/arm/fp16_grad/convolution_fp16_grad_filter.cc", + "src/runtime/kernel/arm/fp16_grad/convolution_fp16_grad_input.cc", + "src/runtime/kernel/arm/fp16_grad/dropout_fp16_grad.cc", + "src/runtime/kernel/arm/fp16_grad/layernorm_fp16_grad.cc", + "src/runtime/kernel/arm/fp16_grad/neg_fp16_grad.cc", + "src/runtime/kernel/arm/fp16_grad/pooling_fp16_grad.cc", + "src/runtime/kernel/arm/fp16_grad/resize_fp16_grad.cc", + "src/runtime/kernel/arm/fp16_grad/strided_slice_fp16_grad.cc", + "src/runtime/kernel/arm/fp16_grad/unsorted_segment_sum_fp16.cc", + "src/runtime/gpu/opencl/opencl_allocator.cc", + "src/runtime/gpu/opencl/opencl_executor.cc", + "src/runtime/gpu/opencl/opencl_runtime.cc", + "src/runtime/gpu/opencl/opencl_runtime_wrapper.cc", + "src/runtime/gpu/opencl/opencl_wrapper.cc", + "src/runtime/kernel/opencl/kernel/activation.cc", + "src/runtime/kernel/opencl/kernel/argminmax.cc", + "src/runtime/kernel/opencl/kernel/arithmetic.cc", + "src/runtime/kernel/opencl/kernel/arithmetic_self.cc", + "src/runtime/kernel/opencl/kernel/batchnorm.cc", + "src/runtime/kernel/opencl/kernel/batch_to_space_nd.cc", + "src/runtime/kernel/opencl/kernel/cast.cc", + "src/runtime/kernel/opencl/kernel/concat.cc", + "src/runtime/kernel/opencl/kernel/conv2d.cc", + "src/runtime/kernel/opencl/kernel/conv2d_transpose.cc", + "src/runtime/kernel/opencl/kernel/depthwise_conv2d.cc", + "src/runtime/kernel/opencl/kernel/fill.cc", + "src/runtime/kernel/opencl/kernel/fullconnection.cc", + "src/runtime/kernel/opencl/kernel/fusion_eltwise.cc", + "src/runtime/kernel/opencl/kernel/gather.cc", + "src/runtime/kernel/opencl/kernel/gl_to_cl.cc", + "src/runtime/kernel/opencl/kernel/int8/arithmetic_int8.cc", + "src/runtime/kernel/opencl/kernel/layer_norm.cc", + "src/runtime/kernel/opencl/kernel/matmul.cc", + "src/runtime/kernel/opencl/kernel/one_hot.cc", + "src/runtime/kernel/opencl/kernel/pad.cc", + "src/runtime/kernel/opencl/kernel/pooling2d.cc", + "src/runtime/kernel/opencl/kernel/power.cc", + "src/runtime/kernel/opencl/kernel/prelu.cc", + "src/runtime/kernel/opencl/kernel/reduce.cc", + "src/runtime/kernel/opencl/kernel/reshape.cc", + "src/runtime/kernel/opencl/kernel/resize.cc", + "src/runtime/kernel/opencl/kernel/scale.cc", + "src/runtime/kernel/opencl/kernel/softmax.cc", + "src/runtime/kernel/opencl/kernel/space_to_batch_nd.cc", + "src/runtime/kernel/opencl/kernel/space_to_depth.cc", + "src/runtime/kernel/opencl/kernel/sparse_to_dense.cc", + "src/runtime/kernel/opencl/kernel/split.cc", + "src/runtime/kernel/opencl/kernel/stack.cc", + "src/runtime/kernel/opencl/kernel/strassen.cc", + "src/runtime/kernel/opencl/kernel/strided_slice.cc", + "src/runtime/kernel/opencl/kernel/to_format.cc", + "src/runtime/kernel/opencl/kernel/transpose.cc", + "src/runtime/kernel/opencl/kernel/winograd.cc", + "src/runtime/kernel/opencl/opencl_fusion.cc", + "src/runtime/kernel/opencl/opencl_kernel.cc", + "src/runtime/kernel/opencl/opencl_subgraph.cc", + "src/runtime/kernel/opencl/utils.cc", + ] + } + + include_dirs = [ + "//base/hiviewdfx/hilog/interfaces/native/innerkits/include", + "./", + "../../", + "../../mindspore/core/", + "src", + "src/c_api/", + "../ccsrc/backend/kernel_compiler/cpu/", + "../../mindspore/core/mindrt/src/", + "../../mindspore/core/mindrt/include/", + "../../third_party/", + "../../third_party/flatbuffers-v2.0.0/include/", + "../../third_party/OpenCL-CLHPP-v2.0.12/include/", + "../../third_party/OpenCL-Headers-v2020.12.18/", + + ] + + defines = [ "ENABLE_MINDRT","OHOS_HILOG"] + + if (target_cpu == "arm") { + defines += [ + "ENABLE_ARM", + "ENABLE_ARM32", + "ENABLE_NEON", + ] + } else if (target_cpu == "arm64") { + defines += [ + "ENABLE_ARM", + "ENABLE_ARM64", + "ENABLE_NEON", + "ENABLE_FP16", + "GPU_OPENCL", + "USE_OPENCL_WRAPPER", + "MS_OPENCL_PROFILE=false", + "CL_TARGET_OPENCL_VERSION=200", + "CL_HPP_TARGET_OPENCL_VERSION=120", + "CL_HPP_MINIMUM_OPENCL_VERSION=120", + ] + } + + configs = [ + ":opencl_option", + ] + + deps = [ + ":third_party", + "../ccsrc/backend/kernel_compiler/cpu/nnacl/:nnacl_o", + "../core/mindrt/:mindrt_o", + ] + + external_deps = [ + "hiviewdfx_hilog_native:libhilog", + ] + + output_name = "libmindspore-lite.huawei" + output_extension = "so" + + public_configs = [ ":mindspore_api" ] + part_name = "mindspore" +} + +config("opencl_option") { + cflags_cc = [ "-Wno-missing-braces" ] +} + +config("mindspore_api") { + include_dirs = [ + "../../include/", + ] + +} + +action("third_party") { + script = "get_thirdparty.sh" + outputs = [ "$root_out_dir/ai/mindspore/log.txt" ] +} diff --git a/mindspore/lite/CMakeLists.txt b/mindspore/lite/CMakeLists.txt index 21744aec2ea2bdf565456200297d1a002dc5569d..54a8f501689c9329fc2775a4bf1a68df4d9e8ec8 100644 --- a/mindspore/lite/CMakeLists.txt +++ b/mindspore/lite/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.12) project(Lite) set(BUILD_LITE "on") - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/secure_option.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/compile_link_option.cmake) diff --git a/mindspore/lite/bundle.json b/mindspore/lite/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..96d9f31686cf2898877cf3103fb3ece8f27a0164 --- /dev/null +++ b/mindspore/lite/bundle.json @@ -0,0 +1,30 @@ +{ + "name": "@ohos/ai_mindspore", + "description": "AI Framework.", + "version": "3.1", + "license": "Apache License 2.0", + "pubiishAs": "code-segment", + "segment": { + "destPath": "third_party/mindspore" + }, + "dirs": {}, + "scripts": {}, + "component": { + "name": "mindspore", + "subsystem": "ai", + "syscap": [ "SystemCapability.Ai.MindSpore" ], + "feature": [], + "adapted_system_type": [ "standard" ], + "rom": "", + "ram": "", + "deps": { + "components": ["hiviewdfx_hilog_native"], + "third_party": [] + }, + "build": { + "sub_component": [ "//third_party/mindspore/mindspore/lite:mindspore" ], + "inner_kits": [], + "test": [ "//third_party/mindspore/mindspore/lite/test:mindspore_test" ] + } + } +} diff --git a/mindspore/lite/src/common/log.cc b/mindspore/lite/src/common/log.cc index e3a2b84c15ea073680f684c56e6c34a0b8261672..20dd49cb3e5407f3864124ab120ac4ddcedecf09 100644 --- a/mindspore/lite/src/common/log.cc +++ b/mindspore/lite/src/common/log.cc @@ -75,6 +75,20 @@ static int GetAndroidLogLevel(LiteLogLevel level) { #endif #endif +#ifdef OHOS_HILOG +void PrintHiLog(LiteLogLevel level, const char *file, int line, const char *func, const char *msg) { + if (level == LiteLogLevel::DEBUG) { + OHOS::HiviewDFX::HiLog::Debug(MSLite_LABEL, FORMAT, file, line, func, msg); + } else if (level == LiteLogLevel::INFO) { + OHOS::HiviewDFX::HiLog::Info(MSLite_LABEL, FORMAT, file, line, func, msg); + } else if (level == LiteLogLevel::WARNING) { + OHOS::HiviewDFX::HiLog::Warn(MSLite_LABEL, FORMAT, file, line, func, msg); + } else if (level == LiteLogLevel::ERROR) { + OHOS::HiviewDFX::HiLog::Error(MSLite_LABEL, FORMAT, file, line, func, msg); + } +} +#endif + const char *EnumStrForMsLogLevel(LiteLogLevel level) { if (level == LiteLogLevel::DEBUG) { return "DEBUG"; @@ -94,6 +108,8 @@ void LiteLogWriter::OutputLog(const std::ostringstream &msg) const { #if defined(ENABLE_ARM) && (defined(__ANDROID__) || defined(ANDROID)) __android_log_print(GetAndroidLogLevel(log_level_), ANDROID_LOG_TAG, "[%s:%d] %s] %s", location_.file_, location_.line_, location_.func_, msg.str().c_str()); +#elif defined(OHOS_HILOG) + PrintHiLog(log_level_, location_.file_, location_.line_, location_.func_, msg.str().c_str()); #else printf("%s [%s:%d] %s] %s\n", EnumStrForMsLogLevel(log_level_), location_.file_, location_.line_, location_.func_, msg.str().c_str()); diff --git a/mindspore/lite/src/common/log.h b/mindspore/lite/src/common/log.h index 21fb03d1a74e5cea59df8210f9021b0e7c3ea168..3882780098fae4eff90521dac932eef284924674 100644 --- a/mindspore/lite/src/common/log.h +++ b/mindspore/lite/src/common/log.h @@ -15,11 +15,13 @@ */ #ifndef MINDSPORE_LITE_SRC_COMMON_LOG_H_ #define MINDSPORE_LITE_SRC_COMMON_LOG_H_ - #include #include #include "utils/overload.h" +#ifdef OHOS_HILOG +#include "hilog/log.h" +#endif // NOTICE: when relative path of 'log.h' changed, macro 'LITE_LOG_HEAR_FILE_REL_PATH' must be changed #define LITE_LOG_HEAR_FILE_REL_PATH "mindspore/lite/src/common/log.h" @@ -88,16 +90,53 @@ class LiteLogWriter { LiteLogLevel log_level_; }; -#define MSLOG_IF(level) \ - mindspore::LiteLogWriter(mindspore::LiteLocationInfo(LITE_FILE_NAME, __LINE__, __FUNCTION__), level) < \ - mindspore::LiteLogStream() - #define MS_LOG(level) MS_LOG_##level #define MS_LOG_DEBUG MSLOG_IF(mindspore::LiteLogLevel::DEBUG) #define MS_LOG_INFO MSLOG_IF(mindspore::LiteLogLevel::INFO) #define MS_LOG_WARNING MSLOG_IF(mindspore::LiteLogLevel::WARNING) #define MS_LOG_ERROR MSLOG_IF(mindspore::LiteLogLevel::ERROR) + +#ifdef OHOS_HILOG +namespace { +constexpr unsigned int MSLITE_DOMAIN_ID_START = 0xD0029A0; +constexpr unsigned int MSLITE_DOMAIN_ID_END = MSLITE_DOMAIN_ID_START + 32; +constexpr unsigned int TEST_DOMAIN_ID = 0xD000F00; +} // namespace + +#define FILE_NAME (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__) +#define FORMAT "[%{public}s:%{public}d] %{public}s# %{public}s" + +#define MSLOG_IF(level) \ + mindspore::LiteLogWriter(mindspore::LiteLocationInfo(FILE_NAME, __LINE__, __FUNCTION__), level) < \ + mindspore::LiteLogStream() + +enum MSLiteManagerLogLabel { + // Component labels, you can add if needed + COMP_FWK = 0, + // Test label + LABEL_TEST, + // The end of labels, max to the domain id range length 32 + LABEL_END, +}; + +enum MSLiteManagerLogDomain { + DOMAIN_FRAMEWORK = MSLITE_DOMAIN_ID_START + COMP_FWK, // 0xD0029A0 + DOMAIN_TEST = TEST_DOMAIN_ID, // 0xD000F00 + DOMAIN_END = MSLITE_DOMAIN_ID_END, // Max to 0xD002940, keep the sequence and length same as MSLiteManagerLogLabel +}; + +// Keep the sequence and length same as MSLiteManagerLogDomain +static constexpr OHOS::HiviewDFX::HiLogLabel MSLite_LABEL = {LOG_CORE, DOMAIN_FRAMEWORK, "MSLiteFwk"}; + +#else + +#define MSLOG_IF(level) \ + mindspore::LiteLogWriter(mindspore::LiteLocationInfo(LITE_FILE_NAME, __LINE__, __FUNCTION__), level) < \ + mindspore::LiteLogStream() + +#endif + } // namespace mindspore #ifdef Debug