Browse Source

add erf kernel

tags/v1.2.0-rc1
Junjie Cheng 4 years ago
parent
commit
0ee840d02e
4 changed files with 12 additions and 1 deletions
  1. +7
    -0
      mindspore/lite/nnacl/fp32/arithmetic_self_fp32.c
  2. +2
    -0
      mindspore/lite/nnacl/fp32/arithmetic_self_fp32.h
  3. +2
    -1
      mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_self_fp32.cc
  4. +1
    -0
      mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_self_fp32.h

+ 7
- 0
mindspore/lite/nnacl/fp32/arithmetic_self_fp32.c View File

@@ -138,3 +138,10 @@ int ElementReciprocal(const float *input, float *output, const int element_size)
}
return NNACL_OK;
}

int ElementErf(const float *input, float *output, const int element_size) {
for (int i = 0; i < element_size; i++) {
output[i] = erff(input[i]);
}
return NNACL_OK;
}

+ 2
- 0
mindspore/lite/nnacl/fp32/arithmetic_self_fp32.h View File

@@ -53,6 +53,8 @@ int ElementCeil(const float *input, float *output, const int number);
int ElementNegative(const float *input, float *output, const int element_size);

int ElementReciprocal(const float *input, float *output, const int element_size);

int ElementErf(const float *input, float *output, const int element_size);
#ifdef __cplusplus
}
#endif


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

@@ -42,7 +42,8 @@ ArithmeticSelfFunc ArithmeticSelfCPUKernel::GetArithmeticSelfFun(int primitive_t
{mindspore::schema::PrimitiveType_Ceil, ElementCeil},
{mindspore::schema::PrimitiveType_Round, ElementRound},
{mindspore::schema::PrimitiveType_Neg, ElementNegative},
{mindspore::schema::PrimitiveType_Reciprocal, ElementReciprocal}};
{mindspore::schema::PrimitiveType_Reciprocal, ElementReciprocal},
{mindspore::schema::PrimitiveType_Erf, ElementErf}};
for (size_t i = 0; i < sizeof(type_func_table) / sizeof(TYPE_FUNC_INFO); i++) {
if (type_func_table[i].primitive_type_ == primitive_type) {
return type_func_table[i].func_;


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

@@ -22,6 +22,7 @@
using mindspore::schema::PrimitiveType_Abs;
using mindspore::schema::PrimitiveType_Ceil;
using mindspore::schema::PrimitiveType_Cos;
using mindspore::schema::PrimitiveType_Erf;
using mindspore::schema::PrimitiveType_Floor;
using mindspore::schema::PrimitiveType_Log;
using mindspore::schema::PrimitiveType_LogicalNot;


Loading…
Cancel
Save