Skip to content

Commit

Permalink
fix rvv extract blob with fp16 enabled, fix #5360 (#5398)
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui authored Apr 1, 2024
1 parent e3758fd commit 824b79a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2703,6 +2703,18 @@ int Extractor::extract(int blob_index, Mat& feat, int type)
}
else
#endif // NCNN_VFPV4
#if NCNN_RVV
if (d->opt.use_fp16_storage && cpu_support_riscv_v() && cpu_support_riscv_zfh() && (type == 0))
{
if (feat.elembits() == 16)
{
Mat feat_fp32;
cast_float16_to_float32(feat, feat_fp32, d->opt);
feat = feat_fp32;
}
}
else
#endif // NCNN_RVV
#if NCNN_BF16
if (d->opt.use_bf16_storage && (type == 0))
{
Expand Down

0 comments on commit 824b79a

Please sign in to comment.