aboutsummaryrefslogtreecommitdiff
path: root/src/core/GLES_COMPUTE/kernels/GCIm2ColKernel.cpp
diff options
context:
space:
mode:
authorFrank Lei <frank.lei@arm.com>2017-12-05 10:43:33 +0800
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:42:17 +0000
commitb9d38ee6378f3035f8dbad442223d3d9e2f3dc4f (patch)
tree89a4b81430100a4a91902d5987ae42edc438012c /src/core/GLES_COMPUTE/kernels/GCIm2ColKernel.cpp
parent397d58aa40b02a26923c34d8cd4ba274eac45963 (diff)
downloadComputeLibrary-b9d38ee6378f3035f8dbad442223d3d9e2f3dc4f.tar.gz
APPBROWSER-312 Fully connected performance optimization
Change-Id: Ie93fd630ebbad7b6ca8812cb5044b3f1908b45fd Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/111830 Reviewed-by: Stephen Li <stephen.li@arm.com> Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/core/GLES_COMPUTE/kernels/GCIm2ColKernel.cpp')
-rw-r--r--src/core/GLES_COMPUTE/kernels/GCIm2ColKernel.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/core/GLES_COMPUTE/kernels/GCIm2ColKernel.cpp b/src/core/GLES_COMPUTE/kernels/GCIm2ColKernel.cpp
index 97c4dc48a1..e849891c7c 100644
--- a/src/core/GLES_COMPUTE/kernels/GCIm2ColKernel.cpp
+++ b/src/core/GLES_COMPUTE/kernels/GCIm2ColKernel.cpp
@@ -107,7 +107,38 @@ void GCIm2ColKernel::configure(const IGCTensor *input, IGCTensor *output, std::p
else
{
build_opts.insert("#define IM2COL_REDUCED");
- _num_elems_processed_per_iteration = 4 / input->info()->element_size();
+
+ if(input->info()->data_type() == DataType::F32)
+ {
+ _num_elems_processed_per_iteration = 4 / input->info()->element_size();
+ }
+ else if(input->info()->data_type() == DataType::F16)
+ {
+ int input_width = input->info()->dimension(0);
+ int input_height = input->info()->dimension(1);
+
+ build_opts.insert("#define IMAGE_SIZE " + support::cpp11::to_string(input_width * input_height));
+ if(input_width % 8 == 0)
+ {
+ _num_elems_processed_per_iteration = 8;
+ build_opts.insert("#define IM2COL_REDUCED_8X");
+ }
+ else if(input_width % 4 == 0)
+ {
+ _num_elems_processed_per_iteration = 4;
+ build_opts.insert("#define IM2COL_REDUCED_4X");
+ }
+ else if(input_width % 2 == 0)
+ {
+ _num_elems_processed_per_iteration = 2;
+ build_opts.insert("#define IM2COL_REDUCED_2X");
+ }
+ else
+ {
+ _num_elems_processed_per_iteration = 2;
+ build_opts.insert("#define IM2COL_REDUCED_GENERIC");
+ }
+ }
// Create kernel
_kernel = static_cast<GCKernel>(GCKernelLibrary::get().create_kernel("im2col_reduced", build_opts));