From e1314665fcfd2a32d6117a8fc16f67a83db3bb05 Mon Sep 17 00:00:00 2001 From: Michele Di Giorgio Date: Mon, 1 Feb 2021 17:09:32 +0000 Subject: Make CL Pooling kernels and functions state-less Resolves COMPMID-4000 Change-Id: I64878f93c033b4928fdefbb964c37c67fdecfaab Signed-off-by: Michele Di Giorgio Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4971 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Manuel Bottini Reviewed-by: Georgios Pinitas --- src/runtime/CL/tuners/BifrostTuner.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/runtime/CL/tuners/BifrostTuner.cpp') diff --git a/src/runtime/CL/tuners/BifrostTuner.cpp b/src/runtime/CL/tuners/BifrostTuner.cpp index 8badd57b9e..7a06de6d1c 100644 --- a/src/runtime/CL/tuners/BifrostTuner.cpp +++ b/src/runtime/CL/tuners/BifrostTuner.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -27,6 +27,8 @@ #include "src/core/CL/CLKernels.h" #include "support/Cast.h" +#include "src/core/gpu/cl/kernels/ClPoolingKernel.h" + namespace arm_compute { namespace tuners @@ -208,7 +210,7 @@ void tune_gemm_kernel(CLGEMMMatrixMultiplyKernel &k) k.set_lws_hint(lws_hint); } -void tune_pooling_kernel(CLPoolingLayerKernel &k) +void tune_pooling_kernel(opencl::kernels::ClPoolingKernel &k) { cl::NDRange lws_hint = k.lws_hint(); const GPUTarget gpu_target = k.get_target(); @@ -217,7 +219,7 @@ void tune_pooling_kernel(CLPoolingLayerKernel &k) // On Bifrost, this works for up to 35x35xC filters, for which the pooling_layer_3_optimized // kernel is launched with gws=(9, 33, C). In any case, the hint will be ignored if it is // invalid (e.g. exceeds the maximum workgroup size that the kernel can be launched with). - if(k._input->info()->data_layout() == DataLayout::NCHW) + if(k._pool_info.data_layout == DataLayout::NCHW) { if(gpu_target_is_in(gpu_target, GPUTarget::G71, GPUTarget::G72, GPUTarget::G76, @@ -279,9 +281,9 @@ void BifrostTuner::tune_kernel_static(ICLKernel &kernel) { tune_gemm_kernel(*utils::cast::polymorphic_downcast(&kernel)); } - else if(dynamic_cast(&kernel) != nullptr) + else if(dynamic_cast(&kernel) != nullptr) { - tune_pooling_kernel(*utils::cast::polymorphic_downcast(&kernel)); + tune_pooling_kernel(*utils::cast::polymorphic_downcast(&kernel)); } else if(dynamic_cast(&kernel) != nullptr) { -- cgit v1.2.1