diff --git a/src/layer/vulkan/convolution1d_vulkan.cpp b/src/layer/vulkan/convolution1d_vulkan.cpp index 445e29345b88..f9d9135ceb90 100644 --- a/src/layer/vulkan/convolution1d_vulkan.cpp +++ b/src/layer/vulkan/convolution1d_vulkan.cpp @@ -166,7 +166,7 @@ int Convolution1D_vulkan::upload_model(VkTransfer& cmd, const Option& opt) { cmd.record_upload(weight_data_packed, weight_data_gpu, opt); } - + weight_data_packed.release(); if (bias_term) @@ -196,7 +196,6 @@ int Convolution1D_vulkan::forward(const VkMat& bottom_blob, VkMat& top_blob, VkC const int kernel_extent_w = dilation_w * (kernel_w - 1) + 1; - VkMat bottom_blob_bordered = bottom_blob; if (pad_left > 0 || pad_right > 0) { @@ -259,13 +258,12 @@ int Convolution1D_vulkan::forward(const VkMat& bottom_blob, VkMat& top_blob, VkC } } - int outw = (bottom_blob_bordered.w - kernel_extent_w) / stride_w + 1; int out_elempack = opt.use_shader_pack8 && num_output % 8 == 0 ? 8 : num_output % 4 == 0 ? 4 : 1; - + size_t out_elemsize = elemsize / elempack * out_elempack; - + if (opt.use_fp16_packed && !opt.use_fp16_storage) { if (out_elempack == 8) out_elemsize = 8 * 2u; @@ -276,7 +274,6 @@ int Convolution1D_vulkan::forward(const VkMat& bottom_blob, VkMat& top_blob, VkC top_blob.create(outw, num_output / out_elempack, out_elemsize, out_elempack, opt.blob_vkallocator); if (top_blob.empty()) return -100; - std::vector bindings(4); bindings[0] = bottom_blob_bordered; @@ -316,7 +313,6 @@ int Convolution1D_vulkan::forward(const VkImageMat& bottom_blob, VkImageMat& top const int kernel_extent_w = dilation_w * (kernel_w - 1) + 1; - VkImageMat bottom_blob_bordered = bottom_blob; if (pad_left > 0 || pad_right > 0) { @@ -379,11 +375,10 @@ int Convolution1D_vulkan::forward(const VkImageMat& bottom_blob, VkImageMat& top } } - int outw = (bottom_blob_bordered.w - kernel_extent_w) / stride_w + 1; int out_elempack = opt.use_shader_pack8 && num_output % 8 == 0 ? 8 : num_output % 4 == 0 ? 4 : 1; - + size_t out_elemsize = elemsize / elempack * out_elempack; if (opt.use_fp16_packed && !opt.use_fp16_storage) @@ -397,7 +392,6 @@ int Convolution1D_vulkan::forward(const VkImageMat& bottom_blob, VkImageMat& top if (top_blob.empty()) return -100; - std::vector bindings(4); bindings[0] = bottom_blob_bordered; bindings[1] = top_blob; diff --git a/src/layer/vulkan/convolution1d_vulkan.h b/src/layer/vulkan/convolution1d_vulkan.h index 0356d1948cb0..4fb22040daa2 100644 --- a/src/layer/vulkan/convolution1d_vulkan.h +++ b/src/layer/vulkan/convolution1d_vulkan.h @@ -35,7 +35,7 @@ class Convolution1D_vulkan : virtual public Convolution1D public: ncnn::Layer* padding; - + Mat weight_data_packed; Mat bias_data_packed;