From 738b21c9700519d2a56b2267f17bae62d0fe2641 Mon Sep 17 00:00:00 2001 From: yeyunpeng Date: Thu, 24 Sep 2020 10:24:13 +0800 Subject: [PATCH] change log_adapter --- build.sh | 4 +- mindspore/core/utils/log_adapter.cc | 27 +--- mindspore/core/utils/log_adapter.h | 3 +- mindspore/lite/CMakeLists.txt | 1 - mindspore/lite/nnacl/optimized_kernel.h | 2 +- mindspore/lite/src/CMakeLists.txt | 95 +++++------ mindspore/lite/src/common/file_utils.h | 2 +- mindspore/lite/src/common/file_utils_ext.h | 2 +- mindspore/lite/src/common/graph_util.cc | 2 +- mindspore/lite/src/common/graph_util.h | 2 +- .../lite/src/common/graph_utils_extends.cc | 149 ------------------ mindspore/lite/src/common/log_adapter.cc | 86 ++-------- mindspore/lite/src/common/log_adapter.h | 112 +++++++++++++ mindspore/lite/src/common/utils.h | 2 +- mindspore/lite/src/inner_context.cc | 2 +- mindspore/lite/src/kernel_registry.cc | 4 +- mindspore/lite/src/lite_session.cc | 2 +- mindspore/lite/src/model.cc | 6 +- mindspore/lite/src/ops/abs.h | 2 +- mindspore/lite/src/ops/activation.h | 2 +- mindspore/lite/src/ops/activation_grad.h | 2 +- mindspore/lite/src/ops/add.h | 1 - mindspore/lite/src/ops/addn.h | 1 - mindspore/lite/src/ops/apply_momentum.h | 2 +- mindspore/lite/src/ops/argmax.h | 2 +- mindspore/lite/src/ops/argmin.h | 1 - mindspore/lite/src/ops/arithmetic.cc | 2 +- mindspore/lite/src/ops/arithmetic.h | 1 - mindspore/lite/src/ops/arithmetic_grad.cc | 2 +- mindspore/lite/src/ops/arithmetic_grad.h | 3 +- mindspore/lite/src/ops/arithmetic_self.cc | 2 +- mindspore/lite/src/ops/batch_norm.h | 1 - mindspore/lite/src/ops/batch_to_space.cc | 2 +- mindspore/lite/src/ops/batch_to_space.h | 1 - mindspore/lite/src/ops/bias_add.h | 1 - mindspore/lite/src/ops/bias_grad.h | 1 - mindspore/lite/src/ops/bn_grad.h | 4 +- mindspore/lite/src/ops/broadcast_to.h | 1 - mindspore/lite/src/ops/cast.h | 1 - mindspore/lite/src/ops/ceil.h | 1 - mindspore/lite/src/ops/clip.h | 1 - mindspore/lite/src/ops/concat.cc | 2 +- mindspore/lite/src/ops/concat.h | 1 - mindspore/lite/src/ops/constant_of_shape.cc | 2 +- mindspore/lite/src/ops/constant_of_shape.h | 1 - mindspore/lite/src/ops/conv2d.cc | 6 +- mindspore/lite/src/ops/conv2d.h | 1 - mindspore/lite/src/ops/conv2d_grad_filter.cc | 2 +- mindspore/lite/src/ops/conv2d_grad_filter.h | 1 - mindspore/lite/src/ops/conv2d_grad_input.h | 1 - mindspore/lite/src/ops/cos.h | 1 - mindspore/lite/src/ops/crop.h | 1 - mindspore/lite/src/ops/deconv2d.h | 1 - mindspore/lite/src/ops/dedepthwise_conv2d.h | 1 - mindspore/lite/src/ops/depth_to_space.h | 1 - mindspore/lite/src/ops/depthwise_conv2d.h | 1 - .../lite/src/ops/detection_post_process.h | 1 - mindspore/lite/src/ops/div.h | 1 - mindspore/lite/src/ops/dropout.h | 1 - mindspore/lite/src/ops/eltwise.h | 1 - mindspore/lite/src/ops/elu.h | 1 - mindspore/lite/src/ops/embedding_lookup.h | 1 - .../lite/src/ops/embedding_lookup_sparse.h | 1 - mindspore/lite/src/ops/equal.h | 1 - mindspore/lite/src/ops/exp.h | 1 - mindspore/lite/src/ops/expand_dims.h | 1 - .../src/ops/fake_quant_with_min_max_vars.h | 1 - mindspore/lite/src/ops/fill.h | 1 - mindspore/lite/src/ops/flatten.h | 1 - mindspore/lite/src/ops/flatten_grad.h | 1 - mindspore/lite/src/ops/floor.h | 1 - mindspore/lite/src/ops/floor_div.h | 1 - mindspore/lite/src/ops/floor_mod.h | 1 - mindspore/lite/src/ops/full_connection.h | 1 - mindspore/lite/src/ops/fused_batchnorm.h | 1 - mindspore/lite/src/ops/gather.cc | 2 +- mindspore/lite/src/ops/gather.h | 2 +- mindspore/lite/src/ops/gather_nd.h | 2 +- mindspore/lite/src/ops/greater.h | 2 +- mindspore/lite/src/ops/greater_equal.h | 2 +- mindspore/lite/src/ops/l2_norm.h | 2 +- mindspore/lite/src/ops/leaky_relu.h | 2 +- mindspore/lite/src/ops/less.h | 2 +- mindspore/lite/src/ops/less_equal.h | 2 +- .../src/ops/local_response_normalization.h | 2 +- mindspore/lite/src/ops/log.h | 2 +- mindspore/lite/src/ops/log_grad.h | 2 +- mindspore/lite/src/ops/logical_and.h | 2 +- mindspore/lite/src/ops/logical_not.h | 2 +- mindspore/lite/src/ops/logical_or.h | 2 +- mindspore/lite/src/ops/lrn.h | 2 +- mindspore/lite/src/ops/lstm.h | 2 +- mindspore/lite/src/ops/matmul.h | 1 - mindspore/lite/src/ops/matrix_diag.h | 2 +- mindspore/lite/src/ops/maximum.h | 2 +- mindspore/lite/src/ops/mean.h | 2 +- mindspore/lite/src/ops/minimum.h | 2 +- mindspore/lite/src/ops/mul.h | 2 +- mindspore/lite/src/ops/nchw2nhwc.h | 2 +- mindspore/lite/src/ops/neg.h | 2 +- mindspore/lite/src/ops/neg_grad.h | 2 +- mindspore/lite/src/ops/nhwc2nchw.h | 2 +- mindspore/lite/src/ops/not_equal.h | 2 +- mindspore/lite/src/ops/one_hot.h | 2 +- mindspore/lite/src/ops/p_relu.h | 2 +- mindspore/lite/src/ops/pad.h | 2 +- mindspore/lite/src/ops/permute.h | 2 +- mindspore/lite/src/ops/pooling.h | 2 +- mindspore/lite/src/ops/pooling_grad.h | 2 +- mindspore/lite/src/ops/power.h | 2 +- mindspore/lite/src/ops/power_grad.h | 2 +- mindspore/lite/src/ops/primitive_c.h | 2 +- mindspore/lite/src/ops/prior_box.h | 2 +- mindspore/lite/src/ops/quant_dtype_cast.h | 2 +- mindspore/lite/src/ops/range.h | 2 +- mindspore/lite/src/ops/rank.h | 2 +- mindspore/lite/src/ops/real_div.h | 2 +- mindspore/lite/src/ops/reduce.h | 2 +- mindspore/lite/src/ops/reshape.cc | 2 +- mindspore/lite/src/ops/reshape.h | 2 +- mindspore/lite/src/ops/resize.h | 2 +- mindspore/lite/src/ops/return.h | 2 +- mindspore/lite/src/ops/reverse.h | 2 +- mindspore/lite/src/ops/reverse_sequence.h | 2 +- mindspore/lite/src/ops/roi_pooling.h | 2 +- mindspore/lite/src/ops/round.h | 2 +- mindspore/lite/src/ops/rsqrt.h | 2 +- mindspore/lite/src/ops/scale.h | 2 +- mindspore/lite/src/ops/scatter_nd.h | 2 +- mindspore/lite/src/ops/shape.cc | 2 +- mindspore/lite/src/ops/shape.h | 1 - mindspore/lite/src/ops/sin.h | 2 +- mindspore/lite/src/ops/slice.cc | 2 +- mindspore/lite/src/ops/slice.h | 2 +- mindspore/lite/src/ops/softmax.h | 2 +- .../lite/src/ops/softmax_cross_entropy.h | 2 +- mindspore/lite/src/ops/space_to_batch.h | 2 +- mindspore/lite/src/ops/space_to_batch_nd.h | 2 +- mindspore/lite/src/ops/space_to_depth.h | 2 +- mindspore/lite/src/ops/sparse_to_dense.h | 2 +- mindspore/lite/src/ops/split.h | 2 +- mindspore/lite/src/ops/sqrt.h | 2 +- mindspore/lite/src/ops/square.h | 2 +- mindspore/lite/src/ops/squared_difference.h | 2 +- mindspore/lite/src/ops/squeeze.h | 2 +- mindspore/lite/src/ops/stack.h | 2 +- mindspore/lite/src/ops/strided_slice.h | 2 +- mindspore/lite/src/ops/sub.h | 2 +- mindspore/lite/src/ops/tile.h | 2 +- mindspore/lite/src/ops/topk.h | 2 +- mindspore/lite/src/ops/transpose.cc | 2 +- mindspore/lite/src/ops/transpose.h | 2 +- mindspore/lite/src/ops/unique.h | 2 +- mindspore/lite/src/ops/unsqueeze.cc | 2 +- mindspore/lite/src/ops/unsqueeze.h | 2 +- mindspore/lite/src/ops/unstack.h | 2 +- mindspore/lite/src/ops/upsample.h | 2 +- mindspore/lite/src/ops/where.h | 2 +- mindspore/lite/src/ops/zeros_like.h | 2 +- mindspore/lite/src/param_value_lite.h | 1 - mindspore/lite/src/populate_parameter.cc | 4 +- mindspore/lite/src/runtime/allocator.cc | 2 +- .../kernel/arm/base/layout_transform.cc | 2 +- .../kernel/arm/base/layout_transform.h | 2 +- .../src/runtime/kernel/arm/base/reduce_base.h | 2 +- .../runtime/kernel/arm/base/strided_slice.h | 2 +- .../kernel/arm/fp16/layout_transform_fp16.cc | 2 +- .../src/runtime/kernel/arm/fp16/reduce_fp16.h | 2 +- .../src/runtime/kernel/arm/fp32/flatten.h | 2 +- .../src/runtime/kernel/arm/fp32/one_hot.h | 1 - .../src/runtime/kernel/arm/fp32/pooling.h | 1 - .../lite/src/runtime/kernel/arm/fp32/reduce.h | 2 +- .../lite/src/runtime/kernel/arm/fp32/shape.cc | 2 +- .../runtime/kernel/arm/fp32/space_to_depth.h | 1 - .../kernel/arm/fp32_grad/activation_grad.h | 1 - .../kernel/arm/fp32_grad/apply_momentum.h | 1 - .../kernel/arm/fp32_grad/arithmetic_grad.h | 2 - .../arm/fp32_grad/arithmetic_self_grad.h | 1 - .../runtime/kernel/arm/fp32_grad/bias_grad.h | 2 - .../runtime/kernel/arm/fp32_grad/bn_grad.cc | 1 - .../runtime/kernel/arm/fp32_grad/bn_grad.h | 1 - .../kernel/arm/fp32_grad/convolution.h | 4 +- .../arm/fp32_grad/convolution_grad_filter.h | 6 +- .../arm/fp32_grad/convolution_grad_input.h | 6 +- .../runtime/kernel/arm/fp32_grad/make_tuple.h | 1 - .../runtime/kernel/arm/fp32_grad/neg_grad.h | 1 - .../kernel/arm/fp32_grad/pooling_grad.h | 1 - .../runtime/kernel/arm/fp32_grad/power_grad.h | 1 - .../softmax_cross_entropy_with_logits.h | 1 - ...parse_softmax_cross_entropy_with_logits.cc | 4 +- ...sparse_softmax_cross_entropy_with_logits.h | 9 +- .../kernel/arm/fp32_grad/tuple_getitem.h | 2 - .../runtime/kernel/arm/int8/pooling_int8.h | 2 +- .../src/runtime/kernel/arm/int8/reduce_int8.h | 2 +- .../kernel/opencl/kernel/arithmetic_self.h | 1 - .../runtime/kernel/opencl/kernel/batchnorm.h | 1 - .../src/runtime/kernel/opencl/kernel/cast.h | 1 - .../src/runtime/kernel/opencl/kernel/concat.h | 1 - .../kernel/opencl/kernel/depthwise_conv2d.cc | 4 +- .../src/runtime/kernel/opencl/kernel/gather.h | 1 - .../src/runtime/kernel/opencl/kernel/scale.cc | 12 +- .../src/runtime/kernel/opencl/kernel/slice.h | 1 - .../lite/src/runtime/kernel/opencl/utils.h | 2 +- .../src/runtime/opencl/opencl_allocator.cc | 2 +- .../lite/src/runtime/opencl/opencl_runtime.h | 2 +- .../lite/src/runtime/opencl/opencl_wrapper.cc | 2 +- mindspore/lite/src/runtime/runtime_api.cc | 2 +- mindspore/lite/src/runtime/workspace_pool.cc | 2 +- mindspore/lite/src/tensor.h | 4 +- mindspore/lite/src/train/train_model.cc | 19 +-- .../src/train/train_populate_parameter.cc | 6 +- mindspore/lite/src/train/train_session.cc | 12 +- mindspore/lite/test/CMakeLists.txt | 39 ++--- mindspore/lite/test/common/common_test.cc | 2 +- mindspore/lite/test/main.cc | 5 +- .../lite/test/ut/internal/vector_test.cc | 2 +- mindspore/lite/test/ut/src/graph_test.cc | 2 +- mindspore/lite/test/ut/src/infer_test.cc | 2 +- .../runtime/kernel/arm/common/pack_tests.cc | 2 +- .../kernel/arm/fp16/convolution_fp16_tests.cc | 2 +- .../kernel/arm/fp16/reduce_fp16_tests.cc | 2 +- .../kernel/arm/fp32/activation_fp32_test.cc | 2 +- .../kernel/arm/fp32/argminmax_fp32_test.cc | 2 +- .../kernel/arm/fp32/arithmetic_fp32_tests.cc | 2 +- .../arm/fp32/batch_to_space_fp32_test.cc | 2 +- .../kernel/arm/fp32/batchnorm_fp32_tests.cc | 2 +- .../arm/fp32/constant_of_shape_fp32_test.cc | 2 +- .../kernel/arm/fp32/conv1x1_fp32_tests.cc | 2 +- .../fp32/convolution_depthwise_fp32_tests.cc | 2 +- .../arm/fp32/deconvolution_fp32_tests.cc | 2 +- .../arm/fp32/depth_to_space_fp32_test.cc | 2 +- .../arm/fp32/detection_post_process_test.cc | 2 +- .../runtime/kernel/arm/fp32/elu_fp32_test.cc | 2 +- .../arm/fp32/embedding_lookup_fp32_test.cc | 2 +- .../arm/fp32/fullconnection_fp32_tests.cc | 2 +- .../kernel/arm/fp32/l2norm_fp32_test.cc | 2 +- .../kernel/arm/fp32/lstm_fp32_tests.cc | 2 +- .../kernel/arm/fp32/matmul_fp32_tests.cc | 2 +- .../kernel/arm/fp32/power_fp32_tests.cc | 2 +- .../kernel/arm/fp32/reduce_fp32_tests.cc | 4 +- .../kernel/arm/fp32/roi_pooling_fp32_tests.cc | 2 +- .../arm/fp32/space_to_batch_fp32_tests.cc | 2 +- .../arm/fp32/space_to_depth_fp32_tests.cc | 2 +- .../arm/fp32/sparse_to_dense_fp32_tests.cc | 29 ++-- .../kernel/arm/fp32/stack_fp32_test.cc | 4 +- .../arm/fp32/strided_slice_fp32_tests.cc | 2 +- .../kernel/arm/fp32/transpose_fp32_tests.cc | 2 +- .../fp32_grad/activation_grad_fp32_tests.cc | 2 +- .../fp32_grad/arithmetic_grad_fp32_tests.cc | 2 +- .../arm/fp32_grad/bias_grad_fp32_tests.cc | 4 +- .../kernel/arm/fp32_grad/bn_grad_fp32_test.cc | 2 +- .../fp32_grad/convolution_grad_fp32_tests.cc | 2 +- .../kernel/arm/fp32_grad/network_test.cc | 2 +- .../arm/fp32_grad/pooling_grad_fp32_tests.cc | 14 +- .../softmax_crossentropy_fp32_tests.cc | 12 +- .../arm/fp32_grad/softmax_grad_fp32_tests.cc | 2 +- .../arm/int8/arithmetic_self_int8_tests.cc | 1 - .../kernel/arm/int8/batchnorm_int8_test.cc | 2 +- .../kernel/arm/int8/concat_int8_tests.cc | 2 +- .../kernel/arm/int8/conv_1x1_int8_tests.cc | 2 +- .../kernel/arm/int8/crop_int8_tests.cc | 2 +- .../arm/int8/fullconnection_int8_tests.cc | 2 +- .../kernel/arm/int8/gatherNd_int8_test.cc | 2 +- .../kernel/arm/int8/gather_int8_test.cc | 2 +- .../kernel/arm/int8/matmul_int8_tests.cc | 2 +- .../runtime/kernel/arm/int8/mul_int8_tests.cc | 2 +- .../kernel/arm/int8/prelu_int8_tests.cc | 4 +- .../kernel/arm/int8/quant_dtype_cast_tests.cc | 2 +- .../kernel/arm/int8/reduce_int8_tests.cc | 2 +- .../kernel/arm/int8/reshape_int8_tests.cc | 2 +- .../src/runtime/kernel/arm/int8/scale_int8.cc | 2 +- .../kernel/arm/int8/split_int8_tests.cc | 2 +- .../kernel/arm/int8/squeeze_int8_tests.cc | 2 +- .../kernel/arm/int8/unsqueeze_int8_tests.cc | 1 - .../runtime/kernel/opencl/activation_tests.cc | 2 +- .../kernel/opencl/arithmetic_self_tests.cc | 2 +- .../kernel/opencl/avg_pooling_tests.cc | 2 +- .../runtime/kernel/opencl/batchnorm_tests.cc | 2 +- .../runtime/kernel/opencl/biasadd_tests.cc | 2 +- .../src/runtime/kernel/opencl/cast_tests.cc | 2 +- .../src/runtime/kernel/opencl/concat_tests.cc | 2 +- .../kernel/opencl/conv2d_transpose_tests.cc | 2 +- .../kernel/opencl/convolution_tests.cc | 2 +- .../kernel/opencl/depthwise_conv2d_tests.cc | 4 +- .../src/runtime/kernel/opencl/gather_tests.cc | 4 +- .../src/runtime/kernel/opencl/matmul_tests.cc | 2 +- .../kernel/opencl/max_pooling_tests.cc | 2 +- .../kernel/opencl/opencl_kernel_tests.h | 2 +- .../src/runtime/kernel/opencl/prelu_tests.cc | 2 +- .../src/runtime/kernel/opencl/reduce_tests.cc | 2 +- .../runtime/kernel/opencl/reshape_tests.cc | 2 +- .../src/runtime/kernel/opencl/slice_tests.cc | 2 +- .../runtime/kernel/opencl/softmax_tests.cc | 2 +- .../runtime/kernel/opencl/to_format_tests.cc | 2 +- .../runtime/kernel/opencl/transpose_tests.cc | 2 +- .../src/runtime/kernel/opencl/utils_tests.cc | 2 +- .../src/runtime/kernel/opencl/utils_tests.h | 2 +- mindspore/lite/test/ut/src/utils_test.cc | 2 +- .../fusion/constant_folding_fusion_test.cc | 2 +- .../fusion/conv_activation_fusion_test.cc | 2 +- .../fusion/conv_biasadd_fusion_test.cc | 2 +- .../optimizer/fusion/conv_bn_fusion_test.cc | 2 +- .../fusion/conv_scale_fusion_test.cc | 2 +- .../lite/tools/anf_exporter/CMakeLists.txt | 1 + .../lite/tools/anf_importer/CMakeLists.txt | 2 +- .../anf_importer/import_from_meta_graphT.cc | 2 +- .../anf_importer/import_from_protobuf.cc | 2 +- mindspore/lite/tools/benchmark/benchmark.h | 1 - mindspore/lite/tools/common/CMakeLists.txt | 13 +- mindspore/lite/tools/common/flag_parser.cc | 2 +- mindspore/lite/tools/common/graph_util.cc | 2 +- mindspore/lite/tools/common/graph_util.h | 1 - mindspore/lite/tools/common/node_util.cc | 2 +- mindspore/lite/tools/common/node_util.h | 2 +- mindspore/lite/tools/common/option.h | 2 +- mindspore/lite/tools/common/storage.cc | 2 +- mindspore/lite/tools/common/tensor_util.h | 2 +- mindspore/lite/tools/converter/CMakeLists.txt | 29 ++-- .../lite/tools/converter/anf_transform.cc | 12 +- mindspore/lite/tools/converter/converter.cc | 2 +- .../lite/tools/converter/converter_context.h | 2 +- .../tools/converter/graphdef_transform.cc | 2 +- .../legacy_optimizer/fusion/CMakeLists.txt | 6 +- .../fusion/batchnorm_fold_fusion_pass.cc | 2 +- .../fusion/format_trans_fusion_pass.cc | 2 +- .../format_trans_transpose_fusion_pass.cc | 2 +- .../legacy_optimizer/fusion/fusion_pass.cc | 2 +- .../legacy_optimizer/fusion/fusion_pattern.cc | 2 +- .../legacy_optimizer/fusion/fusion_pattern.h | 2 +- .../fusion/matmul_biasadd_fusion_pass.cc | 2 +- .../fusion/mul_add_fusion_pass.cc | 2 +- .../fusion/quant_cast_fusion_pass.cc | 2 +- .../legacy_optimizer/graph/CMakeLists.txt | 4 +- .../graph/batchnorm_convert_scale_pass.cc | 3 +- .../graph/format_trans_pass.cc | 5 +- .../legacy_optimizer/graph/infershape_pass.cc | 4 +- .../graph/isolated_node_remove_pass.cc | 2 +- .../model_input_format_preprocess_pass.cc | 2 +- .../graph/topological_sort_pass.cc | 2 +- .../graph/trans_format_insert_pass.cc | 2 +- .../graph/trans_format_remove_pass.cc | 2 +- .../graph/unused_node_remove_pass.cc | 2 +- .../graph/weight_format_hardcode_pass.cc | 2 +- mindspore/lite/tools/converter/main.cc | 11 +- mindspore/lite/tools/converter/optimizer.cc | 2 +- .../converter/parser/caffe/CMakeLists.txt | 40 +---- .../converter/parser/caffe/caffe_inspector.cc | 2 +- .../parser/caffe/caffe_node_parser.h | 2 +- .../converter/parser/onnx/CMakeLists.txt | 2 +- .../parser/onnx/onnx_matmul_parser.cc | 2 +- .../converter/parser/onnx/onnx_node_parser.h | 2 +- .../converter/parser/tflite/CMakeLists.txt | 1 + .../parser/tflite/tflite_node_parser.h | 2 +- .../converter/parser/tflite/tflite_util.cc | 2 +- .../converter/parser/tflite/tflite_util.h | 2 +- .../tools/converter/quantizer/CMakeLists.txt | 28 ++-- .../converter/quantizer/aware_quantizer.cc | 2 +- .../quantizer/post_training_quantizer.cc | 10 +- .../lite/tools/optimizer/common/gllo_utils.h | 2 +- .../lite/tools/time_profiler/time_profiler.cc | 2 +- 360 files changed, 593 insertions(+), 839 deletions(-) delete mode 100644 mindspore/lite/src/common/graph_utils_extends.cc create mode 100644 mindspore/lite/src/common/log_adapter.h diff --git a/build.sh b/build.sh index d7f55ab4d3..6ba9b8e1c3 100755 --- a/build.sh +++ b/build.sh @@ -652,7 +652,7 @@ build_lite() checkndk cmake -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" -DANDROID_NATIVE_API_LEVEL="19" \ -DANDROID_NDK="${ANDROID_NDK}" -DANDROID_ABI="arm64-v8a" -DANDROID_TOOLCHAIN_NAME="aarch64-linux-android-clang" \ - -DANDROID_STL="c++_shared" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSUPPORT_TRAIN=${SUPPORT_TRAIN} \ + -DANDROID_STL="c++_static" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSUPPORT_TRAIN=${SUPPORT_TRAIN} \ -DBUILD_DEVICE=on -DPLATFORM_ARM64=on -DBUILD_CONVERTER=off -DENABLE_NEON=on -DENABLE_FP16="off" \ -DSUPPORT_GPU=${ENABLE_GPU} -DOFFLINE_COMPILE=${OPENCL_OFFLINE_COMPILE} -DBUILD_MINDDATA=${COMPILE_MINDDATA_LITE} \ -DCMAKE_INSTALL_PREFIX=${BASEPATH}/output/tmp -DMS_VERSION_MAJOR=${VERSION_MAJOR} \ @@ -662,7 +662,7 @@ build_lite() checkndk cmake -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" -DANDROID_NATIVE_API_LEVEL="19" \ -DANDROID_NDK="${ANDROID_NDK}" -DANDROID_ABI="armeabi-v7a" -DANDROID_TOOLCHAIN_NAME="clang" \ - -DANDROID_STL="c++_shared" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ + -DANDROID_STL="c++_static" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ -DBUILD_DEVICE=on -DPLATFORM_ARM32=on -DENABLE_NEON=on -DSUPPORT_TRAIN=${SUPPORT_TRAIN} -DBUILD_CONVERTER=off \ -DSUPPORT_GPU=${ENABLE_GPU} -DOFFLINE_COMPILE=${OPENCL_OFFLINE_COMPILE} -DBUILD_MINDDATA=${COMPILE_MINDDATA_LITE} \ -DCMAKE_INSTALL_PREFIX=${BASEPATH}/output/tmp -DMS_VERSION_MAJOR=${VERSION_MAJOR} \ diff --git a/mindspore/core/utils/log_adapter.cc b/mindspore/core/utils/log_adapter.cc index 59d66befd9..bc41a1716c 100644 --- a/mindspore/core/utils/log_adapter.cc +++ b/mindspore/core/utils/log_adapter.cc @@ -22,7 +22,6 @@ // namespace to support utils module definition namespace mindspore { -#ifndef USE_ANDROID_LOG #ifdef USE_GLOG static std::string GetTime() { #define BUFLEN 80 @@ -126,7 +125,6 @@ static int GetSlogLevel(MsLogLevel level) { } } #endif -#endif static std::string ExceptionTypeToString(ExceptionType type) { #define _TO_STRING(x) #x @@ -182,30 +180,13 @@ static const char *GetSubModuleName(SubModuleId module_id) { "UTILS", // SM_UTILS "VM", // SM_VM "PROFILER", // SM_PROFILER - "PS" // SM_PS + "PS", // SM_PS + "LITE" // SM_LITE }; return sub_module_names[module_id % NUM_SUBMODUES]; } - -const char *EnumStrForMsLogLevel(MsLogLevel level) { - if (level == DEBUG) { - return "DEBUG"; - } else if (level == INFO) { - return "INFO"; - } else if (level == WARNING) { - return "WARNING"; - } else if (level == ERROR) { - return "ERROR"; - } else if (level == EXCEPTION) { - return "EXCEPTION"; - } else { - return "NO_LEVEL"; - } -} - void LogWriter::OutputLog(const std::ostringstream &msg) const { -#ifndef USE_ANDROID_LOG #ifdef USE_GLOG auto submodule_name = GetSubModuleName(submodule_); google::LogMessage("", 0, GetGlogLevel(log_level_)).stream() @@ -218,10 +199,6 @@ void LogWriter::OutputLog(const std::ostringstream &msg) const { Dlog(static_cast(slog_module_id), GetSlogLevel(log_level_), "[%s:%d] %s] %s", location_.file_, location_.line_, location_.func_, str_msg.c_str()); #endif -#else - printf("%s [%s:%d] %s] %s\n:", EnumStrForMsLogLevel(log_level_), location_.file_, location_.line_, location_.func_, - msg.str().c_str()); -#endif } void LogWriter::operator<(const LogStream &stream) const noexcept { diff --git a/mindspore/core/utils/log_adapter.h b/mindspore/core/utils/log_adapter.h index 8781298d79..4617a4dab8 100644 --- a/mindspore/core/utils/log_adapter.h +++ b/mindspore/core/utils/log_adapter.h @@ -25,13 +25,11 @@ #include #include "utils/overload.h" #include "./securec.h" -#ifndef USE_ANDROID_LOG #ifdef USE_GLOG #include "glog/logging.h" #else #include "toolchain/slog.h" #endif -#endif // NOTICE: when relative path of 'log_adapter.h' changed, macro 'LOG_HDR_FILE_REL_PATH' must be changed #define LOG_HDR_FILE_REL_PATH "mindspore/core/utils/log_adapter.h" @@ -126,6 +124,7 @@ enum SubModuleId : int { SM_VM, // VM SM_PROFILER, // profiler SM_PS, // Parameter Server + SM_LITE, // LITE NUM_SUBMODUES // number of submodules }; diff --git a/mindspore/lite/CMakeLists.txt b/mindspore/lite/CMakeLists.txt index f0864bd3c6..9fe0586897 100644 --- a/mindspore/lite/CMakeLists.txt +++ b/mindspore/lite/CMakeLists.txt @@ -80,7 +80,6 @@ option(OFFLINE_COMPILE "if offline compile OpenCL kernel" off) set(BUILD_MINDDATA "off" CACHE STRING "off, lite, lite_cv or full") option(BUILD_MINDDATA_EXAMPLE "" on) option(ENABLE_VERBOSE "" off) -add_compile_definitions(USE_ANDROID_LOG) add_compile_definitions(NO_DLIB) add_compile_options(-fPIC) string(REPLACE "-g" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") diff --git a/mindspore/lite/nnacl/optimized_kernel.h b/mindspore/lite/nnacl/optimized_kernel.h index 7b3d7332e0..d070ec26d5 100644 --- a/mindspore/lite/nnacl/optimized_kernel.h +++ b/mindspore/lite/nnacl/optimized_kernel.h @@ -24,7 +24,7 @@ #include #include "nnacl/nnacl_utils.h" #endif -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #define OPTIMIZE_SHARED_LIBRARY_PATH "libmindspore-lite-optimize.so" #define FLOAT16_SHARED_LIBRARY_PATH "libmindspore-lite-fp16.so" diff --git a/mindspore/lite/src/CMakeLists.txt b/mindspore/lite/src/CMakeLists.txt index 19b58916f7..dd85a2251a 100644 --- a/mindspore/lite/src/CMakeLists.txt +++ b/mindspore/lite/src/CMakeLists.txt @@ -1,20 +1,23 @@ - +add_compile_definitions(USE_ANDROID_LOG) set(LITE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..) include_directories(${LITE_DIR}/nnacl/) include_directories(${LITE_DIR}/nnacl/optimize) if (PLATFORM_ARM32 OR PLATFORM_ARM64) -#for performance - if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") -#- fno - rtti - fno - exceptions - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -ffast-math") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -ffast-math") - endif() + #for performance + if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") + if (SUPPORT_GPU) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -ffast-math -fno-rtti") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -ffast-math -fno-rtti") + else () + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -ffast-math -fno-rtti -fno-exceptions") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -ffast-math -fno-rtti -fno-exceptions") + endif () + endif () endif () set(LITE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/common/graph_util.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/gvar/logging_level.cc ${CMAKE_CURRENT_SOURCE_DIR}/common/log_adapter.cc ${CMAKE_CURRENT_SOURCE_DIR}/runtime/allocator.cc ${CMAKE_CURRENT_SOURCE_DIR}/runtime/runtime_api.cc @@ -29,24 +32,24 @@ set(LITE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/scheduler.cc ${CMAKE_CURRENT_SOURCE_DIR}/lite_session.cc ${CMAKE_CURRENT_SOURCE_DIR}/model.cc - ) + ) if (SUPPORT_GPU) set(LITE_SRC - ${LITE_SRC} - ${CMAKE_CURRENT_SOURCE_DIR}/runtime/kernel/opencl/subgraph_opencl_kernel.cc - ${CMAKE_CURRENT_SOURCE_DIR}/runtime/kernel/opencl/utils.cc + ${LITE_SRC} + ${CMAKE_CURRENT_SOURCE_DIR}/runtime/kernel/opencl/subgraph_opencl_kernel.cc + ${CMAKE_CURRENT_SOURCE_DIR}/runtime/kernel/opencl/utils.cc ${CMAKE_CURRENT_SOURCE_DIR}/runtime/opencl/opencl_executor.cc ${CMAKE_CURRENT_SOURCE_DIR}/runtime/opencl/opencl_allocator.cc ${CMAKE_CURRENT_SOURCE_DIR}/runtime/opencl/opencl_runtime.cc ${CMAKE_CURRENT_SOURCE_DIR}/runtime/opencl/opencl_wrapper.cc - ) -endif() + ) +endif () if (SUPPORT_TRAIN) set(ANF_SRC - ${ANF_SRC} + ${ANF_SRC} ) set(PASS_SRC) set(LITE_SRC @@ -71,56 +74,56 @@ set_target_properties(mindspore-lite_static PROPERTIES CLEAN_DIRECT_OUTPUT 1) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-private-field") if (SUPPORT_GPU) - add_subdirectory(runtime/kernel/opencl) - target_link_libraries(mindspore-lite cpu_kernel_mid opencl_kernel_mid nnacl) - target_link_libraries(mindspore-lite_static cpu_kernel_mid opencl_kernel_mid nnacl) + add_subdirectory(runtime/kernel/opencl) + target_link_libraries(mindspore-lite cpu_kernel_mid opencl_kernel_mid nnacl) + target_link_libraries(mindspore-lite_static cpu_kernel_mid opencl_kernel_mid nnacl) else () - target_link_libraries(mindspore-lite cpu_kernel_mid nnacl) - target_link_libraries(mindspore-lite_static cpu_kernel_mid nnacl) + target_link_libraries(mindspore-lite cpu_kernel_mid nnacl) + target_link_libraries(mindspore-lite_static cpu_kernel_mid nnacl) endif () if (PLATFORM_ARM32 OR PLATFORM_ARM64) - target_link_libraries(mindspore-lite log) + target_link_libraries(mindspore-lite log) endif () if (BUILD_MINDDATA STREQUAL "lite") - target_link_libraries(mindspore-lite minddata_eager_mid minddata-lite) - target_link_libraries(mindspore-lite_static minddata_eager_mid) + target_link_libraries(mindspore-lite minddata_eager_mid minddata-lite) + target_link_libraries(mindspore-lite_static minddata_eager_mid) endif () if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND (PLATFORM_ARM64 OR PLATFORM_ARM32)) - add_custom_command(TARGET mindspore-lite POST_BUILD - COMMAND ${ANDROID_NDK}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android/bin/strip - ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite.so) + add_custom_command(TARGET mindspore-lite POST_BUILD + COMMAND ${ANDROID_NDK}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android/bin/strip + ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite.so) endif () if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") - if (PLATFORM_ARM64 OR PLATFORM_ARM32) - add_custom_command(TARGET mindspore-lite POST_BUILD - COMMAND ${ANDROID_NDK}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android/bin/strip - ${CMAKE_BINARY_DIR}/src/libmindspore-lite.so) - elseif (NOT WIN32) - add_custom_command(TARGET mindspore-lite POST_BUILD - COMMAND strip ${CMAKE_BINARY_DIR}/src/libmindspore-lite.so) - endif () + if (PLATFORM_ARM64 OR PLATFORM_ARM32) + add_custom_command(TARGET mindspore-lite POST_BUILD + COMMAND ${ANDROID_NDK}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android/bin/strip + ${CMAKE_BINARY_DIR}/src/libmindspore-lite.so) + elseif (NOT WIN32) + add_custom_command(TARGET mindspore-lite POST_BUILD + COMMAND strip ${CMAKE_BINARY_DIR}/src/libmindspore-lite.so) + endif () endif () ########################## build optimize and float16 library #################################3 if (PLATFORM_ARM64) - add_library(mindspore-lite-optimize SHARED) - target_link_libraries(mindspore-lite-optimize cpu_opt_kernel_mid) - target_link_libraries(mindspore-lite-optimize nnacl_optimize) + add_library(mindspore-lite-optimize SHARED) + target_link_libraries(mindspore-lite-optimize cpu_opt_kernel_mid) + target_link_libraries(mindspore-lite-optimize nnacl_optimize) - add_library(mindspore-lite-fp16 SHARED) - target_link_libraries(mindspore-lite-fp16 cpu_fp16_kernel_mid) - target_link_libraries(mindspore-lite-fp16 nnacl_fp16) + add_library(mindspore-lite-fp16 SHARED) + target_link_libraries(mindspore-lite-fp16 cpu_fp16_kernel_mid) + target_link_libraries(mindspore-lite-fp16 nnacl_fp16) endif () if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND (PLATFORM_ARM64)) - add_custom_command(TARGET mindspore-lite-optimize POST_BUILD COMMAND - ${ANDROID_NDK}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android/bin/strip - ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite-optimize.so) + add_custom_command(TARGET mindspore-lite-optimize POST_BUILD COMMAND + ${ANDROID_NDK}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android/bin/strip + ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite-optimize.so) - add_custom_command(TARGET mindspore-lite-fp16 POST_BUILD COMMAND - ${ANDROID_NDK}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android/bin/strip - ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite-fp16.so) + add_custom_command(TARGET mindspore-lite-fp16 POST_BUILD COMMAND + ${ANDROID_NDK}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android/bin/strip + ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite-fp16.so) endif () diff --git a/mindspore/lite/src/common/file_utils.h b/mindspore/lite/src/common/file_utils.h index 76dbe10255..c1751d9a28 100644 --- a/mindspore/lite/src/common/file_utils.h +++ b/mindspore/lite/src/common/file_utils.h @@ -25,7 +25,7 @@ #include #include #include "src/common/utils.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" namespace mindspore { namespace lite { diff --git a/mindspore/lite/src/common/file_utils_ext.h b/mindspore/lite/src/common/file_utils_ext.h index 086e6c2363..2f6561ffbf 100644 --- a/mindspore/lite/src/common/file_utils_ext.h +++ b/mindspore/lite/src/common/file_utils_ext.h @@ -22,6 +22,6 @@ namespace mindspore { namespace lite { int CompareRelativeOutput(float *output_data, std::string file_path); float RelativeOutputError(float *output_data, std::string file_path); -} +} // namespace lite } // namespace mindspore #endif // MINDSPORE_LITE_COMMON_FILE_UTILS_EXT_H_ diff --git a/mindspore/lite/src/common/graph_util.cc b/mindspore/lite/src/common/graph_util.cc index 82236453d0..9e8a135cd9 100644 --- a/mindspore/lite/src/common/graph_util.cc +++ b/mindspore/lite/src/common/graph_util.cc @@ -19,7 +19,7 @@ #include #include "src/common/graph_util.h" #include "src/common/utils.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "include/errorcode.h" namespace mindspore { diff --git a/mindspore/lite/src/common/graph_util.h b/mindspore/lite/src/common/graph_util.h index 890724a4ea..0fdebcd46d 100644 --- a/mindspore/lite/src/common/graph_util.h +++ b/mindspore/lite/src/common/graph_util.h @@ -23,7 +23,7 @@ #include #include #include "schema/model_generated.h" -#include "utils//log_adapter.h" +#include "src/common/log_adapter.h" #include "include/errorcode.h" #include "include/model.h" diff --git a/mindspore/lite/src/common/graph_utils_extends.cc b/mindspore/lite/src/common/graph_utils_extends.cc deleted file mode 100644 index f7652194fb..0000000000 --- a/mindspore/lite/src/common/graph_utils_extends.cc +++ /dev/null @@ -1,149 +0,0 @@ -/** - * Copyright 2020 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. - */ - -#include "ir/graph_utils.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ir/visitor.h" -#include "ir/func_graph.h" -#include "utils/label.h" -#include "utils/log_adapter.h" -#include "src/common/utils.h" - -namespace mindspore { -namespace { -class DeepFirstSearcher { - public: - explicit DeepFirstSearcher(const IncludeFunc &include) : include_(include) {} - ~DeepFirstSearcher() = default; - - std::vector Search(const AnfNodePtr &root) { - if (root == nullptr) { - return res_; - } - seen_ = NewSeenGeneration(); - Visit(root); - return res_; - } - - void Visit(const AnfNodePtr &node) { - if (node == nullptr) { - return; - } - if (node->seen_ == seen_) { - return; - } - - node->seen_ = seen_; - - auto incl = include_(node); - if (incl == EXCLUDE) { - return; - } - if (filter_ == nullptr || !filter_(node)) { - res_.push_back(node); - } - if (incl == FOLLOW) { - if (node->isa()) { - auto cnode = node->cast(); - auto &inputs = cnode->inputs(); - for (auto iter = inputs.rbegin(); iter != inputs.rend(); ++iter) { - Visit(*iter); - } - return; - } - } - } - - private: - size_t seen_{0}; - IncludeFunc include_; - FilterFunc filter_; - std::vector res_{}; -}; - -class DeepScopedGraphSearcher : public DeepFirstSearcher { - public: - explicit DeepScopedGraphSearcher(const IncludeFunc &include) : DeepFirstSearcher(include) {} - ~DeepScopedGraphSearcher() = default; - - void Visit(const CNodePtr &cnode) { return; } - - void Visit(const ValueNodePtr &vnode) { - if (!IsValueNode(vnode)) { - return; - } - - auto graph = GetValueNode(vnode); - AnfNodePtr ret = graph->get_return(); - if (ret != nullptr) { - DeepFirstSearcher::Visit(ret); - } - } - - void Visit(const ParameterPtr ¶m) { - if (param->func_graph() == nullptr) { - return; - } - - AnfNodePtr ret = param->func_graph()->get_return(); - if (ret != nullptr) { - DeepFirstSearcher::Visit(ret); - } - } -}; - -class DeepUsedGraphSearcher : public DeepFirstSearcher { - public: - explicit DeepUsedGraphSearcher(const IncludeFunc &include) : DeepFirstSearcher(include) {} - ~DeepUsedGraphSearcher() = default; - - void Visit(const CNodePtr &cnode) { return; } - - void Visit(const ValueNodePtr &vnode) { return; } -}; - -class DeepLinkedGraphSearcher : public DeepFirstSearcher { - public: - explicit DeepLinkedGraphSearcher(const IncludeFunc &include) : DeepFirstSearcher(include) {} - ~DeepLinkedGraphSearcher() = default; - - void Visit(const CNodePtr &cnode) { return; } - - void Visit(const ValueNodePtr &) {} -}; -} // namespace - -std::vector DeepScopedGraphSearch(const AnfNodePtr &root, const IncludeFunc &include) { - return DeepScopedGraphSearcher(include).Search(root); -} - -std::vector DeepUsedGraphSearch(const AnfNodePtr &root, const IncludeFunc &include) { - return DeepUsedGraphSearcher(include).Search(root); -} - -std::vector DeepLinkedGraphSearch(const AnfNodePtr &root, const IncludeFunc &include) { - return DeepLinkedGraphSearcher(include).Search(root); -} -} // namespace mindspore diff --git a/mindspore/lite/src/common/log_adapter.cc b/mindspore/lite/src/common/log_adapter.cc index 35e49ddfcf..9253ffc379 100644 --- a/mindspore/lite/src/common/log_adapter.cc +++ b/mindspore/lite/src/common/log_adapter.cc @@ -14,12 +14,10 @@ * limitations under the License. */ -#include "utils/log_adapter.h" - -#include -#include -#include +#include "src/common/log_adapter.h" #include +#include + #ifdef ENABLE_ARM #include #endif @@ -29,19 +27,19 @@ namespace mindspore { constexpr const char *ANDROID_LOG_TAG = "MS_LITE"; int EnvToInt(const char *env) { - if (env == nullptr) return -1; - if (strcmp(env, "DEBUG") == 0) return 0; - if (strcmp(env, "INFO") == 0) return 1; - if (strcmp(env, "WARNING") == 0) return 2; - if (strcmp(env, "ERROR") == 0) return 3; - return -1; + if (env == nullptr) return 2; + if (strcmp(env, "0") == 0) return 0; + if (strcmp(env, "1") == 0) return 1; + if (strcmp(env, "2") == 0) return 2; + if (strcmp(env, "3") == 0) return 3; + return 2; } bool IsPrint(int level) { - static const char *env = std::getenv("MSLOG"); + static const char *env = std::getenv("GLOG_v"); static int ms_level = EnvToInt(env); - if (ms_level < 0) { - ms_level = 2; + if (level < 0) { + level = 2; } return level >= ms_level; } @@ -72,50 +70,19 @@ const char *EnumStrForMsLogLevel(MsLogLevel level) { return "WARNING"; } else if (level == ERROR) { return "ERROR"; - } else if (level == EXCEPTION) { - return "EXCEPTION"; } else { return "NO_LEVEL"; } } -static std::string ExceptionTypeToString(ExceptionType type) { -#define _TO_STRING(x) #x - // clang-format off - static const char *const type_names[] = { - _TO_STRING(NoExceptionType), - _TO_STRING(UnknownError), - _TO_STRING(ArgumentError), - _TO_STRING(NotSupportError), - _TO_STRING(NotExistsError), - _TO_STRING(AlreadyExistsError), - _TO_STRING(UnavailableError), - _TO_STRING(DeviceProcessError), - _TO_STRING(AbortedError), - _TO_STRING(TimeOutError), - _TO_STRING(ResourceUnavailable), - _TO_STRING(NoPermissionError), - _TO_STRING(IndexError), - _TO_STRING(ValueError), - _TO_STRING(TypeError), - _TO_STRING(AttributeError), - }; - // clang-format on -#undef _TO_STRING - if (type < UnknownError || type > AttributeError) { - type = UnknownError; - } - return std::string(type_names[type]); -} - void LogWriter::OutputLog(const std::ostringstream &msg) const { - if (IsPrint(log_level_) && submodule_ != SM_UNKNOWN) { + if (IsPrint(log_level_)) { #ifdef ENABLE_ARM __android_log_print(GetAndroidLogLevel(log_level_), ANDROID_LOG_TAG, "[%s:%d] %s] %s", 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()); + printf("%s [%s:%d] %s] %s\n", EnumStrForMsLogLevel(log_level_), location_.file_, location_.line_, location_.func_, + msg.str().c_str()); #endif } } @@ -125,27 +92,4 @@ void LogWriter::operator<(const LogStream &stream) const noexcept { msg << stream.sstream_->rdbuf(); OutputLog(msg); } - -void LogWriter::operator^(const LogStream &stream) const { - std::ostringstream msg; - msg << stream.sstream_->rdbuf(); - OutputLog(msg); - - std::ostringstream oss; - oss << location_.file_ << ":" << location_.line_ << " " << location_.func_ << "] "; - if (exception_type_ != NoExceptionType && exception_type_ != IndexError && exception_type_ != TypeError && - exception_type_ != ValueError && exception_type_ != AttributeError) { - oss << ExceptionTypeToString(exception_type_) << " "; - } - oss << msg.str(); - - if (trace_provider_ != nullptr) { - trace_provider_(oss); - } - - if (exception_handler_ != nullptr) { - exception_handler_(exception_type_, oss.str()); - } - throw std::runtime_error(oss.str()); -} } // namespace mindspore diff --git a/mindspore/lite/src/common/log_adapter.h b/mindspore/lite/src/common/log_adapter.h new file mode 100644 index 0000000000..848a754294 --- /dev/null +++ b/mindspore/lite/src/common/log_adapter.h @@ -0,0 +1,112 @@ +/** + * Copyright 2019 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. + */ + +#ifndef MINDSPORE_LITE_COMMON_LOG_ADAPTER_H_ +#define MINDSPORE_LITE_COMMON_LOG_ADAPTER_H_ +#ifdef USE_GLOG +#include "utils/log_adapter.h" +#else +#include +#include +#include +#include +#include +#include +#include "utils/overload.h" +// NOTICE: when relative path of 'log_adapter.h' changed, macro 'LOG_HEAR_FILE_REL_PATH' must be changed +#define LOG_HEAR_FILE_REL_PATH "mindspore/lite/src/common/log_adapter.h" + +// Get start index of file relative path in __FILE__ +static constexpr int GetRealPathPos() noexcept { + return sizeof(__FILE__) > sizeof(LOG_HEAR_FILE_REL_PATH) ? sizeof(__FILE__) - sizeof(LOG_HEAR_FILE_REL_PATH) : 0; +} + +namespace mindspore { +#define FILE_NAME \ + (sizeof(__FILE__) > GetRealPathPos() ? static_cast(__FILE__) + GetRealPathPos() \ + : static_cast(__FILE__)) + +struct LocationInfo { + LocationInfo(const char *file, int line, const char *func) : file_(file), line_(line), func_(func) {} + + ~LocationInfo() = default; + + const char *file_; + int line_; + const char *func_; +}; + +class LogStream { + public: + LogStream() { sstream_ = std::make_shared(); } + + ~LogStream() = default; + + template + LogStream &operator<<(const T &val) noexcept { + (*sstream_) << val; + return *this; + } + + LogStream &operator<<(std::ostream &func(std::ostream &os)) noexcept { + (*sstream_) << func; + return *this; + } + friend class LogWriter; + + private: + std::shared_ptr sstream_; +}; + +enum MsLogLevel : int { DEBUG = 0, INFO, WARNING, ERROR }; + +const char *EnumStrForMsLogLevel(MsLogLevel level); + +class LogWriter { + public: + LogWriter(const LocationInfo &location, MsLogLevel log_level) : location_(location), log_level_(log_level) {} + + ~LogWriter() = default; + + void operator<(const LogStream &stream) const noexcept __attribute__((visibility("default"))); + + private: + void OutputLog(const std::ostringstream &msg) const; + + LocationInfo location_; + MsLogLevel log_level_; +}; + +#define MSLOG_IF(level) \ + mindspore::LogWriter(mindspore::LocationInfo(FILE_NAME, __LINE__, __FUNCTION__), level) < mindspore::LogStream() + +#define MS_LOG(level) MS_LOG_##level + +#define MS_LOG_DEBUG MSLOG_IF(mindspore::DEBUG) +#define MS_LOG_INFO MSLOG_IF(mindspore::INFO) +#define MS_LOG_WARNING MSLOG_IF(mindspore::WARNING) +#define MS_LOG_ERROR MSLOG_IF(mindspore::ERROR) + +} // namespace mindspore + +#ifdef DEBUG +#include +#define MS_ASSERT(f) assert(f) +#else +#define MS_ASSERT(f) ((void)0) +#endif +#endif +#endif // MINDSPORE_LITE_COMMON_LOG_ADAPTER_H_ diff --git a/mindspore/lite/src/common/utils.h b/mindspore/lite/src/common/utils.h index 156abcc692..7ef2389368 100644 --- a/mindspore/lite/src/common/utils.h +++ b/mindspore/lite/src/common/utils.h @@ -24,7 +24,7 @@ #include #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/common/option.h" #include "include/errorcode.h" diff --git a/mindspore/lite/src/inner_context.cc b/mindspore/lite/src/inner_context.cc index 109aa34999..085bf19bf6 100644 --- a/mindspore/lite/src/inner_context.cc +++ b/mindspore/lite/src/inner_context.cc @@ -16,7 +16,7 @@ #include "src/inner_context.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" namespace mindspore::lite { int InnerContext::Init() { diff --git a/mindspore/lite/src/kernel_registry.cc b/mindspore/lite/src/kernel_registry.cc index 93e1077db4..a245e285f1 100644 --- a/mindspore/lite/src/kernel_registry.cc +++ b/mindspore/lite/src/kernel_registry.cc @@ -15,12 +15,12 @@ */ #include "src/kernel_registry.h" #include "include/errorcode.h" -#include "ir/dtype/type_id.h" + #include "src/populate_parameter.h" #ifdef ENABLE_ARM64 #include #include "common/utils.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "nnacl/optimized_kernel.h" #endif diff --git a/mindspore/lite/src/lite_session.cc b/mindspore/lite/src/lite_session.cc index 2b971837d9..7ff6a9bdc1 100644 --- a/mindspore/lite/src/lite_session.cc +++ b/mindspore/lite/src/lite_session.cc @@ -19,7 +19,7 @@ #include #include "src/runtime/runtime_api.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/scheduler.h" #include "src/runtime/allocator.h" #include "src/executor.h" diff --git a/mindspore/lite/src/model.cc b/mindspore/lite/src/model.cc index 8f5a896820..f3caca9236 100644 --- a/mindspore/lite/src/model.cc +++ b/mindspore/lite/src/model.cc @@ -15,7 +15,7 @@ */ #include "src/ops/primitive_c.h" #include "include/model.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "include/errorcode.h" #include "src/common/graph_util.h" #include "include/version.h" @@ -86,14 +86,14 @@ Model *Model::Import(const char *model_buf, size_t size) { model->buf = reinterpret_cast(malloc(size)); if (model->buf == nullptr) { MS_LOG(ERROR) << "new inner model buf fail!"; - delete(model); + delete (model); return nullptr; } memcpy(model->buf, model_buf, size); auto meta_graph = schema::GetMetaGraph(model->buf); if (meta_graph == nullptr) { MS_LOG(ERROR) << "meta_graph is nullptr!"; - delete(model); + delete (model); return nullptr; } diff --git a/mindspore/lite/src/ops/abs.h b/mindspore/lite/src/ops/abs.h index 7b4fdc1e45..9d04b1aa2d 100644 --- a/mindspore/lite/src/ops/abs.h +++ b/mindspore/lite/src/ops/abs.h @@ -17,7 +17,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic_self.h" #ifndef LITE_MINDSPORE_LITE_C_OPS_ABS_H_ diff --git a/mindspore/lite/src/ops/activation.h b/mindspore/lite/src/ops/activation.h index 19181d977c..5dfed611a1 100644 --- a/mindspore/lite/src/ops/activation.h +++ b/mindspore/lite/src/ops/activation.h @@ -19,7 +19,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/activation_grad.h b/mindspore/lite/src/ops/activation_grad.h index 907c5c589e..04c35ce9be 100644 --- a/mindspore/lite/src/ops/activation_grad.h +++ b/mindspore/lite/src/ops/activation_grad.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/add.h b/mindspore/lite/src/ops/add.h index 78583b909b..1d2ca6767f 100644 --- a/mindspore/lite/src/ops/add.h +++ b/mindspore/lite/src/ops/add.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/addn.h b/mindspore/lite/src/ops/addn.h index 0483efe4b3..cf726a3b05 100644 --- a/mindspore/lite/src/ops/addn.h +++ b/mindspore/lite/src/ops/addn.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/apply_momentum.h b/mindspore/lite/src/ops/apply_momentum.h index e53306685d..67ef1b5fc8 100644 --- a/mindspore/lite/src/ops/apply_momentum.h +++ b/mindspore/lite/src/ops/apply_momentum.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/argmax.h b/mindspore/lite/src/ops/argmax.h index 9546642864..5bfbacd3b2 100644 --- a/mindspore/lite/src/ops/argmax.h +++ b/mindspore/lite/src/ops/argmax.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/argmin.h b/mindspore/lite/src/ops/argmin.h index a81bce8f37..2a6e0eebdf 100644 --- a/mindspore/lite/src/ops/argmin.h +++ b/mindspore/lite/src/ops/argmin.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/arithmetic.cc b/mindspore/lite/src/ops/arithmetic.cc index 69c84bf6a9..d020e32451 100644 --- a/mindspore/lite/src/ops/arithmetic.cc +++ b/mindspore/lite/src/ops/arithmetic.cc @@ -16,7 +16,7 @@ #include "src/ops/arithmetic.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/tensor.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/arithmetic.h b/mindspore/lite/src/ops/arithmetic.h index e9df6776f9..78283c82e8 100644 --- a/mindspore/lite/src/ops/arithmetic.h +++ b/mindspore/lite/src/ops/arithmetic.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/arithmetic_grad.cc b/mindspore/lite/src/ops/arithmetic_grad.cc index 490269e9a6..c4138444b2 100644 --- a/mindspore/lite/src/ops/arithmetic_grad.cc +++ b/mindspore/lite/src/ops/arithmetic_grad.cc @@ -16,7 +16,7 @@ #include "src/ops/arithmetic_grad.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/tensor.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/arithmetic_grad.h b/mindspore/lite/src/ops/arithmetic_grad.h index d01f8620d7..3cc4fb7d4d 100644 --- a/mindspore/lite/src/ops/arithmetic_grad.h +++ b/mindspore/lite/src/ops/arithmetic_grad.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { @@ -32,7 +31,7 @@ class ArithmeticGrad : public PrimitiveC { ArithmeticGrad() = default; explicit ArithmeticGrad(schema::PrimitiveT *primitive) : PrimitiveC(primitive) {} #else -// explicit ArithmeticGrad(const schema::Primitive &primitive) : PrimitiveC(primitive) {} + // explicit ArithmeticGrad(const schema::Primitive &primitive) : PrimitiveC(primitive) {} ArithmeticGrad() = default; int UnPackToFlatBuilder(const schema::Primitive *primitive, flatbuffers::FlatBufferBuilder *fbb) override { return RET_ERROR; diff --git a/mindspore/lite/src/ops/arithmetic_self.cc b/mindspore/lite/src/ops/arithmetic_self.cc index bee2a0a0d3..0cdeeca9d8 100644 --- a/mindspore/lite/src/ops/arithmetic_self.cc +++ b/mindspore/lite/src/ops/arithmetic_self.cc @@ -16,7 +16,7 @@ #include "src/ops/arithmetic_self.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" namespace mindspore { namespace lite { diff --git a/mindspore/lite/src/ops/batch_norm.h b/mindspore/lite/src/ops/batch_norm.h index 03dac3a71e..cfa599fc4c 100644 --- a/mindspore/lite/src/ops/batch_norm.h +++ b/mindspore/lite/src/ops/batch_norm.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/batch_to_space.cc b/mindspore/lite/src/ops/batch_to_space.cc index 5f16aa9a41..c723e03e1c 100644 --- a/mindspore/lite/src/ops/batch_to_space.cc +++ b/mindspore/lite/src/ops/batch_to_space.cc @@ -17,7 +17,7 @@ #include "src/ops/batch_to_space.h" #include "src/common/common.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/tensor.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/batch_to_space.h b/mindspore/lite/src/ops/batch_to_space.h index fad5f710e7..cc6105d824 100644 --- a/mindspore/lite/src/ops/batch_to_space.h +++ b/mindspore/lite/src/ops/batch_to_space.h @@ -21,7 +21,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/bias_add.h b/mindspore/lite/src/ops/bias_add.h index 1298cf28f1..8aed794a56 100644 --- a/mindspore/lite/src/ops/bias_add.h +++ b/mindspore/lite/src/ops/bias_add.h @@ -21,7 +21,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/bias_grad.h b/mindspore/lite/src/ops/bias_grad.h index cfcb25fef2..b15f8d2f28 100644 --- a/mindspore/lite/src/ops/bias_grad.h +++ b/mindspore/lite/src/ops/bias_grad.h @@ -21,7 +21,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/bn_grad.h b/mindspore/lite/src/ops/bn_grad.h index a4441f2351..beb794e795 100644 --- a/mindspore/lite/src/ops/bn_grad.h +++ b/mindspore/lite/src/ops/bn_grad.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { @@ -38,8 +37,7 @@ class BNGrad : public PrimitiveC { BNGrad() = default; int UnPackToFlatBuilder(const schema::Primitive *primitive, flatbuffers::FlatBufferBuilder *fbb) override; #endif - int InferShape(std::vector inputs_, - std::vector outputs_) override; + int InferShape(std::vector inputs_, std::vector outputs_) override; float GetEps() const; float GetMomentum() const; }; diff --git a/mindspore/lite/src/ops/broadcast_to.h b/mindspore/lite/src/ops/broadcast_to.h index 44a01dff36..53c5dca8ed 100644 --- a/mindspore/lite/src/ops/broadcast_to.h +++ b/mindspore/lite/src/ops/broadcast_to.h @@ -21,7 +21,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/cast.h b/mindspore/lite/src/ops/cast.h index 7e375c0cf6..ab12731367 100644 --- a/mindspore/lite/src/ops/cast.h +++ b/mindspore/lite/src/ops/cast.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/ceil.h b/mindspore/lite/src/ops/ceil.h index 6af9ef2910..70093e00ca 100644 --- a/mindspore/lite/src/ops/ceil.h +++ b/mindspore/lite/src/ops/ceil.h @@ -21,7 +21,6 @@ #include #include #include "src/ops/arithmetic_self.h" -#include "ir/dtype/type_id.h" namespace mindspore { namespace lite { diff --git a/mindspore/lite/src/ops/clip.h b/mindspore/lite/src/ops/clip.h index 7cd343dbad..4b5217db4b 100644 --- a/mindspore/lite/src/ops/clip.h +++ b/mindspore/lite/src/ops/clip.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/concat.cc b/mindspore/lite/src/ops/concat.cc index 90f7b9d5a3..31a63fb002 100644 --- a/mindspore/lite/src/ops/concat.cc +++ b/mindspore/lite/src/ops/concat.cc @@ -17,7 +17,7 @@ #include "src/ops/concat.h" #include #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/tensor.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/concat.h b/mindspore/lite/src/ops/concat.h index d444033e6a..671fac8841 100644 --- a/mindspore/lite/src/ops/concat.h +++ b/mindspore/lite/src/ops/concat.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/constant_of_shape.cc b/mindspore/lite/src/ops/constant_of_shape.cc index 938bcedcfc..b80852a9c2 100644 --- a/mindspore/lite/src/ops/constant_of_shape.cc +++ b/mindspore/lite/src/ops/constant_of_shape.cc @@ -16,7 +16,7 @@ #include "src/ops/constant_of_shape.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/tensor.h" namespace mindspore::lite { diff --git a/mindspore/lite/src/ops/constant_of_shape.h b/mindspore/lite/src/ops/constant_of_shape.h index a14d020c49..26917929ed 100644 --- a/mindspore/lite/src/ops/constant_of_shape.h +++ b/mindspore/lite/src/ops/constant_of_shape.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/conv2d.cc b/mindspore/lite/src/ops/conv2d.cc index d4ed1bd83d..ba635eba09 100644 --- a/mindspore/lite/src/ops/conv2d.cc +++ b/mindspore/lite/src/ops/conv2d.cc @@ -21,7 +21,7 @@ #include #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #ifdef PRIMITIVE_WRITEABLE #include @@ -120,8 +120,8 @@ void ConvertConvWeight(const ParameterPtr ¶m_node) { utils::cast(abstract_tensor->BuildShape())->shape()[1] = filter_k; utils::cast(abstract_tensor->BuildShape())->shape()[2] = filter_h; utils::cast(abstract_tensor->BuildShape())->shape()[3] = filter_w; - weight->set_tensor_shape({static_cast(filter_c), static_cast(filter_k), static_cast(filter_h), - static_cast(filter_w)}); + weight->set_tensor_shape( + {static_cast(filter_c), static_cast(filter_k), static_cast(filter_h), static_cast(filter_w)}); } return; } diff --git a/mindspore/lite/src/ops/conv2d.h b/mindspore/lite/src/ops/conv2d.h index 5a8e8b4e79..42e8dfe70f 100644 --- a/mindspore/lite/src/ops/conv2d.h +++ b/mindspore/lite/src/ops/conv2d.h @@ -22,7 +22,6 @@ #include #include #include "src/ops/primitive_c.h" -#include "ir/dtype/type_id.h" namespace mindspore { namespace lite { diff --git a/mindspore/lite/src/ops/conv2d_grad_filter.cc b/mindspore/lite/src/ops/conv2d_grad_filter.cc index 4b5bff7218..42b1283ead 100644 --- a/mindspore/lite/src/ops/conv2d_grad_filter.cc +++ b/mindspore/lite/src/ops/conv2d_grad_filter.cc @@ -87,7 +87,7 @@ int Conv2DGradFilter::UnPackAttr(const Primitive &prim, const std::vectorgroup = GetValue(prim.GetAttr("group")); + attr->group = GetValue(prim.GetAttr("group")); auto format = GetValue(prim.GetAttr("data_format")); if (format == "NCHW") { attr->format = schema::Format_NCHW; diff --git a/mindspore/lite/src/ops/conv2d_grad_filter.h b/mindspore/lite/src/ops/conv2d_grad_filter.h index eb7b4737b2..b723308982 100644 --- a/mindspore/lite/src/ops/conv2d_grad_filter.h +++ b/mindspore/lite/src/ops/conv2d_grad_filter.h @@ -22,7 +22,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/conv2d_grad_input.h b/mindspore/lite/src/ops/conv2d_grad_input.h index 51a683213c..1247676087 100644 --- a/mindspore/lite/src/ops/conv2d_grad_input.h +++ b/mindspore/lite/src/ops/conv2d_grad_input.h @@ -22,7 +22,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/cos.h b/mindspore/lite/src/ops/cos.h index b88a41f13b..e241edf78f 100644 --- a/mindspore/lite/src/ops/cos.h +++ b/mindspore/lite/src/ops/cos.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/arithmetic_self.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/crop.h b/mindspore/lite/src/ops/crop.h index 8c8a81464c..aa586110f8 100644 --- a/mindspore/lite/src/ops/crop.h +++ b/mindspore/lite/src/ops/crop.h @@ -21,7 +21,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/deconv2d.h b/mindspore/lite/src/ops/deconv2d.h index a73dfdf337..e11d346e16 100644 --- a/mindspore/lite/src/ops/deconv2d.h +++ b/mindspore/lite/src/ops/deconv2d.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/dedepthwise_conv2d.h b/mindspore/lite/src/ops/dedepthwise_conv2d.h index 6b0064979c..7ab1b19390 100644 --- a/mindspore/lite/src/ops/dedepthwise_conv2d.h +++ b/mindspore/lite/src/ops/dedepthwise_conv2d.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/depth_to_space.h b/mindspore/lite/src/ops/depth_to_space.h index 6457655f9c..699e1a0575 100644 --- a/mindspore/lite/src/ops/depth_to_space.h +++ b/mindspore/lite/src/ops/depth_to_space.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/depthwise_conv2d.h b/mindspore/lite/src/ops/depthwise_conv2d.h index 36bc8f037f..b1bf570788 100644 --- a/mindspore/lite/src/ops/depthwise_conv2d.h +++ b/mindspore/lite/src/ops/depthwise_conv2d.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/detection_post_process.h b/mindspore/lite/src/ops/detection_post_process.h index d2d92c7275..930e436534 100644 --- a/mindspore/lite/src/ops/detection_post_process.h +++ b/mindspore/lite/src/ops/detection_post_process.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/div.h b/mindspore/lite/src/ops/div.h index 6ca390b091..b26b2d4763 100644 --- a/mindspore/lite/src/ops/div.h +++ b/mindspore/lite/src/ops/div.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/dropout.h b/mindspore/lite/src/ops/dropout.h index f2a756eddd..1edb13bb59 100644 --- a/mindspore/lite/src/ops/dropout.h +++ b/mindspore/lite/src/ops/dropout.h @@ -21,7 +21,6 @@ #include #include #include "src/ops/primitive_c.h" -#include "ir/dtype/type_id.h" namespace mindspore { namespace lite { diff --git a/mindspore/lite/src/ops/eltwise.h b/mindspore/lite/src/ops/eltwise.h index 720724b94f..2c7bd65a34 100644 --- a/mindspore/lite/src/ops/eltwise.h +++ b/mindspore/lite/src/ops/eltwise.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/elu.h b/mindspore/lite/src/ops/elu.h index 955d9c9ab1..f076be6d4f 100644 --- a/mindspore/lite/src/ops/elu.h +++ b/mindspore/lite/src/ops/elu.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/embedding_lookup.h b/mindspore/lite/src/ops/embedding_lookup.h index 0ed66f718a..19f7494d8c 100644 --- a/mindspore/lite/src/ops/embedding_lookup.h +++ b/mindspore/lite/src/ops/embedding_lookup.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/embedding_lookup_sparse.h b/mindspore/lite/src/ops/embedding_lookup_sparse.h index 8ca4cd1177..99fe7d78fe 100644 --- a/mindspore/lite/src/ops/embedding_lookup_sparse.h +++ b/mindspore/lite/src/ops/embedding_lookup_sparse.h @@ -21,7 +21,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/equal.h b/mindspore/lite/src/ops/equal.h index 34d2d5d7f6..e492e03d65 100644 --- a/mindspore/lite/src/ops/equal.h +++ b/mindspore/lite/src/ops/equal.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/exp.h b/mindspore/lite/src/ops/exp.h index cfd2425305..e0159a1991 100644 --- a/mindspore/lite/src/ops/exp.h +++ b/mindspore/lite/src/ops/exp.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/expand_dims.h b/mindspore/lite/src/ops/expand_dims.h index 78899485a0..b6f5ece401 100644 --- a/mindspore/lite/src/ops/expand_dims.h +++ b/mindspore/lite/src/ops/expand_dims.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/fake_quant_with_min_max_vars.h b/mindspore/lite/src/ops/fake_quant_with_min_max_vars.h index a6f85f7b92..5aadd3d633 100644 --- a/mindspore/lite/src/ops/fake_quant_with_min_max_vars.h +++ b/mindspore/lite/src/ops/fake_quant_with_min_max_vars.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/fill.h b/mindspore/lite/src/ops/fill.h index 372be6a0ce..0d89ad6ea3 100644 --- a/mindspore/lite/src/ops/fill.h +++ b/mindspore/lite/src/ops/fill.h @@ -21,7 +21,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/flatten.h b/mindspore/lite/src/ops/flatten.h index 3a237b501f..76f440b207 100644 --- a/mindspore/lite/src/ops/flatten.h +++ b/mindspore/lite/src/ops/flatten.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/flatten_grad.h b/mindspore/lite/src/ops/flatten_grad.h index d65ff57f4a..d674da0084 100644 --- a/mindspore/lite/src/ops/flatten_grad.h +++ b/mindspore/lite/src/ops/flatten_grad.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/floor.h b/mindspore/lite/src/ops/floor.h index f970218cc4..e2e735259d 100644 --- a/mindspore/lite/src/ops/floor.h +++ b/mindspore/lite/src/ops/floor.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/arithmetic_self.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/floor_div.h b/mindspore/lite/src/ops/floor_div.h index 5525218708..255873a696 100644 --- a/mindspore/lite/src/ops/floor_div.h +++ b/mindspore/lite/src/ops/floor_div.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/floor_mod.h b/mindspore/lite/src/ops/floor_mod.h index adbca5e52c..946f20dbbf 100644 --- a/mindspore/lite/src/ops/floor_mod.h +++ b/mindspore/lite/src/ops/floor_mod.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/full_connection.h b/mindspore/lite/src/ops/full_connection.h index 02c2f0a542..3001899485 100644 --- a/mindspore/lite/src/ops/full_connection.h +++ b/mindspore/lite/src/ops/full_connection.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/fused_batchnorm.h b/mindspore/lite/src/ops/fused_batchnorm.h index ba6373b379..2707bd9188 100644 --- a/mindspore/lite/src/ops/fused_batchnorm.h +++ b/mindspore/lite/src/ops/fused_batchnorm.h @@ -20,7 +20,6 @@ #include #include #include -#include "ir/dtype/type_id.h" #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/gather.cc b/mindspore/lite/src/ops/gather.cc index c5575c3c81..a0ee20942e 100644 --- a/mindspore/lite/src/ops/gather.cc +++ b/mindspore/lite/src/ops/gather.cc @@ -16,7 +16,7 @@ #include "src/ops/gather.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/tensor.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/gather.h b/mindspore/lite/src/ops/gather.h index 73882f2879..554a9c46dc 100644 --- a/mindspore/lite/src/ops/gather.h +++ b/mindspore/lite/src/ops/gather.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/gather_nd.h b/mindspore/lite/src/ops/gather_nd.h index e2946d8aa7..50ca265784 100644 --- a/mindspore/lite/src/ops/gather_nd.h +++ b/mindspore/lite/src/ops/gather_nd.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/greater.h b/mindspore/lite/src/ops/greater.h index 611025152d..ef720a7dea 100644 --- a/mindspore/lite/src/ops/greater.h +++ b/mindspore/lite/src/ops/greater.h @@ -19,7 +19,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/greater_equal.h b/mindspore/lite/src/ops/greater_equal.h index c6a6001764..a25932dfed 100644 --- a/mindspore/lite/src/ops/greater_equal.h +++ b/mindspore/lite/src/ops/greater_equal.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/l2_norm.h b/mindspore/lite/src/ops/l2_norm.h index 19556b00a8..65f3c10967 100644 --- a/mindspore/lite/src/ops/l2_norm.h +++ b/mindspore/lite/src/ops/l2_norm.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/leaky_relu.h b/mindspore/lite/src/ops/leaky_relu.h index f72b75516a..07382dfd3e 100644 --- a/mindspore/lite/src/ops/leaky_relu.h +++ b/mindspore/lite/src/ops/leaky_relu.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/less.h b/mindspore/lite/src/ops/less.h index e230f89412..c88d28d906 100644 --- a/mindspore/lite/src/ops/less.h +++ b/mindspore/lite/src/ops/less.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/less_equal.h b/mindspore/lite/src/ops/less_equal.h index 43a906713d..705caf1cdd 100644 --- a/mindspore/lite/src/ops/less_equal.h +++ b/mindspore/lite/src/ops/less_equal.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/local_response_normalization.h b/mindspore/lite/src/ops/local_response_normalization.h index 108e0c8c83..6403b58458 100644 --- a/mindspore/lite/src/ops/local_response_normalization.h +++ b/mindspore/lite/src/ops/local_response_normalization.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/log.h b/mindspore/lite/src/ops/log.h index e96976cdf0..3cb6008183 100644 --- a/mindspore/lite/src/ops/log.h +++ b/mindspore/lite/src/ops/log.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic_self.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/log_grad.h b/mindspore/lite/src/ops/log_grad.h index 7ba52bfb04..0ba5673b15 100644 --- a/mindspore/lite/src/ops/log_grad.h +++ b/mindspore/lite/src/ops/log_grad.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/logical_and.h b/mindspore/lite/src/ops/logical_and.h index e323b7e9e8..0ec574bccf 100644 --- a/mindspore/lite/src/ops/logical_and.h +++ b/mindspore/lite/src/ops/logical_and.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/logical_not.h b/mindspore/lite/src/ops/logical_not.h index 69555551b8..74737744c0 100644 --- a/mindspore/lite/src/ops/logical_not.h +++ b/mindspore/lite/src/ops/logical_not.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic_self.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/logical_or.h b/mindspore/lite/src/ops/logical_or.h index 5afc583e48..5499c45a7a 100644 --- a/mindspore/lite/src/ops/logical_or.h +++ b/mindspore/lite/src/ops/logical_or.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/lrn.h b/mindspore/lite/src/ops/lrn.h index d1ccb69cb4..746cad03e1 100644 --- a/mindspore/lite/src/ops/lrn.h +++ b/mindspore/lite/src/ops/lrn.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/lstm.h b/mindspore/lite/src/ops/lstm.h index f64538f79a..7c8fe7b708 100644 --- a/mindspore/lite/src/ops/lstm.h +++ b/mindspore/lite/src/ops/lstm.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/matmul.h b/mindspore/lite/src/ops/matmul.h index 94faa9abfc..0ee3239836 100644 --- a/mindspore/lite/src/ops/matmul.h +++ b/mindspore/lite/src/ops/matmul.h @@ -21,7 +21,6 @@ #include #include #include "src/ops/primitive_c.h" -#include "ir/dtype/type_id.h" namespace mindspore { namespace lite { diff --git a/mindspore/lite/src/ops/matrix_diag.h b/mindspore/lite/src/ops/matrix_diag.h index fe36b2558d..ec75d58944 100644 --- a/mindspore/lite/src/ops/matrix_diag.h +++ b/mindspore/lite/src/ops/matrix_diag.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/maximum.h b/mindspore/lite/src/ops/maximum.h index 88fa03aa82..6704e8fe61 100644 --- a/mindspore/lite/src/ops/maximum.h +++ b/mindspore/lite/src/ops/maximum.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/mean.h b/mindspore/lite/src/ops/mean.h index 4ec2ddbba6..97b3835434 100644 --- a/mindspore/lite/src/ops/mean.h +++ b/mindspore/lite/src/ops/mean.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/minimum.h b/mindspore/lite/src/ops/minimum.h index 6c4a097952..d69e5c1597 100644 --- a/mindspore/lite/src/ops/minimum.h +++ b/mindspore/lite/src/ops/minimum.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/mul.h b/mindspore/lite/src/ops/mul.h index ba582db115..bcddee5fe4 100644 --- a/mindspore/lite/src/ops/mul.h +++ b/mindspore/lite/src/ops/mul.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/nchw2nhwc.h b/mindspore/lite/src/ops/nchw2nhwc.h index bec8b04aa7..77a9b8fbc0 100644 --- a/mindspore/lite/src/ops/nchw2nhwc.h +++ b/mindspore/lite/src/ops/nchw2nhwc.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/neg.h b/mindspore/lite/src/ops/neg.h index 1733666ac6..9e461ef10e 100644 --- a/mindspore/lite/src/ops/neg.h +++ b/mindspore/lite/src/ops/neg.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic_self.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/neg_grad.h b/mindspore/lite/src/ops/neg_grad.h index 061d387bdf..94def48398 100644 --- a/mindspore/lite/src/ops/neg_grad.h +++ b/mindspore/lite/src/ops/neg_grad.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic_self.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/nhwc2nchw.h b/mindspore/lite/src/ops/nhwc2nchw.h index 8a8e9fab7d..ad0c2f56e4 100644 --- a/mindspore/lite/src/ops/nhwc2nchw.h +++ b/mindspore/lite/src/ops/nhwc2nchw.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/not_equal.h b/mindspore/lite/src/ops/not_equal.h index 2c73caaa5f..a75cd96837 100644 --- a/mindspore/lite/src/ops/not_equal.h +++ b/mindspore/lite/src/ops/not_equal.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/one_hot.h b/mindspore/lite/src/ops/one_hot.h index ebbe730ff6..67d9d12bb1 100644 --- a/mindspore/lite/src/ops/one_hot.h +++ b/mindspore/lite/src/ops/one_hot.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/p_relu.h b/mindspore/lite/src/ops/p_relu.h index f18f168154..0d67de0fc2 100644 --- a/mindspore/lite/src/ops/p_relu.h +++ b/mindspore/lite/src/ops/p_relu.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/activation.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/pad.h b/mindspore/lite/src/ops/pad.h index 3694464e26..0e94851446 100644 --- a/mindspore/lite/src/ops/pad.h +++ b/mindspore/lite/src/ops/pad.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/permute.h b/mindspore/lite/src/ops/permute.h index f2c082ab30..75a8704d97 100644 --- a/mindspore/lite/src/ops/permute.h +++ b/mindspore/lite/src/ops/permute.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/pooling.h b/mindspore/lite/src/ops/pooling.h index c9f6840dfe..d782a781d0 100644 --- a/mindspore/lite/src/ops/pooling.h +++ b/mindspore/lite/src/ops/pooling.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/pooling_grad.h b/mindspore/lite/src/ops/pooling_grad.h index ff9a5cad4f..c1feeb0313 100644 --- a/mindspore/lite/src/ops/pooling_grad.h +++ b/mindspore/lite/src/ops/pooling_grad.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/power.h b/mindspore/lite/src/ops/power.h index 5797c2e8ee..1f30589991 100644 --- a/mindspore/lite/src/ops/power.h +++ b/mindspore/lite/src/ops/power.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/power_grad.h b/mindspore/lite/src/ops/power_grad.h index 4c98e37f10..9dd8c9976f 100644 --- a/mindspore/lite/src/ops/power_grad.h +++ b/mindspore/lite/src/ops/power_grad.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/primitive_c.h b/mindspore/lite/src/ops/primitive_c.h index 526300eedd..b4209b8282 100644 --- a/mindspore/lite/src/ops/primitive_c.h +++ b/mindspore/lite/src/ops/primitive_c.h @@ -30,7 +30,7 @@ #include "src/tensor.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" namespace mindspore { namespace lite { diff --git a/mindspore/lite/src/ops/prior_box.h b/mindspore/lite/src/ops/prior_box.h index cad8fe2f47..e89acf609a 100644 --- a/mindspore/lite/src/ops/prior_box.h +++ b/mindspore/lite/src/ops/prior_box.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/quant_dtype_cast.h b/mindspore/lite/src/ops/quant_dtype_cast.h index 001a5c8908..577ad5afac 100644 --- a/mindspore/lite/src/ops/quant_dtype_cast.h +++ b/mindspore/lite/src/ops/quant_dtype_cast.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/range.h b/mindspore/lite/src/ops/range.h index b0601fa5c3..efb541b5ad 100644 --- a/mindspore/lite/src/ops/range.h +++ b/mindspore/lite/src/ops/range.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/rank.h b/mindspore/lite/src/ops/rank.h index 5b48ffd399..0481480577 100644 --- a/mindspore/lite/src/ops/rank.h +++ b/mindspore/lite/src/ops/rank.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/real_div.h b/mindspore/lite/src/ops/real_div.h index 16a843e233..47a67753fb 100644 --- a/mindspore/lite/src/ops/real_div.h +++ b/mindspore/lite/src/ops/real_div.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/reduce.h b/mindspore/lite/src/ops/reduce.h index d859e0a1c1..3341750ca8 100644 --- a/mindspore/lite/src/ops/reduce.h +++ b/mindspore/lite/src/ops/reduce.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" #include "schema/model_generated.h" diff --git a/mindspore/lite/src/ops/reshape.cc b/mindspore/lite/src/ops/reshape.cc index 49b2d4de7c..c005647ae5 100644 --- a/mindspore/lite/src/ops/reshape.cc +++ b/mindspore/lite/src/ops/reshape.cc @@ -18,7 +18,7 @@ #include #include #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/tensor.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/reshape.h b/mindspore/lite/src/ops/reshape.h index 3ae61825b2..5dadacdb6a 100644 --- a/mindspore/lite/src/ops/reshape.h +++ b/mindspore/lite/src/ops/reshape.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/resize.h b/mindspore/lite/src/ops/resize.h index 9547bf58d9..4dd40c2895 100644 --- a/mindspore/lite/src/ops/resize.h +++ b/mindspore/lite/src/ops/resize.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/return.h b/mindspore/lite/src/ops/return.h index 695781131b..6896df7e9d 100644 --- a/mindspore/lite/src/ops/return.h +++ b/mindspore/lite/src/ops/return.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/reverse.h b/mindspore/lite/src/ops/reverse.h index 0a95a18413..5cd8507746 100644 --- a/mindspore/lite/src/ops/reverse.h +++ b/mindspore/lite/src/ops/reverse.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/reverse_sequence.h b/mindspore/lite/src/ops/reverse_sequence.h index 7b2b7e525a..270f5bdbf1 100644 --- a/mindspore/lite/src/ops/reverse_sequence.h +++ b/mindspore/lite/src/ops/reverse_sequence.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/roi_pooling.h b/mindspore/lite/src/ops/roi_pooling.h index 0150847d91..25432010e9 100644 --- a/mindspore/lite/src/ops/roi_pooling.h +++ b/mindspore/lite/src/ops/roi_pooling.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/round.h b/mindspore/lite/src/ops/round.h index 606324243c..bbff197ef4 100644 --- a/mindspore/lite/src/ops/round.h +++ b/mindspore/lite/src/ops/round.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic_self.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/rsqrt.h b/mindspore/lite/src/ops/rsqrt.h index 17c48c4413..91d8364b3a 100644 --- a/mindspore/lite/src/ops/rsqrt.h +++ b/mindspore/lite/src/ops/rsqrt.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic_self.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/scale.h b/mindspore/lite/src/ops/scale.h index c9f3d653b6..6ebe6f8b8a 100644 --- a/mindspore/lite/src/ops/scale.h +++ b/mindspore/lite/src/ops/scale.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/scatter_nd.h b/mindspore/lite/src/ops/scatter_nd.h index 988e277f35..70fd8096c6 100644 --- a/mindspore/lite/src/ops/scatter_nd.h +++ b/mindspore/lite/src/ops/scatter_nd.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/shape.cc b/mindspore/lite/src/ops/shape.cc index cd63042973..c0b8d69423 100644 --- a/mindspore/lite/src/ops/shape.cc +++ b/mindspore/lite/src/ops/shape.cc @@ -16,7 +16,7 @@ #include "src/ops/shape.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/tensor.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/shape.h b/mindspore/lite/src/ops/shape.h index 7e6feb8217..3f00b2d665 100644 --- a/mindspore/lite/src/ops/shape.h +++ b/mindspore/lite/src/ops/shape.h @@ -21,7 +21,6 @@ #include #include #include "src/ops/primitive_c.h" -#include "ir/dtype/type_id.h" namespace mindspore { namespace lite { diff --git a/mindspore/lite/src/ops/sin.h b/mindspore/lite/src/ops/sin.h index 82383c166d..3e798e7266 100644 --- a/mindspore/lite/src/ops/sin.h +++ b/mindspore/lite/src/ops/sin.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic_self.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/slice.cc b/mindspore/lite/src/ops/slice.cc index c4d3a4c75c..d42faae5b7 100644 --- a/mindspore/lite/src/ops/slice.cc +++ b/mindspore/lite/src/ops/slice.cc @@ -16,7 +16,7 @@ #include "src/ops/slice.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/tensor.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/slice.h b/mindspore/lite/src/ops/slice.h index e420e161fe..5ad9877b82 100644 --- a/mindspore/lite/src/ops/slice.h +++ b/mindspore/lite/src/ops/slice.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/softmax.h b/mindspore/lite/src/ops/softmax.h index 249b62c84d..8dd425162f 100644 --- a/mindspore/lite/src/ops/softmax.h +++ b/mindspore/lite/src/ops/softmax.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/softmax_cross_entropy.h b/mindspore/lite/src/ops/softmax_cross_entropy.h index 05cb8e95ab..fb61220994 100644 --- a/mindspore/lite/src/ops/softmax_cross_entropy.h +++ b/mindspore/lite/src/ops/softmax_cross_entropy.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/space_to_batch.h b/mindspore/lite/src/ops/space_to_batch.h index 834c529eeb..087a2eea30 100644 --- a/mindspore/lite/src/ops/space_to_batch.h +++ b/mindspore/lite/src/ops/space_to_batch.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/space_to_batch_nd.h b/mindspore/lite/src/ops/space_to_batch_nd.h index fd9719c0c3..386e322498 100644 --- a/mindspore/lite/src/ops/space_to_batch_nd.h +++ b/mindspore/lite/src/ops/space_to_batch_nd.h @@ -19,7 +19,7 @@ #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/space_to_depth.h b/mindspore/lite/src/ops/space_to_depth.h index 4c40c55aa8..40801ca618 100644 --- a/mindspore/lite/src/ops/space_to_depth.h +++ b/mindspore/lite/src/ops/space_to_depth.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/sparse_to_dense.h b/mindspore/lite/src/ops/sparse_to_dense.h index 9e08335085..92183768dd 100644 --- a/mindspore/lite/src/ops/sparse_to_dense.h +++ b/mindspore/lite/src/ops/sparse_to_dense.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/split.h b/mindspore/lite/src/ops/split.h index 95cb4fe638..edc52349be 100644 --- a/mindspore/lite/src/ops/split.h +++ b/mindspore/lite/src/ops/split.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/sqrt.h b/mindspore/lite/src/ops/sqrt.h index 68b82eee60..bc6c573d13 100644 --- a/mindspore/lite/src/ops/sqrt.h +++ b/mindspore/lite/src/ops/sqrt.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic_self.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/square.h b/mindspore/lite/src/ops/square.h index 5ab29590ff..9482330b5b 100644 --- a/mindspore/lite/src/ops/square.h +++ b/mindspore/lite/src/ops/square.h @@ -19,7 +19,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic_self.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/squared_difference.h b/mindspore/lite/src/ops/squared_difference.h index 7b7a6a412f..79be11a5e0 100644 --- a/mindspore/lite/src/ops/squared_difference.h +++ b/mindspore/lite/src/ops/squared_difference.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/squeeze.h b/mindspore/lite/src/ops/squeeze.h index 58013eb913..31ceb5ce6f 100644 --- a/mindspore/lite/src/ops/squeeze.h +++ b/mindspore/lite/src/ops/squeeze.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/stack.h b/mindspore/lite/src/ops/stack.h index a6b12956d1..ffdcaa4a46 100644 --- a/mindspore/lite/src/ops/stack.h +++ b/mindspore/lite/src/ops/stack.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/strided_slice.h b/mindspore/lite/src/ops/strided_slice.h index cd9cdb2ee6..28b989f421 100644 --- a/mindspore/lite/src/ops/strided_slice.h +++ b/mindspore/lite/src/ops/strided_slice.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/sub.h b/mindspore/lite/src/ops/sub.h index 6b4058c368..92780efbc7 100644 --- a/mindspore/lite/src/ops/sub.h +++ b/mindspore/lite/src/ops/sub.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/arithmetic.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/tile.h b/mindspore/lite/src/ops/tile.h index 06202c2766..475018ed6c 100644 --- a/mindspore/lite/src/ops/tile.h +++ b/mindspore/lite/src/ops/tile.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/topk.h b/mindspore/lite/src/ops/topk.h index bf4140566c..054952718d 100644 --- a/mindspore/lite/src/ops/topk.h +++ b/mindspore/lite/src/ops/topk.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/transpose.cc b/mindspore/lite/src/ops/transpose.cc index b6d7b6d275..95c0b02d3d 100644 --- a/mindspore/lite/src/ops/transpose.cc +++ b/mindspore/lite/src/ops/transpose.cc @@ -17,7 +17,7 @@ #include "src/ops/transpose.h" #include #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" namespace mindspore { namespace lite { diff --git a/mindspore/lite/src/ops/transpose.h b/mindspore/lite/src/ops/transpose.h index c6c71ffef4..4f38f318c4 100644 --- a/mindspore/lite/src/ops/transpose.h +++ b/mindspore/lite/src/ops/transpose.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/unique.h b/mindspore/lite/src/ops/unique.h index eb634a1278..7f6e83f6e6 100644 --- a/mindspore/lite/src/ops/unique.h +++ b/mindspore/lite/src/ops/unique.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/unsqueeze.cc b/mindspore/lite/src/ops/unsqueeze.cc index 80beb0e387..7e7e460cbb 100644 --- a/mindspore/lite/src/ops/unsqueeze.cc +++ b/mindspore/lite/src/ops/unsqueeze.cc @@ -16,7 +16,7 @@ #include "src/ops/unsqueeze.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/tensor.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/unsqueeze.h b/mindspore/lite/src/ops/unsqueeze.h index 81011561b0..0aaddfb9a0 100644 --- a/mindspore/lite/src/ops/unsqueeze.h +++ b/mindspore/lite/src/ops/unsqueeze.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/unstack.h b/mindspore/lite/src/ops/unstack.h index ecadc56252..17f372caa7 100644 --- a/mindspore/lite/src/ops/unstack.h +++ b/mindspore/lite/src/ops/unstack.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/upsample.h b/mindspore/lite/src/ops/upsample.h index 3d9ace6abc..8cde562338 100644 --- a/mindspore/lite/src/ops/upsample.h +++ b/mindspore/lite/src/ops/upsample.h @@ -22,7 +22,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/where.h b/mindspore/lite/src/ops/where.h index 4a6be28f23..2c85f369a9 100644 --- a/mindspore/lite/src/ops/where.h +++ b/mindspore/lite/src/ops/where.h @@ -21,7 +21,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/ops/zeros_like.h b/mindspore/lite/src/ops/zeros_like.h index 5c9eedf828..155efdbe7f 100644 --- a/mindspore/lite/src/ops/zeros_like.h +++ b/mindspore/lite/src/ops/zeros_like.h @@ -20,7 +20,7 @@ #include #include #include -#include "ir/dtype/type_id.h" + #include "src/ops/primitive_c.h" namespace mindspore { diff --git a/mindspore/lite/src/param_value_lite.h b/mindspore/lite/src/param_value_lite.h index fcf812b587..db7cf80e31 100644 --- a/mindspore/lite/src/param_value_lite.h +++ b/mindspore/lite/src/param_value_lite.h @@ -22,7 +22,6 @@ #include #include #include "src/tensor.h" -#include "ir/dtype/type_id.h" namespace mindspore { class ParamValueLite : public Value { diff --git a/mindspore/lite/src/populate_parameter.cc b/mindspore/lite/src/populate_parameter.cc index 7e927a0c33..70ab9b4310 100644 --- a/mindspore/lite/src/populate_parameter.cc +++ b/mindspore/lite/src/populate_parameter.cc @@ -16,7 +16,7 @@ #include "src/populate_parameter.h" #include "src/ops/primitive_c.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "schema/ops_generated.h" #include "src/ops/constant_of_shape.h" #include "src/ops/space_to_batch.h" @@ -240,7 +240,7 @@ OpParameter *PopulateExpandDimsParameter(const mindspore::lite::PrimitiveC *prim } OpParameter *PopulatePReLUParameter(const mindspore::lite::PrimitiveC *primitive) { - auto param = dynamic_cast(primitive); + auto param = reinterpret_cast(const_cast(primitive)); PReluParameter *prelu_param = reinterpret_cast(malloc(sizeof(PReluParameter))); if (prelu_param == nullptr) { MS_LOG(ERROR) << "malloc PReluParameter failed."; diff --git a/mindspore/lite/src/runtime/allocator.cc b/mindspore/lite/src/runtime/allocator.cc index 772b5a8461..7d0894a3cf 100644 --- a/mindspore/lite/src/runtime/allocator.cc +++ b/mindspore/lite/src/runtime/allocator.cc @@ -16,7 +16,7 @@ #include "src/runtime/allocator.h" #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" namespace mindspore::lite { std::shared_ptr Allocator::Create() { diff --git a/mindspore/lite/src/runtime/kernel/arm/base/layout_transform.cc b/mindspore/lite/src/runtime/kernel/arm/base/layout_transform.cc index cbdcfe8f53..05e799916a 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/layout_transform.cc +++ b/mindspore/lite/src/runtime/kernel/arm/base/layout_transform.cc @@ -15,7 +15,7 @@ */ #include "src/runtime/kernel/arm/base/layout_transform.h" -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" using mindspore::schema::Format; namespace mindspore::kernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/base/layout_transform.h b/mindspore/lite/src/runtime/kernel/arm/base/layout_transform.h index efa5da1e48..851cfcb823 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/layout_transform.h +++ b/mindspore/lite/src/runtime/kernel/arm/base/layout_transform.h @@ -21,7 +21,7 @@ #include #endif #include "nnacl/pack.h" -#include "ir/dtype/type_id.h" + #include "schema/ops_generated.h" #include "src/tensor.h" diff --git a/mindspore/lite/src/runtime/kernel/arm/base/reduce_base.h b/mindspore/lite/src/runtime/kernel/arm/base/reduce_base.h index 115eee4973..3ec9738763 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/reduce_base.h +++ b/mindspore/lite/src/runtime/kernel/arm/base/reduce_base.h @@ -19,7 +19,7 @@ #include #include "src/lite_kernel.h" -#include "ir/anf.h" + #include "nnacl/reduce_parameter.h" namespace mindspore::kernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/base/strided_slice.h b/mindspore/lite/src/runtime/kernel/arm/base/strided_slice.h index c9d5a8e60b..7a0c835e96 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/strided_slice.h +++ b/mindspore/lite/src/runtime/kernel/arm/base/strided_slice.h @@ -18,7 +18,7 @@ #define MINDSPORE_LITE_SRC_BACKEND_ARM_BASE_STRIDED_SLICE_H_ #include -#include "ir/anf.h" + #include "src/lite_kernel.h" namespace mindspore::kernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/layout_transform_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/layout_transform_fp16.cc index 7decc6ce5e..29ce79bda6 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/layout_transform_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/layout_transform_fp16.cc @@ -16,7 +16,7 @@ #include "src/runtime/kernel/arm/fp16/layout_transform_fp16.h" #include "nnacl/fp16/pack_fp16.h" #include "schema/ops_generated.h" -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" namespace mindspore::kernel { LayoutConvertor LayoutTransformFp16(schema::Format src_format, schema::Format dst_format) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/reduce_fp16.h b/mindspore/lite/src/runtime/kernel/arm/fp16/reduce_fp16.h index 78074f7e66..3f3295342d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/reduce_fp16.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/reduce_fp16.h @@ -21,7 +21,7 @@ #include #include "src/lite_kernel.h" #include "src/runtime/kernel/arm/base/reduce_base.h" -#include "ir/anf.h" + using mindspore::schema::ReduceMode; namespace mindspore::kernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/flatten.h b/mindspore/lite/src/runtime/kernel/arm/fp32/flatten.h index 510005bf12..c476f35931 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/flatten.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/flatten.h @@ -18,7 +18,7 @@ #include #include "src/lite_kernel.h" -#include "ir/anf.h" + #include "include/context.h" #include "nnacl/flatten.h" diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/one_hot.h b/mindspore/lite/src/runtime/kernel/arm/fp32/one_hot.h index d4f8a993f7..f0e960561a 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/one_hot.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/one_hot.h @@ -18,7 +18,6 @@ #include #include "src/lite_kernel.h" -#include "ir/anf.h" namespace mindspore::kernel { class OneHotCPUKernel : public LiteKernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/pooling.h b/mindspore/lite/src/runtime/kernel/arm/fp32/pooling.h index 4634f36e7d..36e65a70f9 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/pooling.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/pooling.h @@ -20,7 +20,6 @@ #include #include "src/runtime/kernel/arm/base/pooling_base.h" #include "src/lite_kernel.h" -#include "ir/anf.h" namespace mindspore::kernel { class PoolingCPUKernel : public PoolingBaseCPUKernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/reduce.h b/mindspore/lite/src/runtime/kernel/arm/fp32/reduce.h index 2cc3a6fc96..dae1e748d1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/reduce.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/reduce.h @@ -22,7 +22,7 @@ #include "nnacl/fp32/reduce.h" #include "src/runtime/kernel/arm/base/reduce_base.h" -#include "ir/anf.h" + using mindspore::schema::ReduceMode; namespace mindspore::kernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/shape.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/shape.cc index ffd09368c2..e0396dc533 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/shape.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/shape.cc @@ -18,7 +18,7 @@ #include "schema/model_generated.h" #include "src/kernel_registry.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" using mindspore::lite::KernelRegistrar; using mindspore::lite::RET_ERROR; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/space_to_depth.h b/mindspore/lite/src/runtime/kernel/arm/fp32/space_to_depth.h index aa8f7af39d..4e243adbe5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/space_to_depth.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/space_to_depth.h @@ -18,7 +18,6 @@ #include #include "src/lite_kernel.h" -#include "ir/anf.h" namespace mindspore::kernel { class SpaceToDepthCPUKernel : public LiteKernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/activation_grad.h b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/activation_grad.h index 61e3e9bae5..e19b526ff1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/activation_grad.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/activation_grad.h @@ -19,7 +19,6 @@ #include #include "src/lite_kernel.h" -#include "ir/anf.h" #include "nnacl/fp32/activation.h" namespace mindspore::kernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/apply_momentum.h b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/apply_momentum.h index c8d599ca1a..21add7a896 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/apply_momentum.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/apply_momentum.h @@ -19,7 +19,6 @@ #include #include "src/lite_kernel.h" -#include "ir/anf.h" namespace mindspore::kernel { class ApplyMomentumCPUKernel : public LiteKernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/arithmetic_grad.h b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/arithmetic_grad.h index 6c76667b6a..479b2d1e48 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/arithmetic_grad.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/arithmetic_grad.h @@ -21,7 +21,6 @@ #include "src/lite_kernel.h" #include "nnacl/fp32/arithmetic.h" #include "schema/model_generated.h" -#include "ir/anf.h" using mindspore::schema::PrimitiveType_AddGrad; using mindspore::schema::PrimitiveType_DivGrad; @@ -64,7 +63,6 @@ class ArithmeticGradCPUKernel : public LiteKernel { if (tile_data1) delete[] tile_data1; if (tile_data2) delete[] tile_data2; } - void InitKernel(const CNodePtr &kernel_node); int Init() override; int InferShape(); diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/arithmetic_self_grad.h b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/arithmetic_self_grad.h index ff414590a5..4c5d04925e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/arithmetic_self_grad.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/arithmetic_self_grad.h @@ -20,7 +20,6 @@ #include #include "src/lite_kernel.h" #include "schema/model_generated.h" -#include "ir/anf.h" namespace mindspore::kernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bias_grad.h b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bias_grad.h index 827e224d6a..7d874fc72f 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bias_grad.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bias_grad.h @@ -19,8 +19,6 @@ #include #include "src/lite_kernel.h" -#include "ir/anf.h" - #include "nnacl/fp32/arithmetic.h" namespace mindspore::kernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bn_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bn_grad.cc index f6f7e13218..ce9bb95dd3 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bn_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bn_grad.cc @@ -29,7 +29,6 @@ using mindspore::lite::RET_OK; // using mindspore::lite::REG_OP; using mindspore::schema::PrimitiveType_BNGrad; - namespace mindspore::kernel { int BNGradCPUKernel::Init() { auto *input_x = in_tensors_.at(1); diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bn_grad.h b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bn_grad.h index a53118d6d3..4bbbce34a6 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bn_grad.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bn_grad.h @@ -19,7 +19,6 @@ #include #include "src/lite_kernel.h" -#include "ir/anf.h" namespace mindspore::kernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution.h b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution.h index 8f06ea4d01..fee2a38f32 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution.h @@ -19,7 +19,6 @@ #include #include "src/lite_kernel.h" -#include "ir/anf.h" namespace mindspore::kernel { class ConvolutionTrainCPUKernel : public LiteKernel { @@ -29,8 +28,7 @@ class ConvolutionTrainCPUKernel : public LiteKernel { const lite::PrimitiveC *primitive) : LiteKernel(parameter, inputs, outputs, ctx, primitive), workspace(nullptr) {} ~ConvolutionTrainCPUKernel() override { - if (workspace) - delete[] workspace; + if (workspace) delete[] workspace; } int Init() override; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution_grad_filter.h b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution_grad_filter.h index 34190bd6f5..afb3624935 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution_grad_filter.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution_grad_filter.h @@ -19,7 +19,6 @@ #include #include "src/lite_kernel.h" -#include "ir/anf.h" namespace mindspore::kernel { class ConvolutionGradFilterCPUKernel : public LiteKernel { @@ -28,9 +27,8 @@ class ConvolutionGradFilterCPUKernel : public LiteKernel { const std::vector &outputs, const lite::InnerContext *ctx, const mindspore::lite::PrimitiveC *primitive) : LiteKernel(parameter, inputs, outputs, ctx, primitive), workspace(nullptr) {} - ~ConvolutionGradFilterCPUKernel() override { - if (workspace) - delete[] workspace; + ~ConvolutionGradFilterCPUKernel() override { + if (workspace) delete[] workspace; } int Init() override; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution_grad_input.h b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution_grad_input.h index aa5d520768..beb0cc1987 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution_grad_input.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution_grad_input.h @@ -19,7 +19,6 @@ #include #include "src/lite_kernel.h" -#include "ir/anf.h" namespace mindspore::kernel { class ConvolutionGradInputCPUKernel : public LiteKernel { @@ -28,9 +27,8 @@ class ConvolutionGradInputCPUKernel : public LiteKernel { const std::vector &outputs, const lite::InnerContext *ctx, const mindspore::lite::PrimitiveC *primitive) : LiteKernel(parameter, inputs, outputs, ctx, primitive), workspace(nullptr) {} - ~ConvolutionGradInputCPUKernel() override { - if (workspace) - delete[] workspace; + ~ConvolutionGradInputCPUKernel() override { + if (workspace) delete[] workspace; } int Init() override; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/make_tuple.h b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/make_tuple.h index cb65756511..dbc62434aa 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/make_tuple.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/make_tuple.h @@ -19,7 +19,6 @@ #include #include "src/lite_kernel.h" -#include "ir/anf.h" #include "src/runtime/kernel/arm/nnacl/fp32/arithmetic.h" diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/neg_grad.h b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/neg_grad.h index 239b3a7958..fdbda2a18b 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/neg_grad.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/neg_grad.h @@ -20,7 +20,6 @@ #include #include "src/lite_kernel.h" #include "schema/model_generated.h" -#include "ir/anf.h" namespace mindspore::kernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/pooling_grad.h b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/pooling_grad.h index 968f121cdb..190ea68301 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/pooling_grad.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/pooling_grad.h @@ -19,7 +19,6 @@ #include #include "src/lite_kernel.h" -#include "ir/anf.h" namespace mindspore::kernel { using mindspore::schema::PadMode; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/power_grad.h b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/power_grad.h index 08728218df..6c1645d31d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/power_grad.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/power_grad.h @@ -19,7 +19,6 @@ #include #include "src/lite_kernel.h" -#include "ir/anf.h" #include "nnacl/power.h" namespace mindspore::kernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/softmax_cross_entropy_with_logits.h b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/softmax_cross_entropy_with_logits.h index 3db1a1314a..2968bdf8e9 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/softmax_cross_entropy_with_logits.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/softmax_cross_entropy_with_logits.h @@ -19,7 +19,6 @@ #include #include "src/train/loss_kernel.h" -#include "ir/anf.h" #include "nnacl/fp32_grad/softmax_grad.h" #include "nnacl/fp32/arithmetic.h" #include "nnacl/softmax_parameter.h" diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.cc index e423f916f7..e10edbf6e1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.cc @@ -31,7 +31,7 @@ namespace mindspore::kernel { int SparseSoftmaxCrossEntropyWithLogitsCPUKernel::ReSize() { return RET_OK; } int SparseSoftmaxCrossEntropyWithLogitsCPUKernel::ForwardPostExecute(const int *labels, const float *losses, - float *output) const { + float *output) const { float total_loss = 0; for (int i = 0; i < param->batch_size_; ++i) { if (labels[i] < 0) { @@ -51,7 +51,7 @@ int SparseSoftmaxCrossEntropyWithLogitsCPUKernel::ForwardPostExecute(const int * } int SparseSoftmaxCrossEntropyWithLogitsCPUKernel::GradPostExecute(const int *labels, const float *losses, float *grads, - float *output) const { + float *output) const { size_t row_start = 0; float total_loss = 0; for (int i = 0; i < param->batch_size_; ++i) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.h b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.h index 8d2cf9af47..e876ef7377 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.h @@ -19,7 +19,6 @@ #include #include "src/train/loss_kernel.h" -#include "ir/anf.h" #include "nnacl/fp32_grad/softmax_grad.h" #include "nnacl/fp32/arithmetic.h" #include "nnacl/softmax_parameter.h" @@ -33,14 +32,12 @@ class SparseSoftmaxCrossEntropyWithLogitsCPUKernel : public LossKernel { const std::vector &outputs, const lite::InnerContext *ctx, const mindspore::lite::PrimitiveC *primitive) - : LossKernel(parameter, inputs, outputs, ctx, primitive), losses_(nullptr), sum_data_(nullptr) { + : LossKernel(parameter, inputs, outputs, ctx, primitive), losses_(nullptr), sum_data_(nullptr) { param = reinterpret_cast(parameter); } ~SparseSoftmaxCrossEntropyWithLogitsCPUKernel() override { - if (losses_) - delete[] losses_; - if (sum_data_) - delete[] sum_data_; + if (losses_) delete[] losses_; + if (sum_data_) delete[] sum_data_; } int ForwardPostExecute(const int *labels, const float *losses, float *output) const; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/tuple_getitem.h b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/tuple_getitem.h index d7de92aaab..3881f7e5ff 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/tuple_getitem.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/tuple_getitem.h @@ -19,8 +19,6 @@ #include #include "src/lite_kernel.h" -#include "ir/anf.h" - #include "nnacl/fp32/arithmetic.h" namespace mindspore::kernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/pooling_int8.h b/mindspore/lite/src/runtime/kernel/arm/int8/pooling_int8.h index 8b690149eb..c9af9ac83f 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/pooling_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/int8/pooling_int8.h @@ -19,7 +19,7 @@ #include #include "src/lite_kernel.h" -#include "ir/anf.h" + #include "include/context.h" #include "src/runtime/kernel/arm/base/pooling_base.h" diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/reduce_int8.h b/mindspore/lite/src/runtime/kernel/arm/int8/reduce_int8.h index ee7fe884d2..92a7542150 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/reduce_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/int8/reduce_int8.h @@ -22,7 +22,7 @@ #include "nnacl/reduce_parameter.h" #include "nnacl/int8/reduce_int8.h" #include "nnacl/quantization/quantize.h" -#include "ir/anf.h" + #include "src/runtime/kernel/arm/base/reduce_base.h" using mindspore::schema::ReduceMode; diff --git a/mindspore/lite/src/runtime/kernel/opencl/kernel/arithmetic_self.h b/mindspore/lite/src/runtime/kernel/opencl/kernel/arithmetic_self.h index 7c1f7614f8..9bdfcf27b5 100644 --- a/mindspore/lite/src/runtime/kernel/opencl/kernel/arithmetic_self.h +++ b/mindspore/lite/src/runtime/kernel/opencl/kernel/arithmetic_self.h @@ -19,7 +19,6 @@ #include #include -#include "ir/anf.h" #include "src/runtime/kernel/opencl/opencl_kernel.h" #include "nnacl/arithmetic_self_parameter.h" diff --git a/mindspore/lite/src/runtime/kernel/opencl/kernel/batchnorm.h b/mindspore/lite/src/runtime/kernel/opencl/kernel/batchnorm.h index a1de54f8ab..8f44b78f87 100644 --- a/mindspore/lite/src/runtime/kernel/opencl/kernel/batchnorm.h +++ b/mindspore/lite/src/runtime/kernel/opencl/kernel/batchnorm.h @@ -18,7 +18,6 @@ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_OPENCL_KERNEL_BATCHNORM_H_ #include -#include "ir/anf.h" #include "src/runtime/kernel/opencl/opencl_kernel.h" #include "nnacl/fp32/batchnorm.h" diff --git a/mindspore/lite/src/runtime/kernel/opencl/kernel/cast.h b/mindspore/lite/src/runtime/kernel/opencl/kernel/cast.h index 28e73c2848..1e536a93d2 100644 --- a/mindspore/lite/src/runtime/kernel/opencl/kernel/cast.h +++ b/mindspore/lite/src/runtime/kernel/opencl/kernel/cast.h @@ -19,7 +19,6 @@ #include #include -#include "ir/anf.h" #include "src/runtime/kernel/opencl/opencl_kernel.h" #include "nnacl/fp32/cast.h" diff --git a/mindspore/lite/src/runtime/kernel/opencl/kernel/concat.h b/mindspore/lite/src/runtime/kernel/opencl/kernel/concat.h index 394103f857..5b3d611354 100644 --- a/mindspore/lite/src/runtime/kernel/opencl/kernel/concat.h +++ b/mindspore/lite/src/runtime/kernel/opencl/kernel/concat.h @@ -18,7 +18,6 @@ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_OPENCL_KERNEL_CONCAT_H_ #include -#include "ir/anf.h" #include "src/runtime/kernel/opencl/opencl_kernel.h" #include "src/runtime/kernel/arm/base/concat_base.h" diff --git a/mindspore/lite/src/runtime/kernel/opencl/kernel/depthwise_conv2d.cc b/mindspore/lite/src/runtime/kernel/opencl/kernel/depthwise_conv2d.cc index 19bea3f050..496e0804f9 100644 --- a/mindspore/lite/src/runtime/kernel/opencl/kernel/depthwise_conv2d.cc +++ b/mindspore/lite/src/runtime/kernel/opencl/kernel/depthwise_conv2d.cc @@ -132,9 +132,9 @@ int DepthwiseConv2dOpenCLKernel::InitBuffer() { memset(bias_data_, 0, up_co_size); auto ori_bias = in_tensors_.at(kBiasIndex)->data_c(); if (is_fp16 && in_tensors_.at(kBiasIndex)->data_type() == kNumberTypeFloat32) { - float16_t *bias_ptr = static_cast(bias_data_); + float16_t *bias_ptr = static_cast(bias_data_); for (size_t i = 0; i < in_tensors_.at(kBiasIndex)->ElementsNum(); ++i) { - bias_ptr[i] = static_cast(static_cast(ori_bias)[i]); + bias_ptr[i] = static_cast(static_cast(ori_bias)[i]); } } else { memcpy(bias_data_, ori_bias, out_tensors_[0]->Channel() * dtype_size); diff --git a/mindspore/lite/src/runtime/kernel/opencl/kernel/gather.h b/mindspore/lite/src/runtime/kernel/opencl/kernel/gather.h index 05883034ca..1b20cc332b 100644 --- a/mindspore/lite/src/runtime/kernel/opencl/kernel/gather.h +++ b/mindspore/lite/src/runtime/kernel/opencl/kernel/gather.h @@ -18,7 +18,6 @@ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_OPENCL_KERNEL_GATHER_H_ #include -#include "ir/anf.h" #include "src/runtime/kernel/opencl/opencl_kernel.h" #include "nnacl/gather_parameter.h" diff --git a/mindspore/lite/src/runtime/kernel/opencl/kernel/scale.cc b/mindspore/lite/src/runtime/kernel/opencl/kernel/scale.cc index e22a3f9aeb..c329d4a502 100644 --- a/mindspore/lite/src/runtime/kernel/opencl/kernel/scale.cc +++ b/mindspore/lite/src/runtime/kernel/opencl/kernel/scale.cc @@ -117,10 +117,8 @@ int ScaleOpenCLKernel::InitBuffer() { if (in_tensors_[1]->shape().size() == 1 && axis_ == 3) { img_size[0] = 1; img_size[1] = UP_DIV(in_tensors_[1]->shape()[0], C4NUM); - scale_ptr_ = - allocator->CreateImageFromHost(in_tensors_[1]->data_c(), in_tensors_[1]->ElementsNum(), img_size); - offset_ptr_ = - allocator->CreateImageFromHost(in_tensors_[2]->data_c(), in_tensors_[2]->ElementsNum(), img_size); + scale_ptr_ = allocator->CreateImageFromHost(in_tensors_[1]->data_c(), in_tensors_[1]->ElementsNum(), img_size); + offset_ptr_ = allocator->CreateImageFromHost(in_tensors_[2]->data_c(), in_tensors_[2]->ElementsNum(), img_size); return RET_OK; } int pack_weight_size = in_tensors_[1]->ElementsC4Num(); @@ -129,10 +127,8 @@ int ScaleOpenCLKernel::InitBuffer() { int batch = in_tensors_[1]->Batch(); if (in_tensors_[0]->GetFormat() == in_tensors_[1]->GetFormat()) { if (in_tensors_[0]->data_type() == in_tensors_[1]->data_type()) { - scale_ptr_ = - allocator->CreateImageFromHost(in_tensors_[1]->data_c(), in_tensors_[1]->ElementsNum(), img_size); - offset_ptr_ = - allocator->CreateImageFromHost(in_tensors_[2]->data_c(), in_tensors_[2]->ElementsNum(), img_size); + scale_ptr_ = allocator->CreateImageFromHost(in_tensors_[1]->data_c(), in_tensors_[1]->ElementsNum(), img_size); + offset_ptr_ = allocator->CreateImageFromHost(in_tensors_[2]->data_c(), in_tensors_[2]->ElementsNum(), img_size); } else { MS_LOG(ERROR) << "Unsupport data type transpose from " << in_tensors_[1]->data_type() << "to " << in_tensors_[0]->data_type(); diff --git a/mindspore/lite/src/runtime/kernel/opencl/kernel/slice.h b/mindspore/lite/src/runtime/kernel/opencl/kernel/slice.h index b081af628e..dc3d4771b3 100644 --- a/mindspore/lite/src/runtime/kernel/opencl/kernel/slice.h +++ b/mindspore/lite/src/runtime/kernel/opencl/kernel/slice.h @@ -18,7 +18,6 @@ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_OPENCL_KERNEL_SLICE_H_ #include -#include "ir/anf.h" #include "src/runtime/kernel/opencl/opencl_kernel.h" #include "nnacl/fp32/slice.h" diff --git a/mindspore/lite/src/runtime/kernel/opencl/utils.h b/mindspore/lite/src/runtime/kernel/opencl/utils.h index 2850a5c393..f163cd4687 100644 --- a/mindspore/lite/src/runtime/kernel/opencl/utils.h +++ b/mindspore/lite/src/runtime/kernel/opencl/utils.h @@ -20,7 +20,7 @@ #include #include #include "CL/cl2.hpp" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "nnacl/op_base.h" #include "src/lite_kernel.h" #include "src/common/utils.h" diff --git a/mindspore/lite/src/runtime/opencl/opencl_allocator.cc b/mindspore/lite/src/runtime/opencl/opencl_allocator.cc index 1e8229421c..1a01335e09 100644 --- a/mindspore/lite/src/runtime/opencl/opencl_allocator.cc +++ b/mindspore/lite/src/runtime/opencl/opencl_allocator.cc @@ -18,7 +18,7 @@ #include #include "src/runtime/opencl/opencl_runtime.h" #include "src/runtime/kernel/opencl/utils.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "include/errorcode.h" namespace mindspore::lite::opencl { diff --git a/mindspore/lite/src/runtime/opencl/opencl_runtime.h b/mindspore/lite/src/runtime/opencl/opencl_runtime.h index b65d31c6da..c413e0406d 100644 --- a/mindspore/lite/src/runtime/opencl/opencl_runtime.h +++ b/mindspore/lite/src/runtime/opencl/opencl_runtime.h @@ -24,7 +24,7 @@ j* you may not use this file except in compliance with the License. #include #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/runtime/opencl/opencl_wrapper.h" #include "src/runtime/opencl/opencl_allocator.h" diff --git a/mindspore/lite/src/runtime/opencl/opencl_wrapper.cc b/mindspore/lite/src/runtime/opencl/opencl_wrapper.cc index 2d86c95111..f6bb741260 100644 --- a/mindspore/lite/src/runtime/opencl/opencl_wrapper.cc +++ b/mindspore/lite/src/runtime/opencl/opencl_wrapper.cc @@ -22,7 +22,7 @@ #include #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/runtime/opencl/opencl_runtime.h" namespace mindspore::lite::opencl { diff --git a/mindspore/lite/src/runtime/runtime_api.cc b/mindspore/lite/src/runtime/runtime_api.cc index b7fd913049..8b28a95c59 100644 --- a/mindspore/lite/src/runtime/runtime_api.cc +++ b/mindspore/lite/src/runtime/runtime_api.cc @@ -18,7 +18,7 @@ #include #include #include "src/runtime/workspace_pool.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" static std::mutex gWorkspaceMutex; #ifdef __cplusplus diff --git a/mindspore/lite/src/runtime/workspace_pool.cc b/mindspore/lite/src/runtime/workspace_pool.cc index 2fbfe6605e..f545c702d7 100644 --- a/mindspore/lite/src/runtime/workspace_pool.cc +++ b/mindspore/lite/src/runtime/workspace_pool.cc @@ -21,7 +21,7 @@ #include #endif #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" namespace mindspore { namespace predict { diff --git a/mindspore/lite/src/tensor.h b/mindspore/lite/src/tensor.h index a279aeb865..749655a7c6 100644 --- a/mindspore/lite/src/tensor.h +++ b/mindspore/lite/src/tensor.h @@ -24,8 +24,8 @@ #include #include "include/ms_tensor.h" #include "src/runtime/allocator.h" -#include "ir/dtype/type_id.h" -#include "utils/log_adapter.h" + +#include "src/common/log_adapter.h" #include "schema/model_generated.h" namespace mindspore { diff --git a/mindspore/lite/src/train/train_model.cc b/mindspore/lite/src/train/train_model.cc index b6133ff35a..38572c28e3 100644 --- a/mindspore/lite/src/train/train_model.cc +++ b/mindspore/lite/src/train/train_model.cc @@ -15,7 +15,7 @@ */ #include "src/ops/primitive_c.h" #include "include/train_model.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "include/errorcode.h" #include "src/common/graph_util.h" @@ -79,11 +79,13 @@ TrainModel *TrainModel::Import(const char *model_buf, size_t size) { return model; } -void TrainModel::Free() { -} +void TrainModel::Free() {} -char* TrainModel::ExportBuf(char* buffer, size_t* len) const { - MS_EXCEPTION_IF_NULL(len); +char *TrainModel::ExportBuf(char *buffer, size_t *len) const { + if (len == nullptr) { + MS_LOG(ERROR) << "len is nullptr"; + return nullptr; + } if (buf_size_ == 0 || buf == nullptr) { MS_LOG(ERROR) << "Model::Export is only available for Train Session"; return nullptr; @@ -93,8 +95,9 @@ char* TrainModel::ExportBuf(char* buffer, size_t* len) const { MS_LOG(ERROR) << "Buffer is too small, Export Failed"; return nullptr; } - if (buffer == nullptr) + if (buffer == nullptr) { buffer = reinterpret_cast(malloc(buf_size_)); + } if (buffer == nullptr) { MS_LOG(ERROR) << "allocated model buf fail!"; return nullptr; @@ -105,7 +108,5 @@ char* TrainModel::ExportBuf(char* buffer, size_t* len) const { return buffer; } -TrainModel::~TrainModel() { - Model::Free(); -} +TrainModel::~TrainModel() { Model::Free(); } } // namespace mindspore::lite diff --git a/mindspore/lite/src/train/train_populate_parameter.cc b/mindspore/lite/src/train/train_populate_parameter.cc index 3c059f997d..2ebe49d9a0 100644 --- a/mindspore/lite/src/train/train_populate_parameter.cc +++ b/mindspore/lite/src/train/train_populate_parameter.cc @@ -53,8 +53,8 @@ OpParameter *PopulateSoftmaxCrossEntropyParameter(const mindspore::lite::Primiti MS_LOG(ERROR) << "Primitive is nullptr when populating parameter for op."; return nullptr; } - SoftmaxCrossEntropyParameter *sce_param = reinterpret_cast - (malloc(sizeof(SoftmaxCrossEntropyParameter))); + SoftmaxCrossEntropyParameter *sce_param = + reinterpret_cast(malloc(sizeof(SoftmaxCrossEntropyParameter))); if (sce_param == nullptr) { MS_LOG(ERROR) << "new SoftmaxCrossEntropyParameter failed."; return nullptr; @@ -241,7 +241,7 @@ OpParameter *PopulateBiasGradParameter(const mindspore::lite::PrimitiveC *primit return nullptr; } - ArithmeticParameter *arithmetic_param = reinterpret_cast(malloc(sizeof(ArithmeticParameter))); + ArithmeticParameter *arithmetic_param = reinterpret_cast(malloc(sizeof(ArithmeticParameter))); if (arithmetic_param == nullptr) { MS_LOG(ERROR) << "new ArithmeticParameter failed."; return nullptr; diff --git a/mindspore/lite/src/train/train_session.cc b/mindspore/lite/src/train/train_session.cc index 57e3a6774f..10e0311307 100644 --- a/mindspore/lite/src/train/train_session.cc +++ b/mindspore/lite/src/train/train_session.cc @@ -16,7 +16,7 @@ #include "include/train_session.h" #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "include/context.h" #include "include/train_model.h" #include "include/errorcode.h" @@ -53,7 +53,7 @@ void TrainSession::ReplaceOps() { } int TrainSession::CompileGraph(lite::Model *model) { - model_ = dynamic_cast(model); + model_ = reinterpret_cast(model); if (model_ == nullptr) { MS_LOG(ERROR) << "TrainSession can only compile TrainModels"; return lite::RET_ERROR; @@ -73,14 +73,14 @@ void *TrainSession::ExportToBuf(char *buf, size_t *len) const { return model_->E int TrainSession::RunGraph(const session::KernelCallBack &before, const session::KernelCallBack &after) { this->outputs_.clear(); for (auto ms_tensors : output_node_map_) - for (auto ms_tensor : ms_tensors.second) this->outputs_.push_back((dynamic_cast(ms_tensor))); + for (auto ms_tensor : ms_tensors.second) this->outputs_.push_back((reinterpret_cast(ms_tensor))); if (train_mode_) return LiteSession::RunGraph(before, after); // object is expected to run only inference part of graph // prepare a list of kernels till the loss function -- temporary solution std::vector inference_kernels; for (auto kernel : this->kernels_) { - if (dynamic_cast(kernel) != nullptr) break; + if (reinterpret_cast(kernel) != nullptr) break; inference_kernels.push_back(kernel); } @@ -106,7 +106,7 @@ void TrainSession::Train() { output_tensor_map_.clear(); train_mode_ = true; for (auto kernel : this->kernels_) { - if (dynamic_cast(kernel) != nullptr) { + if (reinterpret_cast(kernel) != nullptr) { auto *ms_tensor = kernel->out_tensors().at(0); if (ms_tensor != nullptr) { output_node_map_[kernel->name()].emplace_back(ms_tensor); @@ -130,7 +130,7 @@ void TrainSession::Eval() { train_mode_ = false; for (auto kernel : this->kernels_) { - if ((dynamic_cast(kernel) != nullptr) && (last_kernel != nullptr)) { + if ((reinterpret_cast(kernel) != nullptr) && (last_kernel != nullptr)) { if (output_node_map_.find(last_kernel->name()) == output_node_map_.end()) { auto *ms_tensor = last_kernel->out_tensors().at(0); if (ms_tensor != nullptr) { diff --git a/mindspore/lite/test/CMakeLists.txt b/mindspore/lite/test/CMakeLists.txt index 597abb7555..aac448cf5c 100644 --- a/mindspore/lite/test/CMakeLists.txt +++ b/mindspore/lite/test/CMakeLists.txt @@ -11,11 +11,7 @@ string(REPLACE " -Werror " " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") STRING(REPLACE " -fvisibility=hidden " " -fvisibility=default " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") STRING(REPLACE " -fvisibility=hidden " " -fvisibility=default " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - if(BUILD_CONVERTER) -file (GLOB_RECURSE CORE_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/*.cc - ) set(CCSRC_SRC ## ccsrc ${CCSRC_DIR}/backend/optimizer/common/pattern_engine.cc @@ -23,29 +19,8 @@ set(CCSRC_SRC ${CCSRC_DIR}/backend/optimizer/common/optimizer.cc ) else(BUILD_CONVERTER) - set(CORE_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/abstract/utils.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/abstract/dshape.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/abstract/abstract_value.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/abstract/abstract_function.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/ir/primitive.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/ir/named.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/ir/value.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/ir/value_extends.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/ir/dtype.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/ir/dtype_extends.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/ir/dtype/container.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/ir/dtype/type.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/ir/dtype/empty.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/ir/dtype/tensor_type.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/ir/dtype/type_extends.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/ir/dtype/number.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/gvar/logging_level.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/gvar/typeid_manager.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/base/base.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/base/base_ref.cc - ${CMAKE_CURRENT_SOURCE_DIR}/../../core/utils/log_adapter.cc - ) + set(TEST_LITE_SRC ${LITE_DIR}/src/common/log_adapter.cc) + add_compile_definitions(USE_ANDROID_LOG) endif() ### cpu kernel @@ -127,7 +102,7 @@ endif() ### runtime framework file(GLOB_RECURSE OPS_SRC ${LITE_DIR}/src/ops/*.cc) set(TEST_LITE_SRC - ${CORE_SRC} + ${TEST_LITE_SRC} ${CCSRC_SRC} ${OPS_SRC} ${KERNEL_OP_SRC} @@ -175,6 +150,7 @@ endif() ### converter if(BUILD_CONVERTER) add_definitions(-DPRIMITIVE_WRITEABLE) + add_definitions(-DUSE_GLOG) file(GLOB_RECURSE TEST_CASE_TFLITE_PARSERS_SRC ${TEST_DIR}/ut/tools/converter/parser/tflite/*.cc ) @@ -296,7 +272,7 @@ if (BUILD_MINDDATA STREQUAL "lite") elseif(BUILD_MINDDATA STREQUAL "full") if (PLATFORM_ARM32 OR PLATFORM_ARM64) target_link_libraries(lite-test log) - endif() + endif() endif() if (BUILD_CONVERTER) target_link_libraries(lite-test @@ -312,6 +288,9 @@ if (BUILD_CONVERTER) protobuf mindspore::eigen mindspore::json - ${SECUREC_LIBRARY} + mindspore_core + mindspore::glog ) +else(BUILD_CONVERTER) + target_link_libraries(lite-test log) endif() diff --git a/mindspore/lite/test/common/common_test.cc b/mindspore/lite/test/common/common_test.cc index 2b7444134d..22da3a5e13 100644 --- a/mindspore/lite/test/common/common_test.cc +++ b/mindspore/lite/test/common/common_test.cc @@ -14,7 +14,7 @@ * limitations under the License. */ #include "common/common_test.h" -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #ifdef __cplusplus #if __cplusplus diff --git a/mindspore/lite/test/main.cc b/mindspore/lite/test/main.cc index e936ceccaa..d92fef75e8 100644 --- a/mindspore/lite/test/main.cc +++ b/mindspore/lite/test/main.cc @@ -15,14 +15,17 @@ */ #include #include "gtest/gtest.h" -#include "mindspore/core/utils/log_adapter.h" +#ifndef USE_ANDROID_LOG namespace mindspore { extern void InitSubModulesLogLevel(); } +#endif GTEST_API_ int main(int argc, char **argv) { +#ifndef USE_ANDROID_LOG mindspore::InitSubModulesLogLevel(); +#endif testing::InitGoogleTest(&argc, argv); int ret = RUN_ALL_TESTS(); return ret; diff --git a/mindspore/lite/test/ut/internal/vector_test.cc b/mindspore/lite/test/ut/internal/vector_test.cc index 1c8732bedf..6a0a065b6c 100644 --- a/mindspore/lite/test/ut/internal/vector_test.cc +++ b/mindspore/lite/test/ut/internal/vector_test.cc @@ -35,7 +35,7 @@ void CheckArrValue(Vector arr) { TEST_F(VectorTest, VectorTest1) { constexpr int kLen1 = 10; Vector arr1(kLen1); - for (int i = 0 ; i < kLen1; ++i) { + for (int i = 0; i < kLen1; ++i) { arr1[i] = i; } Vector arr2 = arr1; diff --git a/mindspore/lite/test/ut/src/graph_test.cc b/mindspore/lite/test/ut/src/graph_test.cc index 4e5607ae44..3a3b75f978 100644 --- a/mindspore/lite/test/ut/src/graph_test.cc +++ b/mindspore/lite/test/ut/src/graph_test.cc @@ -22,7 +22,7 @@ #include #include #include "common/common_test.h" -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "mindspore/lite/include/lite_session.h" #include "mindspore/lite/src/executor.h" #include "mindspore/lite/schema/inner/anf_ir_generated.h" diff --git a/mindspore/lite/test/ut/src/infer_test.cc b/mindspore/lite/test/ut/src/infer_test.cc index 8ef11d372c..f2d7a6539c 100644 --- a/mindspore/lite/test/ut/src/infer_test.cc +++ b/mindspore/lite/test/ut/src/infer_test.cc @@ -22,7 +22,7 @@ #include "include/lite_session.h" #include "include/context.h" #include "include/errorcode.h" -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/lite_session.h" #include "src/runtime/parallel_executor.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/common/pack_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/common/pack_tests.cc index 8220e31e47..e3329df5c3 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/common/pack_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/common/pack_tests.cc @@ -16,7 +16,7 @@ #include #include -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/common/file_utils.h" #include "mindspore/lite/nnacl/pack.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp16/convolution_fp16_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp16/convolution_fp16_tests.cc index 95cdaf1628..684d2c9d07 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp16/convolution_fp16_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp16/convolution_fp16_tests.cc @@ -16,7 +16,7 @@ #include #include -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/common/utils.h" #include "src/common/file_utils.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp16/reduce_fp16_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp16/reduce_fp16_tests.cc index 5e2026a1f8..1961ecec84 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp16/reduce_fp16_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp16/reduce_fp16_tests.cc @@ -14,7 +14,7 @@ * limitations under the License. */ #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "src/kernel_registry.h" #include "mindspore/lite/src/runtime/kernel/arm/fp16/reduce_fp16.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/activation_fp32_test.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/activation_fp32_test.cc index 8907d1efd2..036ad0ee6a 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/activation_fp32_test.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/activation_fp32_test.cc @@ -14,7 +14,7 @@ * limitations under the License. */ #include -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/fp32/activation.h" #include "mindspore/lite/src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/argminmax_fp32_test.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/argminmax_fp32_test.cc index 03b4fb0af6..b944317ced 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/argminmax_fp32_test.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/argminmax_fp32_test.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/fp32/arg_min_max.h" #include "mindspore/lite/nnacl/arg_min_max.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/arithmetic_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/arithmetic_fp32_tests.cc index 2acfac53fc..1acdb7d60f 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/arithmetic_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/arithmetic_fp32_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "src/common/file_utils.h" #include "mindspore/lite/nnacl/fp32/arithmetic.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/batch_to_space_fp32_test.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/batch_to_space_fp32_test.cc index 51e15c65e4..e43dfd6840 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/batch_to_space_fp32_test.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/batch_to_space_fp32_test.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/batch_to_space.h" #include "mindspore/lite/nnacl/arithmetic_common.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/batchnorm_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/batchnorm_fp32_tests.cc index 8593c16145..c712f413c6 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/batchnorm_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/batchnorm_fp32_tests.cc @@ -14,7 +14,7 @@ * limitations under the License. */ #include -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/fp32/batchnorm.h" #include "mindspore/lite/src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/constant_of_shape_fp32_test.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/constant_of_shape_fp32_test.cc index de89f88655..636b438086 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/constant_of_shape_fp32_test.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/constant_of_shape_fp32_test.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/runtime/kernel/arm/fp32/constant_of_shape.h" #include "src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/conv1x1_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/conv1x1_fp32_tests.cc index 0e288d8323..caca06fe7a 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/conv1x1_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/conv1x1_fp32_tests.cc @@ -16,7 +16,7 @@ #include #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "src/common/file_utils.h" #include "nnacl/matmul_parameter.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/convolution_depthwise_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/convolution_depthwise_fp32_tests.cc index 975cec6626..58f4674af4 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/convolution_depthwise_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/convolution_depthwise_fp32_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "src/common/file_utils.h" #include "mindspore/lite/src/runtime/kernel/arm/base/convolution_base.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/deconvolution_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/deconvolution_fp32_tests.cc index d9d5ad4dec..4681e26fa0 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/deconvolution_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/deconvolution_fp32_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "src/common/file_utils.h" #include "mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/depth_to_space_fp32_test.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/depth_to_space_fp32_test.cc index 85060e1f87..9958bb5a93 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/depth_to_space_fp32_test.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/depth_to_space_fp32_test.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/depth_to_space.h" #include "mindspore/lite/nnacl/arithmetic_common.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/detection_post_process_test.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/detection_post_process_test.cc index 72bf3833e6..de55b780df 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/detection_post_process_test.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/detection_post_process_test.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/runtime/kernel/arm/fp32/detection_post_process.h" #include "src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/elu_fp32_test.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/elu_fp32_test.cc index 5184aca7af..21311edc7a 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/elu_fp32_test.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/elu_fp32_test.cc @@ -19,7 +19,7 @@ #include "nnacl/fp32/elu.h" #include "src/common/file_utils.h" #include "common/common_test.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" namespace mindspore { using mindspore::lite::Tensor; diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/embedding_lookup_fp32_test.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/embedding_lookup_fp32_test.cc index 96f9cf5f88..3566063e5f 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/embedding_lookup_fp32_test.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/embedding_lookup_fp32_test.cc @@ -19,7 +19,7 @@ #include "nnacl/fp32/embedding_lookup.h" #include "src/common/file_utils.h" #include "common/common_test.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" namespace mindspore { using mindspore::lite::Tensor; diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/fullconnection_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/fullconnection_fp32_tests.cc index 785aad906e..e27c63aa60 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/fullconnection_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/fullconnection_fp32_tests.cc @@ -17,7 +17,7 @@ #include #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "src/common/file_utils.h" #include "src/runtime/kernel/arm/fp32/fullconnection.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/l2norm_fp32_test.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/l2norm_fp32_test.cc index 31213e5143..cb9ef486ae 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/l2norm_fp32_test.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/l2norm_fp32_test.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/runtime/kernel/arm/fp32/l2_norm.h" #include "src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/lstm_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/lstm_fp32_tests.cc index 75c9d59b2e..6d61e4c919 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/lstm_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/lstm_fp32_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/fp32/lstm.h" #include "mindspore/lite/src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/matmul_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/matmul_fp32_tests.cc index 284cc6f6d3..f4193f9d4c 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/matmul_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/matmul_fp32_tests.cc @@ -14,7 +14,7 @@ * limitations under the License. */ #include -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/runtime/kernel/arm/fp32/matmul.h" #include "mindspore/lite/nnacl/fp32/matmul.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/power_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/power_fp32_tests.cc index f4ee436f49..cc58a1dda9 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/power_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/power_fp32_tests.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/runtime/kernel/arm/fp32/power.h" #include "src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/reduce_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/reduce_fp32_tests.cc index 4da3ef549e..2c58cf6ee2 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/reduce_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/reduce_fp32_tests.cc @@ -14,7 +14,7 @@ * limitations under the License. */ #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/fp32/reduce.h" #include "schema/inner/model_generated.h" @@ -25,12 +25,12 @@ using mindspore::lite::Allocator; using mindspore::lite::Tensor; using mindspore::schema::ReduceMode; +using mindspore::schema::ReduceMode_ReduceASum; using mindspore::schema::ReduceMode_ReduceMax; using mindspore::schema::ReduceMode_ReduceMean; using mindspore::schema::ReduceMode_ReduceMin; using mindspore::schema::ReduceMode_ReduceProd; using mindspore::schema::ReduceMode_ReduceSum; -using mindspore::schema::ReduceMode_ReduceASum; using mindspore::schema::ReduceMode_ReduceSumSquare; namespace mindspore { diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/roi_pooling_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/roi_pooling_fp32_tests.cc index b9a08ccdfc..b40b8d429d 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/roi_pooling_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/roi_pooling_fp32_tests.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/runtime/kernel/arm/fp32/roi_pooling.h" #include "src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/space_to_batch_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/space_to_batch_fp32_tests.cc index 9f83c503b8..67668d0126 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/space_to_batch_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/space_to_batch_fp32_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/fp32/space_to_batch.h" #include "mindspore/lite/src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/space_to_depth_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/space_to_depth_fp32_tests.cc index 42ab39d856..0f5bbc6f00 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/space_to_depth_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/space_to_depth_fp32_tests.cc @@ -16,7 +16,7 @@ #include #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/fp32/space_to_depth.h" #include "mindspore/lite/src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/sparse_to_dense_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/sparse_to_dense_fp32_tests.cc index daee1544d3..c319087678 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/sparse_to_dense_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/sparse_to_dense_fp32_tests.cc @@ -16,7 +16,7 @@ #include #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/fp32/sparse_to_dense.h" #include "mindspore/lite/src/kernel_registry.h" @@ -94,12 +94,9 @@ TEST_F(TestSparseToDenseFp32, SparseToDense_test1) { ASSERT_EQ(output_tensor_shape, output_shape); kernel->Run(); - std::vector except_result = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; + std::vector except_result = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; PrintData("output data", output, output_size); PrintData("output data shape", output_tensor_shape.data(), output_tensor_shape.size()); CompareOutputData(output, except_result.data(), output_size, 0.000001); @@ -181,12 +178,9 @@ TEST_F(TestSparseToDenseFp32, SparseToDense_test2) { ASSERT_EQ(output_tensor_shape, output_shape); kernel->Run(); - std::vector except_result = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 6}; + std::vector except_result = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6}; PrintData("output data", output, output_size); PrintData("output data shape", output_tensor_shape.data(), output_tensor_shape.size()); CompareOutputData(output, except_result.data(), output_size, 0.000001); @@ -432,12 +426,9 @@ TEST_F(TestSparseToDenseFp32, SparseToDense_test5) { ASSERT_EQ(output_tensor_shape, output_shape); kernel->Run(); - std::vector except_result = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 6}; + std::vector except_result = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6}; PrintData("output data", output, output_size); PrintData("output data shape", output_tensor_shape.data(), output_tensor_shape.size()); CompareOutputData(output, except_result.data(), output_size, 0.000001); diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/stack_fp32_test.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/stack_fp32_test.cc index 8bf5b6b836..7458f242d3 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/stack_fp32_test.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/stack_fp32_test.cc @@ -33,8 +33,7 @@ TEST_F(StackTestFp32, StackTest1) { std::vector shape = {2, 3}; int axis = 2; constexpr int kOutSize = 18; - float expect_out[kOutSize] = {1, 4, 7, 2, 5, 8, 3, 6, 9, - 10, 40, 70, 20, 50, 80, 30, 60, 90}; + float expect_out[kOutSize] = {1, 4, 7, 2, 5, 8, 3, 6, 9, 10, 40, 70, 20, 50, 80, 30, 60, 90}; float output[kOutSize]; DoStack(input, 3, shape.data(), shape.size(), axis, output); for (int i = 0; i < kOutSize; ++i) { @@ -44,5 +43,4 @@ TEST_F(StackTestFp32, StackTest1) { CompareOutputData(output, expect_out, kOutSize, 0.000001); } - } // namespace mindspore diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/strided_slice_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/strided_slice_fp32_tests.cc index 38348f63de..597c7ace71 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/strided_slice_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/strided_slice_fp32_tests.cc @@ -16,7 +16,7 @@ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/common/utils.h" #include "nnacl/strided_slice.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/transpose_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/transpose_fp32_tests.cc index acf687326a..0e0e28f3f2 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/transpose_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/transpose_fp32_tests.cc @@ -16,7 +16,7 @@ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/runtime/kernel/arm/fp32/transpose.h" #include "mindspore/lite/nnacl/transpose.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/activation_grad_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/activation_grad_fp32_tests.cc index 5f8a6fe6ed..3563d2d76b 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/activation_grad_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/activation_grad_fp32_tests.cc @@ -18,7 +18,7 @@ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "src/common/file_utils.h" #include "src/common/file_utils_ext.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/arithmetic_grad_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/arithmetic_grad_fp32_tests.cc index ce8f7cdb53..5a2fced4bb 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/arithmetic_grad_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/arithmetic_grad_fp32_tests.cc @@ -16,7 +16,7 @@ #include #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "src/common/file_utils.h" #include "src/common/file_utils_ext.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/bias_grad_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/bias_grad_fp32_tests.cc index 07021fc7a8..3efc68212b 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/bias_grad_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/bias_grad_fp32_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "src/common/file_utils.h" #include "src/runtime/kernel/arm/fp32_grad/bias_grad.h" @@ -30,7 +30,7 @@ class TestBiasGradFp32 : public mindspore::CommonTest { TEST_F(TestBiasGradFp32, BiasGradFp32) { // prepare stage - ArithmeticParameter* bias_param = static_cast(malloc(sizeof(ArithmeticParameter))); + ArithmeticParameter *bias_param = static_cast(malloc(sizeof(ArithmeticParameter))); size_t input_size; std::string input_path = "./test_data/operators/biasgradfp32_1_dy_10_28_28_7.bin"; auto input_data = reinterpret_cast(mindspore::lite::ReadFile(input_path.c_str(), &input_size)); diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/bn_grad_fp32_test.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/bn_grad_fp32_test.cc index 11b275387c..1242008a71 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/bn_grad_fp32_test.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/bn_grad_fp32_test.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "src/common/file_utils.h" #include "src/common/file_utils_ext.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/convolution_grad_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/convolution_grad_fp32_tests.cc index 44a3960b4d..61948362d0 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/convolution_grad_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/convolution_grad_fp32_tests.cc @@ -17,7 +17,7 @@ #include #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "src/common/file_utils.h" #include "src/common/file_utils_ext.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/network_test.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/network_test.cc index 6bdb8f09ba..518f8931bc 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/network_test.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/network_test.cc @@ -29,7 +29,7 @@ // #include "include/lite_session.h" #include "include/context.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/common/file_utils.h" #include "src/common/file_utils_ext.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/pooling_grad_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/pooling_grad_fp32_tests.cc index 60fd1b9261..f0646e343f 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/pooling_grad_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/pooling_grad_fp32_tests.cc @@ -17,7 +17,7 @@ #include #include #include "mindspore/lite/include/context.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/kernel_registry.h" #include "src/common/utils.h" @@ -59,7 +59,7 @@ void InitPoolingParamFP32(PoolingParameter *pooling_param) { TEST_F(TestPoolingGradFp32, AvgPoolingGradFp32) { // prepare stage - auto pooling_param = static_cast(malloc(sizeof(PoolingParameter))); + auto pooling_param = static_cast(malloc(sizeof(PoolingParameter))); InitPoolingParamFP32(pooling_param); pooling_param->output_channel_ = 3; pooling_param->pool_mode_ = PoolMode_AvgPool; @@ -267,7 +267,7 @@ TEST_F(TestPoolingGradFp32, AvgPoolGradStride2Fp32) { auto time_start = mindspore::lite::GetTimeUs(); kernel->Run(); auto time_end = mindspore::lite::GetTimeUs(); - printf("single thread running time : %ld ms\n", time_end - time_start); + printf("single thread running time : %llu ms\n", time_end - time_start); std::string output_path = "./test_data/pooling/avgpoolgradfp32_s2_dx_3_28_28_3.bin"; auto res = lite::CompareRelativeOutput(out_data, output_path); @@ -327,7 +327,7 @@ TEST_F(TestPoolingGradFp32, AvgPoolGradStride3Fp32) { auto time_start = mindspore::lite::GetTimeUs(); kernel->Run(); auto time_end = mindspore::lite::GetTimeUs(); - printf("single thread running time : %ld ms\n", time_end - time_start); + printf("single thread running time : %llu ms\n", time_end - time_start); std::string output_path = "./test_data/pooling/avgpoolgradfp32_s3_dx_3_28_28_3.bin"; auto res = lite::CompareRelativeOutput(out_data, output_path); @@ -444,7 +444,7 @@ TEST_F(TestPoolingGradFp32, MaxPoolGradBatchFp32) { auto time_start = mindspore::lite::GetTimeUs(); kernel->Run(); auto time_end = mindspore::lite::GetTimeUs(); - printf("single thread running time : %ld ms\n", time_end - time_start); + printf("single thread running time : %llu ms\n", time_end - time_start); std::string output_path = "./test_data/pooling/maxpoolgradfp32_1_xgrad_3_28_28_3.bin"; auto res = lite::CompareRelativeOutput(out_data, output_path); @@ -514,7 +514,7 @@ TEST_F(TestPoolingGradFp32, MaxPoolGradStride2Fp32) { auto time_start = mindspore::lite::GetTimeUs(); kernel->Run(); auto time_end = mindspore::lite::GetTimeUs(); - printf("single thread running time : %ld ms\n", time_end - time_start); + printf("single thread running time : %llu ms\n", time_end - time_start); std::string output_path = "./test_data/pooling/maxpoolgradfp32_s2_xgrad_3_28_28_3.bin"; auto res = lite::CompareRelativeOutput(out_data, output_path); @@ -584,7 +584,7 @@ TEST_F(TestPoolingGradFp32, MaxPoolGradStride3Fp32) { auto time_start = mindspore::lite::GetTimeUs(); kernel->Run(); auto time_end = mindspore::lite::GetTimeUs(); - printf("single thread running time : %ld ms\n", time_end - time_start); + printf("single thread running time : %llu ms\n", time_end - time_start); std::string output_path = "./test_data/pooling/maxpoolgradfp32_s3_xgrad_3_28_28_3.bin"; auto res = lite::CompareRelativeOutput(out_data, output_path); diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/softmax_crossentropy_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/softmax_crossentropy_fp32_tests.cc index 6011e6b101..0599fff9b5 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/softmax_crossentropy_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/softmax_crossentropy_fp32_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "src/common/file_utils.h" #include "src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.h" @@ -83,11 +83,11 @@ TEST_F(TestSoftmaxCrossEntropyFp32, SoftmaxCrossEntropyFp32) { std::string grad_path = "./test_data/operators/sce_fp32_1_dy_6_4.bin"; lite::CompareOutput(grad, grad_path); - delete [] ll_labels; - delete [] labels; - delete [] input_data; - delete [] loss; - delete [] grad; + delete[] ll_labels; + delete[] labels; + delete[] input_data; + delete[] loss; + delete[] grad; l_tensor.SetData(nullptr); y_tensor.SetData(nullptr); loss_tensor.SetData(nullptr); diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/softmax_grad_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/softmax_grad_fp32_tests.cc index 7d8c766b6a..608cb12a0b 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/softmax_grad_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/softmax_grad_fp32_tests.cc @@ -22,7 +22,7 @@ // #include "mindspore/lite/src/lite_kernel.h" #include "mindspore/lite/include/context.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/kernel_registry.h" #include "src/common/utils.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/arithmetic_self_int8_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/arithmetic_self_int8_tests.cc index 1398016f2f..fcb346c6b9 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/arithmetic_self_int8_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/arithmetic_self_int8_tests.cc @@ -16,7 +16,6 @@ #include #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/arithmetic_self_parameter.h" #include "mindspore/lite/src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/batchnorm_int8_test.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/batchnorm_int8_test.cc index 2faf08019b..323b7a5a65 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/batchnorm_int8_test.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/batchnorm_int8_test.cc @@ -15,7 +15,7 @@ */ #include #include "schema/inner/model_generated.h" -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/batchnorm_parameter.h" #include "mindspore/lite/nnacl/int8/batchnorm_int8.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/concat_int8_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/concat_int8_tests.cc index 7432415340..5ff97603e1 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/concat_int8_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/concat_int8_tests.cc @@ -16,7 +16,7 @@ #include #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/concat_parameter.h" #include "mindspore/lite/src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/conv_1x1_int8_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/conv_1x1_int8_tests.cc index d86fee8982..ff8c7e1754 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/conv_1x1_int8_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/conv_1x1_int8_tests.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/lite_kernel.h" #include "src/common/file_utils.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/crop_int8_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/crop_int8_tests.cc index 2e09968fa6..edbf7e2422 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/crop_int8_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/crop_int8_tests.cc @@ -16,7 +16,7 @@ #include #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/crop_parameter.h" #include "mindspore/lite/src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/fullconnection_int8_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/fullconnection_int8_tests.cc index f13f96f244..066e77719f 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/fullconnection_int8_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/fullconnection_int8_tests.cc @@ -14,7 +14,7 @@ * limitations under the License. */ #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/runtime/kernel/arm/int8/fullconnection_int8.h" #include "mindspore/lite/nnacl/common_func.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/gatherNd_int8_test.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/gatherNd_int8_test.cc index 318c74d10b..6ec95b84fc 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/gatherNd_int8_test.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/gatherNd_int8_test.cc @@ -14,7 +14,7 @@ * limitations under the License. */ #include -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/fp32/gatherNd.h" #include "mindspore/lite/nnacl/int8/gatherNd_int8.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/gather_int8_test.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/gather_int8_test.cc index b25894635a..9174875ce7 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/gather_int8_test.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/gather_int8_test.cc @@ -14,7 +14,7 @@ * limitations under the License. */ #include -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/gather_parameter.h" #include "mindspore/lite/nnacl/int8/gather_int8.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/matmul_int8_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/matmul_int8_tests.cc index 52220834c6..371281905b 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/matmul_int8_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/matmul_int8_tests.cc @@ -15,7 +15,7 @@ */ #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/runtime/kernel/arm/int8/matmul_int8.h" #include "nnacl/quantization/quantize.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/mul_int8_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/mul_int8_tests.cc index 16c61a17da..9623182294 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/mul_int8_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/mul_int8_tests.cc @@ -16,7 +16,7 @@ #include #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/mul_parameter.h" #include "mindspore/lite/src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/prelu_int8_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/prelu_int8_tests.cc index b5b2f9d750..e457c7026e 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/prelu_int8_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/prelu_int8_tests.cc @@ -16,7 +16,7 @@ #include #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/quantization/quantize.h" #include "mindspore/lite/src/kernel_registry.h" @@ -71,7 +71,7 @@ TEST_F(TestPreluInt8, prelu_1) { lite::InnerContext *ctx = new lite::InnerContext; ctx->thread_num_ = 2; ASSERT_EQ(lite::RET_OK, ctx->Init()); - op_param.axis_ = 0.25; + op_param.axis_ = 0; kernel::KernelKey desc = {kernel::KERNEL_ARCH::kCPU, kNumberTypeInt8, schema::PrimitiveType_LeakyReLU}; auto creator = lite::KernelRegistry::GetInstance()->GetCreator(desc); ASSERT_NE(creator, nullptr); diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/quant_dtype_cast_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/quant_dtype_cast_tests.cc index f2f9560bb3..ba66766127 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/quant_dtype_cast_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/quant_dtype_cast_tests.cc @@ -16,7 +16,7 @@ #include #include #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/runtime/kernel/arm/base/quant_dtype_cast.h" #include "mindspore/lite/nnacl/int8/quant_dtype_cast.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/reduce_int8_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/reduce_int8_tests.cc index 2933f0ee2d..56bc7c9c2a 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/reduce_int8_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/reduce_int8_tests.cc @@ -15,7 +15,7 @@ */ #include #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "src/tensor.h" #include "mindspore/lite/src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/reshape_int8_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/reshape_int8_tests.cc index d537169bd6..29a8c698f0 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/reshape_int8_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/reshape_int8_tests.cc @@ -16,7 +16,7 @@ #include #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/reshape_parameter.h" #include "mindspore/lite/src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/scale_int8.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/scale_int8.cc index ec0cae9d5e..20fc96b8ba 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/scale_int8.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/scale_int8.cc @@ -15,7 +15,7 @@ */ #include #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "src/tensor.h" #include "mindspore/lite/src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/split_int8_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/split_int8_tests.cc index b589741214..05ee62c78b 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/split_int8_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/split_int8_tests.cc @@ -16,7 +16,7 @@ #include #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/split_parameter.h" #include "mindspore/lite/src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/squeeze_int8_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/squeeze_int8_tests.cc index 65e3c1c36e..98eda9024e 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/squeeze_int8_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/squeeze_int8_tests.cc @@ -16,7 +16,7 @@ #include #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/squeeze_parameter.h" #include "mindspore/lite/src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/unsqueeze_int8_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/unsqueeze_int8_tests.cc index 65192eea46..0546438c89 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/unsqueeze_int8_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/unsqueeze_int8_tests.cc @@ -16,7 +16,6 @@ #include #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/nnacl/unsqueeze_parameter.h" #include "mindspore/lite/src/kernel_registry.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/activation_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/activation_tests.cc index 128dd57c03..6778ed9f42 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/activation_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/activation_tests.cc @@ -15,7 +15,7 @@ */ #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/common/file_utils.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/arithmetic_self_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/arithmetic_self_tests.cc index 21778846f4..9c246a83bb 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/arithmetic_self_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/arithmetic_self_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" #include "mindspore/lite/src/common/file_utils.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/avg_pooling_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/avg_pooling_tests.cc index a5aab09f34..73320a7a74 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/avg_pooling_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/avg_pooling_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/common/file_utils.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/batchnorm_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/batchnorm_tests.cc index 6a89badaf1..19fa65862a 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/batchnorm_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/batchnorm_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" #include "mindspore/lite/src/common/file_utils.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/biasadd_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/biasadd_tests.cc index 72af342b1c..87e8c54cf6 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/biasadd_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/biasadd_tests.cc @@ -15,7 +15,7 @@ */ #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/common/file_utils.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/cast_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/cast_tests.cc index b74f735653..2f9b7a1a6b 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/cast_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/cast_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" #include "mindspore/lite/src/common/file_utils.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/concat_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/concat_tests.cc index c1ca13634b..2de645340e 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/concat_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/concat_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" #include "mindspore/lite/src/common/file_utils.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/conv2d_transpose_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/conv2d_transpose_tests.cc index a522506332..51f9a51bd3 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/conv2d_transpose_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/conv2d_transpose_tests.cc @@ -21,7 +21,7 @@ #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" #include "mindspore/lite/src/runtime/kernel/opencl/subgraph_opencl_kernel.h" #include "mindspore/lite/src/runtime/kernel/opencl/kernel/conv2d_transpose.h" -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "mindspore/lite/test/ut/src/runtime/kernel/opencl/utils_tests.h" namespace mindspore { diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/convolution_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/convolution_tests.cc index 13b9a7d43f..3d35ec23e1 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/convolution_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/convolution_tests.cc @@ -14,7 +14,7 @@ * limitations under the License. */ #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/common/file_utils.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/depthwise_conv2d_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/depthwise_conv2d_tests.cc index e1633936a7..7903cefa26 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/depthwise_conv2d_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/depthwise_conv2d_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/common/file_utils.h" #include "nnacl/pack.h" @@ -161,7 +161,7 @@ void DepthWiseTestMain(ConvParameter *conv_param, T2 *input_data, T1 *weight_dat std::cout << std::endl; // compare CommonTest::CompareOutputData(packed_output, packed_correct_data, packed_output_size, err_max); - delete [] packed_correct_data; + delete[] packed_correct_data; } inputs[1]->SetData(nullptr); diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/gather_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/gather_tests.cc index 79b2e9d22e..41b5f3f7bc 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/gather_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/gather_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "src/runtime/kernel/opencl/utils.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" @@ -77,7 +77,7 @@ void test_main_gather(void *input_data, void *correct_data, const std::vector(outputs[0]->data_c()); - CommonTest::CompareOutputData(output_data, static_cast(correct_data), outputs[0]->ElementsNum(), 0.0001); + CommonTest::CompareOutputData(output_data, static_cast(correct_data), outputs[0]->ElementsNum(), 0.0001); delete sub_graph; } TEST_F(TestGatherOpenCL, Axis1Fp32) { diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/matmul_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/matmul_tests.cc index def820ab90..17ef45ec73 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/matmul_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/matmul_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/common/file_utils.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/max_pooling_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/max_pooling_tests.cc index 0ca9ce0c9a..dc24ddb536 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/max_pooling_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/max_pooling_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/common/file_utils.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/opencl_kernel_tests.h b/mindspore/lite/test/ut/src/runtime/kernel/opencl/opencl_kernel_tests.h index 61ffc86412..eb36b5c9c8 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/opencl_kernel_tests.h +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/opencl_kernel_tests.h @@ -16,7 +16,7 @@ #include #include "common/common_test.h" -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "mindspore/lite/src/common/file_utils.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" #include "mindspore/lite/src/runtime/kernel/opencl/subgraph_opencl_kernel.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/prelu_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/prelu_tests.cc index 22d6671f03..d759e85452 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/prelu_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/prelu_tests.cc @@ -16,7 +16,7 @@ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/common/file_utils.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/reduce_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/reduce_tests.cc index 3447689831..2e0c2ab6dc 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/reduce_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/reduce_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/common/file_utils.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/reshape_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/reshape_tests.cc index 878474b8e0..05ee24f6d0 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/reshape_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/reshape_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/common/file_utils.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/slice_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/slice_tests.cc index 5b6290e3f3..a9560bcd35 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/slice_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/slice_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" #include "mindspore/lite/src/common/file_utils.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/softmax_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/softmax_tests.cc index a953c67413..79d0f29c91 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/softmax_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/softmax_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/common/file_utils.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/to_format_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/to_format_tests.cc index 344400c5b0..3b03679586 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/to_format_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/to_format_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/common/file_utils.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/transpose_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/transpose_tests.cc index 97424d51c8..65fc8e768c 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/transpose_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/transpose_tests.cc @@ -15,7 +15,7 @@ */ #include #include -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "common/common_test.h" #include "mindspore/lite/src/common/file_utils.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/utils_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/opencl/utils_tests.cc index 57807c13c5..1bdc24028e 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/utils_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/utils_tests.cc @@ -15,7 +15,7 @@ */ #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "mindspore/lite/src/common/file_utils.h" #include "mindspore/lite/src/runtime/kernel/opencl/subgraph_opencl_kernel.h" #include "mindspore/lite/test/ut/src/runtime/kernel/opencl/utils_tests.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/opencl/utils_tests.h b/mindspore/lite/test/ut/src/runtime/kernel/opencl/utils_tests.h index 047b22d593..dd4fb08958 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/opencl/utils_tests.h +++ b/mindspore/lite/test/ut/src/runtime/kernel/opencl/utils_tests.h @@ -17,7 +17,7 @@ #include #include #include "tests/ut/cpp/common/common_test.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "mindspore/lite/src/common/file_utils.h" #include "mindspore/lite/src/runtime/opencl/opencl_runtime.h" #include "mindspore/lite/src/runtime/kernel/opencl/subgraph_opencl_kernel.h" diff --git a/mindspore/lite/test/ut/src/utils_test.cc b/mindspore/lite/test/ut/src/utils_test.cc index ee4ec0f850..d3e17dbd8b 100644 --- a/mindspore/lite/test/ut/src/utils_test.cc +++ b/mindspore/lite/test/ut/src/utils_test.cc @@ -22,7 +22,7 @@ #include "include/lite_session.h" #include "include/context.h" #include "include/errorcode.h" -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "mindspore/lite/src/lite_kernel.h" namespace mindspore { diff --git a/mindspore/lite/test/ut/tools/optimizer/fusion/constant_folding_fusion_test.cc b/mindspore/lite/test/ut/tools/optimizer/fusion/constant_folding_fusion_test.cc index 524d0c4553..c63ebb19bc 100644 --- a/mindspore/lite/test/ut/tools/optimizer/fusion/constant_folding_fusion_test.cc +++ b/mindspore/lite/test/ut/tools/optimizer/fusion/constant_folding_fusion_test.cc @@ -21,7 +21,7 @@ #include "include/lite_session.h" #include "include/context.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/converter/model_parser.h" #include "tools/converter/anf_transform.h" #include "tools/optimizer/fusion/constant_folding_fusion.h" diff --git a/mindspore/lite/test/ut/tools/optimizer/fusion/conv_activation_fusion_test.cc b/mindspore/lite/test/ut/tools/optimizer/fusion/conv_activation_fusion_test.cc index 9d503e82a2..a171d31ccc 100644 --- a/mindspore/lite/test/ut/tools/optimizer/fusion/conv_activation_fusion_test.cc +++ b/mindspore/lite/test/ut/tools/optimizer/fusion/conv_activation_fusion_test.cc @@ -21,7 +21,7 @@ #include "include/lite_session.h" #include "include/context.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/converter/model_parser.h" #include "tools/converter/anf_transform.h" #include "tools/anf_exporter/anf_exporter.h" diff --git a/mindspore/lite/test/ut/tools/optimizer/fusion/conv_biasadd_fusion_test.cc b/mindspore/lite/test/ut/tools/optimizer/fusion/conv_biasadd_fusion_test.cc index 9a0dc1dbb1..7ab3ff8e4a 100644 --- a/mindspore/lite/test/ut/tools/optimizer/fusion/conv_biasadd_fusion_test.cc +++ b/mindspore/lite/test/ut/tools/optimizer/fusion/conv_biasadd_fusion_test.cc @@ -21,7 +21,7 @@ #include "include/lite_session.h" #include "include/context.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/converter/model_parser.h" #include "tools/converter/anf_transform.h" #include "tools/anf_exporter/anf_exporter.h" diff --git a/mindspore/lite/test/ut/tools/optimizer/fusion/conv_bn_fusion_test.cc b/mindspore/lite/test/ut/tools/optimizer/fusion/conv_bn_fusion_test.cc index a06d872575..cd11cf5af0 100644 --- a/mindspore/lite/test/ut/tools/optimizer/fusion/conv_bn_fusion_test.cc +++ b/mindspore/lite/test/ut/tools/optimizer/fusion/conv_bn_fusion_test.cc @@ -21,7 +21,7 @@ #include "include/lite_session.h" #include "include/context.h" #include "include/errorcode.h" -#include "mindspore/core/utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/converter/model_parser.h" #include "tools/converter/anf_transform.h" #include "tools/anf_exporter/anf_exporter.h" diff --git a/mindspore/lite/test/ut/tools/optimizer/fusion/conv_scale_fusion_test.cc b/mindspore/lite/test/ut/tools/optimizer/fusion/conv_scale_fusion_test.cc index f458630ffa..5cc5d17c84 100644 --- a/mindspore/lite/test/ut/tools/optimizer/fusion/conv_scale_fusion_test.cc +++ b/mindspore/lite/test/ut/tools/optimizer/fusion/conv_scale_fusion_test.cc @@ -21,7 +21,7 @@ #include "include/lite_session.h" #include "include/context.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/converter/model_parser.h" #include "tools/converter/anf_transform.h" #include "tools/anf_exporter/anf_exporter.h" diff --git a/mindspore/lite/tools/anf_exporter/CMakeLists.txt b/mindspore/lite/tools/anf_exporter/CMakeLists.txt index d6c4808226..2a0d5ec174 100644 --- a/mindspore/lite/tools/anf_exporter/CMakeLists.txt +++ b/mindspore/lite/tools/anf_exporter/CMakeLists.txt @@ -1,6 +1,7 @@ file(GLOB_RECURSE ANF_EXPORTER_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cc ) +set_property(SOURCE ${ANF_EXPORTER_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE) add_library(anf_exporter_mid OBJECT ${ANF_EXPORTER_SRC_LIST} ) diff --git a/mindspore/lite/tools/anf_importer/CMakeLists.txt b/mindspore/lite/tools/anf_importer/CMakeLists.txt index 92488d226f..aea7294620 100644 --- a/mindspore/lite/tools/anf_importer/CMakeLists.txt +++ b/mindspore/lite/tools/anf_importer/CMakeLists.txt @@ -1,7 +1,7 @@ file(GLOB ANF_IMPORTER_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cc ) - +set_property(SOURCE ${ANF_IMPORTER_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE) add_library(anf_importer_mid OBJECT ${ANF_IMPORTER_SRC_LIST} ) diff --git a/mindspore/lite/tools/anf_importer/import_from_meta_graphT.cc b/mindspore/lite/tools/anf_importer/import_from_meta_graphT.cc index de9318f713..251440101a 100644 --- a/mindspore/lite/tools/anf_importer/import_from_meta_graphT.cc +++ b/mindspore/lite/tools/anf_importer/import_from_meta_graphT.cc @@ -20,7 +20,7 @@ #include "frontend/operator/ops.h" #include "src/param_value_lite.h" #include "tools/anf_importer/import_from_meta_graphT.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "include/errorcode.h" namespace mindspore::lite { diff --git a/mindspore/lite/tools/anf_importer/import_from_protobuf.cc b/mindspore/lite/tools/anf_importer/import_from_protobuf.cc index 1194e062ba..a904b0f623 100644 --- a/mindspore/lite/tools/anf_importer/import_from_protobuf.cc +++ b/mindspore/lite/tools/anf_importer/import_from_protobuf.cc @@ -35,7 +35,7 @@ #include "src/tensor.h" #include "src/param_value_lite.h" #include "tools/converter/parser/onnx/onnx.pb.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/common/protobuf_utils.h" using string = std::string; diff --git a/mindspore/lite/tools/benchmark/benchmark.h b/mindspore/lite/tools/benchmark/benchmark.h index e38790d9d2..1da5743d39 100644 --- a/mindspore/lite/tools/benchmark/benchmark.h +++ b/mindspore/lite/tools/benchmark/benchmark.h @@ -33,7 +33,6 @@ #include "src/common/file_utils.h" #include "src/common/utils.h" #include "include/lite_session.h" -#include "include/inference.h" namespace mindspore::lite { enum MS_API InDataType { kImage = 0, kBinary = 1 }; diff --git a/mindspore/lite/tools/common/CMakeLists.txt b/mindspore/lite/tools/common/CMakeLists.txt index 0250fa6378..47c0a827a3 100755 --- a/mindspore/lite/tools/common/CMakeLists.txt +++ b/mindspore/lite/tools/common/CMakeLists.txt @@ -1,9 +1,12 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -add_library(converter_common_mid OBJECT - ${CMAKE_CURRENT_SOURCE_DIR}/graph_util.cc - ${CMAKE_CURRENT_SOURCE_DIR}/node_util.cc - ${CMAKE_CURRENT_SOURCE_DIR}/tensor_util.cc - ${CMAKE_CURRENT_SOURCE_DIR}/storage.cc +file(GLOB CONVERTER_COMMON_SRC + ${CMAKE_CURRENT_SOURCE_DIR}/graph_util.cc + ${CMAKE_CURRENT_SOURCE_DIR}/node_util.cc + ${CMAKE_CURRENT_SOURCE_DIR}/tensor_util.cc + ${CMAKE_CURRENT_SOURCE_DIR}/storage.cc ) + +add_library(converter_common_mid OBJECT ${CONVERTER_COMMON_SRC}) + set_target_properties(converter_common_mid PROPERTIES COMPILE_FLAGS "-Wno-unused-function") diff --git a/mindspore/lite/tools/common/flag_parser.cc b/mindspore/lite/tools/common/flag_parser.cc index ebc87a61a8..656bfd20be 100644 --- a/mindspore/lite/tools/common/flag_parser.cc +++ b/mindspore/lite/tools/common/flag_parser.cc @@ -15,7 +15,7 @@ */ #include "tools/common/flag_parser.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" namespace mindspore { namespace lite { diff --git a/mindspore/lite/tools/common/graph_util.cc b/mindspore/lite/tools/common/graph_util.cc index 8f9bb4fd02..e4e31a214f 100644 --- a/mindspore/lite/tools/common/graph_util.cc +++ b/mindspore/lite/tools/common/graph_util.cc @@ -22,7 +22,7 @@ #include "schema/inner/model_generated.h" #include "tools/common/tensor_util.h" #include "tools/common/node_util.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/common/utils.h" namespace mindspore { diff --git a/mindspore/lite/tools/common/graph_util.h b/mindspore/lite/tools/common/graph_util.h index 2b4dfb9a9f..e4ef83a964 100644 --- a/mindspore/lite/tools/common/graph_util.h +++ b/mindspore/lite/tools/common/graph_util.h @@ -26,7 +26,6 @@ #include "include/errorcode.h" #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" #include "src/common/graph_util.h" namespace mindspore { diff --git a/mindspore/lite/tools/common/node_util.cc b/mindspore/lite/tools/common/node_util.cc index 524da3d50a..7d98d1d05d 100644 --- a/mindspore/lite/tools/common/node_util.cc +++ b/mindspore/lite/tools/common/node_util.cc @@ -18,7 +18,7 @@ #include #include #include "src/common/common.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/common/graph_util.h" #include "tools/common/tensor_util.h" diff --git a/mindspore/lite/tools/common/node_util.h b/mindspore/lite/tools/common/node_util.h index 0a238c589c..72e499d9eb 100644 --- a/mindspore/lite/tools/common/node_util.h +++ b/mindspore/lite/tools/common/node_util.h @@ -22,7 +22,7 @@ #include #include "schema/inner/model_generated.h" #include "src/common/common.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "include/errorcode.h" #include "securec/include/securec.h" diff --git a/mindspore/lite/tools/common/option.h b/mindspore/lite/tools/common/option.h index 76222f4ebd..d39473e8eb 100644 --- a/mindspore/lite/tools/common/option.h +++ b/mindspore/lite/tools/common/option.h @@ -19,7 +19,7 @@ #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" namespace mindspore { namespace lite { diff --git a/mindspore/lite/tools/common/storage.cc b/mindspore/lite/tools/common/storage.cc index 9d904f4398..33f4a62a7e 100644 --- a/mindspore/lite/tools/common/storage.cc +++ b/mindspore/lite/tools/common/storage.cc @@ -18,7 +18,7 @@ #include #include #include "flatbuffers/flatbuffers.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/common/file_utils.h" namespace mindspore { diff --git a/mindspore/lite/tools/common/tensor_util.h b/mindspore/lite/tools/common/tensor_util.h index 6d3e5616a5..c908d94c46 100644 --- a/mindspore/lite/tools/common/tensor_util.h +++ b/mindspore/lite/tools/common/tensor_util.h @@ -24,7 +24,7 @@ #include #include #include "schema/inner/model_generated.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "ir/dtype/type_id.h" namespace mindspore { diff --git a/mindspore/lite/tools/converter/CMakeLists.txt b/mindspore/lite/tools/converter/CMakeLists.txt index 0f4dbca099..68ec75f20e 100644 --- a/mindspore/lite/tools/converter/CMakeLists.txt +++ b/mindspore/lite/tools/converter/CMakeLists.txt @@ -1,10 +1,5 @@ add_definitions(-DPRIMITIVE_WRITEABLE) - -file (GLOB_RECURSE CORE_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/../../../core/*.cc - ) -list(REMOVE_ITEM CORE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../../core/utils/log_adapter.cc) -list(REMOVE_ITEM CORE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../../core/ir/graph_utils_extends.cc) +add_definitions(-DUSE_GLOG) set(CCSRC_SRC ${CCSRC_DIR}/backend/optimizer/common/pattern_engine.cc @@ -12,7 +7,7 @@ set(CCSRC_SRC ${CCSRC_DIR}/backend/optimizer/common/optimizer.cc ) - +include(${TOP_DIR}/cmake/external_libs/glog.cmake) if (WIN32) set(LITE_SRC #src @@ -74,11 +69,10 @@ add_subdirectory(parser/tflite) add_subdirectory(parser/onnx) add_subdirectory(legacy_optimizer) add_subdirectory(quantizer) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../core mindspore_core) set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../src) set(LITE_SRC - ${SRC_DIR}/common/graph_utils_extends.cc - ${SRC_DIR}/common/log_adapter.cc ${SRC_DIR}/common/graph_util.cc ${SRC_DIR}/runtime/allocator.cc ${SRC_DIR}/runtime/runtime_api.cc @@ -95,7 +89,7 @@ set(LITE_SRC ${SRC_DIR}/model.cc ) if (SUPPORT_TRAIN) -set(LITE_SRC +set(LITE_SRC ${LITE_SRC} ) @@ -125,19 +119,21 @@ else() set(PROTO_LIBRARY protobuf) endif() +set_property(SOURCE ${CONVERTER_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE) +set_property(SOURCE ${CCSRC_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE) +set_property(SOURCE ${OPS_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE) +set_property(SOURCE ${KERNEL_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE) +set_property(SOURCE ${LITE_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE) add_executable(converter_lite main.cc - ${CORE_SRC} ${CCSRC_SRC} ${CONVERTER_SRC} ${OPS_SRC} ${KERNEL_SRC} ${LITE_SRC} ) - if (WIN32) add_library(converter_mid OBJECT - ${CORE_SRC} ${CCSRC_SRC} ${CONVERTER_SRC} ${OPS_SRC} @@ -166,15 +162,20 @@ target_link_libraries(converter_lite PRIVATE graph_pass_mid fusion_mid quantizer_mid - quantizer_mid pthread ${PROTO_LIBRARY} ${SECUREC_LIBRARY} mindspore::json mindspore::eigen + mindspore_core + mindspore::glog ) if (NOT PLATFORM_ARM64 AND NOT PLATFORM_ARM32) install(TARGETS converter_lite RUNTIME DESTINATION ${MAIN_DIR}-${COMPONENT_NAME}/converter COMPONENT ${COMPONENT_NAME}) + install(FILES ${TOP_DIR}/mindspore/lite/build/tools/converter/mindspore_core/gvar/libmindspore_gvar.so + DESTINATION ${MAIN_DIR}-${COMPONENT_NAME}/lib COMPONENT ${COMPONENT_NAME}) + install(FILES ${glog_LIBPATH}/libglog.so.0.4.0 + DESTINATION ${MAIN_DIR}-${COMPONENT_NAME}/lib RENAME libglog.so.0 COMPONENT ${COMPONENT_NAME}) endif () diff --git a/mindspore/lite/tools/converter/anf_transform.cc b/mindspore/lite/tools/converter/anf_transform.cc index ac8b1b2212..d12e28c84e 100644 --- a/mindspore/lite/tools/converter/anf_transform.cc +++ b/mindspore/lite/tools/converter/anf_transform.cc @@ -17,7 +17,7 @@ #include "tools/converter/anf_transform.h" #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/optimizer/fusion/conv_biasadd_fusion.h" #include "tools/optimizer/fusion/conv_activation_fusion.h" #include "tools/optimizer/fusion/conv_tuple_activation_fusion.h" @@ -58,12 +58,10 @@ FuncGraphPtr AnfTransform::Transform(const FuncGraphPtr &old_graph, const conver schema::ActivationType_RELU)); pm->AddPass(std::make_shared(true, "conv_relu6", schema::PrimitiveType_Activation, schema::ActivationType_RELU6)); - pm->AddPass(std::make_shared(true, "conv_tuple_relu", - schema::PrimitiveType_Activation, - schema::ActivationType_RELU)); - pm->AddPass(std::make_shared(true, "conv_tuple_relu6", - schema::PrimitiveType_Activation, - schema::ActivationType_RELU6)); + pm->AddPass(std::make_shared( + true, "conv_tuple_relu", schema::PrimitiveType_Activation, schema::ActivationType_RELU)); + pm->AddPass(std::make_shared( + true, "conv_tuple_relu6", schema::PrimitiveType_Activation, schema::ActivationType_RELU6)); auto weight_format_hardcode_pass = std::make_shared(); weight_format_hardcode_pass->SetFmkType(config->fmk); weight_format_hardcode_pass->SetQuantType(config->quantType); diff --git a/mindspore/lite/tools/converter/converter.cc b/mindspore/lite/tools/converter/converter.cc index 76f3ace21a..382aaf0202 100644 --- a/mindspore/lite/tools/converter/converter.cc +++ b/mindspore/lite/tools/converter/converter.cc @@ -23,7 +23,7 @@ #include "src/common/file_utils.h" #include "ir/func_graph.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/common/storage.h" #include "parser/caffe/caffe_converter.h" #include "parser/tflite/tflite_converter.h" diff --git a/mindspore/lite/tools/converter/converter_context.h b/mindspore/lite/tools/converter/converter_context.h index 23a54b02bc..da99538afb 100644 --- a/mindspore/lite/tools/converter/converter_context.h +++ b/mindspore/lite/tools/converter/converter_context.h @@ -20,7 +20,7 @@ #include #include #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" namespace mindspore { namespace lite { diff --git a/mindspore/lite/tools/converter/graphdef_transform.cc b/mindspore/lite/tools/converter/graphdef_transform.cc index 97c1f71650..8654611bbe 100644 --- a/mindspore/lite/tools/converter/graphdef_transform.cc +++ b/mindspore/lite/tools/converter/graphdef_transform.cc @@ -18,7 +18,7 @@ #include #include #include "schema/model_generated.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/converter/converter_flags.h" #include "tools/converter/legacy_optimizer/graph/dtype_trans_pass.h" #include "tools/converter/legacy_optimizer/fusion/format_trans_fusion_pass.h" diff --git a/mindspore/lite/tools/converter/legacy_optimizer/fusion/CMakeLists.txt b/mindspore/lite/tools/converter/legacy_optimizer/fusion/CMakeLists.txt index 3bdeaead0d..51699912ce 100755 --- a/mindspore/lite/tools/converter/legacy_optimizer/fusion/CMakeLists.txt +++ b/mindspore/lite/tools/converter/legacy_optimizer/fusion/CMakeLists.txt @@ -1,12 +1,14 @@ -add_library(fusion_mid OBJECT +file(GLOB FUSION_SRC ${CMAKE_CURRENT_SOURCE_DIR}/fusion_pattern.cc ${CMAKE_CURRENT_SOURCE_DIR}/fusion_pass.cc ${CMAKE_CURRENT_SOURCE_DIR}/matmul_biasadd_fusion_pass.cc - ${CMAKE_CURRENT_SOURCE_DIR}/mul_add_fusion_pass.cc + ${CMAKE_CURRENT_SOURCE_DIR}/mul_add_fusion_pass.cc ${CMAKE_CURRENT_SOURCE_DIR}/quant_cast_fusion_pass.cc ${CMAKE_CURRENT_SOURCE_DIR}/batchnorm_fold_fusion_pass.cc ${CMAKE_CURRENT_SOURCE_DIR}/format_trans_fusion_pass.cc ${CMAKE_CURRENT_SOURCE_DIR}/format_trans_transpose_fusion_pass.cc ) +set_property(SOURCE ${FUSION_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE) +add_library(fusion_mid OBJECT ${FUSION_SRC}) target_link_libraries(fusion_mid securec) diff --git a/mindspore/lite/tools/converter/legacy_optimizer/fusion/batchnorm_fold_fusion_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/fusion/batchnorm_fold_fusion_pass.cc index e6a2388406..e51a5b0ed7 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/fusion/batchnorm_fold_fusion_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/fusion/batchnorm_fold_fusion_pass.cc @@ -21,7 +21,7 @@ #include #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/common/graph_util.h" #include "tools/common/tensor_util.h" #include "include/errorcode.h" diff --git a/mindspore/lite/tools/converter/legacy_optimizer/fusion/format_trans_fusion_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/fusion/format_trans_fusion_pass.cc index 9fda406d84..01042a5914 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/fusion/format_trans_fusion_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/fusion/format_trans_fusion_pass.cc @@ -18,7 +18,7 @@ #include #include #include "tools/converter/legacy_optimizer/fusion/format_trans_fusion_pass.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/common/graph_util.h" #include "include/errorcode.h" #include "mindspore/lite/schema/inner/model_generated.h" diff --git a/mindspore/lite/tools/converter/legacy_optimizer/fusion/format_trans_transpose_fusion_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/fusion/format_trans_transpose_fusion_pass.cc index 44e9c00b5d..b1db9467eb 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/fusion/format_trans_transpose_fusion_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/fusion/format_trans_transpose_fusion_pass.cc @@ -19,7 +19,7 @@ #include #include #include "tools/converter/legacy_optimizer/fusion/format_trans_transpose_fusion_pass.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "securec/include/securec.h" #include "tools/common/graph_util.h" #include "include/errorcode.h" diff --git a/mindspore/lite/tools/converter/legacy_optimizer/fusion/fusion_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/fusion/fusion_pass.cc index 1ffd26daa2..82ed5b0dc9 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/fusion/fusion_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/fusion/fusion_pass.cc @@ -24,7 +24,7 @@ #include #include "tools/converter/legacy_optimizer/fusion/fusion_pass.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/common/converter_op_utils.h" #include "src/common/utils.h" #include "tools/common/graph_util.h" diff --git a/mindspore/lite/tools/converter/legacy_optimizer/fusion/fusion_pattern.cc b/mindspore/lite/tools/converter/legacy_optimizer/fusion/fusion_pattern.cc index b88899e8d4..6475d751a7 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/fusion/fusion_pattern.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/fusion/fusion_pattern.cc @@ -17,7 +17,7 @@ #include #include #include "tools/converter/legacy_optimizer/fusion/fusion_pattern.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/common/utils.h" #include "include/errorcode.h" diff --git a/mindspore/lite/tools/converter/legacy_optimizer/fusion/fusion_pattern.h b/mindspore/lite/tools/converter/legacy_optimizer/fusion/fusion_pattern.h index 89737b2177..444108f3f0 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/fusion/fusion_pattern.h +++ b/mindspore/lite/tools/converter/legacy_optimizer/fusion/fusion_pattern.h @@ -23,7 +23,7 @@ #include #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "schema/inner/model_generated.h" namespace mindspore { diff --git a/mindspore/lite/tools/converter/legacy_optimizer/fusion/matmul_biasadd_fusion_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/fusion/matmul_biasadd_fusion_pass.cc index 63691ede97..c5dd766865 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/fusion/matmul_biasadd_fusion_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/fusion/matmul_biasadd_fusion_pass.cc @@ -20,7 +20,7 @@ #include #include #include "tools/converter/legacy_optimizer/fusion/matmul_biasadd_fusion_pass.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "securec/include/securec.h" #include "tools/common/graph_util.h" #include "include/errorcode.h" diff --git a/mindspore/lite/tools/converter/legacy_optimizer/fusion/mul_add_fusion_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/fusion/mul_add_fusion_pass.cc index fe9ee557e3..1419e50cb9 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/fusion/mul_add_fusion_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/fusion/mul_add_fusion_pass.cc @@ -20,7 +20,7 @@ #include #include #include "tools/converter/legacy_optimizer/fusion/mul_add_fusion_pass.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "securec/include/securec.h" #include "tools/common/graph_util.h" #include "include/errorcode.h" diff --git a/mindspore/lite/tools/converter/legacy_optimizer/fusion/quant_cast_fusion_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/fusion/quant_cast_fusion_pass.cc index 61c639b810..d65b23224c 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/fusion/quant_cast_fusion_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/fusion/quant_cast_fusion_pass.cc @@ -18,7 +18,7 @@ #include #include #include "tools/converter/legacy_optimizer/fusion/quant_cast_fusion_pass.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "securec/include/securec.h" #include "tools/common/graph_util.h" #include "include/errorcode.h" diff --git a/mindspore/lite/tools/converter/legacy_optimizer/graph/CMakeLists.txt b/mindspore/lite/tools/converter/legacy_optimizer/graph/CMakeLists.txt index e084f6af14..68f4f1d782 100755 --- a/mindspore/lite/tools/converter/legacy_optimizer/graph/CMakeLists.txt +++ b/mindspore/lite/tools/converter/legacy_optimizer/graph/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(graph_pass_mid OBJECT +file(GLOB GRAPH_PASS ${CMAKE_CURRENT_SOURCE_DIR}/format_trans_pass.cc ${CMAKE_CURRENT_SOURCE_DIR}/trans_format_insert_pass.cc ${CMAKE_CURRENT_SOURCE_DIR}/dtype_trans_pass.cc @@ -10,3 +10,5 @@ add_library(graph_pass_mid OBJECT ${CMAKE_CURRENT_SOURCE_DIR}/trans_format_remove_pass.cc ${CMAKE_CURRENT_SOURCE_DIR}/infershape_pass.cc ) +set_property(SOURCE ${GRAPH_PASS} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE) +add_library(graph_pass_mid OBJECT ${GRAPH_PASS}) diff --git a/mindspore/lite/tools/converter/legacy_optimizer/graph/batchnorm_convert_scale_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/graph/batchnorm_convert_scale_pass.cc index cf8b34ca80..6fc4bcdad1 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/graph/batchnorm_convert_scale_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/graph/batchnorm_convert_scale_pass.cc @@ -21,7 +21,8 @@ #include #include #include -#include "utils/log_adapter.h" +#include "third_party/securec/include/securec.h" +#include "src/common/log_adapter.h" #include "tools/common/graph_util.h" #include "tools/common/tensor_util.h" #include "include/errorcode.h" diff --git a/mindspore/lite/tools/converter/legacy_optimizer/graph/format_trans_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/graph/format_trans_pass.cc index fedffea9a4..f3c832a8f0 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/graph/format_trans_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/graph/format_trans_pass.cc @@ -20,7 +20,7 @@ #include "tools/converter/legacy_optimizer/graph/format_trans_pass.h" #include "tools/common/converter_op_utils.h" #include "tools/common/node_util.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/common/common.h" #include "src/common/utils.h" @@ -159,8 +159,7 @@ STATUS FormatTransPass::DoNodeInoutFormatTrans(schema::MetaGraphT *graph) { } } else { int idx = 0; - if (GetCNodeTType(**iter) == schema::PrimitiveType_ApplyMomentum) - idx = 3; + if (GetCNodeTType(**iter) == schema::PrimitiveType_ApplyMomentum) idx = 3; iter = InsertFormatTransNode(graph, iter, kBefore, idx, beforeNodeType, &status); if (status != RET_OK) { MS_LOG(ERROR) << "InsertNhwc2NchwNode after " << nodeName << "failed"; diff --git a/mindspore/lite/tools/converter/legacy_optimizer/graph/infershape_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/graph/infershape_pass.cc index d355e9c1ad..fa4858e30c 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/graph/infershape_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/graph/infershape_pass.cc @@ -16,7 +16,7 @@ #include "tools/converter/legacy_optimizer/graph/infershape_pass.h" #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "include/errorcode.h" #include "src/tensor.h" #include "src/ops/primitive_c.h" @@ -100,7 +100,7 @@ STATUS InferShapePass::Run(MetaGraphT *graph) { FreeTensors(input_tensors, output_tensors); return RET_INFER_ERR; } - std::unique_ptr primitiveT(new(std::nothrow) PrimitiveT(*node->primitive)); + std::unique_ptr primitiveT(new (std::nothrow) PrimitiveT(*node->primitive)); if (primitiveT == nullptr) { MS_LOG(ERROR) << "copy primitiveT error"; FreeTensors(input_tensors, output_tensors); diff --git a/mindspore/lite/tools/converter/legacy_optimizer/graph/isolated_node_remove_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/graph/isolated_node_remove_pass.cc index 848699f7ca..a8197895d6 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/graph/isolated_node_remove_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/graph/isolated_node_remove_pass.cc @@ -19,7 +19,7 @@ #include #include "tools/converter/legacy_optimizer/graph/isolated_node_remove_pass.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/common/converter_op_utils.h" #include "src/common/utils.h" #include "tools/common/graph_util.h" diff --git a/mindspore/lite/tools/converter/legacy_optimizer/graph/model_input_format_preprocess_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/graph/model_input_format_preprocess_pass.cc index 1a4002ae2d..a16cdbb889 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/graph/model_input_format_preprocess_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/graph/model_input_format_preprocess_pass.cc @@ -16,7 +16,7 @@ #include #include "tools/converter/legacy_optimizer/graph/model_input_format_preprocess_pass.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/common/converter_op_utils.h" #include "tools/common/node_util.h" #include "include/errorcode.h" diff --git a/mindspore/lite/tools/converter/legacy_optimizer/graph/topological_sort_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/graph/topological_sort_pass.cc index 3082cb6ad5..6e55d6228f 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/graph/topological_sort_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/graph/topological_sort_pass.cc @@ -20,7 +20,7 @@ #include #include "tools/converter/legacy_optimizer/graph/topological_sort_pass.h" #include "tools/common/converter_op_utils.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/common/utils.h" namespace mindspore { diff --git a/mindspore/lite/tools/converter/legacy_optimizer/graph/trans_format_insert_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/graph/trans_format_insert_pass.cc index f2999c2d1d..dca8150222 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/graph/trans_format_insert_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/graph/trans_format_insert_pass.cc @@ -21,7 +21,7 @@ #include "tools/converter/legacy_optimizer/graph/trans_format_insert_pass.h" #include "tools/common/converter_op_utils.h" #include "tools/common/node_util.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/common/utils.h" namespace mindspore { diff --git a/mindspore/lite/tools/converter/legacy_optimizer/graph/trans_format_remove_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/graph/trans_format_remove_pass.cc index a8d7bf8f51..8fe7afe469 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/graph/trans_format_remove_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/graph/trans_format_remove_pass.cc @@ -16,7 +16,7 @@ #include "tools/converter/legacy_optimizer/graph/trans_format_remove_pass.h" #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "include/errorcode.h" #include "tools/common/graph_util.h" #include "src/tensor.h" diff --git a/mindspore/lite/tools/converter/legacy_optimizer/graph/unused_node_remove_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/graph/unused_node_remove_pass.cc index 5b22488de0..455779cf7d 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/graph/unused_node_remove_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/graph/unused_node_remove_pass.cc @@ -19,7 +19,7 @@ #include #include "mindspore/lite/tools/converter/legacy_optimizer/graph/unused_node_remove_pass.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "tools/common/converter_op_utils.h" #include "src/common/utils.h" #include "tools/common/graph_util.h" diff --git a/mindspore/lite/tools/converter/legacy_optimizer/graph/weight_format_hardcode_pass.cc b/mindspore/lite/tools/converter/legacy_optimizer/graph/weight_format_hardcode_pass.cc index 38c5d19579..92d9e11a0d 100644 --- a/mindspore/lite/tools/converter/legacy_optimizer/graph/weight_format_hardcode_pass.cc +++ b/mindspore/lite/tools/converter/legacy_optimizer/graph/weight_format_hardcode_pass.cc @@ -16,7 +16,7 @@ #include "tools/converter/legacy_optimizer/graph/weight_format_hardcode_pass.h" #include "tools/common/converter_op_utils.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "src/common/utils.h" #include "tools/common/node_util.h" diff --git a/mindspore/lite/tools/converter/main.cc b/mindspore/lite/tools/converter/main.cc index d54a1dcc81..a7ae5b1455 100644 --- a/mindspore/lite/tools/converter/main.cc +++ b/mindspore/lite/tools/converter/main.cc @@ -15,5 +15,12 @@ */ #include "tools/converter/converter.h" - -int main(int argc, const char **argv) { return mindspore::lite::RunConverter(argc, argv); } +namespace mindspore { +extern "C" { +extern void common_log_init(); +} +} // namespace mindspore +int main(int argc, const char **argv) { + mindspore::common_log_init(); + return mindspore::lite::RunConverter(argc, argv); +} diff --git a/mindspore/lite/tools/converter/optimizer.cc b/mindspore/lite/tools/converter/optimizer.cc index ac7d819319..e3ebd62869 100644 --- a/mindspore/lite/tools/converter/optimizer.cc +++ b/mindspore/lite/tools/converter/optimizer.cc @@ -15,7 +15,7 @@ */ #include "tools/converter/optimizer.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" namespace mindspore { namespace lite { diff --git a/mindspore/lite/tools/converter/parser/caffe/CMakeLists.txt b/mindspore/lite/tools/converter/parser/caffe/CMakeLists.txt index 0e46a92e10..d19caf84bd 100644 --- a/mindspore/lite/tools/converter/parser/caffe/CMakeLists.txt +++ b/mindspore/lite/tools/converter/parser/caffe/CMakeLists.txt @@ -1,35 +1,5 @@ -add_library(caffe_parser_mid OBJECT - ${CMAKE_CURRENT_SOURCE_DIR}/caffe.pb.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_argmax_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_batchnorm_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_concat_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_conv_base_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_converter.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_convolution_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_crop_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_deconvolution_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_eltwise_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_flatten_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_innerproduct_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_inspector.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_model_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_node_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_node_parser_registry.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_pooling_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_power_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_prelu_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_relu_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_relu6_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_reshape_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_scale_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_sigmoid_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_softmax_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_inspector.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_interp_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_permute_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_tile_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_tanh_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_exp_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_slice_parser.cc - ${CMAKE_CURRENT_SOURCE_DIR}/caffe_reduce_parser.cc - ) +file(GLOB_RECURSE CAFFE_SRC_LIST ${CMAKE_CURRENT_SOURCE_DIR}/*.cc) + +set_property(SOURCE ${CAFFE_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE) + +add_library(caffe_parser_mid OBJECT ${CAFFE_SRC_LIST}) diff --git a/mindspore/lite/tools/converter/parser/caffe/caffe_inspector.cc b/mindspore/lite/tools/converter/parser/caffe/caffe_inspector.cc index 7168e5714c..c5c877cfbb 100644 --- a/mindspore/lite/tools/converter/parser/caffe/caffe_inspector.cc +++ b/mindspore/lite/tools/converter/parser/caffe/caffe_inspector.cc @@ -15,7 +15,7 @@ */ #include "tools/converter/parser/caffe/caffe_inspector.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" namespace mindspore { namespace lite { diff --git a/mindspore/lite/tools/converter/parser/caffe/caffe_node_parser.h b/mindspore/lite/tools/converter/parser/caffe/caffe_node_parser.h index 7a8391ae69..231a684300 100644 --- a/mindspore/lite/tools/converter/parser/caffe/caffe_node_parser.h +++ b/mindspore/lite/tools/converter/parser/caffe/caffe_node_parser.h @@ -24,7 +24,7 @@ #include "tools/converter/parser/caffe/caffe.pb.h" #include "tools/converter/parser/caffe/caffe_node_parser.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" namespace mindspore { namespace lite { diff --git a/mindspore/lite/tools/converter/parser/onnx/CMakeLists.txt b/mindspore/lite/tools/converter/parser/onnx/CMakeLists.txt index d0b6cd3d52..3b4760875c 100644 --- a/mindspore/lite/tools/converter/parser/onnx/CMakeLists.txt +++ b/mindspore/lite/tools/converter/parser/onnx/CMakeLists.txt @@ -1,5 +1,5 @@ file(GLOB_RECURSE ONNX_SRC_LIST ${CMAKE_CURRENT_SOURCE_DIR}/*.cc) - +set_property(SOURCE ${ONNX_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE) add_library(onnx_parser_mid OBJECT ${ONNX_SRC_LIST} ) diff --git a/mindspore/lite/tools/converter/parser/onnx/onnx_matmul_parser.cc b/mindspore/lite/tools/converter/parser/onnx/onnx_matmul_parser.cc index 435520c70d..03ee1f156e 100644 --- a/mindspore/lite/tools/converter/parser/onnx/onnx_matmul_parser.cc +++ b/mindspore/lite/tools/converter/parser/onnx/onnx_matmul_parser.cc @@ -43,7 +43,7 @@ STATUS OnnxMatmulParser::Parse(const onnx::GraphProto &onnx_graph, const onnx::N for (const auto &onnx_node_attr : onnx_node.attribute()) { const auto &attribute_name = onnx_node_attr.name(); if (attribute_name == "broadcast") { - attr->broadcast = static_cast(onnx_node_attr.i()); + attr->broadcast = static_cast(onnx_node_attr.i()); } if (attribute_name == "transA") { attr->transposeA = static_cast(onnx_node_attr.i()); diff --git a/mindspore/lite/tools/converter/parser/onnx/onnx_node_parser.h b/mindspore/lite/tools/converter/parser/onnx/onnx_node_parser.h index fdbe936ce8..5fc2f98084 100644 --- a/mindspore/lite/tools/converter/parser/onnx/onnx_node_parser.h +++ b/mindspore/lite/tools/converter/parser/onnx/onnx_node_parser.h @@ -22,7 +22,7 @@ #include "google/protobuf/message.h" #include "tools/converter/parser/onnx/onnx.pb.h" #include "include/errorcode.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "schema/inner/model_generated.h" namespace mindspore { diff --git a/mindspore/lite/tools/converter/parser/tflite/CMakeLists.txt b/mindspore/lite/tools/converter/parser/tflite/CMakeLists.txt index a76bc30432..287bf8bf5f 100644 --- a/mindspore/lite/tools/converter/parser/tflite/CMakeLists.txt +++ b/mindspore/lite/tools/converter/parser/tflite/CMakeLists.txt @@ -1,6 +1,7 @@ file(GLOB_RECURSE TFLITE_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cc ) +set_property(SOURCE ${TFLITE_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE) if (NOT WIN32) ADD_DEFINITIONS(-DFLATBUFFERS_LOCALE_INDEPENDENT=1) find_library(FLATBUFFERS_LIBRARY flatbuffers HINTS ${TOP_DIR}/third_party/flatbuffers/build) diff --git a/mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h b/mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h index f3df22b20e..8b8bd0d40e 100644 --- a/mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h +++ b/mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h @@ -22,7 +22,7 @@ #include #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "schema/inner/model_generated.h" #include "tools/converter/parser/tflite/schema_generated.h" #include "tools/common/tensor_util.h" diff --git a/mindspore/lite/tools/converter/parser/tflite/tflite_util.cc b/mindspore/lite/tools/converter/parser/tflite/tflite_util.cc index 3c1d4fe4fe..e9ec14fc12 100644 --- a/mindspore/lite/tools/converter/parser/tflite/tflite_util.cc +++ b/mindspore/lite/tools/converter/parser/tflite/tflite_util.cc @@ -19,7 +19,7 @@ #include #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "include/errorcode.h" namespace mindspore { diff --git a/mindspore/lite/tools/converter/parser/tflite/tflite_util.h b/mindspore/lite/tools/converter/parser/tflite/tflite_util.h index eb588a611a..e9a050c4bf 100644 --- a/mindspore/lite/tools/converter/parser/tflite/tflite_util.h +++ b/mindspore/lite/tools/converter/parser/tflite/tflite_util.h @@ -21,7 +21,7 @@ #include #include #include -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "schema/inner/model_generated.h" #include "tools/converter/parser/tflite/schema_generated.h" #include "schema/inner/ops_generated.h" diff --git a/mindspore/lite/tools/converter/quantizer/CMakeLists.txt b/mindspore/lite/tools/converter/quantizer/CMakeLists.txt index d0f7e6c7d3..ba8d4ebbeb 100644 --- a/mindspore/lite/tools/converter/quantizer/CMakeLists.txt +++ b/mindspore/lite/tools/converter/quantizer/CMakeLists.txt @@ -3,17 +3,19 @@ include_directories(${3RD_DIR}/protobuf/build/include) include_directories(${3RD_DIR}/flatbuffers/include) include_directories(${3RD_DIR}/opencv/build/include/opencv4) -add_library(quantizer_mid OBJECT - ${CMAKE_CURRENT_SOURCE_DIR}/calc_quant_param.cc - ${CMAKE_CURRENT_SOURCE_DIR}/quantizer.cc - ${CMAKE_CURRENT_SOURCE_DIR}/aware_quantizer.cc - ${CMAKE_CURRENT_SOURCE_DIR}/quantize_util.cc - ${CMAKE_CURRENT_SOURCE_DIR}/general_bitpacking.cc - ${CMAKE_CURRENT_SOURCE_DIR}/post_training_quantizer.cc - ${CMAKE_CURRENT_SOURCE_DIR}/quant_cast.cc - ${CMAKE_CURRENT_SOURCE_DIR}/weight_quantizer.cc - ) +file(GLOB QUANTIZER + ${CMAKE_CURRENT_SOURCE_DIR}/calc_quant_param.cc + ${CMAKE_CURRENT_SOURCE_DIR}/quantizer.cc + ${CMAKE_CURRENT_SOURCE_DIR}/aware_quantizer.cc + ${CMAKE_CURRENT_SOURCE_DIR}/quantize_util.cc + ${CMAKE_CURRENT_SOURCE_DIR}/general_bitpacking.cc + ${CMAKE_CURRENT_SOURCE_DIR}/post_training_quantizer.cc + ${CMAKE_CURRENT_SOURCE_DIR}/quant_cast.cc + ${CMAKE_CURRENT_SOURCE_DIR}/weight_quantizer.cc + ) +set_property(SOURCE ${QUANTIZER} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE) +add_library(quantizer_mid OBJECT ${QUANTIZER}) -if(ENABLE_ASAN) - target_link_libraries(quantizer_mid libasan libSecodefuzz) -endif() +if (ENABLE_ASAN) + target_link_libraries(quantizer_mid libasan libSecodefuzz) +endif () diff --git a/mindspore/lite/tools/converter/quantizer/aware_quantizer.cc b/mindspore/lite/tools/converter/quantizer/aware_quantizer.cc index 0e40fba131..d8dd169066 100644 --- a/mindspore/lite/tools/converter/quantizer/aware_quantizer.cc +++ b/mindspore/lite/tools/converter/quantizer/aware_quantizer.cc @@ -29,7 +29,7 @@ #include "tools/common/node_util.h" #include "tools/common/tensor_util.h" #include "tools/converter/quantizer/calc_quant_param.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" using std::string; using std::vector; diff --git a/mindspore/lite/tools/converter/quantizer/post_training_quantizer.cc b/mindspore/lite/tools/converter/quantizer/post_training_quantizer.cc index 9508f621da..f6fee8d3d9 100644 --- a/mindspore/lite/tools/converter/quantizer/post_training_quantizer.cc +++ b/mindspore/lite/tools/converter/quantizer/post_training_quantizer.cc @@ -30,7 +30,7 @@ #include "src/tensor.h" #include "tools/anf_exporter/anf_exporter.h" #include "tools/converter/quantizer/quantize_util.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "securec/include/securec.h" #include "tools/common/tensor_util.h" #include "src/common/file_utils.h" @@ -533,8 +533,8 @@ STATUS PostTrainingQuantizer::DoWeightQuant(AnfNodePtr weight, std::shared_ptr

fullname_with_scope() << " can not get value"; return RET_ERROR; } - auto status = QuantFilter(paramValue, primitive_c, QuantType_PostTraining, quant_max, quant_min, bit_num, - perchanel); + auto status = + QuantFilter(paramValue, primitive_c, QuantType_PostTraining, quant_max, quant_min, bit_num, perchanel); if (status != RET_OK) { MS_LOG(ERROR) << "QuantFilter failed: " << status; return status; @@ -637,8 +637,8 @@ STATUS PostTrainingQuantizer::DoBiasQuant(AnfNodePtr bias, std::shared_ptr #include -#include "src/ops//primitive_c.h" +#include "src/ops/primitive_c.h" #include "ir/anf.h" #include "ir/func_graph.h" #include "src/common/utils.h" diff --git a/mindspore/lite/tools/time_profiler/time_profiler.cc b/mindspore/lite/tools/time_profiler/time_profiler.cc index 555d0af4c2..f4f273a977 100644 --- a/mindspore/lite/tools/time_profiler/time_profiler.cc +++ b/mindspore/lite/tools/time_profiler/time_profiler.cc @@ -22,7 +22,7 @@ #include #include #include "include/ms_tensor.h" -#include "utils/log_adapter.h" +#include "src/common/log_adapter.h" #include "include/context.h" namespace mindspore {