From 960ffa1a50eba42cd16e5cb1b84f664a3ce6211d Mon Sep 17 00:00:00 2001 From: nihui Date: Fri, 15 Feb 2019 08:43:21 +0800 Subject: [PATCH] optimize workgroup size for convolution depthwise and innerproduct pack4 --- src/layer/convolutiondepthwise.cpp | 2 +- src/layer/innerproduct.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layer/convolutiondepthwise.cpp b/src/layer/convolutiondepthwise.cpp index c4166c45e..fd4ae15a8 100644 --- a/src/layer/convolutiondepthwise.cpp +++ b/src/layer/convolutiondepthwise.cpp @@ -659,7 +659,7 @@ int ConvolutionDepthWise::create_pipeline() if (num_output % 4 == 0) { pipeline_convolutiondepthwise_pack4 = new Pipeline(vkdev); - pipeline_convolutiondepthwise_pack4->set_optimal_local_size_xyz(32, 32, std::max(1, num_output / 8)); + pipeline_convolutiondepthwise_pack4->set_optimal_local_size_xyz(32, 32, std::max(1, num_output / 4)); pipeline_convolutiondepthwise_pack4->create("convolutiondepthwise_pack4", specializations, 4, 10); } diff --git a/src/layer/innerproduct.cpp b/src/layer/innerproduct.cpp index b1e2688e1..ad3d901d7 100644 --- a/src/layer/innerproduct.cpp +++ b/src/layer/innerproduct.cpp @@ -411,7 +411,7 @@ int InnerProduct::create_pipeline() if (num_input % 4 == 0 && num_output % 4 != 0) { pipeline_innerproduct_pack4to1 = new Pipeline(vkdev); - pipeline_innerproduct_pack4to1->set_optimal_local_size_xyz(num_output / 4, 1, 1); + pipeline_innerproduct_pack4to1->set_optimal_local_size_xyz(num_output, 1, 1); pipeline_innerproduct_pack4to1->create("innerproduct_pack4to1", specializations, 4, 10); }