COMPMID-3951 LargeGraph_FLOAT32_Rank4_25 CTS failures in Android Q in CL Fix 2
authorSiCong Li <sicong.li@arm.com>
Sun, 8 Nov 2020 22:11:01 +0000 (22:11 +0000)
committerGeorgios Pinitas <georgios.pinitas@arm.com>
Mon, 9 Nov 2020 12:32:08 +0000 (12:32 +0000)
* Select between the 2 reshaped rhs only kernels at run time

Signed-off-by: SiCong Li <sicong.li@arm.com>
Change-Id: Iae6bcc5379d6d84b5538feccf255cbed43fe64c0
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4348
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
arm_compute/runtime/CL/functions/CLGEMM.h
src/runtime/CL/functions/CLGEMM.cpp

index 0b13e7dbbfe1fb491b0d7d3efd8dcc7bffd0373c..3d645bdbff7c71eb53107f1c6476504684cda869 100644 (file)
@@ -212,7 +212,6 @@ private:
     ICLTensor                                                                    *_dst;
     bool                                                                          _reshape_b_only_on_first_run;
     bool                                                                          _is_prepared;
-    bool                                                                          _has_pad_y;
     CLGEMMKernelType                                                              _gemm_kernel_type;
 };
 } // namespace arm_compute
index 0151485849dccfebe94ccee53d2fc5756fe3dc9c..57a5f9739e6c41b0b3cc2185ec9134bc6fd54e4e 100644 (file)
@@ -116,7 +116,6 @@ CLGEMM::CLGEMM(std::shared_ptr<IMemoryManager> 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))