Skip to content

Commit e207b3b

Browse files
authored
fix vulkan command upload pack16 mat (#6231)
1 parent a17e31b commit e207b3b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/command.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,14 @@ void VkCompute::record_upload(const Mat& src, VkMat& dst, const Option& opt)
366366
src_fp16 = src;
367367
}
368368

369+
// vkdev->convert_packing only handles elempack=1/4/8
370+
if (src_fp16.elempack > 8)
371+
{
372+
Mat src_fp16_pack8;
373+
ncnn::convert_packing(src_fp16, src_fp16_pack8, 8, opt);
374+
src_fp16 = src_fp16_pack8;
375+
}
376+
369377
// upload
370378
VkMat dst_staging;
371379
dst_staging.create_like(src_fp16, opt.staging_vkallocator);

0 commit comments

Comments
 (0)