Changesets · Branches · Tags · Compare
| Changeset | f02fb0de18a8f193d2ff9919c15d5ea7d6f6283b86f7e79e533bc869265093c6 |
|---|---|
| Author | zhangyang2057 <zhangyang@canaan-creative.com> · 2024-07-18 14:19 +08:00 |
| Committer | GitHub <noreply@github.com> · 2024-07-18 14:19 +08:00 |
| Parents | 7ff5deef62d9 |
2 files changed
modified src/layer/riscv/rvv_mathfun.h +1 −1
| @@ -308,7 +308,7 @@ | ||
| 308 | 308 | \ |
| 309 | 309 | /* clamp the inputs to the range [-9, 9] since anything outside */ \ |
| 310 | 310 | /* this range is -/+1.0f in single-precision. */ \ |
| 311 | - x2 = vfmin_vf_f32m##LMUL(x, c_tanh_hi, vl); \ | |
| 311 | + x2 = vfmin_vf_f32m##LMUL(x2, c_tanh_hi, vl); \ | |
| 312 | 312 | \ |
| 313 | 313 | /* since the polynomials are odd/even, we need x**2. */ \ |
| 314 | 314 | vfloat32m##LMUL##_t z = vfmul_vv_f32m##LMUL(x2, x2, vl); \ |
modified src/layer/riscv/rvv_mathfun_fp16s.h +1 −1
| @@ -308,7 +308,7 @@ | ||
| 308 | 308 | \ |
| 309 | 309 | /* clamp the inputs to the range [-9, 9] since anything outside */ \ |
| 310 | 310 | /* this range is -/+1.0f in single-precision. */ \ |
| 311 | - x2 = vfmin_vf_f16m##LMUL(x, c_tanh_hi, vl); \ | |
| 311 | + x2 = vfmin_vf_f16m##LMUL(x2, c_tanh_hi, vl); \ | |
| 312 | 312 | \ |
| 313 | 313 | /* since the polynomials are odd/even, we need x**2. */ \ |
| 314 | 314 | vfloat16m##LMUL##_t z = vfmul_vv_f16m##LMUL(x2, x2, vl); \ |