!4223 Remove NNACL's c++ features

Merge pull request !4223 from zhanyuan/micro_dev
pull/4223/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit a05aad1706

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save