Skip to content

Commit 824b79a

Browse files
authored
fix rvv extract blob with fp16 enabled, fix #5360 (#5398)
1 parent e3758fd commit 824b79a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/net.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -2703,6 +2703,18 @@ int Extractor::extract(int blob_index, Mat& feat, int type)
27032703
}
27042704
else
27052705
#endif // NCNN_VFPV4
2706+
#if NCNN_RVV
2707+
if (d->opt.use_fp16_storage && cpu_support_riscv_v() && cpu_support_riscv_zfh() && (type == 0))
2708+
{
2709+
if (feat.elembits() == 16)
2710+
{
2711+
Mat feat_fp32;
2712+
cast_float16_to_float32(feat, feat_fp32, d->opt);
2713+
feat = feat_fp32;
2714+
}
2715+
}
2716+
else
2717+
#endif // NCNN_RVV
27062718
#if NCNN_BF16
27072719
if (d->opt.use_bf16_storage && (type == 0))
27082720
{

0 commit comments

Comments
 (0)