Browse Source

Remove NNACL's c++ features

tags/v0.7.0-beta
zhanyuan 5 years ago
parent
commit
5405aa5bb7
100 changed files with 267 additions and 245 deletions
  1. +1
    -0
      mindspore/lite/CMakeLists.txt
  2. +1
    -1
      mindspore/lite/src/populate_parameter.cc
  3. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/base/fullconnection_base.h
  4. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/base/matmul_base.h
  5. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/fp32/convolution_1x1.h
  6. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/fp32/matmul.h
  7. +1
    -0
      mindspore/lite/src/runtime/kernel/arm/int8/add_int8.cc
  8. +2
    -1
      mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_int8.h
  9. +1
    -0
      mindspore/lite/src/runtime/kernel/arm/int8/depth_to_space_int8.h
  10. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/int8/fullconnection_int8.cc
  11. +1
    -0
      mindspore/lite/src/runtime/kernel/arm/int8/hswish_int8.h
  12. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/int8/matmul_int8.cc
  13. +1
    -0
      mindspore/lite/src/runtime/kernel/arm/int8/sigmoid_int8.cc
  14. +1
    -0
      mindspore/lite/src/runtime/kernel/arm/int8/softmax_int8.h
  15. +5
    -5
      mindspore/lite/src/runtime/kernel/arm/nnacl/activation_grad.h
  16. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/add_int8.cc
  17. +3
    -4
      mindspore/lite/src/runtime/kernel/arm/nnacl/add_int8.h
  18. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max.cc
  19. +1
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max.h
  20. +17
    -17
      mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max_parameter.h
  21. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_common.cc
  22. +5
    -4
      mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_common.h
  23. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_parameter.h
  24. +5
    -4
      mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_self_parameter.h
  25. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/batch_to_space.cc
  26. +7
    -7
      mindspore/lite/src/runtime/kernel/arm/nnacl/batch_to_space.h
  27. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/common_func.cc
  28. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/common_func.h
  29. +5
    -4
      mindspore/lite/src/runtime/kernel/arm/nnacl/concat_parameter.h
  30. +4
    -5
      mindspore/lite/src/runtime/kernel/arm/nnacl/conv_parameter.h
  31. +5
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/crop_parameter.h
  32. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space.cc
  33. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space.h
  34. +12
    -12
      mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space_parameter.h
  35. +16
    -8
      mindspore/lite/src/runtime/kernel/arm/nnacl/errorcode.h
  36. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/flatten.cc
  37. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/flatten.h
  38. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/common_func.h
  39. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_depthwise_fp16.cc
  40. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_depthwise_fp16.h
  41. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_fp16.cc
  42. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_fp16.h
  43. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/pack_fp16.cc
  44. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/pack_fp16.h
  45. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/winograd_transform_fp16.cc
  46. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/winograd_transform_fp16.h
  47. +5
    -5
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/activation.h
  48. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arg_min_max.cc
  49. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arg_min_max.h
  50. +2
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic.cc
  51. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic.h
  52. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic_self.cc
  53. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic_self.h
  54. +2
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/batchnorm.cc
  55. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/batchnorm.h
  56. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/broadcast_to.cc
  57. +5
    -5
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/broadcast_to.h
  58. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/cast.cc
  59. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/cast.h
  60. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/common_func.cc
  61. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/common_func.h
  62. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/concat.cc
  63. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/concat.h
  64. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv.cc
  65. +6
    -6
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv.h
  66. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.cc
  67. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.h
  68. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/crop.cc
  69. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/crop.h
  70. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/deconv.cc
  71. +4
    -4
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/deconv.h
  72. +3
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/elu.cc
  73. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/elu.h
  74. +3
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/embedding_lookup.cc
  75. +9
    -9
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/embedding_lookup.h
  76. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/expandDims.cc
  77. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/expandDims.h
  78. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/fill.cc
  79. +4
    -4
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/fill.h
  80. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gather.cc
  81. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gather.h
  82. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gatherNd.cc
  83. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gatherNd.h
  84. +2
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/local_response_norm.cc
  85. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/local_response_norm.h
  86. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/lstm.cc
  87. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/lstm.h
  88. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/matmul.cc
  89. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/matmul.h
  90. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/one_hot.cc
  91. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/one_hot.h
  92. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pad.cc
  93. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pad.h
  94. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pooling.cc
  95. +4
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pooling.h
  96. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/range.cc
  97. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/range.h
  98. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/rank.cc
  99. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/rank.h
  100. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reduce.cc

+ 1
- 0
mindspore/lite/CMakeLists.txt View File

@@ -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)



+ 1
- 1
mindspore/lite/src/populate_parameter.cc View File

@@ -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"


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/base/fullconnection_base.h View File

@@ -20,7 +20,7 @@
#include <vector>
#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;



+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/base/matmul_base.h View File

@@ -20,7 +20,7 @@
#include <vector>
#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;



+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/fp32/convolution_1x1.h View File

@@ -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 {


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/fp32/matmul.h View File

@@ -19,7 +19,7 @@

#include <vector>
#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 {


+ 1
- 0
mindspore/lite/src/runtime/kernel/arm/int8/add_int8.cc View File

@@ -18,6 +18,7 @@
#include <limits>
#include <algorithm>
#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"


+ 2
- 1
mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_int8.h View File

@@ -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"


+ 1
- 0
mindspore/lite/src/runtime/kernel/arm/int8/depth_to_space_int8.h View File

@@ -18,6 +18,7 @@

#include <vector>
#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 {


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/int8/fullconnection_int8.cc View File

@@ -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"


+ 1
- 0
mindspore/lite/src/runtime/kernel/arm/int8/hswish_int8.h View File

@@ -20,6 +20,7 @@
#include <vector>
#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 {


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/int8/matmul_int8.cc View File

@@ -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"


+ 1
- 0
mindspore/lite/src/runtime/kernel/arm/int8/sigmoid_int8.cc View File

@@ -17,6 +17,7 @@
#include "src/runtime/kernel/arm/int8/sigmoid_int8.h"
#include <limits>
#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"


+ 1
- 0
mindspore/lite/src/runtime/kernel/arm/int8/softmax_int8.h View File

@@ -19,6 +19,7 @@

#include <vector>
#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 {


+ 5
- 5
mindspore/lite/src/runtime/kernel/arm/nnacl/activation_grad.h View File

@@ -17,15 +17,15 @@
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ACTIVATION_GRAD_H_

#include <math.h>
#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) {


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/add_int8.cc View File

@@ -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 <arm_neon.h>
#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) {


+ 3
- 4
mindspore/lite/src/runtime/kernel/arm/nnacl/add_int8.h View File

@@ -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_


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max.cc View File

@@ -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



+ 1
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max.h View File

@@ -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_

+ 17
- 17
mindspore/lite/src/runtime/kernel/arm/nnacl/arg_min_max_parameter.h View File

@@ -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_

+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_common.cc View File

@@ -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) {


+ 5
- 4
mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_common.h View File

@@ -20,10 +20,10 @@
#include <arm_neon.h>
#endif
#include <string.h>
#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);


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_parameter.h View File

@@ -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"





+ 5
- 4
mindspore/lite/src/runtime/kernel/arm/nnacl/arithmetic_self_parameter.h View File

@@ -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_

+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/batch_to_space.cc View File

@@ -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) {


+ 7
- 7
mindspore/lite/src/runtime/kernel/arm/nnacl/batch_to_space.h View File

@@ -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);


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/common_func.cc View File

@@ -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,


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/common_func.h View File

@@ -20,8 +20,8 @@
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#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" {


+ 5
- 4
mindspore/lite/src/runtime/kernel/arm/nnacl/concat_parameter.h View File

@@ -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_


+ 4
- 5
mindspore/lite/src/runtime/kernel/arm/nnacl/conv_parameter.h View File

@@ -20,10 +20,10 @@
#ifdef ENABLE_NEON
#include <arm_neon.h>
#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_


+ 5
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/crop_parameter.h View File

@@ -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_

+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space.cc View File

@@ -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 <string.h>

void DepthToSpaceForNHWC(const void *input, void *output, int *in_shape, DepthToSpaceParameter *param) {


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space.h View File

@@ -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_

+ 12
- 12
mindspore/lite/src/runtime/kernel/arm/nnacl/depth_to_space_parameter.h View File

@@ -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_

+ 16
- 8
mindspore/lite/src/runtime/kernel/arm/nnacl/errorcode.h View File

@@ -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_


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/flatten.cc View File

@@ -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 <string.h>

void Flatten(const void *input, void *output, FlattenParameter *flatten_param) {


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/flatten.h View File

@@ -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_


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/common_func.h View File

@@ -20,8 +20,8 @@
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#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" {


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_depthwise_fp16.cc View File

@@ -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 <arm_neon.h>
#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,


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_depthwise_fp16.h View File

@@ -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,


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_fp16.cc View File

@@ -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 <string.h>
#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


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/conv_fp16.h View File

@@ -17,7 +17,7 @@
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP16_CONV_FP16_H_

#include <arm_neon.h>
#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,


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/pack_fp16.cc View File

@@ -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 <cstring>
#include <cstdlib>



+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/pack_fp16.h View File

@@ -20,8 +20,8 @@
#ifdef ENABLE_NEON
#include <arm_neon.h>
#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);


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/winograd_transform_fp16.cc View File

@@ -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) {


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/winograd_transform_fp16.h View File

@@ -19,8 +19,8 @@

#include <arm_neon.h>
#include <string.h>
#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);


+ 5
- 5
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/activation.h View File

@@ -17,15 +17,15 @@
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_ACTIVATION_H_

#include <math.h>
#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) {


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arg_min_max.cc View File

@@ -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 <stdlib.h>
#include <float.h>



+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arg_min_max.h View File

@@ -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);


+ 2
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic.cc View File

@@ -14,7 +14,8 @@
* 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 block_mod = element_size % C4NUM;


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic.h View File

@@ -19,9 +19,9 @@
#ifdef ENABLE_NEON
#include <arm_neon.h>
#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);


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic_self.cc View File

@@ -16,7 +16,7 @@

#include <string.h>
#include <math.h>
#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) {


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/arithmetic_self.h View File

@@ -20,8 +20,8 @@
#ifdef ENABLE_NEON
#include <arm_neon.h>
#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);



+ 2
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/batchnorm.cc View File

@@ -14,7 +14,8 @@
* 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,
BatchNormParameter *param) {


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/batchnorm.h View File

@@ -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);


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/broadcast_to.cc View File

@@ -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 <string.h>
#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) {


+ 5
- 5
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/broadcast_to.h View File

@@ -19,22 +19,22 @@
#ifdef ENABLE_NEON
#include <arm_neon.h>
#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_


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/cast.cc View File

@@ -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) {


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/cast.h View File

@@ -19,14 +19,14 @@
#ifdef ENABLE_NEON
#include <arm_neon.h>
#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);


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/common_func.cc View File

@@ -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,


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/common_func.h View File

@@ -20,8 +20,8 @@
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#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" {


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/concat.cc View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "src/runtime/kernel/arm/nnacl/fp32/concat.h"
#include "nnacl/fp32/concat.h"
#include <string.h>

void Concat(void **input, int input_num, int axis, int **inputs_output_shape, size_t shape_size, void *output) {


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/concat.h View File

@@ -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);



+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv.cc View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/

#include "src/runtime/kernel/arm/nnacl/fp32/conv.h"
#include "nnacl/fp32/conv.h"
#include <string.h>
#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,


+ 6
- 6
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv.h View File

@@ -20,12 +20,12 @@
#ifdef ENABLE_NEON
#include <arm_neon.h>
#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,


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.cc View File

@@ -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 <arm_neon.h>
#endif


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.h View File

@@ -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);



+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/crop.cc View File

@@ -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 <string.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 Pad4DOffset(CropParameter *crop_param, int64_t *offset) {
int axis = crop_param->axis_;


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/crop.h View File

@@ -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



+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/deconv.cc View File

@@ -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 */


+ 4
- 4
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/deconv.h View File

@@ -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);



+ 3
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/elu.cc View File

@@ -14,9 +14,10 @@
* 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 "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) {


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/elu.h View File

@@ -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_;


+ 3
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/embedding_lookup.cc View File

@@ -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 <string.h>
#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) {


+ 9
- 9
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/embedding_lookup.h View File

@@ -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);


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/expandDims.cc View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/

#include "src/runtime/kernel/arm/nnacl/fp32/expandDims.h"
#include "nnacl/fp32/expandDims.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) {
memcpy(output_ptr, input_ptr, data_size);


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/expandDims.h View File

@@ -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);



+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/fill.cc View File

@@ -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) {


+ 4
- 4
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/fill.h View File

@@ -19,16 +19,16 @@
#ifdef ENABLE_NEON
#include <arm_neon.h>
#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);



+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gather.cc View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "src/runtime/kernel/arm/nnacl/fp32/gather.h"
#include "nnacl/fp32/gather.h"
#include <string.h>

inline int Stride(int *shape, int rank, int index) {


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gather.h View File

@@ -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);


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gatherNd.cc View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/

#include "src/runtime/kernel/arm/nnacl/fp32/gatherNd.h"
#include "nnacl/fp32/gatherNd.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 i = 0;


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/gatherNd.h View File

@@ -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);



+ 2
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/local_response_norm.cc View File

@@ -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 <math.h>

int LocalResponseNorm(float *input_ptr, int out_size, int channel, float *output_ptr,
LocalResponseNormParameter *param) {


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/local_response_norm.h View File

@@ -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);


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/lstm.cc View File

@@ -14,10 +14,10 @@
* limitations under the License.
*/

#include "src/runtime/kernel/arm/nnacl/fp32/lstm.h"
#include "nnacl/fp32/lstm.h"
#include <string.h>
#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;


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/lstm.h View File

@@ -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);


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/matmul.cc View File

@@ -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++) {


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/matmul.h View File

@@ -18,9 +18,9 @@
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_NNACL_FP32_MATMUL_H_

#include <float.h>
#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);


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/one_hot.cc View File

@@ -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) {


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/one_hot.h View File

@@ -20,9 +20,9 @@
#ifdef ENABLE_NEON
#include <arm_neon.h>
#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);


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pad.cc View File

@@ -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) {


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pad.h View File

@@ -21,8 +21,8 @@
#endif
#include <memory.h>
#include <float.h>
#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);


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pooling.cc View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "src/runtime/kernel/arm/nnacl/fp32/pooling.h"
#include "nnacl/fp32/pooling.h"
#include <float.h>

void AvgPooling(const float *input_ptr, float *output_ptr, PoolingParameter *pooling_param, int task_id) {


+ 4
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/pooling.h View File

@@ -20,9 +20,10 @@
#ifdef ENABLE_NEON
#include <arm_neon.h>
#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);



+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/range.cc View File

@@ -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;


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/range.h View File

@@ -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);



+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/rank.cc View File

@@ -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);


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/rank.h View File

@@ -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);



+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/reduce.cc View File

@@ -15,8 +15,8 @@
*/

#include <float.h>
#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) {


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save