Skip to content

Commit

Permalink
fix unlocked pool allocator destroyed too early issue in gpu convdw a…
Browse files Browse the repository at this point in the history
…nd deconvdw inference
  • Loading branch information
nihui committed Mar 3, 2022
1 parent 30e106b commit b053a8c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 8 additions & 3 deletions src/layer/vulkan/convolutiondepthwise_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,14 @@ int ConvolutionDepthWise_vulkan::upload_model(VkTransfer& cmd, const Option& opt
Mat weight_data_r2 = weight_data.reshape(maxk, group);
convert_packing(weight_data_r2, weight_data_packed, elempack, opt);

cmd.record_upload(weight_data_packed, weight_data_gpu, opt);

cmd.record_upload(weight_data_packed, weight_data_gpu_image, opt);
if (support_image_storage && opt.use_image_storage)
{
cmd.record_upload(weight_data_packed, weight_data_gpu_image, opt);
}
else
{
cmd.record_upload(weight_data_packed, weight_data_gpu, opt);
}

if (bias_term)
{
Expand Down
11 changes: 8 additions & 3 deletions src/layer/vulkan/deconvolutiondepthwise_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,14 @@ int DeconvolutionDepthWise_vulkan::upload_model(VkTransfer& cmd, const Option& o
Mat weight_data_r2_packed;
convert_packing(weight_data_r2, weight_data_r2_packed, elempack, opt);

cmd.record_upload(weight_data_r2_packed, weight_data_gpu, opt);

cmd.record_upload(weight_data_r2_packed, weight_data_gpu_image, opt);
if (support_image_storage && opt.use_image_storage)
{
cmd.record_upload(weight_data_r2_packed, weight_data_gpu_image, opt);
}
else
{
cmd.record_upload(weight_data_r2_packed, weight_data_gpu, opt);
}

if (bias_term)
{
Expand Down

0 comments on commit b053a8c

Please sign in to comment.