Skip to content

Commit

Permalink
apply code-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui authored and github-actions[bot] committed Dec 2, 2024
1 parent c3b9078 commit c651d48
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions src/layer/riscv/rvv_mathfun.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,14 @@ _RVV_FLOAT32_POW_OP(4, 8)
_RVV_FLOAT32_POW_OP(8, 4)

#if __riscv_xtheadvector
#define _RVV_FLOAT32_SIGMOID_OP(LMUL, MLEN) \
static inline vfloat32m##LMUL##_t sigmoid_ps(vfloat32m##LMUL##_t _v, size_t vl) \
{ \
_v = __riscv_vfneg_v_f32m##LMUL(_v, vl); \
_v = exp_ps(_v, vl); \
_v = __riscv_vfadd_vf_f32m##LMUL(_v, 1.f, vl); \
vfloat32m##LMUL##_t _reciprocal = __riscv_vfrdiv_vf_f32m##LMUL(_v, 1.f, vl); \
return _reciprocal; \
#define _RVV_FLOAT32_SIGMOID_OP(LMUL, MLEN) \
static inline vfloat32m##LMUL##_t sigmoid_ps(vfloat32m##LMUL##_t _v, size_t vl) \
{ \
_v = __riscv_vfneg_v_f32m##LMUL(_v, vl); \
_v = exp_ps(_v, vl); \
_v = __riscv_vfadd_vf_f32m##LMUL(_v, 1.f, vl); \
vfloat32m##LMUL##_t _reciprocal = __riscv_vfrdiv_vf_f32m##LMUL(_v, 1.f, vl); \
return _reciprocal; \
}
#else // __riscv_xtheadvector
#define _RVV_FLOAT32_SIGMOID_OP(LMUL, MLEN) \
Expand Down
16 changes: 8 additions & 8 deletions src/layer/riscv/rvv_mathfun_fp16s.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,14 @@ _RVV_FLOAT16_POW_OP(4, 4)
_RVV_FLOAT16_POW_OP(8, 2)

#if __riscv_xtheadvector
#define _RVV_FLOAT16_SIGMOID_OP(LMUL, MLEN) \
static inline vfloat16m##LMUL##_t sigmoid_ps(vfloat16m##LMUL##_t _v, size_t vl) \
{ \
_v = __riscv_vfneg_v_f16m##LMUL(_v, vl); \
_v = exp_ps(_v, vl); \
_v = __riscv_vfadd_vf_f16m##LMUL(_v, (__fp16)1.f, vl); \
vfloat16m##LMUL##_t _reciprocal = __riscv_vfrdiv_vf_f16m##LMUL(_v, (__fp16)1.f, vl); \
return _reciprocal; \
#define _RVV_FLOAT16_SIGMOID_OP(LMUL, MLEN) \
static inline vfloat16m##LMUL##_t sigmoid_ps(vfloat16m##LMUL##_t _v, size_t vl) \
{ \
_v = __riscv_vfneg_v_f16m##LMUL(_v, vl); \
_v = exp_ps(_v, vl); \
_v = __riscv_vfadd_vf_f16m##LMUL(_v, (__fp16)1.f, vl); \
vfloat16m##LMUL##_t _reciprocal = __riscv_vfrdiv_vf_f16m##LMUL(_v, (__fp16)1.f, vl); \
return _reciprocal; \
}
#else // __riscv_xtheadvector
#define _RVV_FLOAT16_SIGMOID_OP(LMUL, MLEN) \
Expand Down

0 comments on commit c651d48

Please sign in to comment.