Skip to content

Commit

Permalink
Optimze erf for rvv.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyang2057 committed Sep 27, 2024
1 parent 52b0e8d commit e250d13
Show file tree
Hide file tree
Showing 4 changed files with 415 additions and 66 deletions.
10 changes: 10 additions & 0 deletions src/Native/include/nncase/ntt/arch/riscv64/primitive_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,16 @@ REGISTER_RVV_UNARY_OP(square, float, square_float32)
REGISTER_RVV_KERNEL(TANH_FLOAT32)
REGISTER_RVV_UNARY_OP(tanh, float, tanh_float32)

// erf
#define ERF_FLOAT32(lmul, mlen) \
inline vfloat32m##lmul##_t erf_float32(const vfloat32m##lmul##_t &v, \
const size_t vl) { \
return erf_ps(v, vl); \
}

REGISTER_RVV_KERNEL(ERF_FLOAT32)
REGISTER_RVV_UNARY_OP(erf, float, erf_float32)

// binary
#define RVV_BINARY_OP(op, dtype, vl, kernel) \
template <> struct op<ntt::vector<dtype, vl>, ntt::vector<dtype, vl>> { \
Expand Down
Loading

0 comments on commit e250d13

Please sign in to comment.