Open ArthurLiu-jbl opened 6 months ago
Test_relu : 测试结果: -0.067289 exception: 0.667084
ReLU_riscv::forward_inplace()
int n = size; while (n > 0) { size_t vl = vsetvl_e32m8(n); vfloat32m8_t _p = vle32_v_f32m8(ptr, vl); vbool4_t _b = vmflt_vf_f32m8_b4(_p, .0f, vl); _p = vfmul_vf_f32m8_m(_b, _p, slope, vl); //slope: float(float32_t) vse32_v_f32m8(ptr, _p, vl); ptr += vl; n -= vl; }
for (int i = 0; i < size; i++) { if (*ptr < 0) *ptr *= slope; ptr++; }
clang 17 汇编代码: vsetvli a3, a3, e32, m8, ta, ma vle32.v v8, (a1) vle32.v v16, (a0) vmflt.vf v0, v8, fa5 vfmul.vv v8, v8, v16, v0.t vse32.v v8, (a1)
error log | 日志或报错信息 | ログ
Test_relu : 测试结果: -0.067289 exception: 0.667084
ReLU_riscv::forward_inplace()
if __riscv_vector
else // __riscv_vector
endif // __riscv_vector
context | 编译/运行环境 | バックグラウンド
clang 17 汇编代码: vsetvli a3, a3, e32, m8, ta, ma vle32.v v8, (a1) vle32.v v16, (a0) vmflt.vf v0, v8, fa5 vfmul.vv v8, v8, v16, v0.t vse32.v v8, (a1)
how to reproduce | 复现步骤 | 再現方法