提交 5405aa5b 编写于 作者: Z zhanyuan

Remove NNACL's c++ features

上级 33784fef
...@@ -13,6 +13,7 @@ include_directories(${TOP_DIR}) ...@@ -13,6 +13,7 @@ include_directories(${TOP_DIR})
include_directories(${CORE_DIR}) include_directories(${CORE_DIR})
include_directories(${CCSRC_DIR}) include_directories(${CCSRC_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_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)
include_directories(${TOP_DIR}/third_party/flatbuffers/include) include_directories(${TOP_DIR}/third_party/flatbuffers/include)
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "src/runtime/kernel/arm/nnacl/depth_to_space.h" #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/conv_parameter.h"
#include "src/runtime/kernel/arm/nnacl/fp32/pooling.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/softmax_parameter.h"
#include "src/runtime/kernel/arm/nnacl/tile.h" #include "src/runtime/kernel/arm/nnacl/tile.h"
#include "src/runtime/kernel/arm/nnacl/fp32/topk.h" #include "src/runtime/kernel/arm/nnacl/fp32/topk.h"
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <vector> #include <vector>
#include "src/lite_kernel.h" #include "src/lite_kernel.h"
#include "include/context.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; using mindspore::lite::Context;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <vector> #include <vector>
#include "src/lite_kernel.h" #include "src/lite_kernel.h"
#include "include/context.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; using mindspore::lite::Context;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "src/runtime/kernel/arm/base/layout_transform.h" #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/conv.h"
#include "src/runtime/kernel/arm/nnacl/fp32/common_func.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" #include "src/runtime/kernel/arm/nnacl/fp32/matmul.h"
namespace mindspore::kernel { namespace mindspore::kernel {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <vector> #include <vector>
#include "src/lite_kernel.h" #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" #include "src/runtime/kernel/arm/base/matmul_base.h"
namespace mindspore::kernel { namespace mindspore::kernel {
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <limits> #include <limits>
#include <algorithm> #include <algorithm>
#include "src/runtime/kernel/arm/nnacl/arithmetic_common.h" #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/runtime/runtime_api.h"
#include "src/kernel_registry.h" #include "src/kernel_registry.h"
#include "include/errorcode.h" #include "include/errorcode.h"
......
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
#include "schema/model_generated.h" #include "schema/model_generated.h"
#include "src/kernel_registry.h" #include "src/kernel_registry.h"
#include "include/errorcode.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/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/layout_transform.h"
#include "src/runtime/kernel/arm/base/convolution_base.h" #include "src/runtime/kernel/arm/base/convolution_base.h"
#include "src/runtime/kernel/arm/nnacl/arithmetic_common.h" #include "src/runtime/kernel/arm/nnacl/arithmetic_common.h"
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <vector> #include <vector>
#include "src/runtime/kernel/arm/base/depth_to_space_base.h" #include "src/runtime/kernel/arm/base/depth_to_space_base.h"
#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h"
namespace mindspore::kernel { namespace mindspore::kernel {
class DepthToSpaceInt8CPUKernel : public DepthToSpaceBaseCPUKernel { class DepthToSpaceInt8CPUKernel : public DepthToSpaceBaseCPUKernel {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
#include "src/runtime/kernel/arm/int8/fullconnection_int8.h" #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/kernel/arm/nnacl/common_func.h"
#include "src/runtime/runtime_api.h" #include "src/runtime/runtime_api.h"
#include "include/errorcode.h" #include "include/errorcode.h"
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <vector> #include <vector>
#include "src/lite_kernel.h" #include "src/lite_kernel.h"
#include "src/runtime/kernel/arm/nnacl/int8/hswish_int8.h" #include "src/runtime/kernel/arm/nnacl/int8/hswish_int8.h"
#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h"
namespace mindspore::kernel { namespace mindspore::kernel {
class HswishInt8CPUKernel : public LiteKernel { class HswishInt8CPUKernel : public LiteKernel {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
#include "src/runtime/kernel/arm/int8/matmul_int8.h" #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/kernel/arm/nnacl/common_func.h"
#include "src/runtime/runtime_api.h" #include "src/runtime/runtime_api.h"
#include "include/errorcode.h" #include "include/errorcode.h"
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "src/runtime/kernel/arm/int8/sigmoid_int8.h" #include "src/runtime/kernel/arm/int8/sigmoid_int8.h"
#include <limits> #include <limits>
#include "src/runtime/kernel/arm/nnacl/int8/sigmoid_int8.h" #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 "schema/model_generated.h"
#include "src/kernel_registry.h" #include "src/kernel_registry.h"
#include "src/runtime/runtime_api.h" #include "src/runtime/runtime_api.h"
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <vector> #include <vector>
#include "src/runtime/kernel/arm/base/softmax_base.h" #include "src/runtime/kernel/arm/base/softmax_base.h"
#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h"
namespace mindspore::kernel { namespace mindspore::kernel {
class SoftmaxInt8CPUKernel : public SoftmaxBaseCPUKernel { class SoftmaxInt8CPUKernel : public SoftmaxBaseCPUKernel {
......
...@@ -17,15 +17,15 @@ ...@@ -17,15 +17,15 @@
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ACTIVATION_GRAD_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ACTIVATION_GRAD_H_
#include <math.h> #include <math.h>
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/fp32/arithmetic.h" #include "nnacl/fp32/arithmetic.h"
#include "src/runtime/kernel/arm/nnacl/errorcode.h" #include "nnacl/errorcode.h"
struct ActivationGradParameter { typedef struct ActivationGradParameter {
OpParameter op_parameter{}; OpParameter op_parameter{};
int type_; int type_;
float alpha_{0.01}; float alpha_{0.01};
}; } ActivationGradParameter;
inline int ReluGrad(float *src0, float *src1, int length, float *dst) { inline int ReluGrad(float *src0, float *src1, int length, float *dst) {
for (int i = 0; i < length; ++i) { for (int i = 0; i < length; ++i) {
......
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/add_int8.h" #include "nnacl/add_int8.h"
#ifdef ENABLE_NEON #ifdef ENABLE_NEON
#include <arm_neon.h> #include <arm_neon.h>
#endif #endif
#include "src/runtime/kernel/arm/nnacl/quantization/fixed_point.h" #include "nnacl/quantization/fixed_point.h"
#ifdef ENABLE_NEON #ifdef ENABLE_NEON
int16x8_t LoadAndAddOffset(int8_t *data, int index, int offset) { int16x8_t LoadAndAddOffset(int8_t *data, int index, int offset) {
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ADD_INT8_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ADD_INT8_H_
#define 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 input0_offset_;
int input1_offset_; int input1_offset_;
int output_offset_; int output_offset_;
...@@ -40,7 +40,7 @@ struct AddQuantParameter { ...@@ -40,7 +40,7 @@ struct AddQuantParameter {
int right_shift1_; int right_shift1_;
int left_shift_out_; int left_shift_out_;
int right_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, void AddInt8(int8_t *input0_data, int8_t *input1_data, int8_t *output_data, int64_t real_dst_count,
AddQuantParameter *para); AddQuantParameter *para);
...@@ -51,4 +51,3 @@ int16x8_t LoadAndAddOffset(int8_t *data, int index, int offset); ...@@ -51,4 +51,3 @@ int16x8_t LoadAndAddOffset(int8_t *data, int index, int offset);
#endif #endif
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ADD_INT8_H_ #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ADD_INT8_H_
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/arg_min_max.h" #include "nnacl/arg_min_max.h"
#include "src/runtime/kernel/arm/nnacl/fp32/arg_min_max.h" #include "nnacl/fp32/arg_min_max.h"
#define FLOAT_DATA_TYPE 43 #define FLOAT_DATA_TYPE 43
......
...@@ -16,9 +16,7 @@ ...@@ -16,9 +16,7 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARG_MIN_MAX_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARG_MIN_MAX_H_
#define 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 "nnacl/arg_min_max_parameter.h"
#include "src/runtime/kernel/arm/nnacl/arg_min_max_parameter.h"
#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h"
void ArgMinMax(const void *input, void *output, const int *in_shape, ArgMinMaxParameter *param); 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_ #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARG_MIN_MAX_H_
...@@ -17,30 +17,30 @@ ...@@ -17,30 +17,30 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARG_MIN_MAX_PARAMETER_H_ #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_ #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_; uint32_t index_;
union ArgData { union ArgData {
int8_t i8_data_; int8_t i8_data_;
int32_t i_data_; int32_t i_data_;
float f_data_; float f_data_;
} data_; } data_;
}; } ArgElement;
struct ArgMinMaxParameter { typedef struct ArgMinMaxParameter {
OpParameter op_parameter_; OpParameter op_parameter_;
bool out_value_; bool out_value_;
bool keep_dims_; bool keep_dims_;
bool get_max_; bool get_max_;
int32_t axis_; int32_t axis_;
int32_t topk_; int32_t topk_;
int32_t axis_type_; int32_t axis_type_;
int32_t dims_size_; int32_t dims_size_;
int32_t data_type_; // equals to type_id int32_t data_type_; // equals to type_id
int32_t in_strides_[DIMENSION_4D]; int32_t in_strides_[DIMENSION_4D];
int32_t out_strides_[DIMENSION_4D]; int32_t out_strides_[DIMENSION_4D];
ArgElement *arg_elements_; ArgElement *arg_elements_;
}; } ArgMinMaxParameter;
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARG_MIN_MAX_PARAMETER_H_ #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARG_MIN_MAX_PARAMETER_H_
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * 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, void TileOneDimension(float *inData, float *outData, int dim, size_t ndim, int *inShape, int *inStrides,
int *outStrides, int *multiple) { int *outStrides, int *multiple) {
......
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
#include <arm_neon.h> #include <arm_neon.h>
#endif #endif
#include <string.h> #include <string.h>
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/arithmetic_common.h" #include "nnacl/arithmetic_common.h"
struct ArithmeticParameter { typedef struct ArithmeticParameter {
OpParameter op_parameter_; OpParameter op_parameter_;
bool broadcasting_; bool broadcasting_;
size_t ndim_; size_t ndim_;
...@@ -38,7 +38,8 @@ struct ArithmeticParameter { ...@@ -38,7 +38,8 @@ struct ArithmeticParameter {
int multiples0_[5]; int multiples0_[5];
int multiples1_[5]; int multiples1_[5];
}; } ArithmeticParameter;
void TileOneDimension(float *inData, float *outData, int dim, size_t ndim, int *inShape, int *inStrides, void TileOneDimension(float *inData, float *outData, int dim, size_t ndim, int *inShape, int *inStrides,
int *outStrides, int *multiple); int *outStrides, int *multiple);
void ComputeStrides(int *shape, int *strides, int ndim); void ComputeStrides(int *shape, int *strides, int ndim);
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARTITHMETIC_PARAMETER_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARTITHMETIC_PARAMETER_H_
#define 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"
......
...@@ -17,13 +17,14 @@ ...@@ -17,13 +17,14 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARITHMETIC_SELF_PARAMETER_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARITHMETIC_SELF_PARAMETER_H_
#define 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 "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/errorcode.h" #include "nnacl/errorcode.h"
#include "nnacl/quantization/quantize.h"
// For Abs, Cos, Exp, Log, Square, Sqrt, Rsqrt ops. // For Abs, Cos, Exp, Log, Square, Sqrt, Rsqrt ops.
struct ArithmeticSelfParameter { typedef struct ArithmeticSelfParameter {
OpParameter op_parameter_; OpParameter op_parameter_;
ArithSelfQuantArg quant_arg_; ArithSelfQuantArg quant_arg_;
}; } ArithmeticSelfParameter;
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARITHMETIC_SELF_PARAMETER_H_ #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ARITHMETIC_SELF_PARAMETER_H_
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/batch_to_space.h" #include "nnacl/batch_to_space.h"
#include "src/runtime/kernel/arm/nnacl/arithmetic_common.h" #include "nnacl/arithmetic_common.h"
void BatchToSpaceNoCropForNHWC(const void *input, void *output, const int *in_shape, int out_n, const int *block, void BatchToSpaceNoCropForNHWC(const void *input, void *output, const int *in_shape, int out_n, const int *block,
int data_size) { int data_size) {
......
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
*/ */
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_BATCH_TO_SPACE_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_BATCH_TO_SPACE_H_
#define 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_BLOCK_SHAPE_SIZE 2
#define BATCH_TO_SPACE_CROPS_SIZE 4 #define BATCH_TO_SPACE_CROPS_SIZE 4
struct BatchToSpaceParameter { typedef struct BatchToSpaceParameter {
OpParameter op_parameter_; OpParameter op_parameter_;
int32_t block_shape_[BATCH_TO_SPACE_BLOCK_SHAPE_SIZE]; int32_t block_shape_[BATCH_TO_SPACE_BLOCK_SHAPE_SIZE];
int32_t crops_[BATCH_TO_SPACE_CROPS_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, void BatchToSpaceNoCropForNHWC(const void *input, void *output, const int *in_shape, int out_n, const int *block,
int data_size); int data_size);
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/common_func.h" #include "nnacl/common_func.h"
#include "src/runtime/kernel/arm/nnacl/quantization/fixed_point.h" #include "nnacl/quantization/fixed_point.h"
#ifndef ENABLE_ARM64 #ifndef ENABLE_ARM64
void IndirectGemmFp32(float *output, const float *input, const float *weight, const float *bias, size_t step, int ic4, void IndirectGemmFp32(float *output, const float *input, const float *weight, const float *bias, size_t step, int ic4,
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" #include "nnacl/conv_parameter.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
......
...@@ -17,8 +17,10 @@ ...@@ -17,8 +17,10 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CONCAT_PARAMETER_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CONCAT_PARAMETER_H_
#define 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" #include "nnacl/op_base.h"
struct ConcatParameter { #include "nnacl/quantization/quantize.h"
typedef struct ConcatParameter {
OpParameter op_parameter_; OpParameter op_parameter_;
ConcatQuantArg quant_arg_; ConcatQuantArg quant_arg_;
int axis_; int axis_;
...@@ -28,7 +30,6 @@ struct ConcatParameter { ...@@ -28,7 +30,6 @@ struct ConcatParameter {
const int *output_shapes_; const int *output_shapes_;
int64_t after_axis_size; int64_t after_axis_size;
int64_t count_unit_; int64_t count_unit_;
}; } ConcatParameter;
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CONCAT_PARAMETER_H_ #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CONCAT_PARAMETER_H_
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
#ifdef ENABLE_NEON #ifdef ENABLE_NEON
#include <arm_neon.h> #include <arm_neon.h>
#endif #endif
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/quantization/quantize.h" #include "nnacl/quantization/quantize.h"
struct ConvParameter { typedef struct ConvParameter {
OpParameter op_parameter_; OpParameter op_parameter_;
ConvQuantArg conv_quant_arg_; ConvQuantArg conv_quant_arg_;
int kernel_h_; int kernel_h_;
...@@ -53,7 +53,6 @@ struct ConvParameter { ...@@ -53,7 +53,6 @@ struct ConvParameter {
int output_unit_; int output_unit_;
bool is_relu_; bool is_relu_;
bool is_relu6_; bool is_relu6_;
}; } ConvParameter;
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CONV_PARAMETER_H_ #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CONV_PARAMETER_H_
...@@ -16,11 +16,13 @@ ...@@ -16,11 +16,13 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CROP_PARAMETER_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CROP_PARAMETER_H_
#define 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 #define CROP_OFFSET_MAX_SIZE 4
struct CropParameter { typedef struct CropParameter {
OpParameter op_parameter_; OpParameter op_parameter_;
CropQuantArg quant_arg; CropQuantArg quant_arg;
int thread_count_; int thread_count_;
...@@ -32,6 +34,6 @@ struct CropParameter { ...@@ -32,6 +34,6 @@ struct CropParameter {
const int *in_shape_; const int *in_shape_;
const int *out_shape_; const int *out_shape_;
int input_dim_; int input_dim_;
}; } CropParameter;
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CROP_PARAMETER_H_ #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_CROP_PARAMETER_H_
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/depth_to_space.h" #include "nnacl/depth_to_space.h"
#include <string.h> #include <string.h>
void DepthToSpaceForNHWC(const void *input, void *output, int *in_shape, DepthToSpaceParameter *param) { void DepthToSpaceForNHWC(const void *input, void *output, int *in_shape, DepthToSpaceParameter *param) {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_DEPTH_TO_SPACE_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_DEPTH_TO_SPACE_H_
#define 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); void DepthToSpaceForNHWC(const void *input, void *output, int *in_shape, DepthToSpaceParameter *param);
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_DEPTH_TO_SPACE_H_ #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_DEPTH_TO_SPACE_H_
...@@ -15,18 +15,18 @@ ...@@ -15,18 +15,18 @@
*/ */
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_DEPTH_TO_SPACE_PARAMETER_H_ #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_ #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 { typedef struct DepthToSpaceParameter {
OpParameter op_parameter_; OpParameter op_parameter_;
int32_t block_size_; int32_t block_size_;
int32_t in_stride_dim0_; int32_t in_stride_dim0_;
int32_t in_stride_dim1_; int32_t in_stride_dim1_;
int32_t in_stride_dim2_; int32_t in_stride_dim2_;
int32_t out_stride_dim0_; int32_t out_stride_dim0_;
int32_t out_stride_dim1_; int32_t out_stride_dim1_;
int32_t out_stride_dim2_; int32_t out_stride_dim2_;
uint8_t data_type_size_; uint8_t data_type_size_;
}; } DepthToSpaceParameter;
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_DEPTH_TO_SPACE_PARAMETER_H_ #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_DEPTH_TO_SPACE_PARAMETER_H_
...@@ -17,15 +17,15 @@ ...@@ -17,15 +17,15 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ERRORCODE_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ERRORCODE_H_
#define 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_OK = 0,
NNACL_ERR = 1, NNACL_ERR = 1,
NNACL_NULL_PTR, NNACL_NULL_PTR,
NNACL_PARAM_INVALID, NNACL_PARAM_INVALID,
OPLIB_COMMON_END = 9999 OPLIB_COMMON_END = 9999
}; } ErrorCodeCommonEnum;
enum ErrorCodeFp32OpEnum { typedef enum ErrorCodeFp32OpEnum {
NNACL_ERRCODE_OP_FP32_START = 10000, NNACL_ERRCODE_OP_FP32_START = 10000,
NNACL_ERRCODE_STRASSEN_RECURSION_MALLOC, NNACL_ERRCODE_STRASSEN_RECURSION_MALLOC,
NNACL_ERRCODE_REVERSE_MALLOC, NNACL_ERRCODE_REVERSE_MALLOC,
...@@ -35,13 +35,21 @@ enum ErrorCodeFp32OpEnum { ...@@ -35,13 +35,21 @@ enum ErrorCodeFp32OpEnum {
NNACL_ERRCODE_DIVISOR_ZERO, NNACL_ERRCODE_DIVISOR_ZERO,
NNACL_ERRCODE_INDEX_OUT_OF_RANGE, NNACL_ERRCODE_INDEX_OUT_OF_RANGE,
NNACL_ERRCODE_OP_FP32_END = 19999 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_ #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ERRORCODE_H_
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/flatten.h" #include "nnacl/flatten.h"
#include <string.h> #include <string.h>
void Flatten(const void *input, void *output, FlattenParameter *flatten_param) { void Flatten(const void *input, void *output, FlattenParameter *flatten_param) {
......
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
*/ */
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FLATTEN_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FLATTEN_H_
#define 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_; OpParameter op_parameter_;
int size; int size;
}; } FlattenParameter;
void Flatten(const void *input, void *output, FlattenParameter *flatten_param); void Flatten(const void *input, void *output, FlattenParameter *flatten_param);
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FLATTEN_H_ #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FLATTEN_H_
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" #include "nnacl/conv_parameter.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp16/conv_depthwise_fp16.h" #include "nnacl/fp16/conv_depthwise_fp16.h"
#include <arm_neon.h> #include <arm_neon.h>
#include "src/runtime/kernel/arm/nnacl/fp16/common_func.h" #include "nnacl/fp16/common_func.h"
/*conv depthwise fp16 begin*/ /*conv depthwise fp16 begin*/
void DepthwiseBorderPixelFp16(float16_t *dst, const float16_t *src, const float16_t *weight, const float16_t *bias, void DepthwiseBorderPixelFp16(float16_t *dst, const float16_t *src, const float16_t *weight, const float16_t *bias,
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP16_CONV_DEPTHWISE_FP16_H_ #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_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP16_CONV_DEPTHWISE_FP16_H_
#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" #include "nnacl/conv_parameter.h"
#include "src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.h" #include "nnacl/fp32/conv_depthwise.h"
void ConvDwC8Fp16(float16_t *output_data, const float16_t *input_data, const float16_t *weight_data, 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, const float16_t *bias_data, const ConvParameter *conv_param, const SlidingWindowParam *sliding,
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp16/conv_fp16.h" #include "nnacl/fp16/conv_fp16.h"
#include <string.h> #include <string.h>
#include "src/runtime/kernel/arm/nnacl/fp16/pack_fp16.h" #include "nnacl/fp16/pack_fp16.h"
#include "src/runtime/kernel/arm/nnacl/fp16/winograd_transform_fp16.h" #include "nnacl/fp16/winograd_transform_fp16.h"
extern "C" { extern "C" {
#ifdef ENABLE_ARM64 #ifdef ENABLE_ARM64
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP16_CONV_FP16_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP16_CONV_FP16_H_
#include <arm_neon.h> #include <arm_neon.h>
#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" #include "nnacl/conv_parameter.h"
#ifndef ENABLE_NEON #ifndef ENABLE_NEON
void IndirectGemmFp16_16x8(float16_t *output, float16_t *input, float16_t *weight, float16_t *bias, size_t step, void IndirectGemmFp16_16x8(float16_t *output, float16_t *input, float16_t *weight, float16_t *bias, size_t step,
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp16/pack_fp16.h" #include "nnacl/fp16/pack_fp16.h"
#include <cstring> #include <cstring>
#include <cstdlib> #include <cstdlib>
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#ifdef ENABLE_NEON #ifdef ENABLE_NEON
#include <arm_neon.h> #include <arm_neon.h>
#endif #endif
#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" #include "nnacl/conv_parameter.h"
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
void Im2ColPackUnitFp16(float16_t *input_data, ConvParameter *conv_param, float16_t *packed_input, int real_cal_num, void Im2ColPackUnitFp16(float16_t *input_data, ConvParameter *conv_param, float16_t *packed_input, int real_cal_num,
int block_index); int block_index);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * 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) // 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) { void Conv3x3Fp16InputUnit(float16_t *tmp_data, float16_t *trans_input_data, size_t step) {
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
#include <arm_neon.h> #include <arm_neon.h>
#include <string.h> #include <string.h>
#include "src/runtime/kernel/arm/nnacl/fp16/pack_fp16.h" #include "nnacl/fp16/pack_fp16.h"
#include "src/runtime/kernel/arm/nnacl/fp16/conv_fp16.h" #include "nnacl/fp16/conv_fp16.h"
// for fp16 convolution 3x3 filter/input/output transform // for fp16 convolution 3x3 filter/input/output transform
void Conv3x3Fp16InputUnit(float16_t *tmp_data, float16_t *trans_input_data, size_t step); void Conv3x3Fp16InputUnit(float16_t *tmp_data, float16_t *trans_input_data, size_t step);
......
...@@ -17,15 +17,15 @@ ...@@ -17,15 +17,15 @@
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ACTIVATION_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ACTIVATION_H_
#include <math.h> #include <math.h>
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/errorcode.h" #include "nnacl/errorcode.h"
#include "src/runtime/kernel/arm/nnacl/quantization/fixed_point.h" #include "nnacl/quantization/fixed_point.h"
struct ActivationParameter { typedef struct ActivationParameter {
OpParameter op_parameter_; OpParameter op_parameter_;
int type_; int type_;
float alpha_{0.2}; float alpha_{0.2};
}; } ActivationParameter;
inline int Relu(const float *src, int length, float *dst) { inline int Relu(const float *src, int length, float *dst) {
for (int i = 0; i < length; ++i) { for (int i = 0; i < length; ++i) {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/arg_min_max.h" #include "nnacl/fp32/arg_min_max.h"
#include <stdlib.h> #include <stdlib.h>
#include <float.h> #include <float.h>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_ARG_MIN_MAX_H_ #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_ #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, void ArgMax(const float *input, float *output, ArgMinMaxParameter *param, int pre_axis_count, int axis_count,
int after_axis_count); int after_axis_count);
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/arithmetic.h" #include "nnacl/fp32/arithmetic.h"
#include <math.h>
int ElementMul(float *input0, float *input1, float *output, int element_size) { int ElementMul(float *input0, float *input1, float *output, int element_size) {
int block_mod = element_size % C4NUM; int block_mod = element_size % C4NUM;
......
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
#ifdef ENABLE_NEON #ifdef ENABLE_NEON
#include <arm_neon.h> #include <arm_neon.h>
#endif #endif
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/arithmetic_common.h" #include "nnacl/arithmetic_common.h"
#include "src/runtime/kernel/arm/nnacl/errorcode.h" #include "nnacl/errorcode.h"
int ElementMul(float *input0, float *input1, float *output, int element_size); int ElementMul(float *input0, float *input1, float *output, int element_size);
int ElementMulRelu(float *input0, float *input1, float *output, int element_size); int ElementMulRelu(float *input0, float *input1, float *output, int element_size);
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include "src/runtime/kernel/arm/nnacl/fp32/arithmetic_self.h" #include "nnacl/fp32/arithmetic_self.h"
// abs: // abs:
int ElementAbs(float *input, float *output, int element_size) { int ElementAbs(float *input, float *output, int element_size) {
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#ifdef ENABLE_NEON #ifdef ENABLE_NEON
#include <arm_neon.h> #include <arm_neon.h>
#endif #endif
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/errorcode.h" #include "nnacl/errorcode.h"
int ElementAbs(float *input, float *output, int element_size); int ElementAbs(float *input, float *output, int element_size);
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/batchnorm.h" #include "nnacl/fp32/batchnorm.h"
#include <math.h>
void BatchNorm(float *output_ptr, const float *input_ptr, const float *mean_ptr, const float *variance_ptr, int task_id, void BatchNorm(float *output_ptr, const float *input_ptr, const float *mean_ptr, const float *variance_ptr, int task_id,
BatchNormParameter *param) { BatchNormParameter *param) {
......
...@@ -17,14 +17,14 @@ ...@@ -17,14 +17,14 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_BATCHNORM_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_BATCHNORM_H_
#define 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_; OpParameter op_parameter_;
float epsilon_; float epsilon_;
int unit_; int unit_;
int channel_; int channel_;
}; } BatchNormParameter;
void BatchNorm(float *output_ptr, const float *input_ptr, const float *mean_ptr, const float *variance_ptr, int task_id, void BatchNorm(float *output_ptr, const float *input_ptr, const float *mean_ptr, const float *variance_ptr, int task_id,
BatchNormParameter *param); BatchNormParameter *param);
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/broadcast_to.h" #include "nnacl/fp32/broadcast_to.h"
#include <string.h> #include <string.h>
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
void PadBroadcastShapeInfo(BroadcastShapeInfo *shape_info) { void PadBroadcastShapeInfo(BroadcastShapeInfo *shape_info) {
if (shape_info->input_shape_size_ < DIMENSION_4D) { if (shape_info->input_shape_size_ < DIMENSION_4D) {
......
...@@ -19,22 +19,22 @@ ...@@ -19,22 +19,22 @@
#ifdef ENABLE_NEON #ifdef ENABLE_NEON
#include <arm_neon.h> #include <arm_neon.h>
#endif #endif
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
#define BROADCAST_TO_SHAPE_MAX_SIZE 4 #define BROADCAST_TO_SHAPE_MAX_SIZE 4
struct BroadcastToParameter { typedef struct BroadcastToParameter {
OpParameter op_parameter_; OpParameter op_parameter_;
int shape_[BROADCAST_TO_SHAPE_MAX_SIZE]; int shape_[BROADCAST_TO_SHAPE_MAX_SIZE];
size_t shape_size_; size_t shape_size_;
}; } BroadcastToParameter;
struct BroadcastShapeInfo { typedef struct BroadcastShapeInfo {
int input_shape_[BROADCAST_TO_SHAPE_MAX_SIZE]; int input_shape_[BROADCAST_TO_SHAPE_MAX_SIZE];
int input_shape_size_; int input_shape_size_;
int output_shape_[BROADCAST_TO_SHAPE_MAX_SIZE]; int output_shape_[BROADCAST_TO_SHAPE_MAX_SIZE];
int output_shape_size_; int output_shape_size_;
}; } BroadcastShapeInfo;
int BroadcastTo(const float *input, BroadcastShapeInfo *shape_info, float *output); int BroadcastTo(const float *input, BroadcastShapeInfo *shape_info, float *output);
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_BROADCAST_TO_H_ #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_BROADCAST_TO_H_
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * 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) { void Uint8ToFloat32(const uint8_t *input, float *output, int number) {
for (int i = 0; i < number; ++i) { for (int i = 0; i < number; ++i) {
......
...@@ -19,14 +19,14 @@ ...@@ -19,14 +19,14 @@
#ifdef ENABLE_NEON #ifdef ENABLE_NEON
#include <arm_neon.h> #include <arm_neon.h>
#endif #endif
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
// For cast. // For cast.
struct CastParameter { typedef struct CastParameter {
OpParameter op_parameter_; OpParameter op_parameter_;
int src_type_; int src_type_;
int dst_type_; int dst_type_;
}; } CastParameter;
void Uint8ToFloat32(const uint8_t *input, float *output, int number); void Uint8ToFloat32(const uint8_t *input, float *output, int number);
void Uint8ToInt8(const uint8_t *input, int8_t *output, int number); void Uint8ToInt8(const uint8_t *input, int8_t *output, int number);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/common_func.h" #include "nnacl/fp32/common_func.h"
#ifndef __aarch64__ #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, void MatrixAdd(const float *a_ptr, const float *b_ptr, float *dst, size_t a_stride, size_t b_stride, size_t c_stride,
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" #include "nnacl/conv_parameter.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/concat.h" #include "nnacl/fp32/concat.h"
#include <string.h> #include <string.h>
void Concat(void **input, int input_num, int axis, int **inputs_output_shape, size_t shape_size, void *output) { void Concat(void **input, int input_num, int axis, int **inputs_output_shape, size_t shape_size, void *output) {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_CONCAT_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_CONCAT_H_
#define 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); void Concat(void **input, int input_num, int axis, int **inputs_output_shape, size_t shape_size, void *output);
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/conv.h" #include "nnacl/fp32/conv.h"
#include <string.h> #include <string.h>
#include "src/runtime/kernel/arm/nnacl/winograd_transform.h" #include "nnacl/winograd_transform.h"
// fp32 conv common // fp32 conv common
void ConvFp32(float *input_data, float *packed_input, float *packed_weight, const float *bias_data, void ConvFp32(float *input_data, float *packed_input, float *packed_weight, const float *bias_data,
......
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
#ifdef ENABLE_NEON #ifdef ENABLE_NEON
#include <arm_neon.h> #include <arm_neon.h>
#endif #endif
#include "src/runtime/kernel/arm/nnacl/pack.h" #include "nnacl/pack.h"
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/common_func.h" #include "nnacl/common_func.h"
#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" #include "nnacl/conv_parameter.h"
#include "src/runtime/kernel/arm/nnacl/fp32/strassen_matmul.h" #include "nnacl/fp32/strassen_matmul.h"
#include "src/runtime/kernel/arm/nnacl/winograd_utils.h" #include "nnacl/winograd_utils.h"
using TmpBufferAddress = float *; using TmpBufferAddress = float *;
typedef void (*GEMM_FUNC_FP32)(float *output, const float *input, const float *weight, const float *bias, size_t step, typedef void (*GEMM_FUNC_FP32)(float *output, const float *input, const float *weight, const float *bias, size_t step,
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.h" #include "nnacl/fp32/conv_depthwise.h"
#include "src/runtime/kernel/arm/nnacl/fp32/common_func.h" #include "nnacl/fp32/common_func.h"
#include "src/runtime/kernel/arm/nnacl/winograd_transform.h" #include "nnacl/winograd_transform.h"
#ifdef ENABLE_ARM64 #ifdef ENABLE_ARM64
#include <arm_neon.h> #include <arm_neon.h>
#endif #endif
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_CONV_DEPTHWISE_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_CONV_DEPTHWISE_H_
#define 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 left_;
int right_; int right_;
int top_; int top_;
...@@ -35,7 +35,7 @@ struct SlidingWindowParam { ...@@ -35,7 +35,7 @@ struct SlidingWindowParam {
int in_kh_step_; // kernel H int in_kh_step_; // kernel H
int in_kw_step_; // kernel W int in_kw_step_; // kernel W
int kernel_step_; int kernel_step_;
}; } SlidingWindowParam;
void InitSlidingParam(SlidingWindowParam *sliding, const ConvParameter *conv_param, int block); void InitSlidingParam(SlidingWindowParam *sliding, const ConvParameter *conv_param, int block);
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/crop.h" #include "nnacl/fp32/crop.h"
#include <string.h> #include <string.h>
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/crop_parameter.h" #include "nnacl/crop_parameter.h"
void Pad4DOffset(CropParameter *crop_param, int64_t *offset) { void Pad4DOffset(CropParameter *crop_param, int64_t *offset) {
int axis = crop_param->axis_; int axis = crop_param->axis_;
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
*/ */
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_CROP_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_CROP_H_
#define 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 "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/crop_parameter.h" #include "nnacl/crop_parameter.h"
#define CROP_OFFSET_MAX_SIZE 4 #define CROP_OFFSET_MAX_SIZE 4
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * 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) { void PackDeConvWeightFp32(const float *weight, float *dst, int input_channel, int output_channel, int plane) {
/* ichwoc(nhwc) -> oc4 * h * w * incUP4 * 4 */ /* ichwoc(nhwc) -> oc4 * h * w * incUP4 * 4 */
......
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_DECONV_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_DECONV_H_
#define 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 "nnacl/pack.h"
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/conv_parameter.h" #include "nnacl/conv_parameter.h"
#include "src/runtime/kernel/arm/nnacl/fp32/strassen_matmul.h" #include "nnacl/fp32/strassen_matmul.h"
void PackDeConvWeightFp32(const float *weight, float *dst, int input_channel, int output_channel, int plane); void PackDeConvWeightFp32(const float *weight, float *dst, int input_channel, int output_channel, int plane);
......
...@@ -14,9 +14,10 @@ ...@@ -14,9 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/elu.h" #include "nnacl/fp32/elu.h"
#include <math.h>
#include "include/errorcode.h" #include "include/errorcode.h"
#include "src/runtime/kernel/arm/nnacl/errorcode.h" #include "nnacl/errorcode.h"
#include "mindspore/core/utils/log_adapter.h" #include "mindspore/core/utils/log_adapter.h"
void Calculate_Data(float *input_data, float *output_data, int num, EluParameter *parameter) { void Calculate_Data(float *input_data, float *output_data, int num, EluParameter *parameter) {
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_ELU_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_ELU_H_
#define 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_; OpParameter op_parameter_;
float alpha_; float alpha_;
int thread_num_; int thread_num_;
......
...@@ -14,9 +14,10 @@ ...@@ -14,9 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/embedding_lookup.h" #include "nnacl/fp32/embedding_lookup.h"
#include <string.h>
#include "include/errorcode.h" #include "include/errorcode.h"
#include "src/runtime/kernel/arm/nnacl/errorcode.h" #include "nnacl/errorcode.h"
#include "mindspore/core/utils/log_adapter.h" #include "mindspore/core/utils/log_adapter.h"
void l2_regulate(float *data, int size, float max_norm) { void l2_regulate(float *data, int size, float max_norm) {
......
...@@ -17,16 +17,16 @@ ...@@ -17,16 +17,16 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_EMBEDDING_LOOKUP_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_EMBEDDING_LOOKUP_H_
#define 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 { typedef struct EmbeddingLookupParameter {
OpParameter op_parameter_; OpParameter op_parameter_;
bool *is_regulated_; bool *is_regulated_;
float max_norm_; float max_norm_;
int ids_size_; int ids_size_;
int layer_size_; int layer_size_;
int layer_num_; int layer_num_;
int thread_num; int thread_num;
} EmbeddingLookupParameter; } EmbeddingLookupParameter;
int EmbeddingLookup(float *input_data, int *ids, float *output_data, EmbeddingLookupParameter *parameter, int task_id); int EmbeddingLookup(float *input_data, int *ids, float *output_data, EmbeddingLookupParameter *parameter, int task_id);
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/expandDims.h" #include "nnacl/fp32/expandDims.h"
#include <string.h> #include <string.h>
#include "src/runtime/kernel/arm/nnacl/errorcode.h" #include "nnacl/errorcode.h"
int ExpandDims(float *input_ptr, float *output_ptr, size_t data_size) { int ExpandDims(float *input_ptr, float *output_ptr, size_t data_size) {
memcpy(output_ptr, input_ptr, data_size); memcpy(output_ptr, input_ptr, data_size);
......
...@@ -17,12 +17,12 @@ ...@@ -17,12 +17,12 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_EXPANDDIMS_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_EXPANDDIMS_H_
#define 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_; OpParameter op_parameter_;
int dim_; int dim_;
}; } ExpandDimsParameter;
int ExpandDims(float *input_ptr, float *output_ptr, size_t data_size); int ExpandDims(float *input_ptr, float *output_ptr, size_t data_size);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * 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) { int Fill(float *output, int size, float data) {
for (int i = 0; i < size; ++i) { for (int i = 0; i < size; ++i) {
......
...@@ -19,16 +19,16 @@ ...@@ -19,16 +19,16 @@
#ifdef ENABLE_NEON #ifdef ENABLE_NEON
#include <arm_neon.h> #include <arm_neon.h>
#endif #endif
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/errorcode.h" #include "nnacl/errorcode.h"
#define FILL_DIMS_MAX_SIZE 4 #define FILL_DIMS_MAX_SIZE 4
struct FillParameter { typedef struct FillParameter {
OpParameter op_parameter_; OpParameter op_parameter_;
int dims_[FILL_DIMS_MAX_SIZE]; int dims_[FILL_DIMS_MAX_SIZE];
int num_dims_; int num_dims_;
}; } FillParameter;
int Fill(float *output, int size, float data); int Fill(float *output, int size, float data);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/gather.h" #include "nnacl/fp32/gather.h"
#include <string.h> #include <string.h>
inline int Stride(int *shape, int rank, int index) { inline int Stride(int *shape, int rank, int index) {
......
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_GATHER_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_GATHER_H_
#define 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_; OpParameter op_parameter_;
int axis_; int axis_;
int batchDims_; int batchDims_;
}; } GatherParameter;
int Gather(float *input, int outer_size, int inner_size, int limit, int *indices, int indices_element_size, int Gather(float *input, int outer_size, int inner_size, int limit, int *indices, int indices_element_size,
float *output); float *output);
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/gatherNd.h" #include "nnacl/fp32/gatherNd.h"
#include <string.h> #include <string.h>
#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 GatherNd(float *input, float *output, int *in_offset, int area, int count) {
int i = 0; int i = 0;
......
...@@ -17,12 +17,12 @@ ...@@ -17,12 +17,12 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_GATHERND_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_GATHERND_H_
#define 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_; OpParameter op_parameter_;
int batchDims_; int batchDims_;
}; } GatherNdParameter;
int GatherNd(float *input, float *output, int *in_offset, int area, int count); int GatherNd(float *input, float *output, int *in_offset, int area, int count);
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/local_response_norm.h" #include "nnacl/fp32/local_response_norm.h"
#include <math.h>
int LocalResponseNorm(float *input_ptr, int out_size, int channel, float *output_ptr, int LocalResponseNorm(float *input_ptr, int out_size, int channel, float *output_ptr,
LocalResponseNormParameter *param) { LocalResponseNormParameter *param) {
......
...@@ -17,15 +17,15 @@ ...@@ -17,15 +17,15 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_LOCAL_RESPONSE_NORM_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_LOCAL_RESPONSE_NORM_H_
#define 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_; OpParameter op_parameter_;
int depth_radius_; int depth_radius_;
float bias_; float bias_;
float alpha_; float alpha_;
float beta_; float beta_;
}; } LocalResponseNormParameter;
int LocalResponseNorm(float *input_ptr, int out_size, int channel, float *output_ptr, int LocalResponseNorm(float *input_ptr, int out_size, int channel, float *output_ptr,
LocalResponseNormParameter *param); LocalResponseNormParameter *param);
......
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/lstm.h" #include "nnacl/fp32/lstm.h"
#include <string.h> #include <string.h>
#include "src/runtime/kernel/arm/nnacl/fp32/activation.h" #include "nnacl/fp32/activation.h"
#include "src/runtime/kernel/arm/nnacl/fp32/arithmetic.h" #include "nnacl/fp32/arithmetic.h"
void InitGate(float *gate_buffer, const float *bias, LstmParameter *lstm_parm) { void InitGate(float *gate_buffer, const float *bias, LstmParameter *lstm_parm) {
int gate_offest = 0; int gate_offest = 0;
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_LSTM_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_LSTM_H_
#define 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_; OpParameter op_parameter_;
int input_size_; int input_size_;
int hidden_size_; // output_size int hidden_size_; // output_size
...@@ -28,7 +28,7 @@ struct LstmParameter { ...@@ -28,7 +28,7 @@ struct LstmParameter {
int input_step_; int input_step_;
int output_step_; int output_step_;
bool bidirectional_; bool bidirectional_;
}; } LstmParameter;
void Lstm(float *output, const float *input, const float *weight_i, const float *weight_h, const float *bias, 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); float *hidden_state, float *cell_state, float *gate_buffer, LstmParameter *lstm_parm);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * 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) { void RowMajor2Row8Major(float *src_ptr, float *dst_ptr, int row, int col) {
for (int r = 0; r < row; r++) { for (int r = 0; r < row; r++) {
......
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_MATMUL_H_ #define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_MATMUL_H_
#include <float.h> #include <float.h>
#include "src/runtime/kernel/arm/nnacl/errorcode.h" #include "nnacl/errorcode.h"
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/matmul.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 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); void RowMajor2Row8Major(float *src_ptr, float *dst_ptr, int row, int col);
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/one_hot.h" #include "nnacl/fp32/one_hot.h"
#include "src/runtime/kernel/arm/nnacl/errorcode.h" #include "nnacl/errorcode.h"
int OneHot(const int *indices, float *output, const OneHotParameter *one_hot_param, const int tid, int OneHot(const int *indices, float *output, const OneHotParameter *one_hot_param, const int tid,
const int thread_num) { const int thread_num) {
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
#ifdef ENABLE_NEON #ifdef ENABLE_NEON
#include <arm_neon.h> #include <arm_neon.h>
#endif #endif
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
struct OneHotParameter { typedef struct OneHotParameter {
OpParameter op_parameter_; OpParameter op_parameter_;
int axis_; int axis_;
int depth_; int depth_;
...@@ -30,7 +30,7 @@ struct OneHotParameter { ...@@ -30,7 +30,7 @@ struct OneHotParameter {
float off_value_; float off_value_;
int outer_size_; int outer_size_;
int inner_size_; int inner_size_;
}; } OneHotParameter;
int OneHot(const int *indices, float *output, const OneHotParameter *one_hot_param, const int tid, int OneHot(const int *indices, float *output, const OneHotParameter *one_hot_param, const int tid,
const int thread_num); const int thread_num);
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/pad.h" #include "nnacl/fp32/pad.h"
#include "src/runtime/kernel/arm/nnacl/common_func.h" #include "nnacl/common_func.h"
void Pad(const float *input_data, float *output_data, const int *input_shape, const int *output_shape, 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) { const int *paddings, const int tid, const int thread_num) {
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
#endif #endif
#include <memory.h> #include <memory.h>
#include <float.h> #include <float.h>
#include "src/runtime/kernel/arm/nnacl/op_base.h" #include "nnacl/op_base.h"
#include "src/runtime/kernel/arm/nnacl/pad_parameter.h" #include "nnacl/pad_parameter.h"
void Pad(const float *input_data, float *output_data, const int *input_shape, const int *output_shape, 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); const int *paddings, const int tid, const int thread_num);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/pooling.h" #include "nnacl/fp32/pooling.h"
#include <float.h> #include <float.h>
void AvgPooling(const float *input_ptr, float *output_ptr, PoolingParameter *pooling_param, int task_id) { void AvgPooling(const float *input_ptr, float *output_ptr, PoolingParameter *pooling_param, int task_id) {
......
...@@ -20,9 +20,10 @@ ...@@ -20,9 +20,10 @@
#ifdef ENABLE_NEON #ifdef ENABLE_NEON
#include <arm_neon.h> #include <arm_neon.h>
#endif #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_; OpParameter op_parameter_;
QuantArg **quant_args_; QuantArg **quant_args_;
bool global_; bool global_;
...@@ -47,7 +48,7 @@ struct PoolingParameter { ...@@ -47,7 +48,7 @@ struct PoolingParameter {
int stride_w_; int stride_w_;
int stride_h_; int stride_h_;
int thread_num_; int thread_num_;
}; } PoolingParameter;
void AvgPooling(const float *input_ptr, float *output_ptr, PoolingParameter *pooling_param, int task_id); void AvgPooling(const float *input_ptr, float *output_ptr, PoolingParameter *pooling_param, int task_id);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * 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) { void Range(float *output_ptr, int start, int limit, int delta) {
size_t index = 0; size_t index = 0;
......
...@@ -17,15 +17,15 @@ ...@@ -17,15 +17,15 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_RANGE_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_RANGE_H_
#define 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_; OpParameter op_parameter_;
int dType_; int dType_;
int start_; int start_;
int limit_; int limit_;
int delta_; int delta_;
}; } RangeParameter;
void Range(float *output_ptr, int start, int limit, int delta); void Range(float *output_ptr, int start, int limit, int delta);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#include "src/runtime/kernel/arm/nnacl/fp32/rank.h" #include "nnacl/fp32/rank.h"
void Rank(float* output, int rank) { void Rank(float* output, int rank) {
output[0] = (float)(rank); output[0] = (float)(rank);
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_RANK_H_ #ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_RANK_H_
#define 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); void Rank(float* output, int rank);
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
*/ */
#include <float.h> #include <float.h>
#include "src/runtime/kernel/arm/nnacl/fp32/reduce.h" #include "nnacl/fp32/reduce.h"
#include "src/runtime/kernel/arm/nnacl/errorcode.h" #include "nnacl/errorcode.h"
int ReduceMean(const int outer_size, const int inner_size, const int axis_size, const float *src_data, 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) { const int *src_shape, float *dst_data, const int tid, const int thread_num) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册