From 4d2365de0a63f5e8cabe161da2efe99221dcfa43 Mon Sep 17 00:00:00 2001 From: SiCong Li Date: Sun, 8 Nov 2020 22:11:01 +0000 Subject: COMPMID-3951 LargeGraph_FLOAT32_Rank4_25 CTS failures in Android Q in CL Fix 2 * Select between the 2 reshaped rhs only kernels at run time Signed-off-by: SiCong Li Change-Id: Iae6bcc5379d6d84b5538feccf255cbed43fe64c0 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4348 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas --- src/runtime/CL/functions/CLGEMM.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/runtime/CL/functions/CLGEMM.cpp') diff --git a/src/runtime/CL/functions/CLGEMM.cpp b/src/runtime/CL/functions/CLGEMM.cpp index 0151485849..57a5f9739e 100644 --- a/src/runtime/CL/functions/CLGEMM.cpp +++ b/src/runtime/CL/functions/CLGEMM.cpp @@ -116,7 +116,6 @@ CLGEMM::CLGEMM(std::shared_ptr memory_manager, IWeightsManager * _dst(nullptr), _reshape_b_only_on_first_run(false), _is_prepared(false), - _has_pad_y(false), _gemm_kernel_type(CLGEMMKernelType::NATIVE_V1) { } @@ -735,7 +734,13 @@ void CLGEMM::run() CLScheduler::get().enqueue(*_reshape_rhs_kernel, false); } } - if(_has_pad_y) + // In case of RESHAPED_ONLY_RHS, we need to check the padding requirement + // Check if the lhs or dst tensors have padding + const unsigned int cross_plane_pad_lhs = _lhs->info()->padding().top + _lhs->info()->padding().bottom; + const unsigned int cross_plane_pad_dst = _dst->info()->padding().top + _dst->info()->padding().bottom; + + bool has_pad_y = (cross_plane_pad_lhs != 0) || (cross_plane_pad_dst != 0); + if(has_pad_y) { CLScheduler::get().enqueue(*_mm_reshaped_only_rhs_fallback_kernel, true); } @@ -756,16 +761,6 @@ void CLGEMM::prepare() { if(!_is_prepared) { - // In case of RESHAPED_ONLY_RHS, we need to check the padding requirement - if(_gemm_kernel_type == CLGEMMKernelType::RESHAPED_ONLY_RHS) - { - // Check if the lhs or dst tensors have padding - const unsigned int cross_plane_pad_lhs = _lhs->info()->padding().top + _lhs->info()->padding().bottom; - const unsigned int cross_plane_pad_dst = _dst->info()->padding().top + _dst->info()->padding().bottom; - - _has_pad_y = (cross_plane_pad_lhs != 0) || (cross_plane_pad_dst != 0); - } - if(_gemm_kernel_type != CLGEMMKernelType::NATIVE_V1 && _reshape_b_only_on_first_run) { if(_weights_manager && _weights_manager->are_weights_managed(_original_b)) -- cgit v1.2.1