Skip to content

Commit

Permalink
fix rvv extract blob with fp16 enabled, fix #5360
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Apr 1, 2024
1 parent e3758fd commit 83b6f29
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/net.cpp
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 83b6f29

Please sign in to comment.