COMPMID-3792: Graph examples crash on bare-metal
authorGeorgios Pinitas <georgios.pinitas@arm.com>
Tue, 10 Nov 2020 16:42:30 +0000 (16:42 +0000)
committerGeorgios Pinitas <georgios.pinitas@arm.com>
Wed, 11 Nov 2020 14:21:06 +0000 (14:21 +0000)
Restricts check of empty windows to 1D splits.
This avoids out-of-bounds access when the GEMM2D Interleaved kernel
is picked where the split dimension specified is MAX_UINT32.

Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: I65f42a0cda7b2f1ae65f29c665c2734fbc825214
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4367
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Sang-Hoon Park <sang-hoon.park@arm.com>
src/runtime/CPP/SingleThreadScheduler.cpp

index 6f67bc005f77ddd3636289a27d34574a12913b37..96265ac757ce2e0b2029b4173f06631f9bdbad15 100644 (file)
@@ -37,11 +37,15 @@ void SingleThreadScheduler::set_num_threads(unsigned int num_threads)
 
 void SingleThreadScheduler::schedule(ICPPKernel *kernel, const Hints &hints)
 {
-    const Window      &max_window     = kernel->window();
-    const unsigned int num_iterations = max_window.num_iterations(hints.split_dimension());
-    if(num_iterations < 1)
+    const Window &max_window = kernel->window();
+
+    if(hints.split_dimension() != IScheduler::split_dimensions_all)
     {
-        return;
+        const unsigned int num_iterations = max_window.num_iterations(hints.split_dimension());
+        if(num_iterations < 1)
+        {
+            return;
+        }
     }
 
     ThreadInfo info;