Skip to content

Commit

Permalink
apply code-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui authored and github-actions[bot] committed Oct 20, 2023
1 parent 90ad738 commit d542506
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
14 changes: 4 additions & 10 deletions src/layer/vulkan/convolution1d_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand All @@ -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<VkMat> bindings(4);
bindings[0] = bottom_blob_bordered;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
Expand All @@ -397,7 +392,6 @@ int Convolution1D_vulkan::forward(const VkImageMat& bottom_blob, VkImageMat& top
if (top_blob.empty())
return -100;


std::vector<VkImageMat> bindings(4);
bindings[0] = bottom_blob_bordered;
bindings[1] = top_blob;
Expand Down
2 changes: 1 addition & 1 deletion src/layer/vulkan/convolution1d_vulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Convolution1D_vulkan : virtual public Convolution1D

public:
ncnn::Layer* padding;

Mat weight_data_packed;
Mat bias_data_packed;

Expand Down

0 comments on commit d542506

Please sign in to comment.