diff --git a/mindspore/lite/CMakeLists.txt b/mindspore/lite/CMakeLists.txt index 697c55eb59..aff588fc5e 100644 --- a/mindspore/lite/CMakeLists.txt +++ b/mindspore/lite/CMakeLists.txt @@ -13,6 +13,7 @@ include_directories(${TOP_DIR}) include_directories(${CORE_DIR}) include_directories(${CCSRC_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/runtime/kernel/arm) include_directories(${TOP_DIR}/third_party) include_directories(${TOP_DIR}/third_party/flatbuffers/include) diff --git a/mindspore/lite/src/populate_parameter.cc b/mindspore/lite/src/populate_parameter.cc index 3670137677..ea5fc6f9c1 100644 --- a/mindspore/lite/src/populate_parameter.cc +++ b/mindspore/lite/src/populate_parameter.cc @@ -31,7 +31,7 @@ #include "src/runtime/kernel/arm/nnacl/depth_to_space.h" #include "src/runtime/kernel/arm/nnacl/conv_parameter.h" #include "src/runtime/kernel/arm/nnacl/fp32/pooling.h" -#include "src/runtime/kernel/arm/nnacl/matmul.h" +#include "src/runtime/kernel/arm/nnacl/matmul_parameter.h" #include "src/runtime/kernel/arm/nnacl/softmax_parameter.h" #include "src/runtime/kernel/arm/nnacl/tile.h" #include "src/runtime/kernel/arm/nnacl/fp32/topk.h" diff --git a/mindspore/lite/src/runtime/kernel/arm/base/fullconnection_base.h b/mindspore/lite/src/runtime/kernel/arm/base/fullconnection_base.h index a5a056a1ef..bf03869188 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/fullconnection_base.h +++ b/mindspore/lite/src/runtime/kernel/arm/base/fullconnection_base.h @@ -20,7 +20,7 @@ #include #include "src/lite_kernel.h" #include "include/context.h" -#include "src/runtime/kernel/arm/nnacl/matmul.h" +#include "src/runtime/kernel/arm/nnacl/matmul_parameter.h" using mindspore::lite::Context; diff --git a/mindspore/lite/src/runtime/kernel/arm/base/matmul_base.h b/mindspore/lite/src/runtime/kernel/arm/base/matmul_base.h index 95d8897c60..a1cda81bb4 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/matmul_base.h +++ b/mindspore/lite/src/runtime/kernel/arm/base/matmul_base.h @@ -20,7 +20,7 @@ #include #include "src/lite_kernel.h" #include "include/context.h" -#include "src/runtime/kernel/arm/nnacl/matmul.h" +#include "src/runtime/kernel/arm/nnacl/matmul_parameter.h" using mindspore::lite::Context; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_1x1.h b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_1x1.h index 1753821147..c3800ad479 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_1x1.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_1x1.h @@ -27,7 +27,7 @@ #include "src/runtime/kernel/arm/base/layout_transform.h" #include "src/runtime/kernel/arm/nnacl/fp32/conv.h" #include "src/runtime/kernel/arm/nnacl/fp32/common_func.h" -#include "src/runtime/kernel/arm/nnacl/matmul.h" +#include "src/runtime/kernel/arm/nnacl/matmul_parameter.h" #include "src/runtime/kernel/arm/nnacl/fp32/matmul.h" namespace mindspore::kernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/matmul.h b/mindspore/lite/src/runtime/kernel/arm/fp32/matmul.h index 8bdc43caee..6efb35bfe4 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/matmul.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/matmul.h @@ -19,7 +19,7 @@ #include #include "src/lite_kernel.h" -#include "src/runtime/kernel/arm/nnacl/matmul.h" +#include "src/runtime/kernel/arm/nnacl/matmul_parameter.h" #include "src/runtime/kernel/arm/base/matmul_base.h" namespace mindspore::kernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/add_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/add_int8.cc index 3a811f9e57..121e16279c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/add_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/add_int8.cc @@ -18,6 +18,7 @@ #include #include #include "src/runtime/kernel/arm/nnacl/arithmetic_common.h" +#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h" #include "src/runtime/runtime_api.h" #include "src/kernel_registry.h" #include "include/errorcode.h" diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_int8.h b/mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_int8.h index ce19d61e9c..df42f2d158 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_int8.h @@ -21,8 +21,9 @@ #include "schema/model_generated.h" #include "src/kernel_registry.h" #include "include/errorcode.h" +#include "src/runtime/kernel/arm/nnacl/matmul_parameter.h" #include "src/runtime/kernel/arm/nnacl/int8/deconv.h" -#include "src/runtime/kernel/arm/nnacl/int8/matmul.h" +#include "src/runtime/kernel/arm/nnacl/int8/matmul_int8.h" #include "src/runtime/kernel/arm/base/layout_transform.h" #include "src/runtime/kernel/arm/base/convolution_base.h" #include "src/runtime/kernel/arm/nnacl/arithmetic_common.h" diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/depth_to_space_int8.h b/mindspore/lite/src/runtime/kernel/arm/int8/depth_to_space_int8.h index 6548918ce3..728e31fadb 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/depth_to_space_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/int8/depth_to_space_int8.h @@ -18,6 +18,7 @@ #include #include "src/runtime/kernel/arm/base/depth_to_space_base.h" +#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h" namespace mindspore::kernel { class DepthToSpaceInt8CPUKernel : public DepthToSpaceBaseCPUKernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/fullconnection_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/fullconnection_int8.cc index aa6ebd5edf..2975aa8253 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/fullconnection_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/fullconnection_int8.cc @@ -15,7 +15,7 @@ */ #include "src/runtime/kernel/arm/int8/fullconnection_int8.h" -#include "src/runtime/kernel/arm/nnacl/int8/matmul.h" +#include "src/runtime/kernel/arm/nnacl/int8/matmul_int8.h" #include "src/runtime/kernel/arm/nnacl/common_func.h" #include "src/runtime/runtime_api.h" #include "include/errorcode.h" diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/hswish_int8.h b/mindspore/lite/src/runtime/kernel/arm/int8/hswish_int8.h index 7a480f98e7..9fb8eb83d7 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/hswish_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/int8/hswish_int8.h @@ -20,6 +20,7 @@ #include #include "src/lite_kernel.h" #include "src/runtime/kernel/arm/nnacl/int8/hswish_int8.h" +#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h" namespace mindspore::kernel { class HswishInt8CPUKernel : public LiteKernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/matmul_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/matmul_int8.cc index 63b23f3fc2..c9597214c1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/matmul_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/matmul_int8.cc @@ -15,7 +15,7 @@ */ #include "src/runtime/kernel/arm/int8/matmul_int8.h" -#include "src/runtime/kernel/arm/nnacl/int8/matmul.h" +#include "src/runtime/kernel/arm/nnacl/int8/matmul_int8.h" #include "src/runtime/kernel/arm/nnacl/common_func.h" #include "src/runtime/runtime_api.h" #include "include/errorcode.h" diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/sigmoid_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/sigmoid_int8.cc index 5abf0773b5..efd385b2d2 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/sigmoid_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/sigmoid_int8.cc @@ -17,6 +17,7 @@ #include "src/runtime/kernel/arm/int8/sigmoid_int8.h" #include #include "src/runtime/kernel/arm/nnacl/int8/sigmoid_int8.h" +#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h" #include "schema/model_generated.h" #include "src/kernel_registry.h" #include "src/runtime/runtime_api.h" diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/softmax_int8.h b/mindspore/lite/src/runtime/kernel/arm/int8/softmax_int8.h index f3cbe6eacf..c3c47ea0e1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/softmax_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/int8/softmax_int8.h @@ -19,6 +19,7 @@ #include #include "src/runtime/kernel/arm/base/softmax_base.h" +#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h" namespace mindspore::kernel { class SoftmaxInt8CPUKernel : public SoftmaxBaseCPUKernel { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/activation_grad.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/activation_grad.h index c0ebfc368a..30b57094a2 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/activation_grad.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/activation_grad.h @@ -17,15 +17,15 @@ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ACTIVATION_GRAD_H_ #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/fp32/arithmetic.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/op_base.h" +#include "nnacl/fp32/arithmetic.h" +#include "nnacl/errorcode.h" -struct ActivationGradParameter { +typedef struct ActivationGradParameter { OpParameter op_parameter{}; int type_; float alpha_{0.01}; -}; +} ActivationGradParameter; inline int ReluGrad(float *src0, float *src1, int length, float *dst) { for (int i = 0; i < length; ++i) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/add_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/add_int8.cc index a11e76f77c..2aa3bef6d2 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/add_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/add_int8.cc @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/add_int8.h" +#include "nnacl/add_int8.h" #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/quantization/fixed_point.h" +#include "nnacl/quantization/fixed_point.h" #ifdef ENABLE_NEON int16x8_t LoadAndAddOffset(int8_t *data, int index, int offset) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/add_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/add_int8.h index ee667f1713..28ba83720a 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/add_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/add_int8.h @@ -17,9 +17,9 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ADD_INT8_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ADD_INT8_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct AddQuantParameter { +typedef struct AddQuantParameter { int input0_offset_; int input1_offset_; int output_offset_; @@ -40,7 +40,7 @@ struct AddQuantParameter { int right_shift1_; int left_shift_out_; int right_shift_out_; -}; +} AddQuantParameter; void AddInt8(int8_t *input0_data, int8_t *input1_data, int8_t *output_data, int64_t real_dst_count, AddQuantParameter *para); @@ -51,4 +51,3 @@ int16x8_t LoadAndAddOffset(int8_t *data, int index, int offset); #endif #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ADD_INT8_H_ - diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max.cc index fd1a6f7c72..80c33f9174 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max.cc @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/arg_min_max.h" -#include "src/runtime/kernel/arm/nnacl/fp32/arg_min_max.h" +#include "nnacl/arg_min_max.h" +#include "nnacl/fp32/arg_min_max.h" #define FLOAT_DATA_TYPE 43 diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max.h index a308f65c51..01e4fb12be 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max.h @@ -16,9 +16,7 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARG_MIN_MAX_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARG_MIN_MAX_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/arg_min_max_parameter.h" -#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h" +#include "nnacl/arg_min_max_parameter.h" void ArgMinMax(const void *input, void *output, const int *in_shape, ArgMinMaxParameter *param); #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARG_MIN_MAX_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max_parameter.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max_parameter.h index c403f2a7c5..f8635c208c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max_parameter.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max_parameter.h @@ -17,30 +17,30 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARG_MIN_MAX_PARAMETER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARG_MIN_MAX_PARAMETER_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct ArgElement { +typedef struct ArgElement { uint32_t index_; union ArgData { int8_t i8_data_; int32_t i_data_; float f_data_; } data_; -}; +} ArgElement; -struct ArgMinMaxParameter { - OpParameter op_parameter_; - bool out_value_; - bool keep_dims_; - bool get_max_; - int32_t axis_; - int32_t topk_; - int32_t axis_type_; - int32_t dims_size_; - int32_t data_type_; // equals to type_id - int32_t in_strides_[DIMENSION_4D]; - int32_t out_strides_[DIMENSION_4D]; - ArgElement *arg_elements_; -}; +typedef struct ArgMinMaxParameter { + OpParameter op_parameter_; + bool out_value_; + bool keep_dims_; + bool get_max_; + int32_t axis_; + int32_t topk_; + int32_t axis_type_; + int32_t dims_size_; + int32_t data_type_; // equals to type_id + int32_t in_strides_[DIMENSION_4D]; + int32_t out_strides_[DIMENSION_4D]; + ArgElement *arg_elements_; +} ArgMinMaxParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARG_MIN_MAX_PARAMETER_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_common.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_common.cc index b136fd8d42..f4a3ff3663 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_common.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_common.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/arithmetic_common.h" +#include "nnacl/arithmetic_common.h" void TileOneDimension(float *inData, float *outData, int dim, size_t ndim, int *inShape, int *inStrides, int *outStrides, int *multiple) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_common.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_common.h index b0e52b8694..73a5108232 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_common.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_common.h @@ -20,10 +20,10 @@ #include #endif #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/arithmetic_common.h" +#include "nnacl/op_base.h" +#include "nnacl/arithmetic_common.h" -struct ArithmeticParameter { +typedef struct ArithmeticParameter { OpParameter op_parameter_; bool broadcasting_; size_t ndim_; @@ -38,7 +38,8 @@ struct ArithmeticParameter { int multiples0_[5]; int multiples1_[5]; -}; +} ArithmeticParameter; + void TileOneDimension(float *inData, float *outData, int dim, size_t ndim, int *inShape, int *inStrides, int *outStrides, int *multiple); void ComputeStrides(int *shape, int *strides, int ndim); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_parameter.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_parameter.h index 132ad4a0ab..0b51ab8057 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_parameter.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_parameter.h @@ -17,7 +17,7 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARTITHMETIC_PARAMETER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARTITHMETIC_PARAMETER_H_ -#include "src/runtime/kernel/arm/nnacl/op_attribute.h" +#include "nnacl/op_attribute.h" diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_self_parameter.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_self_parameter.h index 35669c5518..0e4a29e506 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_self_parameter.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_self_parameter.h @@ -17,13 +17,14 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARITHMETIC_SELF_PARAMETER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARITHMETIC_SELF_PARAMETER_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/op_base.h" +#include "nnacl/errorcode.h" +#include "nnacl/quantization/quantize.h" // For Abs, Cos, Exp, Log, Square, Sqrt, Rsqrt ops. -struct ArithmeticSelfParameter { +typedef struct ArithmeticSelfParameter { OpParameter op_parameter_; ArithSelfQuantArg quant_arg_; -}; +} ArithmeticSelfParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARITHMETIC_SELF_PARAMETER_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/batch_to_space.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/batch_to_space.cc index e114f59cbf..5773292e1e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/batch_to_space.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/batch_to_space.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/batch_to_space.h" -#include "src/runtime/kernel/arm/nnacl/arithmetic_common.h" +#include "nnacl/batch_to_space.h" +#include "nnacl/arithmetic_common.h" void BatchToSpaceNoCropForNHWC(const void *input, void *output, const int *in_shape, int out_n, const int *block, int data_size) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/batch_to_space.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/batch_to_space.h index 0cee0f071b..3e76096085 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/batch_to_space.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/batch_to_space.h @@ -15,16 +15,16 @@ */ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_BATCH_TO_SPACE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_BATCH_TO_SPACE_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" #define BATCH_TO_SPACE_BLOCK_SHAPE_SIZE 2 -#define BATCH_TO_SPACE_CROPS_SIZE 4 +#define BATCH_TO_SPACE_CROPS_SIZE 4 -struct BatchToSpaceParameter { - OpParameter op_parameter_; - int32_t block_shape_[BATCH_TO_SPACE_BLOCK_SHAPE_SIZE]; - int32_t crops_[BATCH_TO_SPACE_CROPS_SIZE]; -}; +typedef struct BatchToSpaceParameter { + OpParameter op_parameter_; + int32_t block_shape_[BATCH_TO_SPACE_BLOCK_SHAPE_SIZE]; + int32_t crops_[BATCH_TO_SPACE_CROPS_SIZE]; +} BatchToSpaceParameter; void BatchToSpaceNoCropForNHWC(const void *input, void *output, const int *in_shape, int out_n, const int *block, int data_size); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/common_func.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/common_func.cc index 5fa758f610..55487e7a09 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/common_func.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/common_func.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/common_func.h" -#include "src/runtime/kernel/arm/nnacl/quantization/fixed_point.h" +#include "nnacl/common_func.h" +#include "nnacl/quantization/fixed_point.h" #ifndef ENABLE_ARM64 void IndirectGemmFp32(float *output, const float *input, const float *weight, const float *bias, size_t step, int ic4, diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/common_func.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/common_func.h index 1d59aaf902..33f6256646 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/common_func.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/common_func.h @@ -20,8 +20,8 @@ #include #include #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/conv_parameter.h" #ifdef __cplusplus extern "C" { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/concat_parameter.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/concat_parameter.h index b4d06bb645..fba336b755 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/concat_parameter.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/concat_parameter.h @@ -17,8 +17,10 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CONCAT_PARAMETER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CONCAT_PARAMETER_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -struct ConcatParameter { +#include "nnacl/op_base.h" +#include "nnacl/quantization/quantize.h" + +typedef struct ConcatParameter { OpParameter op_parameter_; ConcatQuantArg quant_arg_; int axis_; @@ -28,7 +30,6 @@ struct ConcatParameter { const int *output_shapes_; int64_t after_axis_size; int64_t count_unit_; -}; +} ConcatParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CONCAT_PARAMETER_H_ - diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/conv_parameter.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/conv_parameter.h index 8a4d0ef843..d7f2286f5d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/conv_parameter.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/conv_parameter.h @@ -20,10 +20,10 @@ #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h" +#include "nnacl/op_base.h" +#include "nnacl/quantization/quantize.h" -struct ConvParameter { +typedef struct ConvParameter { OpParameter op_parameter_; ConvQuantArg conv_quant_arg_; int kernel_h_; @@ -53,7 +53,6 @@ struct ConvParameter { int output_unit_; bool is_relu_; bool is_relu6_; -}; +} ConvParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CONV_PARAMETER_H_ - diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/crop_parameter.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/crop_parameter.h index 93907046d1..847441dd86 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/crop_parameter.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/crop_parameter.h @@ -16,11 +16,13 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CROP_PARAMETER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CROP_PARAMETER_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" + +#include "nnacl/op_base.h" +#include "nnacl/quantization/quantize.h" #define CROP_OFFSET_MAX_SIZE 4 -struct CropParameter { +typedef struct CropParameter { OpParameter op_parameter_; CropQuantArg quant_arg; int thread_count_; @@ -32,6 +34,6 @@ struct CropParameter { const int *in_shape_; const int *out_shape_; int input_dim_; -}; +} CropParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CROP_PARAMETER_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space.cc index 6ded162136..3de8376102 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/depth_to_space.h" +#include "nnacl/depth_to_space.h" #include void DepthToSpaceForNHWC(const void *input, void *output, int *in_shape, DepthToSpaceParameter *param) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space.h index 88ae21c840..471f08d396 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space.h @@ -15,7 +15,7 @@ */ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_DEPTH_TO_SPACE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_DEPTH_TO_SPACE_H_ -#include "src/runtime/kernel/arm/nnacl/depth_to_space_parameter.h" +#include "nnacl/depth_to_space_parameter.h" void DepthToSpaceForNHWC(const void *input, void *output, int *in_shape, DepthToSpaceParameter *param); #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_DEPTH_TO_SPACE_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space_parameter.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space_parameter.h index 0a44d45dba..61fe9937d5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space_parameter.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space_parameter.h @@ -15,18 +15,18 @@ */ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_DEPTH_TO_SPACE_PARAMETER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_DEPTH_TO_SPACE_PARAMETER_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct DepthToSpaceParameter { - OpParameter op_parameter_; - int32_t block_size_; - int32_t in_stride_dim0_; - int32_t in_stride_dim1_; - int32_t in_stride_dim2_; - int32_t out_stride_dim0_; - int32_t out_stride_dim1_; - int32_t out_stride_dim2_; - uint8_t data_type_size_; -}; +typedef struct DepthToSpaceParameter { + OpParameter op_parameter_; + int32_t block_size_; + int32_t in_stride_dim0_; + int32_t in_stride_dim1_; + int32_t in_stride_dim2_; + int32_t out_stride_dim0_; + int32_t out_stride_dim1_; + int32_t out_stride_dim2_; + uint8_t data_type_size_; +} DepthToSpaceParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_DEPTH_TO_SPACE_PARAMETER_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/errorcode.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/errorcode.h index 8c74dcbf39..2d4553cede 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/errorcode.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/errorcode.h @@ -17,15 +17,15 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ERRORCODE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ERRORCODE_H_ -enum ErrorCodeCommonEnum { +typedef enum ErrorCodeCommonEnum { NNACL_OK = 0, NNACL_ERR = 1, NNACL_NULL_PTR, NNACL_PARAM_INVALID, OPLIB_COMMON_END = 9999 -}; +} ErrorCodeCommonEnum; -enum ErrorCodeFp32OpEnum { +typedef enum ErrorCodeFp32OpEnum { NNACL_ERRCODE_OP_FP32_START = 10000, NNACL_ERRCODE_STRASSEN_RECURSION_MALLOC, NNACL_ERRCODE_REVERSE_MALLOC, @@ -35,13 +35,21 @@ enum ErrorCodeFp32OpEnum { NNACL_ERRCODE_DIVISOR_ZERO, NNACL_ERRCODE_INDEX_OUT_OF_RANGE, NNACL_ERRCODE_OP_FP32_END = 19999 -}; +} ErrorCodeFp32OpEnum; -enum ErrorCodeFp16OpEnum { NNACL_ERRCODE_OP_FP16_START = 20000, NNACL_ERRCODE_OP_FP16_END = 29999 }; +typedef enum ErrorCodeFp16OpEnum { + NNACL_ERRCODE_OP_FP16_START = 20000, + NNACL_ERRCODE_OP_FP16_END = 29999 +} ErrorCodeFp16OpEnum; -enum ErrorCodeUint8OpEnum { NNACL_ERRCODE_OP_UINT8_START = 30000, NNACL_ERRCODE_OP_UINT8_END = 39999 }; +typedef enum ErrorCodeUint8OpEnum { + NNACL_ERRCODE_OP_UINT8_START = 30000, + NNACL_ERRCODE_OP_UINT8_END = 39999 +} ErrorCodeUint8OpEnum; -enum ErrorCodeInt8OpEnum { NNACL_ERRCODE_OP_INT8_START = 40000, NNACL_ERRCODE_OP_INT8_END = 49999 }; +typedef enum ErrorCodeInt8OpEnum { + NNACL_ERRCODE_OP_INT8_START = 40000, + NNACL_ERRCODE_OP_INT8_END = 49999 +} ErrorCodeInt8OpEnums; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ERRORCODE_H_ - diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/flatten.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/flatten.cc index 2ca6ad285e..49a7fda62e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/flatten.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/flatten.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/flatten.h" +#include "nnacl/flatten.h" #include void Flatten(const void *input, void *output, FlattenParameter *flatten_param) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/flatten.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/flatten.h index feb9c0641c..b2b2fdfebb 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/flatten.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/flatten.h @@ -15,12 +15,12 @@ */ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FLATTEN_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FLATTEN_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct FlattenParameter { +typedef struct FlattenParameter { OpParameter op_parameter_; int size; -}; +} FlattenParameter; void Flatten(const void *input, void *output, FlattenParameter *flatten_param); #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FLATTEN_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/common_func.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/common_func.h index ba0c7a35b8..177bc27b10 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/common_func.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/common_func.h @@ -20,8 +20,8 @@ #include #include #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/conv_parameter.h" #ifdef __cplusplus extern "C" { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_depthwise_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_depthwise_fp16.cc index 254bbaf115..6ad46b7ac1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_depthwise_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_depthwise_fp16.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp16/conv_depthwise_fp16.h" +#include "nnacl/fp16/conv_depthwise_fp16.h" #include -#include "src/runtime/kernel/arm/nnacl/fp16/common_func.h" +#include "nnacl/fp16/common_func.h" /*conv depthwise fp16 begin*/ void DepthwiseBorderPixelFp16(float16_t *dst, const float16_t *src, const float16_t *weight, const float16_t *bias, diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_depthwise_fp16.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_depthwise_fp16.h index dec8c48eeb..daab03fc9d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_depthwise_fp16.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_depthwise_fp16.h @@ -17,8 +17,8 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP16_CONV_DEPTHWISE_FP16_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP16_CONV_DEPTHWISE_FP16_H_ -#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" -#include "src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.h" +#include "nnacl/conv_parameter.h" +#include "nnacl/fp32/conv_depthwise.h" void ConvDwC8Fp16(float16_t *output_data, const float16_t *input_data, const float16_t *weight_data, const float16_t *bias_data, const ConvParameter *conv_param, const SlidingWindowParam *sliding, diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_fp16.cc index e02f7710ae..f8ce5035d1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_fp16.cc @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp16/conv_fp16.h" +#include "nnacl/fp16/conv_fp16.h" #include -#include "src/runtime/kernel/arm/nnacl/fp16/pack_fp16.h" -#include "src/runtime/kernel/arm/nnacl/fp16/winograd_transform_fp16.h" +#include "nnacl/fp16/pack_fp16.h" +#include "nnacl/fp16/winograd_transform_fp16.h" extern "C" { #ifdef ENABLE_ARM64 diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_fp16.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_fp16.h index c28ffbdd30..8d5ffa392d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_fp16.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_fp16.h @@ -17,7 +17,7 @@ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP16_CONV_FP16_H_ #include -#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" +#include "nnacl/conv_parameter.h" #ifndef ENABLE_NEON void IndirectGemmFp16_16x8(float16_t *output, float16_t *input, float16_t *weight, float16_t *bias, size_t step, diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/pack_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/pack_fp16.cc index 2d2f7a93cc..da628aad16 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/pack_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/pack_fp16.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp16/pack_fp16.h" +#include "nnacl/fp16/pack_fp16.h" #include #include diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/pack_fp16.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/pack_fp16.h index a4ac6201d1..f347628a27 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/pack_fp16.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/pack_fp16.h @@ -20,8 +20,8 @@ #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/conv_parameter.h" +#include "nnacl/op_base.h" void Im2ColPackUnitFp16(float16_t *input_data, ConvParameter *conv_param, float16_t *packed_input, int real_cal_num, int block_index); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/winograd_transform_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/winograd_transform_fp16.cc index 941d3bc705..074653532d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/winograd_transform_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/winograd_transform_fp16.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp16/winograd_transform_fp16.h" +#include "nnacl/fp16/winograd_transform_fp16.h" // for fp16 convolution 3x3 filter/input/output transform F(4,3) void Conv3x3Fp16InputUnit(float16_t *tmp_data, float16_t *trans_input_data, size_t step) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/winograd_transform_fp16.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/winograd_transform_fp16.h index 235b9979c0..f5bd11749e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/winograd_transform_fp16.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/winograd_transform_fp16.h @@ -19,8 +19,8 @@ #include #include -#include "src/runtime/kernel/arm/nnacl/fp16/pack_fp16.h" -#include "src/runtime/kernel/arm/nnacl/fp16/conv_fp16.h" +#include "nnacl/fp16/pack_fp16.h" +#include "nnacl/fp16/conv_fp16.h" // for fp16 convolution 3x3 filter/input/output transform void Conv3x3Fp16InputUnit(float16_t *tmp_data, float16_t *trans_input_data, size_t step); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/activation.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/activation.h index 0544d30308..9718d9ae75 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/activation.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/activation.h @@ -17,15 +17,15 @@ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ACTIVATION_H_ #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" -#include "src/runtime/kernel/arm/nnacl/quantization/fixed_point.h" +#include "nnacl/op_base.h" +#include "nnacl/errorcode.h" +#include "nnacl/quantization/fixed_point.h" -struct ActivationParameter { +typedef struct ActivationParameter { OpParameter op_parameter_; int type_; float alpha_{0.2}; -}; +} ActivationParameter; inline int Relu(const float *src, int length, float *dst) { for (int i = 0; i < length; ++i) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arg_min_max.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arg_min_max.cc index 2b592dc574..b10ba90a8c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arg_min_max.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arg_min_max.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/arg_min_max.h" +#include "nnacl/fp32/arg_min_max.h" #include #include diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arg_min_max.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arg_min_max.h index 8812459de2..d30b6c4dd3 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arg_min_max.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arg_min_max.h @@ -16,7 +16,7 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_ARG_MIN_MAX_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_ARG_MIN_MAX_H_ -#include "src/runtime/kernel/arm/nnacl/arg_min_max_parameter.h" +#include "nnacl/arg_min_max_parameter.h" void ArgMax(const float *input, float *output, ArgMinMaxParameter *param, int pre_axis_count, int axis_count, int after_axis_count); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic.cc index 0fc3d805a7..a7be697b1d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic.cc @@ -14,7 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/arithmetic.h" +#include "nnacl/fp32/arithmetic.h" +#include int ElementMul(float *input0, float *input1, float *output, int element_size) { int block_mod = element_size % C4NUM; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic.h index 81f388800a..86eacdaf40 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic.h @@ -19,9 +19,9 @@ #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/arithmetic_common.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/op_base.h" +#include "nnacl/arithmetic_common.h" +#include "nnacl/errorcode.h" int ElementMul(float *input0, float *input1, float *output, int element_size); int ElementMulRelu(float *input0, float *input1, float *output, int element_size); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic_self.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic_self.cc index 6bb22ad021..d426806e11 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic_self.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic_self.cc @@ -16,7 +16,7 @@ #include #include -#include "src/runtime/kernel/arm/nnacl/fp32/arithmetic_self.h" +#include "nnacl/fp32/arithmetic_self.h" // abs: int ElementAbs(float *input, float *output, int element_size) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic_self.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic_self.h index 62ad6d3cf9..503fbe820d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic_self.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic_self.h @@ -20,8 +20,8 @@ #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/op_base.h" +#include "nnacl/errorcode.h" int ElementAbs(float *input, float *output, int element_size); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/batchnorm.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/batchnorm.cc index 2a0c1433db..269528e0a4 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/batchnorm.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/batchnorm.cc @@ -14,7 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/batchnorm.h" +#include "nnacl/fp32/batchnorm.h" +#include void BatchNorm(float *output_ptr, const float *input_ptr, const float *mean_ptr, const float *variance_ptr, int task_id, BatchNormParameter *param) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/batchnorm.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/batchnorm.h index fb6f025e08..c6103565e1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/batchnorm.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/batchnorm.h @@ -17,14 +17,14 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_BATCHNORM_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_BATCHNORM_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct BatchNormParameter { +typedef struct BatchNormParameter { OpParameter op_parameter_; float epsilon_; int unit_; int channel_; -}; +} BatchNormParameter; void BatchNorm(float *output_ptr, const float *input_ptr, const float *mean_ptr, const float *variance_ptr, int task_id, BatchNormParameter *param); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/broadcast_to.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/broadcast_to.cc index b16bb3a9c6..63d5c9b5ec 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/broadcast_to.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/broadcast_to.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/broadcast_to.h" +#include "nnacl/fp32/broadcast_to.h" #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" void PadBroadcastShapeInfo(BroadcastShapeInfo *shape_info) { if (shape_info->input_shape_size_ < DIMENSION_4D) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/broadcast_to.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/broadcast_to.h index 281cfaaa0d..df7a1eef7c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/broadcast_to.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/broadcast_to.h @@ -19,22 +19,22 @@ #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" #define BROADCAST_TO_SHAPE_MAX_SIZE 4 -struct BroadcastToParameter { +typedef struct BroadcastToParameter { OpParameter op_parameter_; int shape_[BROADCAST_TO_SHAPE_MAX_SIZE]; size_t shape_size_; -}; +} BroadcastToParameter; -struct BroadcastShapeInfo { +typedef struct BroadcastShapeInfo { int input_shape_[BROADCAST_TO_SHAPE_MAX_SIZE]; int input_shape_size_; int output_shape_[BROADCAST_TO_SHAPE_MAX_SIZE]; int output_shape_size_; -}; +} BroadcastShapeInfo; int BroadcastTo(const float *input, BroadcastShapeInfo *shape_info, float *output); #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_BROADCAST_TO_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/cast.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/cast.cc index 4582e31474..9b9d326a50 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/cast.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/cast.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/cast.h" +#include "nnacl/fp32/cast.h" void Uint8ToFloat32(const uint8_t *input, float *output, int number) { for (int i = 0; i < number; ++i) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/cast.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/cast.h index 616e0b89fa..9bb2df36e1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/cast.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/cast.h @@ -19,14 +19,14 @@ #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" // For cast. -struct CastParameter { +typedef struct CastParameter { OpParameter op_parameter_; int src_type_; int dst_type_; -}; +} CastParameter; void Uint8ToFloat32(const uint8_t *input, float *output, int number); void Uint8ToInt8(const uint8_t *input, int8_t *output, int number); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/common_func.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/common_func.cc index f50036bf3c..1c2037767c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/common_func.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/common_func.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/common_func.h" +#include "nnacl/fp32/common_func.h" #ifndef __aarch64__ void MatrixAdd(const float *a_ptr, const float *b_ptr, float *dst, size_t a_stride, size_t b_stride, size_t c_stride, diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/common_func.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/common_func.h index 3802a82cf2..8b93e88c4a 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/common_func.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/common_func.h @@ -20,8 +20,8 @@ #include #include #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/conv_parameter.h" #ifdef __cplusplus extern "C" { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/concat.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/concat.cc index 8c50292552..ad3207e598 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/concat.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/concat.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/concat.h" +#include "nnacl/fp32/concat.h" #include void Concat(void **input, int input_num, int axis, int **inputs_output_shape, size_t shape_size, void *output) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/concat.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/concat.h index a692fdc1cb..ffeb27f04b 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/concat.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/concat.h @@ -17,7 +17,7 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_CONCAT_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_CONCAT_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" void Concat(void **input, int input_num, int axis, int **inputs_output_shape, size_t shape_size, void *output); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv.cc index ab97e7ee55..bf9636503b 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/conv.h" +#include "nnacl/fp32/conv.h" #include -#include "src/runtime/kernel/arm/nnacl/winograd_transform.h" +#include "nnacl/winograd_transform.h" // fp32 conv common void ConvFp32(float *input_data, float *packed_input, float *packed_weight, const float *bias_data, diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv.h index 97a2b08e70..766f11bdd0 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv.h @@ -20,12 +20,12 @@ #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/pack.h" -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/common_func.h" -#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" -#include "src/runtime/kernel/arm/nnacl/fp32/strassen_matmul.h" -#include "src/runtime/kernel/arm/nnacl/winograd_utils.h" +#include "nnacl/pack.h" +#include "nnacl/op_base.h" +#include "nnacl/common_func.h" +#include "nnacl/conv_parameter.h" +#include "nnacl/fp32/strassen_matmul.h" +#include "nnacl/winograd_utils.h" using TmpBufferAddress = float *; typedef void (*GEMM_FUNC_FP32)(float *output, const float *input, const float *weight, const float *bias, size_t step, diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.cc index 1994dc30cb..1d4291d383 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.h" -#include "src/runtime/kernel/arm/nnacl/fp32/common_func.h" -#include "src/runtime/kernel/arm/nnacl/winograd_transform.h" +#include "nnacl/fp32/conv_depthwise.h" +#include "nnacl/fp32/common_func.h" +#include "nnacl/winograd_transform.h" #ifdef ENABLE_ARM64 #include #endif diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.h index e83b6b6dcf..c4f2ca7962 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.h @@ -17,9 +17,9 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_CONV_DEPTHWISE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_CONV_DEPTHWISE_H_ -#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" +#include "nnacl/conv_parameter.h" -struct SlidingWindowParam { +typedef struct SlidingWindowParam { int left_; int right_; int top_; @@ -35,7 +35,7 @@ struct SlidingWindowParam { int in_kh_step_; // kernel H int in_kw_step_; // kernel W int kernel_step_; -}; +} SlidingWindowParam; void InitSlidingParam(SlidingWindowParam *sliding, const ConvParameter *conv_param, int block); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/crop.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/crop.cc index 4336b10af8..9ca387fb07 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/crop.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/crop.cc @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/crop.h" +#include "nnacl/fp32/crop.h" #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/crop_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/crop_parameter.h" void Pad4DOffset(CropParameter *crop_param, int64_t *offset) { int axis = crop_param->axis_; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/crop.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/crop.h index c728f8aee9..788bd30250 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/crop.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/crop.h @@ -15,8 +15,8 @@ */ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_CROP_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_CROP_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/crop_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/crop_parameter.h" #define CROP_OFFSET_MAX_SIZE 4 diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/deconv.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/deconv.cc index 16a43f94ec..769802e186 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/deconv.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/deconv.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/deconv.h" +#include "nnacl/fp32/deconv.h" void PackDeConvWeightFp32(const float *weight, float *dst, int input_channel, int output_channel, int plane) { /* ichwoc(nhwc) -> oc4 * h * w * incUP4 * 4 */ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/deconv.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/deconv.h index 003fb36c1f..61b26f96c5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/deconv.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/deconv.h @@ -16,10 +16,10 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_DECONV_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_DECONV_H_ -#include "src/runtime/kernel/arm/nnacl/pack.h" -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" -#include "src/runtime/kernel/arm/nnacl/fp32/strassen_matmul.h" +#include "nnacl/pack.h" +#include "nnacl/op_base.h" +#include "nnacl/conv_parameter.h" +#include "nnacl/fp32/strassen_matmul.h" void PackDeConvWeightFp32(const float *weight, float *dst, int input_channel, int output_channel, int plane); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/elu.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/elu.cc index 5ae5b31d66..0e9df747a5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/elu.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/elu.cc @@ -14,9 +14,10 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/elu.h" +#include "nnacl/fp32/elu.h" +#include #include "include/errorcode.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/errorcode.h" #include "mindspore/core/utils/log_adapter.h" void Calculate_Data(float *input_data, float *output_data, int num, EluParameter *parameter) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/elu.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/elu.h index 6a510c9d47..940b2fbe66 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/elu.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/elu.h @@ -17,9 +17,9 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_ELU_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_ELU_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -typedef struct { +typedef struct EluParameter { OpParameter op_parameter_; float alpha_; int thread_num_; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/embedding_lookup.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/embedding_lookup.cc index 93a5438cb9..8693986413 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/embedding_lookup.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/embedding_lookup.cc @@ -14,9 +14,10 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/embedding_lookup.h" +#include "nnacl/fp32/embedding_lookup.h" +#include #include "include/errorcode.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/errorcode.h" #include "mindspore/core/utils/log_adapter.h" void l2_regulate(float *data, int size, float max_norm) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/embedding_lookup.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/embedding_lookup.h index 1a8087ad56..5b125834da 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/embedding_lookup.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/embedding_lookup.h @@ -17,16 +17,16 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_EMBEDDING_LOOKUP_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_EMBEDDING_LOOKUP_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -typedef struct { - OpParameter op_parameter_; - bool *is_regulated_; - float max_norm_; - int ids_size_; - int layer_size_; - int layer_num_; - int thread_num; +typedef struct EmbeddingLookupParameter { + OpParameter op_parameter_; + bool *is_regulated_; + float max_norm_; + int ids_size_; + int layer_size_; + int layer_num_; + int thread_num; } EmbeddingLookupParameter; int EmbeddingLookup(float *input_data, int *ids, float *output_data, EmbeddingLookupParameter *parameter, int task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/expandDims.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/expandDims.cc index 65c2a58e90..f1e14fddc5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/expandDims.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/expandDims.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/expandDims.h" +#include "nnacl/fp32/expandDims.h" #include -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/errorcode.h" int ExpandDims(float *input_ptr, float *output_ptr, size_t data_size) { memcpy(output_ptr, input_ptr, data_size); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/expandDims.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/expandDims.h index 21b1fc9789..b49bf77677 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/expandDims.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/expandDims.h @@ -17,12 +17,12 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_EXPANDDIMS_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_EXPANDDIMS_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct ExpandDimsParameter { +typedef struct ExpandDimsParameter { OpParameter op_parameter_; int dim_; -}; +} ExpandDimsParameter; int ExpandDims(float *input_ptr, float *output_ptr, size_t data_size); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/fill.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/fill.cc index 38bc4dbb27..a19586d3a2 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/fill.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/fill.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/fill.h" +#include "nnacl/fp32/fill.h" int Fill(float *output, int size, float data) { for (int i = 0; i < size; ++i) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/fill.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/fill.h index 905afafd3f..31b0fc8119 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/fill.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/fill.h @@ -19,16 +19,16 @@ #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/op_base.h" +#include "nnacl/errorcode.h" #define FILL_DIMS_MAX_SIZE 4 -struct FillParameter { +typedef struct FillParameter { OpParameter op_parameter_; int dims_[FILL_DIMS_MAX_SIZE]; int num_dims_; -}; +} FillParameter; int Fill(float *output, int size, float data); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gather.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gather.cc index c6bef4c940..6691fa0a5b 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gather.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gather.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/gather.h" +#include "nnacl/fp32/gather.h" #include inline int Stride(int *shape, int rank, int index) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gather.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gather.h index 95a4046c46..c2f919a296 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gather.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gather.h @@ -17,13 +17,13 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_GATHER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_GATHER_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct GatherParameter { +typedef struct GatherParameter { OpParameter op_parameter_; int axis_; int batchDims_; -}; +} GatherParameter; int Gather(float *input, int outer_size, int inner_size, int limit, int *indices, int indices_element_size, float *output); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gatherNd.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gatherNd.cc index fd62a5ab46..5d6e7827d3 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gatherNd.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gatherNd.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/gatherNd.h" +#include "nnacl/fp32/gatherNd.h" #include -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/errorcode.h" int GatherNd(float *input, float *output, int *in_offset, int area, int count) { int i = 0; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gatherNd.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gatherNd.h index 93c97002a2..8a966a5d04 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gatherNd.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gatherNd.h @@ -17,12 +17,12 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_GATHERND_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_GATHERND_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct GatherNdParameter { +typedef struct GatherNdParameter { OpParameter op_parameter_; int batchDims_; -}; +} GatherNdParameter; int GatherNd(float *input, float *output, int *in_offset, int area, int count); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/local_response_norm.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/local_response_norm.cc index 0120e93645..860897a5da 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/local_response_norm.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/local_response_norm.cc @@ -14,7 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/local_response_norm.h" +#include "nnacl/fp32/local_response_norm.h" +#include int LocalResponseNorm(float *input_ptr, int out_size, int channel, float *output_ptr, LocalResponseNormParameter *param) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/local_response_norm.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/local_response_norm.h index ad10be79e9..e046fbd313 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/local_response_norm.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/local_response_norm.h @@ -17,15 +17,15 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_LOCAL_RESPONSE_NORM_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_LOCAL_RESPONSE_NORM_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct LocalResponseNormParameter { +typedef struct LocalResponseNormParameter { OpParameter op_parameter_; int depth_radius_; float bias_; float alpha_; float beta_; -}; +} LocalResponseNormParameter; int LocalResponseNorm(float *input_ptr, int out_size, int channel, float *output_ptr, LocalResponseNormParameter *param); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/lstm.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/lstm.cc index 7a3a07ed0d..8742b5c7b8 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/lstm.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/lstm.cc @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/lstm.h" +#include "nnacl/fp32/lstm.h" #include -#include "src/runtime/kernel/arm/nnacl/fp32/activation.h" -#include "src/runtime/kernel/arm/nnacl/fp32/arithmetic.h" +#include "nnacl/fp32/activation.h" +#include "nnacl/fp32/arithmetic.h" void InitGate(float *gate_buffer, const float *bias, LstmParameter *lstm_parm) { int gate_offest = 0; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/lstm.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/lstm.h index 05fff4f1dc..af50e5a3fb 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/lstm.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/lstm.h @@ -17,9 +17,9 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_LSTM_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_LSTM_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct LstmParameter { +typedef struct LstmParameter { OpParameter op_parameter_; int input_size_; int hidden_size_; // output_size @@ -28,7 +28,7 @@ struct LstmParameter { int input_step_; int output_step_; bool bidirectional_; -}; +} LstmParameter; void Lstm(float *output, const float *input, const float *weight_i, const float *weight_h, const float *bias, float *hidden_state, float *cell_state, float *gate_buffer, LstmParameter *lstm_parm); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/matmul.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/matmul.cc index 3155fe9561..5573ac7974 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/matmul.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/matmul.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/matmul.h" +#include "nnacl/fp32/matmul.h" void RowMajor2Row8Major(float *src_ptr, float *dst_ptr, int row, int col) { for (int r = 0; r < row; r++) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/matmul.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/matmul.h index ad2e4531bb..e643105e82 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/matmul.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/matmul.h @@ -18,9 +18,9 @@ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_MATMUL_H_ #include -#include "src/runtime/kernel/arm/nnacl/errorcode.h" -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/matmul.h" +#include "nnacl/errorcode.h" +#include "nnacl/op_base.h" +#include "nnacl/matmul_parameter.h" void MatMul(const float *a, const float *b, float *c, const float *bias, ActType act_type, int depth, int row, int col); void RowMajor2Row8Major(float *src_ptr, float *dst_ptr, int row, int col); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/one_hot.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/one_hot.cc index 351e154290..fbe75876e9 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/one_hot.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/one_hot.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/one_hot.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/fp32/one_hot.h" +#include "nnacl/errorcode.h" int OneHot(const int *indices, float *output, const OneHotParameter *one_hot_param, const int tid, const int thread_num) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/one_hot.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/one_hot.h index 9cefa121ec..4cc0ba1018 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/one_hot.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/one_hot.h @@ -20,9 +20,9 @@ #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct OneHotParameter { +typedef struct OneHotParameter { OpParameter op_parameter_; int axis_; int depth_; @@ -30,7 +30,7 @@ struct OneHotParameter { float off_value_; int outer_size_; int inner_size_; -}; +} OneHotParameter; int OneHot(const int *indices, float *output, const OneHotParameter *one_hot_param, const int tid, const int thread_num); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pad.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pad.cc index 1857ed6515..5a1448c2e5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pad.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/pad.h" -#include "src/runtime/kernel/arm/nnacl/common_func.h" +#include "nnacl/fp32/pad.h" +#include "nnacl/common_func.h" void Pad(const float *input_data, float *output_data, const int *input_shape, const int *output_shape, const int *paddings, const int tid, const int thread_num) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pad.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pad.h index 1b60946e29..eef9796f56 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pad.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pad.h @@ -21,8 +21,8 @@ #endif #include #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/pad_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/pad_parameter.h" void Pad(const float *input_data, float *output_data, const int *input_shape, const int *output_shape, const int *paddings, const int tid, const int thread_num); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pooling.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pooling.cc index 5d06ffff5f..543ccfb132 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pooling.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pooling.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/pooling.h" +#include "nnacl/fp32/pooling.h" #include void AvgPooling(const float *input_ptr, float *output_ptr, PoolingParameter *pooling_param, int task_id) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pooling.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pooling.h index b460ea490c..8b167a3d65 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pooling.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pooling.h @@ -20,9 +20,10 @@ #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" +#include "nnacl/quantization/quantize.h" -struct PoolingParameter { +typedef struct PoolingParameter { OpParameter op_parameter_; QuantArg **quant_args_; bool global_; @@ -47,7 +48,7 @@ struct PoolingParameter { int stride_w_; int stride_h_; int thread_num_; -}; +} PoolingParameter; void AvgPooling(const float *input_ptr, float *output_ptr, PoolingParameter *pooling_param, int task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/range.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/range.cc index acb6c18cd5..63b285d506 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/range.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/range.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/range.h" +#include "nnacl/fp32/range.h" void Range(float *output_ptr, int start, int limit, int delta) { size_t index = 0; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/range.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/range.h index bdb40c6d25..f48d98ca92 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/range.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/range.h @@ -17,15 +17,15 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_RANGE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_RANGE_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct RangeParameter { +typedef struct RangeParameter { OpParameter op_parameter_; int dType_; int start_; int limit_; int delta_; -}; +} RangeParameter; void Range(float *output_ptr, int start, int limit, int delta); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/rank.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/rank.cc index 1cf475b625..b3b27f3a4d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/rank.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/rank.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/rank.h" +#include "nnacl/fp32/rank.h" void Rank(float* output, int rank) { output[0] = (float)(rank); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/rank.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/rank.h index e8133d0ac7..15c5a9affd 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/rank.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/rank.h @@ -16,7 +16,7 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_RANK_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_RANK_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" void Rank(float* output, int rank); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reduce.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reduce.cc index 4fe680b8cd..4a4e95ea8a 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reduce.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reduce.cc @@ -15,8 +15,8 @@ */ #include -#include "src/runtime/kernel/arm/nnacl/fp32/reduce.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/fp32/reduce.h" +#include "nnacl/errorcode.h" int ReduceMean(const int outer_size, const int inner_size, const int axis_size, const float *src_data, const int *src_shape, float *dst_data, const int tid, const int thread_num) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reduce.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reduce.h index 9ebdb9638a..e20ae4c45e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reduce.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reduce.h @@ -16,16 +16,16 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_REDUCE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_REDUCE_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" #define REDUCE_MAX_AXES_NUM 8 -struct ReduceParameter { +typedef struct ReduceParameter { OpParameter op_parameter_; bool keep_dims_; int axes_[REDUCE_MAX_AXES_NUM]; int num_axes_; int mode_; -}; +} ReduceParameter; int ReduceMean(const int outer_size, const int inner_size, const int axis_size, const float *src_data, const int *src_shape, float *dst_data, const int tid, const int thread_num); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reverse.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reverse.cc index 6c1867f954..1023c5bbc0 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reverse.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reverse.cc @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/reverse.h" +#include "nnacl/fp32/reverse.h" #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/op_base.h" +#include "nnacl/errorcode.h" int Reverse(const float *input, float *output, size_t elem_size, int *index) { for (int i = 0; i < elem_size; i++) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reverse.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reverse.h index 8e76eb4b94..d4e45938a2 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reverse.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reverse.h @@ -20,15 +20,15 @@ #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" #define REVERSE_SHAPE_MAX_SIZE 4 // For reverse. -struct ReverseParameter { +typedef struct ReverseParameter { OpParameter op_parameter_; int axis_[REVERSE_SHAPE_MAX_SIZE]; int num_axis_; -}; +} ReverseParameter; int Reverse(const float *input, float *output, size_t elem_size, int *index); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/slice.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/slice.cc index 02e3b3fcee..732b51be33 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/slice.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/slice.cc @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/slice.h" +#include "nnacl/fp32/slice.h" #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/op_base.h" +#include "nnacl/errorcode.h" void PadSliceParameterTo4D(SliceParameter *param) { int32_t begin[DIMENSION_4D]; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/slice.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/slice.h index 07da4625c2..835e1623fc 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/slice.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/slice.h @@ -16,10 +16,10 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_SLICE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_SLICE_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" #define SLICE_SHAPE_MAX_SIZE 4 -struct SliceParameter { +typedef struct SliceParameter { OpParameter op_parameter_; int32_t begin_[SLICE_SHAPE_MAX_SIZE]; int32_t end_[SLICE_SHAPE_MAX_SIZE]; @@ -27,7 +27,7 @@ struct SliceParameter { int32_t shape_[SLICE_SHAPE_MAX_SIZE]; int32_t param_length_; int32_t thread_id_; -}; +} SliceParameter; void PadSliceParameterTo4D(SliceParameter *param); void DoSlice(const float *input, float *output, SliceParameter *param); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/softmax.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/softmax.cc index d07229b871..6bf03d35c4 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/softmax.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/softmax.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/softmax.h" -#include +#include "nnacl/fp32/softmax.h" +#include // output = exp(input) / reduce_sum(exp(input), axis) void Softmax(const float *input_ptr, float *output_ptr, float *sum_data, SoftmaxParameter *parameter) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/softmax.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/softmax.h index 7324b0d4d5..bd1a780222 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/softmax.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/softmax.h @@ -17,8 +17,8 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_SOFTMAX_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_SOFTMAX_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/softmax_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/softmax_parameter.h" void Softmax(const float *input_ptr, float *output_ptr, float *sum_data, SoftmaxParameter *parameter); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/space_to_batch.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/space_to_batch.cc index cbc4e247dd..809c0fd324 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/space_to_batch.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/space_to_batch.cc @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/space_to_batch.h" -#include "src/runtime/kernel/arm/nnacl/arithmetic_common.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" -#include "src/runtime/kernel/arm/nnacl/fp32/concat.h" -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/fp32/space_to_batch.h" +#include "nnacl/arithmetic_common.h" +#include "nnacl/errorcode.h" +#include "nnacl/fp32/concat.h" +#include "nnacl/op_base.h" int EnumElement(int *shape, int n_dims) { int total = 1; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/space_to_batch.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/space_to_batch.h index 4d4ab437f7..53a5c2410c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/space_to_batch.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/space_to_batch.h @@ -15,12 +15,12 @@ */ #ifndef MINDSPORE_LITE_SRC_BACKEND_ARM_NNACL_FP32_SPACE_TO_BATCH_H_ #define MINDSPORE_LITE_SRC_BACKEND_ARM_NNACL_FP32_SPACE_TO_BATCH_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" #define SPACE_TO_BATCH_BLOCK_SIZES_SIZE 2 #define SPACE_TO_BATCH_PADDINGS_SIZE 4 -struct SpaceToBatchParameter { +typedef struct SpaceToBatchParameter { OpParameter op_parameter_; int block_sizes_[8]; int paddings_[8]; @@ -31,7 +31,7 @@ struct SpaceToBatchParameter { int in_shape_[8]; int padded_in_shape_[8]; bool need_paddings_ = false; -}; +} SpaceToBatchParameter; int SpaceToBatch(const float *input, float *output, SpaceToBatchParameter param, float *tmp_space[3]); int SpaceToBatchForNHWC(const float *input, float *output, int *in_shape, int shape_size, int *block_size); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/space_to_depth.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/space_to_depth.cc index dab1dd7b8e..bf0f6b88b9 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/space_to_depth.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/space_to_depth.cc @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/space_to_depth.h" -#include "src/runtime/kernel/arm/nnacl/arithmetic_common.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/fp32/space_to_depth.h" +#include "nnacl/arithmetic_common.h" +#include "nnacl/errorcode.h" +#include "nnacl/op_base.h" int SpaceToDepthForNHWC(const float *input, float *output, int *in_shape, int *out_shape, int shape_size, int block_size, int h_start, int h_end) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/space_to_depth.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/space_to_depth.h index 5bfdacac89..e83c6137f6 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/space_to_depth.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/space_to_depth.h @@ -15,12 +15,12 @@ */ #ifndef MINDSPORE_LITE_SRC_BACKEND_ARM_NNACL_FP32_SPACE_TO_DEPTH_H_ #define MINDSPORE_LITE_SRC_BACKEND_ARM_NNACL_FP32_SPACE_TO_DEPTH_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct SpaceToDepthParameter { +typedef struct SpaceToDepthParameter { OpParameter op_parameter_; int32_t block_size_; -}; +} SpaceToDepthParameter; int SpaceToDepthForNHWC(const float *input, float *output, int *in_shape, int *out_shape, int shape_size, int block_size, int h_start, int h_end); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/stack.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/stack.cc index 1496ec7d47..1ccdb8d347 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/stack.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/stack.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/stack.h" -#include "src/runtime/kernel/arm/nnacl/arithmetic_common.h" +#include "nnacl/fp32/stack.h" +#include "nnacl/arithmetic_common.h" void DoStack(const float * const *inputs, size_t input_num, int *in_shape, size_t shape_size, int axis, float *output) { size_t one_input_size = 1; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/stack.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/stack.h index cf08d4901b..0b9f656975 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/stack.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/stack.h @@ -16,12 +16,12 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_STACK_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_STACK_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct StackParameter { +typedef struct StackParameter { OpParameter op_parameter_; int32_t axis_; -}; +} StackParameter; void DoStack(const float * const *inputs, size_t input_num, int *in_shape, size_t shape_size, int axis, float *output); #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_STACK_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/strassen_matmul.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/strassen_matmul.cc index 1baa31f8e7..df0c48362d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/strassen_matmul.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/strassen_matmul.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/strassen_matmul.h" +#include "nnacl/fp32/strassen_matmul.h" bool CheckRecursion(int row, int col, int deep, int max_recursion, int cur_recursion) { if (cur_recursion >= max_recursion) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/strassen_matmul.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/strassen_matmul.h index 06afd71669..7af6ae7c37 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/strassen_matmul.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/strassen_matmul.h @@ -18,11 +18,11 @@ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_STRASSEN_MATMUL_H_ #include -#include "src/runtime/kernel/arm/nnacl/pack.h" -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" -#include "src/runtime/kernel/arm/nnacl/strassen_matmul.h" -#include "src/runtime/kernel/arm/nnacl/fp32/common_func.h" +#include "nnacl/pack.h" +#include "nnacl/op_base.h" +#include "nnacl/errorcode.h" +#include "nnacl/strassen_matmul.h" +#include "nnacl/fp32/common_func.h" #define FP32_STRASSEN_UINT C4NUM #define FP32_STRASSEN_WEIGHT_UINT (C4NUM * C4NUM) diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/topk.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/topk.cc index be0c8b3f13..fcb6bc7798 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/topk.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/topk.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/topk.h" +#include "nnacl/fp32/topk.h" int DescendCmp(const void *a, const void *b) { return ((const TopkNode *)b)->element - ((const TopkNode *)a)->element; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/topk.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/topk.h index a49e5f8ef4..de4c6b9240 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/topk.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/topk.h @@ -17,21 +17,21 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_TOPK_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_TOPK_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct TopkNode { +typedef struct TopkNode { float element; int32_t index; -}; +} TopkNode; -struct TopkParameter { +typedef struct TopkParameter { OpParameter op_parameter_; int last_dim_size_; int loop_num_; int k_; bool sorted_; void *topk_node_list_; -}; +} TopkParameter; void Topk(float *input_data, float *output_data, int32_t *output_index, TopkParameter *parameter); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/unsqueeze.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/unsqueeze.cc index 4d7d1600cf..b4164bb35d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/unsqueeze.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/unsqueeze.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32/unsqueeze.h" +#include "nnacl/fp32/unsqueeze.h" #include -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/errorcode.h" int Unsqueeze(float *input_ptr, float *output_ptr, size_t data_size) { memcpy(output_ptr, input_ptr, data_size); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/unsqueeze.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/unsqueeze.h index 59c01944f3..c609ad1f27 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/unsqueeze.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/unsqueeze.h @@ -17,15 +17,15 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_UNSQUEEZE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_UNSQUEEZE_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" #define UNSQUEEZE_DIMS_MAX_SIZE 4 -struct UnsqueezeParameter { +typedef struct UnsqueezeParameter { OpParameter op_parameter_; int dims_[UNSQUEEZE_DIMS_MAX_SIZE]; int num_dim_; -}; +} UnsqueezeParameter; int Unsqueeze(float *input_ptr, float *output_ptr, size_t data_size); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/activation_grad.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/activation_grad.h index da9d2850f6..41b734085b 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/activation_grad.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/activation_grad.h @@ -17,15 +17,15 @@ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_GRAD_ACTIVATION_GRAD_H_ #include -#include "src/runtime/kernel/arm/opclib/op_base.h" -#include "src/runtime/kernel/arm/opclib/fp32/arithmetic.h" -#include "src/runtime/kernel/arm/opclib/errorcode.h" +#include "nnacl/op_base.h" +#include "nnacl/fp32/arithmetic.h" +#include "nnacl/errorcode.h" -struct ActivationGradParameter { +typedef struct ActivationGradParameter { OpParameter op_parameter{}; int type_; float alpha_{0.01}; -}; +} ActivationGradParameter; inline int ReluGrad(float *src0, float *src1, int length, float *dst) { for (int i = 0; i < length; ++i) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/arithmetic_grad.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/arithmetic_grad.cc index 6727bf0e64..6e5b56ecf5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/arithmetic_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/arithmetic_grad.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32_grad/arithmetic_grad.h" +#include "nnacl/fp32_grad/arithmetic_grad.h" void ElementDivNegSquare(const float *nom, const float *denom, float *output, int element_size) { for (int i = 0; i < element_size; i++) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/batch_norm.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/batch_norm.cc index 4e863c9a00..fc9893de2d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/batch_norm.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/batch_norm.cc @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include -#include -#include "src/runtime/kernel/arm/nnacl/fp32_grad/batch_norm.h" +#include +#include +#include "nnacl/fp32_grad/batch_norm.h" static void sumSpatialBatch(const float *in, int size, int ch, float *out) { - std::fill(out, out + ch, 0.f); + memset(out, 0, ch * sizeof(float)); for (int i = 0; i < size; i++) { const float *ptr = in + i * ch; for (int c = 0; c < ch; c++) { @@ -39,7 +39,7 @@ void normalize(const float *x, const float *mean, const float *variance, float e for (i = 0; i < spatial; ++i) { for (f = 0; f < filters; ++f) { int index = b * filters * spatial + i * filters + f; - out[index] = (x[index] - mean[f]) / (std::sqrt(variance[f]) + eps); + out[index] = (x[index] - mean[f]) / (sqrt(variance[f]) + eps); } } } @@ -47,7 +47,7 @@ void normalize(const float *x, const float *mean, const float *variance, float e void backwardScale(const float *x_norm, const float *delta, int batch, int n, int size, float *scale_updates) { int i, b, f; - std::fill(scale_updates, scale_updates + n, 0.f); + memset(scale_updates, 0, n * sizeof(float)); for (b = 0; b < batch; ++b) { for (i = 0; i < size; ++i) { for (f = 0; f < n; ++f) { @@ -62,7 +62,7 @@ void meanVar(const float *in, int batch, int spatial, int ch, float *mean, float float N = batch * spatial; sumSpatialBatch(in, N, ch, mean); for (int f = 0; f < ch; ++f) mean[f] /= N; - std::fill(var, var + ch, 0.f); + memset(var, 0, ch * sizeof(float)); for (int i = 0; i < N; i++) { for (int f = 0; f < ch; f++) { float x = in[i * ch + f]; @@ -74,13 +74,13 @@ void meanVar(const float *in, int batch, int spatial, int ch, float *mean, float void meanDelta(float *yt, int size, int ch, float eps, float *variance, float *mean_delta) { sumSpatialBatch(yt, size, ch, mean_delta); - for (int i = 0; i < ch; i++) mean_delta[i] *= -1.f / std::sqrt((variance[i] + eps)); + for (int i = 0; i < ch; i++) mean_delta[i] *= -1.f / sqrt((variance[i] + eps)); } void meanAdd(const float *x, const float *mean, const float *variance_delta, int batch, int filters, int spatial, float *mean_add, float *mean_delta) { int i, k; - std::fill(mean_add, mean_add + filters, 0.f); + memset(mean_add, 0, filters * sizeof(float)); for (k = 0; k < spatial * batch; ++k) { for (i = 0; i < filters; ++i) { int index = k * filters + i; @@ -96,7 +96,7 @@ void meanAdd(const float *x, const float *mean, const float *variance_delta, int void varianceDelta(const float *x, const float *delta, const float *mean, const float *variance, int batch, int filters, int spatial, float eps, float *variance_delta) { int i, k; - std::fill(variance_delta, variance_delta + filters, 0.f); + memset(variance_delta, 0, filters * sizeof(float)); for (k = 0; k < batch * spatial; k++) { for (i = 0; i < filters; i++) { int index = k * filters + i; @@ -112,7 +112,7 @@ void NormalizeDelta(const float *x, const float *mean, const float *variance, co for (k = 0; k < batch * spatial; k++) { for (f = 0; f < filters; f++) { int index = k * filters + f; - delta[index] = delta[index] * 1. / (std::sqrt(variance[f] + eps)) + + delta[index] = delta[index] * 1. / (sqrt(variance[f] + eps)) + variance_delta[f] * 2. * (x[index] - mean[f]) / (spatial * batch) + mean_delta[f] / (spatial * batch); } diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/batch_norm.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/batch_norm.h index b7a0a3b691..f4e1616e77 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/batch_norm.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/batch_norm.h @@ -17,12 +17,12 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_BATCH_NORM_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_BATCH_NORM_H_ -struct bnParameter { +typedef struct bnParameter { int batch; int channels; int spatial; float eps; -}; +} bnParameter; void scaleBias(const float *scales, int batch, int n, int size, float *output); void normalize(const float *x, const float *mean, const float *variance, float eps, int batch, int filters, int spatial, float *out); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/gemm.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/gemm.cc index d62d0c6f23..8cfc9e2818 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/gemm.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/gemm.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fp32_grad/gemm.h" +#include "nnacl/fp32_grad/gemm.h" static void gemm_nn(int M, int N, int K, float alpha, float *mat_a, int lda, float *mat_B, int ldb, float *mat_c, int ldc) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/pack_ext.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/pack_ext.cc index 1ccaf52f9a..d95cc6daf9 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/pack_ext.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/pack_ext.cc @@ -15,7 +15,7 @@ */ #include -#include "src/runtime/kernel/arm/nnacl/fp32_grad/pack_ext.h" +#include "nnacl/fp32_grad/pack_ext.h" static int is_a_ge_zero_and_a_lt_b(int a, int b) { return (unsigned)(a) < (unsigned)(b); } diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/pack_ext.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/pack_ext.h index d943467f16..e2a771109c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/pack_ext.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/pack_ext.h @@ -17,7 +17,7 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_PACK_EXT_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_PACK_EXT_H_ -#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" +#include "nnacl/conv_parameter.h" void im2col_hwc(const float *in_data, float *data_col, ConvParameter *conv_param); void im2row_hwc(const float *in_data, float *data_row, ConvParameter *conv_param); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/pooling_grad.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/pooling_grad.cc index 5511b82216..bb8b979861 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/pooling_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/pooling_grad.cc @@ -14,7 +14,7 @@ * limitations under the License. */ #include -#include "src/runtime/kernel/arm/nnacl/fp32_grad/pooling_grad.h" +#include "nnacl/fp32_grad/pooling_grad.h" void AvgPoolingGrad(const float *input_ptr, float *output_ptr, PoolingParameter *pooling_param) { int stride_w = pooling_param->stride_w_; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/pooling_grad.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/pooling_grad.h index 1fabdfd962..f16c6b4b31 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/pooling_grad.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/pooling_grad.h @@ -17,7 +17,7 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_GRAD_POOLING_GRAD_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_GRAD_POOLING_GRAD_H_ -#include "src/runtime/kernel/arm/nnacl/fp32/pooling.h" +#include "nnacl/fp32/pooling.h" void AvgPoolingGrad(const float *input_ptr, float *output_ptr, PoolingParameter *pooling_param); void MaxPoolingGrad(const float *dy, const int *indices_ptr, float *output_ptr, PoolingParameter *pooling_param); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/reduce_grad.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/reduce_grad.cc index b90c16a30c..f5e313310e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/reduce_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/reduce_grad.cc @@ -15,7 +15,7 @@ */ #include #include -#include "mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/reduce_grad.h" +#include "mindspore/lite/nnacl/fp32_grad/reduce_grad.h" static inline bool NextIndex(const int num_dims, const int *dims, int *current) { int carry = 1; @@ -108,8 +108,7 @@ void ReduceSumByAxes(const float *input, const int *input_dims, float *output, c if (output_dims[idx] != input_dims[idx]) same_shape = false; } if (same_shape) { - std::copy(input, input + num_outputs * sizeof(float), output); - // memcpy(output, input, num_outputs*sizeof(float)); + memcpy(output, input, num_outputs * sizeof(float)); return; } diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/softmax_grad.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/softmax_grad.h index e9b0955d9d..e110308571 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/softmax_grad.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fp32_grad/softmax_grad.h @@ -17,13 +17,13 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_SOFTMAX_GRAD_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_SOFTMAX_GRAD_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct SoftmaxCrossEntropyParameter { +typedef struct SoftmaxCrossEntropyParameter { OpParameter op_parameter; int32_t batch_size_; unsigned int number_of_classes_; int n_dim_; int input_shape_[5]; -}; +} SoftmaxCrossEntropyParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_SOFTMAX_GRAD_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fused_batchnorm.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/fused_batchnorm.cc index 9c8aa0fa8c..c740c9cdb1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fused_batchnorm.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fused_batchnorm.cc @@ -14,7 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/fused_batchnorm.h" +#include "nnacl/fused_batchnorm.h" +#include void FusedBatchNorm(const float *input_ptr, const float *scale_ptr, const float *offest_ptr, const float *mean_ptr, const float *variance_ptr, int *input_shapes, float epsilon, float *output_ptr) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/fused_batchnorm.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/fused_batchnorm.h index 8aac705e46..259b967ac6 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/fused_batchnorm.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/fused_batchnorm.h @@ -17,13 +17,12 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FUSED_BATCHNORM_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FUSED_BATCHNORM_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct FusedBatchNormParameter { +typedef struct FusedBatchNormParameter { OpParameter op_parameter_; float epsilon_; -}; - +} FusedBatchNormParameter; void FusedBatchNorm(const float *input_ptr, const float *scale_ptr, const float *offest_ptr, const float *mean_ptr, const float *variance_ptr, int *input_shapes, float epsilon, float *output_ptr); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arg_min_max_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arg_min_max_int8.cc index 31ac63ec5b..bb7e59f509 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arg_min_max_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arg_min_max_int8.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/arg_min_max_int8.h" +#include "nnacl/int8/arg_min_max_int8.h" #include void CalcParameter(const int *shape, int dims_number, int axis, int *pre_axis_count, int *axis_count, diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arg_min_max_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arg_min_max_int8.h index ec4f259715..20cd3db8e1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arg_min_max_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arg_min_max_int8.h @@ -16,8 +16,8 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_ARG_MIN_MAX_INT8_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_ARG_MIN_MAX_INT8_H_ -#include "src/runtime/kernel/arm/nnacl/arg_min_max_parameter.h" -#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h" +#include "nnacl/arg_min_max_parameter.h" +#include "nnacl/quantization/quantize.h" void ArgMinMaxQuant(const int8_t *input, int8_t *output, const int *in_shape, ArgMinMaxParameter *param, QuantArg *in_quant, QuantArg *out_quant); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arithmetic_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arithmetic_int8.cc index d949d64179..893af2bb15 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arithmetic_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arithmetic_int8.cc @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/arithmetic_int8.h" +#include "nnacl/int8/arithmetic_int8.h" #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/errorcode.h" int ElementNotEqual(int8_t *input0, int8_t *input1, int8_t *output, int element_size) { for (int index = 0; index < element_size; ++index) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arithmetic_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arithmetic_int8.h index 9229657f51..01562a9e90 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arithmetic_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arithmetic_int8.h @@ -16,7 +16,7 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_ARITHMETIC_INT8_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_ARITHMETIC_INT8_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" int ElementNotEqual(int8_t *input0, int8_t *input1, int8_t *output, int element_size); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arithmetic_self_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arithmetic_self_int8.cc index b6b98d109e..7ae664077c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arithmetic_self_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arithmetic_self_int8.cc @@ -15,12 +15,12 @@ */ #include -#include "src/runtime/kernel/arm/nnacl/int8/arithmetic_self_int8.h" +#include "nnacl/int8/arithmetic_self_int8.h" #ifdef ENABLE_NEON #include -#include "src/runtime/kernel/arm/nnacl/add_int8.h" +#include "nnacl/add_int8.h" #endif -#include "src/runtime/kernel/arm/nnacl/quantization/fixed_point.h" +#include "nnacl/quantization/fixed_point.h" int ElementFloor(int8_t *input, int8_t *output, int element_size, ArithSelfQuantArg para) { float in_scale = para.in_args_.scale_; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arithmetic_self_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arithmetic_self_int8.h index 78c9a42f25..b2d8abc7ba 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arithmetic_self_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/arithmetic_self_int8.h @@ -20,8 +20,9 @@ #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/op_base.h" +#include "nnacl/errorcode.h" +#include "nnacl/quantization/quantize.h" int ElementRound(int8_t *input, int8_t *output, int element_size, ArithSelfQuantArg para); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/batch_to_space_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/batch_to_space_int8.cc index a10a0f151b..d226d1d807 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/batch_to_space_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/batch_to_space_int8.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/batch_to_space_int8.h" -#include "src/runtime/kernel/arm/nnacl/arithmetic_common.h" +#include "nnacl/int8/batch_to_space_int8.h" +#include "nnacl/arithmetic_common.h" void BatchToSpaceNoCropForNHWC(const int8_t *input, int8_t *output, const int *in_shape, int out_n, const int *block, QuantArg *in_quant_arg, QuantArg *out_quant_arg) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/batch_to_space_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/batch_to_space_int8.h index 7846e9a1e6..b349e2dcc6 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/batch_to_space_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/batch_to_space_int8.h @@ -15,8 +15,8 @@ */ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_BATCH_TO_SPACE_INT8_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_BATCH_TO_SPACE_INT8_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h" +#include "nnacl/op_base.h" +#include "nnacl/quantization/quantize.h" void BatchToSpaceNoCropForNHWC(const int8_t *input, int8_t *output, const int *in_shape, int out_n, const int *block, QuantArg *in_quant_arg, QuantArg *out_quant_arg); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/common_func.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/common_func.h index 3439fbe1db..a9b4cb9a4b 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/common_func.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/common_func.h @@ -20,8 +20,8 @@ #include #include #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/conv_parameter.h" #ifdef __cplusplus extern "C" { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/concat_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/concat_int8.cc index 295113dc2c..a9e2b86332 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/concat_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/concat_int8.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/concat_int8.h" -#include "src/runtime/kernel/arm/nnacl/concat_parameter.h" +#include "nnacl/int8/concat_int8.h" +#include "nnacl/concat_parameter.h" #include void Concat(int8_t **inputs, int8_t *output, ConcatParameter *para, int axis, int64_t real_dst_count, int task_id) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/concat_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/concat_int8.h index 0243a2fb54..c6f860c3a2 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/concat_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/concat_int8.h @@ -17,8 +17,8 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_CONCAT_INT8_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_CONCAT_INT8_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/concat_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/concat_parameter.h" void Concat(int8_t **inputs, int8_t *output_ptr, ConcatParameter *para, int axis, int64_t real_dst_count, int task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/conv_depthwise_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/conv_depthwise_int8.cc index 11167a165b..46f107f09c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/conv_depthwise_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/conv_depthwise_int8.cc @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/conv_depthwise_int8.h" +#include "nnacl/int8/conv_depthwise_int8.h" #include -#include "src/runtime/kernel/arm/nnacl/quantization/fixed_point.h" -#include "src/runtime/kernel/arm/nnacl/int8/common_func.h" +#include "nnacl/quantization/fixed_point.h" +#include "nnacl/int8/common_func.h" /*conv depthwise int8 begin*/ void DepthwiseBorderPixelInt8(int8_t *dst, const int16_t *src, const int16_t *weight, const int32_t *bias, int height, diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/conv_depthwise_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/conv_depthwise_int8.h index 555c3693ab..f4c484e7e2 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/conv_depthwise_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/conv_depthwise_int8.h @@ -17,8 +17,8 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_CONV_DEPTHWISE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_CONV_DEPTHWISE_H_ -#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" -#include "src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.h" +#include "nnacl/conv_parameter.h" +#include "nnacl/fp32/conv_depthwise.h" void ConvDwInt8(int8_t *output_data, const int16_t *input_data, const int16_t *weight_data, const int32_t *bias_data, const ConvParameter *conv_param, const SlidingWindowParam *sliding, int task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/conv_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/conv_int8.cc index fa02fd99f1..5fbbb768b0 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/conv_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/conv_int8.cc @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/conv_int8.h" +#include "nnacl/int8/conv_int8.h" #include -#include "src/runtime/kernel/arm/nnacl/winograd_transform.h" -#include "src/runtime/kernel/arm/nnacl/int8/common_func.h" +#include "nnacl/winograd_transform.h" +#include "nnacl/int8/common_func.h" void IndirectGemmInt8(int8_t *dst, int32_t *tmp_dst, const int8_t *src, const int8_t *weight, const int32_t *bias, int ic4, size_t kernel_plane, size_t output_channel, const int32_t *input_sum, diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/conv_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/conv_int8.h index 96f08c0c6b..1ec29d6074 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/conv_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/conv_int8.h @@ -19,12 +19,12 @@ #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/pack.h" -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/common_func.h" -#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" -#include "src/runtime/kernel/arm/nnacl/winograd_utils.h" -#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h" +#include "nnacl/pack.h" +#include "nnacl/op_base.h" +#include "nnacl/common_func.h" +#include "nnacl/conv_parameter.h" +#include "nnacl/winograd_utils.h" +#include "nnacl/quantization/quantize.h" typedef void (*GEMM_FUNC)(int8_t *dst, const int8_t *src, const int8_t *weight, const int32_t *bias, size_t ksize, size_t ic4, size_t output_channel, size_t offset, const int32_t *input_sum, size_t act_min, diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/crop_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/crop_int8.cc index d9a6115a24..f13c1ed5b0 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/crop_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/crop_int8.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/crop_parameter.h" -#include "src/runtime/kernel/arm/nnacl/int8/crop_int8.h" +#include "nnacl/crop_parameter.h" +#include "nnacl/int8/crop_int8.h" #include void Crop(const int8_t *input, int8_t *output, int task_id, CropParameter *para) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/crop_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/crop_int8.h index d574b0813b..1c4b310333 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/crop_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/crop_int8.h @@ -16,8 +16,8 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_CROP_INT8_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_CROP_INT8_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/crop_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/crop_parameter.h" void Crop(const int8_t *input, int8_t *output, int task_id, CropParameter *para); void Crop1D(const int8_t *input, int8_t *output, int task_id, CropParameter *para); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/deconv.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/deconv.cc index 32586063a3..691ae7ba0c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/deconv.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/deconv.cc @@ -14,7 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/deconv.h" +#include "nnacl/int8/deconv.h" +#include "nnacl/int8/matmul_int8.h" int DeConvInt8(const int8_t *input, const int8_t *weight, int32_t *output, size_t row8, size_t col8, size_t deep, ConvParameter *conv_param) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/deconv.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/deconv.h index 145a0c1ff6..041d8f93c9 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/deconv.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/deconv.h @@ -17,12 +17,11 @@ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_DECONV_H_ #include -#include "src/runtime/kernel/arm/nnacl/pack.h" -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" -#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" -#include "src/runtime/kernel/arm/nnacl/common_func.h" -#include "src/runtime/kernel/arm/nnacl/int8/matmul.h" +#include "nnacl/pack.h" +#include "nnacl/op_base.h" +#include "nnacl/errorcode.h" +#include "nnacl/conv_parameter.h" +#include "nnacl/common_func.h" int DeConvInt8(const int8_t *input, const int8_t *weight, int32_t *output, size_t row8, size_t col8, size_t deep, ConvParameter *conv_param); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/depth_to_space_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/depth_to_space_int8.cc index 4ee38a88c4..5c98da4d18 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/depth_to_space_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/depth_to_space_int8.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/depth_to_space_int8.h" +#include "nnacl/int8/depth_to_space_int8.h" #include void DepthToSpaceForNHWC(const int8_t *input, int8_t *output, int *in_shape, DepthToSpaceParameter *param, diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/depth_to_space_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/depth_to_space_int8.h index b2abb1f068..a8fbe0ccaa 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/depth_to_space_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/depth_to_space_int8.h @@ -16,8 +16,8 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_DEPTH_TO_SPACE_INT8_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_DEPTH_TO_SPACE_INT8_H_ -#include "src/runtime/kernel/arm/nnacl/depth_to_space_parameter.h" -#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h" +#include "nnacl/depth_to_space_parameter.h" +#include "nnacl/quantization/quantize.h" void DepthToSpaceForNHWC(const int8_t *input, int8_t *output, int *in_shape, DepthToSpaceParameter *param, QuantArg *in_quant_arg, QuantArg *out_quant_arg); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/hswish_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/hswish_int8.cc index 3e048590c8..21d8909195 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/hswish_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/hswish_int8.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/hswish_int8.h" +#include "nnacl/int8/hswish_int8.h" int16_t SaturatingLeftShift(int16_t value, int shift_num) { int32_t result = (int32_t)value * (1 << shift_num); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/hswish_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/hswish_int8.h index 2d32aee083..62577f3ed4 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/hswish_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/hswish_int8.h @@ -17,11 +17,11 @@ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_HSWISH_INT8_H_ #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" -#include "src/runtime/kernel/arm/nnacl/quantization/fixed_point.h" +#include "nnacl/op_base.h" +#include "nnacl/errorcode.h" +#include "nnacl/quantization/fixed_point.h" -struct HswishQuantArg { +typedef struct HswishQuantArg { double input_scale; int32_t input_zp; double output_scale; @@ -30,7 +30,7 @@ struct HswishQuantArg { int32_t relu6_multiplier_exponent; int16_t output_multiplier_fixedpoint_int16; int32_t output_multiplier_exponent; -}; +} HswishQuantArg; int HSwishInt8(const int8_t *src, int length, int8_t *dst, HswishQuantArg *arg); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/matmul.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/matmul_int8.cc similarity index 94% rename from mindspore/lite/src/runtime/kernel/arm/nnacl/int8/matmul.cc rename to mindspore/lite/src/runtime/kernel/arm/nnacl/int8/matmul_int8.cc index 972dfd46c5..30185a750d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/matmul.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/matmul_int8.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/matmul.h" +#include "nnacl/int8/matmul_int8.h" #include -#include "src/runtime/kernel/arm/nnacl/quantization/fixed_point.h" +#include "nnacl/quantization/fixed_point.h" void RowMajor2Row8MajorInt8(int8_t *src_ptr, int8_t *dst_ptr, int row, int col) { for (int r = 0; r < row; r++) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/matmul.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/matmul_int8.h similarity index 92% rename from mindspore/lite/src/runtime/kernel/arm/nnacl/int8/matmul.h rename to mindspore/lite/src/runtime/kernel/arm/nnacl/int8/matmul_int8.h index 7e2cc43ca9..3e189d1472 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/matmul.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/matmul_int8.h @@ -17,8 +17,7 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_MATMUL_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_MATMUL_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/matmul.h" +#include "nnacl/op_base.h" void MatMulInt8(const int8_t *a, const int8_t *b, int32_t *c, const int row8, const int col8, const int deep, const int32_t a_zp, const int32_t b_zp); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/mul_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/mul_int8.cc index 774ce33176..98157e78ea 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/mul_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/mul_int8.cc @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/mul_int8.h" -#include "src/runtime/kernel/arm/nnacl/mul_parameter.h" +#include "nnacl/int8/mul_int8.h" +#include "nnacl/mul_parameter.h" #ifdef ENABLE_NEON #include -#include "src/runtime/kernel/arm/nnacl/add_int8.h" +#include "nnacl/add_int8.h" #endif -#include "src/runtime/kernel/arm/nnacl/quantization/fixed_point.h" +#include "nnacl/quantization/fixed_point.h" #ifdef ENABLE_NEON diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/mul_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/mul_int8.h index 000fa37b8e..1eb4f3e1f9 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/mul_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/mul_int8.h @@ -17,8 +17,8 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_MUL_INT8_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_MUL_INT8_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/mul_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/mul_parameter.h" void Mul(int8_t *input0_data, int8_t *input1_data, int8_t *output_data, int64_t real_dst_count, MulQuantArg para); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pad.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pad.cc index 55c6d93404..8a9b2858e6 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pad.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/pad.h" -#include "src/runtime/kernel/arm/nnacl/common_func.h" +#include "nnacl/int8/pad.h" +#include "nnacl/common_func.h" void PadConstant4D(const int8_t *in_data, int8_t *out_data, const int32_t *in_dims, const int32_t *out_dims, const int32_t *paddings) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pad.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pad.h index 336af7f852..a2ea97c499 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pad.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pad.h @@ -18,8 +18,8 @@ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_PAD_INT8_H_ #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/pad_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/pad_parameter.h" void PadConstant4D(const int8_t *in_data, int8_t *out_data, const int32_t *in_dims, const int32_t *out_dims, const int32_t *paddings); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pooling_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pooling_int8.cc index 854e7e7fc3..45245df425 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pooling_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pooling_int8.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/pooling_int8.h" -#include "src/runtime/kernel/arm/nnacl/common_func.h" +#include "nnacl/int8/pooling_int8.h" +#include "nnacl/common_func.h" void AvgPoolingInt8(const int8_t *input_ptr, int8_t *output_ptr, PoolingParameter *pooling_param, int task_id) { int stride_w = pooling_param->stride_w_; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pooling_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pooling_int8.h index 007b60f32d..f9a471fdf2 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pooling_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pooling_int8.h @@ -20,8 +20,8 @@ #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/fp32/pooling.h" +#include "nnacl/op_base.h" +#include "nnacl/fp32/pooling.h" void AvgPoolingInt8(const int8_t *input_ptr, int8_t *output_ptr, PoolingParameter *pooling_param, int task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/prelu_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/prelu_int8.cc index 496379ec37..5e91865cbd 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/prelu_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/prelu_int8.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/prelu_parameter.h" -#include "src/runtime/kernel/arm/nnacl/int8/prelu_int8.h" +#include "nnacl/prelu_parameter.h" +#include "nnacl/int8/prelu_int8.h" void prelu(int8_t *inputs, int8_t *output_ptr, PreluParameter *quant_prelu_parm, int task_id) { float output_scale = quant_prelu_parm->quant_arg.out_args_.scale_; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/prelu_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/prelu_int8.h index 187540c20d..947caf9a21 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/prelu_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/prelu_int8.h @@ -17,8 +17,8 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_INT8_PRELU_INT8_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_INT8_PRELU_INT8_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/prelu_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/prelu_parameter.h" void prelu(int8_t *inputs, int8_t *output_ptr, PreluParameter *quant_Prelu_parm, int task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/quant_dtype_cast.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/quant_dtype_cast.cc index 196ae8e51b..a0d17523df 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/quant_dtype_cast.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/quant_dtype_cast.cc @@ -14,8 +14,9 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/quant_dtype_cast.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include +#include "nnacl/int8/quant_dtype_cast.h" +#include "nnacl/errorcode.h" int DequantizeInt8(int8_t *quant_values, float *real_values, float scale, int32_t zp, int size) { if (quant_values == nullptr || real_values == nullptr) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/quant_dtype_cast.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/quant_dtype_cast.h index d11ae2c5f6..8d74a8a6d8 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/quant_dtype_cast.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/quant_dtype_cast.h @@ -17,13 +17,13 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_QUANTDTYPECAST_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_QUANTDTYPECAST_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct QuantDTypeCastParameter { +typedef struct QuantDTypeCastParameter { OpParameter op_parameter_; int32_t srcT; int32_t dstT; -}; +} QuantDTypeCastParameter; int DequantizeInt8(int8_t *quant_values, float *real_values, float scale, int32_t zp, int size); int QuantizeToInt8(float *real_values, int8_t *quant_values, float scale, int32_t zp, int size); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/relux_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/relux_int8.h index a1c3673150..c0eba9a5d8 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/relux_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/relux_int8.h @@ -17,11 +17,12 @@ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_RELU_INT8_H_ #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" -#include "src/runtime/kernel/arm/nnacl/quantization/fixed_point.h" +#include "nnacl/op_base.h" +#include "nnacl/errorcode.h" +#include "nnacl/quantization/fixed_point.h" +#include "nnacl/quantization/quantize.h" -struct ReluXQuantArg { +typedef struct ReluXQuantArg { QuantArg input_arg; QuantArg output_arg; int input_multiplier_; @@ -29,7 +30,7 @@ struct ReluXQuantArg { int right_shift_; int quantized_output_min; int quantized_output_max; -}; +} ReluXQuantArg; inline void ReluXInt8(const int8_t *src, int length, int8_t *dst, ReluXQuantArg *arg) { for (int i = 0; i < length; ++i) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/reshape_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/reshape_int8.cc index d02d4486a9..786cc048f9 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/reshape_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/reshape_int8.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/reshape_int8.h" -#include "src/runtime/kernel/arm/nnacl/reshape_parameter.h" +#include "nnacl/int8/reshape_int8.h" +#include "nnacl/reshape_parameter.h" #include void Reshape(int8_t *input_ptr, int8_t *output_ptr, int64_t real_dst_count, ReshapeQuantArg para) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/reshape_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/reshape_int8.h index 0ae26d9347..4f3bf77e3a 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/reshape_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/reshape_int8.h @@ -16,8 +16,8 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_RESHAHPE_INT8_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_RESHAHPE_INT8_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/reshape_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/reshape_parameter.h" void Reshape(int8_t *input_ptr, int8_t *output_ptr, int64_t real_dst_count, ReshapeQuantArg para); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/sigmoid_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/sigmoid_int8.cc index af0cf889bc..3729d2798d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/sigmoid_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/sigmoid_int8.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/sigmoid_int8.h" +#include "nnacl/int8/sigmoid_int8.h" int SigmoidInt8(const int8_t *src, int length, int8_t *dst, SigmoidQuantArg *arg) { for (int i = 0; i < length; i++) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/sigmoid_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/sigmoid_int8.h index 5be0108d3c..7e3d27ff54 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/sigmoid_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/sigmoid_int8.h @@ -17,11 +17,11 @@ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_INT8_Sigmoid_INT8_H_ #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" -#include "src/runtime/kernel/arm/nnacl/quantization/fixed_point.h" +#include "nnacl/op_base.h" +#include "nnacl/errorcode.h" +#include "nnacl/quantization/fixed_point.h" -struct SigmoidQuantArg { +typedef struct SigmoidQuantArg { double input_scale; int32_t input_zp; double output_scale; @@ -30,7 +30,7 @@ struct SigmoidQuantArg { int32_t relu6_multiplier_exponent; int16_t output_multiplier_fixedpoint_int16; int32_t output_multiplier_exponent; -}; +} SigmoidQuantArg; int SigmoidInt8(const int8_t *src, int length, int8_t *dst, SigmoidQuantArg *arg); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/softmax_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/softmax_int8.cc index 0428717522..e75a515c84 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/softmax_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/softmax_int8.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/softmax_int8.h" -#include +#include "nnacl/int8/softmax_int8.h" +#include int Softmax(const int8_t *input_ptr, int8_t *output_ptr, int count, float *exp_data, float *sum_data, SoftmaxQuantArg quant_param, SoftmaxParameter *parameter) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/softmax_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/softmax_int8.h index 546f9e940a..9a446c5b24 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/softmax_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/softmax_int8.h @@ -17,8 +17,9 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_SOFTMAX_INT8_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_SOFTMAX_INT8_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/softmax_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/softmax_parameter.h" +#include "nnacl/quantization/quantize.h" int Softmax(const int8_t *input_ptr, int8_t *output_ptr, int count, float *exp_data, float *sum_data, SoftmaxQuantArg quant_param, SoftmaxParameter *parameter); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/split_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/split_int8.cc index b4d6602124..bd77e0cd17 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/split_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/split_int8.cc @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/split_int8.h" -#include "src/runtime/kernel/arm/nnacl/split_parameter.h" +#include "nnacl/int8/split_int8.h" +#include "nnacl/split_parameter.h" #include -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/errorcode.h" int DoSplit(int8_t *in_data, int8_t **out_data, const int *input_shape, int offset, int num_unit, SplitParameter *param) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/split_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/split_int8.h index 2c269af394..e9809f5560 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/split_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/split_int8.h @@ -16,8 +16,8 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_SPLIT_INT8_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_SPLIT_INT8_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/split_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/split_parameter.h" int DoSplit(int8_t *in_data, int8_t **out_data, const int *input_shape, int offset, int num_unit, SplitParameter *split_param); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/squeeze_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/squeeze_int8.cc index 013f4fe89a..e0ac5885bf 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/squeeze_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/squeeze_int8.cc @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/squeeze_parameter.h" -#include "src/runtime/kernel/arm/nnacl/int8/squeeze_int8.h" +#include "nnacl/squeeze_parameter.h" +#include "nnacl/int8/squeeze_int8.h" #include void Squeeze(int8_t **inputs, int8_t *output_ptr, int task_id, SqueezeQuantArg *quant_Squeeze_parm, diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/squeeze_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/squeeze_int8.h index 6f9de3d515..bda2cbe90e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/squeeze_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/squeeze_int8.h @@ -17,10 +17,8 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_INT8_SQUEEZE_INT8_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_INT8_SQUEEZE_INT8_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/int8/squeeze_int8.h" -#include "src/runtime/kernel/arm/int8/squeeze_int8.h" - +#include "nnacl/quantization/quantize.h" +#include "nnacl/squeeze_parameter.h" void Squeeze(int8_t **inputs, int8_t *output_ptr, int task_id, SqueezeQuantArg *quant_Squeeze_parm, SqueezeParameter *para_, size_t osize); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/topk_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/topk_int8.cc index 3cb482177f..cd9f5a9a59 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/topk_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/topk_int8.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/int8/topk_int8.h" +#include "nnacl/int8/topk_int8.h" int DescendCmpInt8(const void *a, const void *b) { return ((const TopkNodeInt8 *)b)->element - ((const TopkNodeInt8 *)a)->element; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/topk_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/topk_int8.h index 5b7bbc554f..998a4ba645 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/topk_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/topk_int8.h @@ -17,13 +17,13 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_TOPK_INT8_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_INT8_TOPK_INT8_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/fp32/topk.h" +#include "nnacl/op_base.h" +#include "nnacl/fp32/topk.h" -struct TopkNodeInt8 { +typedef struct TopkNodeInt8 { int8_t element; int32_t index; -}; +} TopkNodeInt8; void TopkInt8(int8_t *input_data, int8_t *output_data, int32_t *output_index, TopkParameter *parameter); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/unsqueeze_int8.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/unsqueeze_int8.cc index f996ad4efb..657ed3aacc 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/unsqueeze_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/unsqueeze_int8.cc @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/unsqueeze_parameter.h" -#include "src/runtime/kernel/arm/nnacl/int8/unsqueeze_int8.h" +#include "nnacl/unsqueeze_parameter.h" +#include "nnacl/int8/unsqueeze_int8.h" #include -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/errorcode.h" int Unsqueeze(int8_t *input_ptr, int8_t *output_ptr, UnSqueezeParameter *para_, size_t data_size, int task_id) { float output_scale = para_->quant_arg.out_quant_args_.scale_; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/unsqueeze_int8.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/unsqueeze_int8.h index 18639ef369..e87d58a91d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/unsqueeze_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/int8/unsqueeze_int8.h @@ -17,8 +17,8 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_INT8_UNSQUEEZE_INT8_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_INT8_UNSQUEEZE_INT8_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/unsqueeze_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/unsqueeze_parameter.h" int Unsqueeze(int8_t *input_ptr, int8_t *output_ptr, UnSqueezeParameter *para_, size_t data_size, int task_id); #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_INT8_UNSQUEEZE_INT8_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/matmul.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/matmul_parameter.h similarity index 87% rename from mindspore/lite/src/runtime/kernel/arm/nnacl/matmul.h rename to mindspore/lite/src/runtime/kernel/arm/nnacl/matmul_parameter.h index 058f0371ab..4bed0f0e07 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/matmul.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/matmul_parameter.h @@ -17,11 +17,11 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_MATMUL_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_MATMUL_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -enum ActType { ActType_No, ActType_Relu, ActType_Relu6 }; +typedef enum ActType { ActType_No, ActType_Relu, ActType_Relu6 } ActType; -struct MatMulParameter { +typedef struct MatMulParameter { OpParameter op_parameter_; int row_; int col_; @@ -33,6 +33,6 @@ struct MatMulParameter { bool a_transpose_; /* false : row-major */ bool b_transpose_; /* true : col-major */ ActType act_type_; -}; +} MatMulParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_MATMUL_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/mul_parameter.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/mul_parameter.h index 8b70bd09ee..74c5065614 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/mul_parameter.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/mul_parameter.h @@ -17,12 +17,13 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_MUL_PARAMETER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_MUL_PARAMETER_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" +#include "nnacl/quantization/quantize.h" -struct MulParameter { +typedef struct MulParameter { OpParameter op_parameter_; int thread_count_; MulQuantArg mul_quant_arg_; -}; +} MulParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_MUL_PARAMETER_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/nnacl_utils.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/nnacl_utils.cc index 1607d5793d..6fb1abe472 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/nnacl_utils.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/nnacl_utils.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/nnacl_utils.h" +#include "nnacl/nnacl_utils.h" #ifdef __ANDROID__ #include #endif diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/op_base.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/op_base.h index dcf1e956e7..49b4d405bc 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/op_base.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/op_base.h @@ -17,8 +17,8 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_OP_BASE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_OP_BASE_H_ -#include -#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h" +#include +#include #define C4NUM 4 #define C8NUM 8 @@ -48,15 +48,15 @@ #define kInputSize1 2 #define kInputSize2 3 -enum LiteDataType { +typedef enum LiteDataType { kDataTypeFloat, kDataTypeInt8, -}; +} LiteDataType; -struct OpParameter { +typedef struct OpParameter { char name_[100]; int type_; int thread_num_; -}; +} OpParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_OP_BASE_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/optimized_kernel.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/optimized_kernel.h index d5bf245376..553fe71116 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/optimized_kernel.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/optimized_kernel.h @@ -20,7 +20,7 @@ #include #ifdef __ANDROID__ #include -#include "src/runtime/kernel/arm/nnacl/nnacl_utils.h" +#include "nnacl/nnacl_utils.h" #endif #define OPTIMIZE_SHARED_LIBRARY_PATH "liboptimize.so" diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/pack.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/pack.cc index 64dcbaaa4c..174ad2f4f2 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/pack.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/pack.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/pack.h" +#include "nnacl/pack.h" #include #include diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/pack.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/pack.h index 02ed4c6fba..3f4d4283ed 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/pack.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/pack.h @@ -20,8 +20,8 @@ #ifdef ENABLE_NEON #include #endif -#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/conv_parameter.h" +#include "nnacl/op_base.h" void Im2ColPackUnitFp32(const float *input_data, ConvParameter *conv_param, float *packed_input, int real_cal_num, int block_index); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/pad_parameter.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/pad_parameter.h index 230ca70aaf..ba108b66a2 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/pad_parameter.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/pad_parameter.h @@ -16,17 +16,18 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_PAD_PARAMETER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_PAD_PARAMETER_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" +#include "nnacl/quantization/quantize.h" #define MAX_PAD_SIZE 8 #define DEFAULT_PAD_NDIMS 4 -struct PadParameter { +typedef struct PadParameter { OpParameter op_parameter_; PadQuantArg pad_quant_arg_; int paddings_[MAX_PAD_SIZE] = {0}; int pad_mode_; float constant_value_; -}; +} PadParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_PAD_PARAMETER_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/power.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/power.cc index b1165f12c1..7b86129438 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/power.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/power.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/power.h" +#include "nnacl/power.h" bool CheckInteger(float f) { return floorf(f) == f; } diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/power.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/power.h index 61800b47dd..5dbb49c6fb 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/power.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/power.h @@ -17,14 +17,14 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_POWER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_POWER_H_ #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct PowerParameter { +typedef struct PowerParameter { OpParameter op_parameter_; float power_; float scale_; float shift_; -}; +} PowerParameter; void Power(const float *input, const float *exponent, float *output, int len, float scale, float shift, bool broadcast); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/prelu.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/prelu.cc index 6b454e94f9..cc04ba5411 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/prelu.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/prelu.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/prelu.h" +#include "nnacl/prelu.h" void PRelu(float *input, float *output, PReluParameter *prelu_param_, int task_id) { for (int i = task_id; i < prelu_param_->input_num_; i += prelu_param_->op_parameter_.thread_num_) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/prelu.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/prelu.h index 208274ee6b..1f14c83aa8 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/prelu.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/prelu.h @@ -16,14 +16,14 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_PRELU_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_PRELU_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct PReluParameter { +typedef struct PReluParameter { OpParameter op_parameter_; float *negtive_slope_; int input_num_; int thread_num_; -}; +} PReluParameter; void PRelu(float *input, float *output, PReluParameter *prelu_param_, int task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/prelu_parameter.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/prelu_parameter.h index b7db1db949..7f8be0d563 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/prelu_parameter.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/prelu_parameter.h @@ -17,10 +17,12 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_PRELU_PARAMETER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_PRELU_PARAMETER_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" +#include "nnacl/quantization/quantize.h" + #define PRELU_OFFSET_MAX_SIZE 4 -struct PreluParameter { +typedef struct PreluParameter { OpParameter op_parameter_; PreluQuantArg quant_arg; double alpha_; @@ -32,6 +34,6 @@ struct PreluParameter { const int *out_shape_; int input_dim_; int element_num; -}; +} PreluParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_PRELU_PARAMETER_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/prior_box.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/prior_box.cc index e149ed90ca..7fd1c0bdef 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/prior_box.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/prior_box.cc @@ -15,8 +15,8 @@ */ #include -#include "src/runtime/kernel/arm/nnacl/errorcode.h" -#include "src/runtime/kernel/arm/nnacl/prior_box.h" +#include "nnacl/errorcode.h" +#include "nnacl/prior_box.h" int PriorBox(const float *input_data, float *output_data, const size_t size, const int tid, const int thread_num) { size_t unit_size = size / thread_num; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/prior_box.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/prior_box.h index fd0ea64e28..557934d3e1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/prior_box.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/prior_box.h @@ -20,10 +20,10 @@ #include #endif #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" #define PRIOR_BOX_MAX_NUM 8 #define PRIOR_BOX_VAR_NUM 4 -struct PriorBoxParameter { +typedef struct PriorBoxParameter { OpParameter op_parameter_; int32_t min_sizes_size; int32_t min_sizes[PRIOR_BOX_MAX_NUM]; @@ -39,7 +39,7 @@ struct PriorBoxParameter { bool clip; bool flip; float offset; -}; +} PriorBoxParameter; int PriorBox(const float *input_data, float *output_data, const size_t size, const int tid, const int thread_num); #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_PRIOR_BOX_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/quantization/quantize.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/quantization/quantize.cc index aee93ed738..502be9e530 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/quantization/quantize.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/quantization/quantize.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h" +#include "nnacl/quantization/quantize.h" const uint64_t dSignMask = 1ull << 63; const uint64_t dExponentMask = 0x7ffull << 52; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/quantization/quantize.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/quantization/quantize.h index cf9eb90745..de43a3c88b 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/quantization/quantize.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/quantization/quantize.h @@ -22,14 +22,14 @@ #include #include #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct QuantArg { +typedef struct QuantArg { double scale_; int32_t zp_; -}; +} QuantArg; -struct ConvQuantArg { +typedef struct ConvQuantArg { QuantArg **quant_args_; double *real_multiplier_; int32_t *left_shift_; @@ -37,43 +37,42 @@ struct ConvQuantArg { int32_t *quant_multiplier_; int32_t *out_act_min_; int32_t *out_act_max_; -}; +} ConvQuantArg; -struct ConcatQuantArg { +typedef struct ConcatQuantArg { QuantArg *in_args_; QuantArg out_args_; int output_activation_min_; int output_activation_max_; -}; +} ConcatQuantArg; -struct SqueezeQuantArg { - int *input_sizes_; - int output_size_; - int **input_shapes_; - int *output_shape_; - float alpha; - int axis_; - size_t input_num_; - size_t output_dim_; - QuantArg *in_quant_args_; - QuantArg out_quant_args_; -}; - -struct UnSqueezeQuantArg { - int *input_sizes_; - int output_size_; - int **input_shapes_; - int *output_shape_; - float alpha; - int axis_; - size_t input_num_; - size_t output_dim_; - QuantArg in_quant_args_; - QuantArg out_quant_args_; -}; +typedef struct SqueezeQuantArg { + int *input_sizes_; + int output_size_; + int **input_shapes_; + int *output_shape_; + float alpha; + int axis_; + size_t input_num_; + size_t output_dim_; + QuantArg *in_quant_args_; + QuantArg out_quant_args_; +} SqueezeQuantArg; +typedef struct UnSqueezeQuantArg { + int *input_sizes_; + int output_size_; + int **input_shapes_; + int *output_shape_; + float alpha; + int axis_; + size_t input_num_; + size_t output_dim_; + QuantArg in_quant_args_; + QuantArg out_quant_args_; +} UnSqueezeQuantArg; -struct PreluQuantArg { +typedef struct PreluQuantArg { int *input_sizes_; int output_size_; int **input_shapes_; @@ -87,9 +86,9 @@ struct PreluQuantArg { int output_activation_max_; QuantArg *in_quant_args_; QuantArg out_quant_args_; -}; +} PreluQuantArg; -/*struct SigmoidQuantArg { +/*typedef struct SigmoidQuantArg { int *input_sizes_; int output_size_; int **input_shapes_; @@ -103,9 +102,9 @@ struct PreluQuantArg { int output_activation_max_; QuantArg *in_quant_args_; QuantArg out_quant_args_; -};*/ +} SigmoidQuantArg;*/ -struct MatmulQuantArg { +typedef struct MatmulQuantArg { QuantArg input; QuantArg weight; QuantArg output; @@ -114,15 +113,15 @@ struct MatmulQuantArg { int32_t left_shift; int32_t right_shift; int32_t quant_multiplier; -}; +} MatmulQuantArg; -struct PadQuantArg { +typedef struct PadQuantArg { QuantArg *in_quant_args_ = nullptr; QuantArg *out_quanr_args_ = nullptr; int8_t *constant_value_ = nullptr; -}; +} PadQuantArg; -struct MulQuantArg { +typedef struct MulQuantArg { QuantArg in_quant_args_[2]; QuantArg out_quant_arg_; int output_multiplier_; @@ -130,16 +129,16 @@ struct MulQuantArg { int output_activation_max_; int shift_left_; int shift_right_; -}; +} MulQuantArg; -struct CropQuantArg { +typedef struct CropQuantArg { QuantArg in_args_; QuantArg out_args_; int output_activation_min_; int output_activation_max_; -}; +} CropQuantArg; -struct ArithSelfQuantArg { +typedef struct ArithSelfQuantArg { QuantArg in_args_; QuantArg out_args_; int output_activation_min_; @@ -147,26 +146,26 @@ struct ArithSelfQuantArg { int output_multiplier_; int shift_left_; int shift_right_; -}; +} ArithSelfQuantArg; -struct SplitQuantArg { +typedef struct SplitQuantArg { QuantArg in_args_; QuantArg out_args_[20]; int output_activation_min_; int output_activation_max_; -}; +} SplitQuantArg; -struct SoftmaxQuantArg { +typedef struct SoftmaxQuantArg { QuantArg in_quant_args_; QuantArg out_quant_arg_; -}; +} SoftmaxQuantArg; -struct ReshapeQuantArg { +typedef struct ReshapeQuantArg { QuantArg in_args_; QuantArg out_args_; int output_activation_min_; int output_activation_max_; -}; +} ReshapeQuantArg; void QuantizeMultiplier(double double_multiplier, int32_t *quantized_multiplier, int *shift); @@ -200,8 +199,8 @@ inline int32_t QuantizeToInt8(float real_value, float scale, int32_t zp) { retur inline void CalculateActivationRangeQuantized(bool is_relu, bool is_relu6, int32_t zp, float scale, int *mini, int *maxi) { - int32_t min = std::numeric_limits::min(); - int32_t max = std::numeric_limits::max(); + int32_t min = CHAR_MIN; + int32_t max = CHAR_MAX; int32_t quantized_zero = QuantizeToInt8(0, scale, zp); int32_t quantized_six = QuantizeToInt8(6, scale, zp); if (is_relu) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/reshape.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/reshape.cc index 5505c8b0f9..a44dbd4718 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/reshape.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/reshape.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/reshape.h" +#include "nnacl/reshape.h" #include void Reshape(void *input_ptr, void *output_ptr, size_t data_size) { memcpy(output_ptr, input_ptr, data_size); } diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/reshape.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/reshape.h index a992a46ba0..9c2ed360fa 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/reshape.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/reshape.h @@ -16,7 +16,7 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_RESHAHPE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_RESHAHPE_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" void Reshape(void *input_ptr, void *output_ptr, size_t data_size); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/reshape_parameter.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/reshape_parameter.h index c9de4c342d..2f6da2267d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/reshape_parameter.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/reshape_parameter.h @@ -17,13 +17,14 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_RESHAHPE_PARAMETER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_RESHAHPE_PARAMETER_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" +#include "nnacl/quantization/quantize.h" -struct ReshapeParameter { +typedef struct ReshapeParameter { OpParameter op_parameter_; ReshapeQuantArg quant_para_; int thread_count_; -}; +} ReshapeParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_RESHAHPE_PARAMETER_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/resize.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/resize.cc index 48567ce01b..903f149d79 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/resize.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/resize.cc @@ -14,8 +14,8 @@ * limitations under the License. */ #include -#include "src/runtime/kernel/arm/nnacl/resize.h" -#include "src/runtime/kernel/arm/nnacl/common_func.h" +#include "nnacl/resize.h" +#include "nnacl/common_func.h" int ResizeBilinear(const float *input_data, float *output_data, const int *input_shape, const int *output_shape, bool align_corners, int tid, int thread_num) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/resize.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/resize.h index e7fd4a6876..a018001914 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/resize.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/resize.h @@ -20,20 +20,20 @@ #include #endif #include -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" #include "schema/ops_generated.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/errorcode.h" using mindspore::schema::ResizeMethod; -struct ResizeParameter { +typedef struct ResizeParameter { OpParameter op_parameter_; ResizeMethod method_; int64_t new_height_; int64_t new_width_; bool align_corners_; bool preserve_aspect_ratio_; -}; +} ResizeParameter; int ResizeBilinear(const float *input_data, float *output_data, const int *input_shape, const int *output_shape, bool align_corners, int tid, int thread_num); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/reverse_sequence.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/reverse_sequence.cc index 7308716fbb..66711c6430 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/reverse_sequence.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/reverse_sequence.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/reverse_sequence.h" +#include "nnacl/reverse_sequence.h" #include -#include "src/runtime/kernel/arm/nnacl/arithmetic_common.h" +#include "nnacl/arithmetic_common.h" void ReverseSequence(float *input0, int *input1, float *output, ReverseSequenceParameter *para) { (void)memcpy(output, input0, para->total_data_size_); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/reverse_sequence.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/reverse_sequence.h index 582bcd35eb..11dd1c4d7e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/reverse_sequence.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/reverse_sequence.h @@ -17,9 +17,9 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_REVERSE_SEQUENCE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_REVERSE_SEQUENCE_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct ReverseSequenceParameter { +typedef struct ReverseSequenceParameter { OpParameter op_parameter_; int ndim_; int input_shape0_[5]; @@ -34,7 +34,7 @@ struct ReverseSequenceParameter { int inner_stride_; int copy_byte_size_; int total_data_size_; -}; +} ReverseSequenceParameter; void ReverseSequence(float *input0, int *input1, float *output, ReverseSequenceParameter *para); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/scale.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/scale.cc index 37405b67c1..1c39f03e2a 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/scale.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/scale.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/scale.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/scale.h" +#include "nnacl/errorcode.h" int DoScale(float *in_data, float *out_data, float *scale, float *offset, int task_id, ScaleParameter *scale_param) { if (in_data == nullptr || out_data == nullptr || scale == nullptr || offset == nullptr || scale_param == nullptr) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/scale.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/scale.h index aaa77b7dda..0b1b733f5f 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/scale.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/scale.h @@ -17,9 +17,9 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SCALE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SCALE_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct ScaleParameter { +typedef struct ScaleParameter { OpParameter op_parameter_; int outer_size_; int axis_size_; @@ -27,7 +27,7 @@ struct ScaleParameter { int axis_; bool has_offset_; // todo yangruoqi: axis -}; +} ScaleParameter; int DoScale(float *in_data, float *out_data, float *scale, float *offset, int task_id, ScaleParameter *scale_param); #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SCALE_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/scatter_nd.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/scatter_nd.cc index 0194e928af..f3c6f21de2 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/scatter_nd.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/scatter_nd.cc @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/scatter_nd.h" +#include "nnacl/scatter_nd.h" #include #include -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/errorcode.h" int DoScatterND(float *output_ptr, float *update, int *output_unit_offsets, int unit_size, int num_units) { if (output_ptr == nullptr || update == nullptr || output_unit_offsets == nullptr || unit_size <= 0 || num_units < 0) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/scatter_nd.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/scatter_nd.h index adbe179bed..e93453dba4 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/scatter_nd.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/scatter_nd.h @@ -17,11 +17,11 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SCATTER_ND_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SCATTER_ND_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct ScatterNDParameter { +typedef struct ScatterNDParameter { OpParameter op_parameter_; -}; +} ScatterNDParameter; int DoScatterND(float *output_ptr, float *update, int *output_unit_offsets, int unit_size, int num_units); #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SCATTER_ND_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/shape.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/shape.h index bfcbc4f8dc..d4dedc39db 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/shape.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/shape.h @@ -17,11 +17,11 @@ #ifndef MINDSPORE_CCSRC_KERNEL_CPU_ARM_NNACL_SHAPE_H_ #define MINDSPORE_CCSRC_KERNEL_CPU_ARM_NNACL_SHAPE_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct ShapeParameter { +typedef struct ShapeParameter { OpParameter op_parameter_; -}; +} ShapeParameter; #endif // MINDSPORE_CCSRC_KERNEL_CPU_ARM_NNACL_SHAPE_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/sigmoid_parameter.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/sigmoid_parameter.h index dc51784bfb..0b29da145e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/sigmoid_parameter.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/sigmoid_parameter.h @@ -17,10 +17,10 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_SIGMOID_PARAMETER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_SIGMOID_PARAMETER_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" #define SIGMOID_OFFSET_MAX_SIZE 4 -struct SigmoidParameter { +typedef struct SigmoidParameter { OpParameter op_parameter_; SigmoidQuantArg quant_arg; double alpha_; @@ -32,6 +32,6 @@ struct SigmoidParameter { const int *out_shape_; int input_dim_; int element_num; -}; +} SigmoidParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_SIGMOID_PARAMETER_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/softmax_parameter.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/softmax_parameter.h index b0fc83ce3e..b8f545444a 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/softmax_parameter.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/softmax_parameter.h @@ -17,14 +17,14 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SOFTMAX_PARAMETER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SOFTMAX_PARAMETER_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct SoftmaxParameter { +typedef struct SoftmaxParameter { OpParameter op_parameter_; int32_t axis_; int element_size_; int n_dim_; int input_shape_[4]; -}; +} SoftmaxParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SOFTMAX_PARAMETER_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/sparse_to_dense.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/sparse_to_dense.cc index 17b80564b3..542f73c8a4 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/sparse_to_dense.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/sparse_to_dense.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/sparse_to_dense.h" +#include "nnacl/sparse_to_dense.h" void SparseToDense(int *input, int *output_shape_, float *snum, float *dnum, int sp_num, float *output, SparseToDenseParameter *s2d_param_, int task_id) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/sparse_to_dense.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/sparse_to_dense.h index 3f048dd817..a1cc395ee5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/sparse_to_dense.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/sparse_to_dense.h @@ -16,13 +16,13 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SPARSETODENSE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SPARSETODENSE_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct SparseToDenseParameter { +typedef struct SparseToDenseParameter { OpParameter op_parameter_; int thread_num_; int count_ = 0; -}; +} SparseToDenseParameter; void SparseToDense(int *input, int *output_shape_, float *snum, float *dnum, int sp_num, float *output, SparseToDenseParameter *s2d_param_, int task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/split.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/split.cc index 712abebe19..d7aa29d22a 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/split.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/split.cc @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/split.h" -#include "src/runtime/kernel/arm/nnacl/split_parameter.h" +#include "nnacl/split.h" +#include "nnacl/split_parameter.h" #include -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/errorcode.h" int DoSplit(float *in_data, float **out_data, const int *input_shape, int offset, int num_unit, SplitParameter *split_param) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/split.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/split.h index ff861ff4ca..24c81875d1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/split.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/split.h @@ -17,8 +17,8 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SPLIT_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SPLIT_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" -#include "src/runtime/kernel/arm/nnacl/split_parameter.h" +#include "nnacl/op_base.h" +#include "nnacl/split_parameter.h" int DoSplit(float *in_data, float **out_data, const int *input_shape, int offset, int num_unit, SplitParameter *split_param); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/split_parameter.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/split_parameter.h index 30456df654..67864698b2 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/split_parameter.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/split_parameter.h @@ -17,9 +17,10 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SPLIT_PARAMETER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SPLIT_PARAMETER_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" +#include "nnacl/quantization/quantize.h" -struct SplitParameter { +typedef struct SplitParameter { OpParameter op_parameter_; SplitQuantArg quant_arg_; int num_split_; @@ -28,6 +29,6 @@ struct SplitParameter { int split_dim_; int n_dims_; int split_count_; -}; +} SplitParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SPLIT_PARAMETER_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/squeeze.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/squeeze.cc index 43e7ffad7c..c2a7554ddf 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/squeeze.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/squeeze.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/squeeze.h" +#include "nnacl/squeeze.h" #include int DoSqueeze(float *in_data, float *out_data, size_t data_size) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/squeeze.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/squeeze.h index 5da0637e8a..28367138dc 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/squeeze.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/squeeze.h @@ -17,12 +17,12 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SQUEEZE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_SQUEEZE_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct SqueezeParameter { +typedef struct SqueezeParameter { OpParameter op_parameter_; int axes_[8]; -}; +} SqueezeParameter; int DoSqueeze(float *input_ptr, float *output_ptr, size_t data_size); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/squeeze_parameter.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/squeeze_parameter.h index cb8eb0b248..b25922fa3d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/squeeze_parameter.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/squeeze_parameter.h @@ -16,11 +16,12 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_SQUEEZE_PARAMETER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_SQUEEZE_PARAMETER_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" +#include "nnacl/quantization/quantize.h" #define SQUEEZE_OFFSET_MAX_SIZE 4 -struct SqueezeParameter { +typedef struct SqueezeParameter { OpParameter op_parameter_; SqueezeQuantArg quant_arg; int thread_count_; @@ -32,6 +33,6 @@ struct SqueezeParameter { const int *in_shape_; const int *out_shape_; int input_dim_; -}; +} SqueezeParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_SQUEEZE_PARAMETER_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/strassen_matmul.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/strassen_matmul.h index c385d3b45f..32b7067e55 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/strassen_matmul.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/strassen_matmul.h @@ -17,18 +17,17 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_STRASSEN_MATMUL_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_STRASSEN_MATMUL_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" /* hw*inc4 X inc4*oc4 */ -struct StrassenMatMulParameter { +typedef struct StrassenMatMulParameter { OpParameter op_parameter; - int row_{}; /* h * w */ - int col_{}; /* oc4 / 4 */ - int deep_{}; /* inc4 / 4 */ - int a_stride_{}; /* h * w * 4 */ - int b_stride_{}; /* inc4 * 4 */ - int c_stride_{}; /* h * w * 4 */ -}; + int row_; /* h * w */ + int col_; /* oc4 / 4 */ + int deep_; /* inc4 / 4 */ + int a_stride_; /* h * w * 4 */ + int b_stride_; /* inc4 * 4 */ + int c_stride_; /* h * w * 4 */ +} StrassenMatMulParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_STRASSEN_MATMUL_H_ - diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/strided_slice.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/strided_slice.cc index 0c14eb2f71..699203316d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/strided_slice.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/strided_slice.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/strided_slice.h" -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/strided_slice.h" +#include "nnacl/errorcode.h" void PadStridedSliceParameterTo4D(StridedSliceParameter *param) { int32_t begins[DIMENSION_4D]; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/strided_slice.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/strided_slice.h index 0e9bcac593..5b60c2d267 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/strided_slice.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/strided_slice.h @@ -16,9 +16,9 @@ #ifndef MINDSPORE_LITE_SRC_BACKEND_ARM_NNACL_STRIDED_SLICE_H_ #define MINDSPORE_LITE_SRC_BACKEND_ARM_NNACL_STRIDED_SLICE_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct StridedSliceParameter { +typedef struct StridedSliceParameter { OpParameter op_parameter_; int begins_[8] = {0}; int ends_[8] = {0}; @@ -27,7 +27,7 @@ struct StridedSliceParameter { int num_axes_; int in_shape_[8]; LiteDataType data_type; -}; +} StridedSliceParameter; int DoStridedSlice(const void *inputs, void *output, StridedSliceParameter *param); #endif // MINDSPORE_LITE_SRC_BACKEND_ARM_NNACL_STRIDED_SLICE_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/tile.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/tile.cc index 747a4a51f7..942afde518 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/tile.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/tile.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/tile.h" +#include "nnacl/tile.h" #include void CopyData(float *input_data, float *output_data, size_t size, size_t multiple) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/tile.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/tile.h index da6d09602e..77b8c20bf4 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/tile.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/tile.h @@ -17,9 +17,9 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_TILE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_TILE_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct TileParameter { +typedef struct TileParameter { OpParameter op_parameter_; int in_dim_; int in_shape_[5]; @@ -27,7 +27,7 @@ struct TileParameter { int multiples_[5]; int in_strides_[5]; int out_strides_[5]; -}; +} TileParameter; void Tile(float *input_data, float *output_data, TileParameter *parameter); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/transpose.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/transpose.cc index 0e1b75db9a..c8f860812a 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/transpose.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/transpose.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/transpose.h" +#include "nnacl/transpose.h" #include -#include "src/runtime/kernel/arm/nnacl/errorcode.h" +#include "nnacl/errorcode.h" void TransposeDim2(float *in_data, float *out_data, int *strides, int *out_strides, int *perm, int *output_shape) { const int stride0 = strides[perm[0]]; diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/transpose.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/transpose.h index 80e19b8ae8..9220bfbd7e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/transpose.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/transpose.h @@ -17,9 +17,9 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_TRANSPOSE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_TRANSPOSE_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct TransposeParameter { +typedef struct TransposeParameter { OpParameter op_parameter_; int perm_[8]; bool conjugate_; @@ -27,7 +27,7 @@ struct TransposeParameter { int strides_[8]; int out_strides_[8]; int data_size_; -}; +} TransposeParameter; int DoTranspose(float *in_data, float *out_data, int *input_shape, int *output_shape, TransposeParameter *transpose_param); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/unique.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/unique.cc index 9db29931ae..6f6642c9e3 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/unique.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/unique.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/unique.h" +#include "nnacl/unique.h" int Find(float *array, int len, float target) { for (int i = 0; i < len; ++i) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/unique.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/unique.h index dce4b59319..23317e3708 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/unique.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/unique.h @@ -17,11 +17,11 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_UNIQUE_H #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_UNIQUE_H -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct UniqueParameter { +typedef struct UniqueParameter { OpParameter op_parameter_; -}; +} UniqueParameter; void Unique(float *input, int input_len, float *output0, int *output0_len, int *output1); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/unsqueeze_parameter.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/unsqueeze_parameter.h index 1a1e64a395..c1b6c1725c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/unsqueeze_parameter.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/unsqueeze_parameter.h @@ -16,11 +16,12 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_UNSQUEEZE_PARAMETER_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_UNSQUEEZE_PARAMETER_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" +#include "nnacl/quantization/quantize.h" #define UNSQUEEZE_OFFSET_MAX_SIZE 4 -struct UnSqueezeParameter { +typedef struct UnSqueezeParameter { OpParameter op_parameter_; UnSqueezeQuantArg quant_arg; int thread_count_; @@ -32,6 +33,6 @@ struct UnSqueezeParameter { const int *in_shape_; const int *out_shape_; int input_dim_; -}; +} UnSqueezeParameter; #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPCLIB_SQUEEZE_PARAMETER_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/unstack.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/unstack.cc index 5a7fd07b91..216ca888f6 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/unstack.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/unstack.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/unstack.h" +#include "nnacl/unstack.h" #include void Unistack(float *input, float **output, UnstackParameter *para) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/unstack.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/unstack.h index ee57a810af..b7d60141d5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/unstack.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/unstack.h @@ -17,16 +17,16 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_UNSTACK_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_UNSTACK_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct UnstackParameter { +typedef struct UnstackParameter { OpParameter op_parameter_; int num_; int axis_; int pre_dims_; int axis_dim_; int after_dims_; -}; +} UnstackParameter; void Unistack(float *input, float **output, UnstackParameter *para); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/where.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/where.cc index 40a4802ab6..5971a68801 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/where.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/where.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/where.h" +#include "nnacl/where.h" void Where(bool *input, float *input1, float *input2, float *output, WhereParameter *where_param_, int task_id) { for (int i = task_id; i < where_param_->number_; i += where_param_->op_parameter_.thread_num_) { diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/where.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/where.h index 73145fd9ec..600daa6fa0 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/where.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/where.h @@ -16,16 +16,16 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_WHERE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_WHERE_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" -struct WhereParameter { +typedef struct WhereParameter { OpParameter op_parameter_; int num_; int num1_; int num2_; int number_; int thread_num_; -}; +} WhereParameter; void Where(bool *input, float *input1, float *input2, float *output, WhereParameter *where_param_, int task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_transform.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_transform.cc index 23b40f6639..148fde8517 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_transform.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_transform.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/winograd_transform.h" +#include "nnacl/winograd_transform.h" // fp32 conv winograd void WinogradInputTransform(const float *input_data, float *trans_input, float *tmp_data, int cal_num, diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_transform.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_transform.h index e31e2e1930..75827cf42a 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_transform.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_transform.h @@ -21,10 +21,10 @@ #include #endif #include -#include "src/runtime/kernel/arm/nnacl/pack.h" -#include "src/runtime/kernel/arm/nnacl/fp32/conv.h" -#include "src/runtime/kernel/arm/nnacl/winograd_utils.h" -#include "src/runtime/kernel/arm/nnacl/quantization/fixed_point.h" +#include "nnacl/pack.h" +#include "nnacl/fp32/conv.h" +#include "nnacl/winograd_utils.h" +#include "nnacl/quantization/fixed_point.h" #define OUPUT_UNIT 2 diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_utils.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_utils.cc index 3ee722d4ec..fcc3f3ee37 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_utils.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_utils.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/winograd_utils.h" +#include "nnacl/winograd_utils.h" #include #define MIN_UNIT 2 diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_utils.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_utils.h index 67bc39becd..d651b644e5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_utils.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_utils.h @@ -20,9 +20,9 @@ #ifdef ENABLE_ARM #include #endif -#include "src/runtime/kernel/arm/nnacl/matrix_table.h" -#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/matrix_table.h" +#include "nnacl/conv_parameter.h" +#include "nnacl/op_base.h" using InputTransformUnitFunc = void (*)(const float *src_data, float *dst_data, int src_step, int dst_step); using OutputTransformUnitFunc = void (*)(const float *src_data, float *dst_data, const float *bias_data, int src_step, diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/zeroslike.cc b/mindspore/lite/src/runtime/kernel/arm/nnacl/zeroslike.cc index 697d77e6ee..8f56ae532c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/zeroslike.cc +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/zeroslike.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "src/runtime/kernel/arm/nnacl/zeroslike.h" +#include "nnacl/zeroslike.h" #include #include diff --git a/mindspore/lite/src/runtime/kernel/arm/nnacl/zeroslike.h b/mindspore/lite/src/runtime/kernel/arm/nnacl/zeroslike.h index 8948ad39fa..054fe4f26f 100644 --- a/mindspore/lite/src/runtime/kernel/arm/nnacl/zeroslike.h +++ b/mindspore/lite/src/runtime/kernel/arm/nnacl/zeroslike.h @@ -16,7 +16,7 @@ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ZEROSLIKE_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ZEROSLIKE_H_ -#include "src/runtime/kernel/arm/nnacl/op_base.h" +#include "nnacl/op_base.h" void ApproximateZerosLike(float *input, float *output, int number); 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 9c8901b845..3d57b070c3 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 @@ -20,7 +20,7 @@ #include "common/common_test.h" #include "src/common/file_utils.h" #include "src/runtime/kernel/arm/fp32/convolution_1x1.h" -#include "src/runtime/kernel/arm/nnacl/matmul.h" +#include "src/runtime/kernel/arm/nnacl/matmul_parameter.h" #include "src/runtime/kernel/arm/nnacl/strassen_matmul.h" namespace mindspore {