Use polymorphic_downcast instead of dynamic_cast

Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: Ibd8f629c3f0a2943705ba0f7d65a264948dac4b0
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5147
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
diff --git a/src/runtime/OperatorTensor.cpp b/src/runtime/OperatorTensor.cpp
index 5a35154..a8ad53d 100644
--- a/src/runtime/OperatorTensor.cpp
+++ b/src/runtime/OperatorTensor.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Arm Limited.
+ * Copyright (c) 2020-2021 Arm Limited.
  *
  * SPDX-License-Identifier: MIT
  *
@@ -24,6 +24,8 @@
 #include "arm_compute/runtime/OperatorTensor.h"
 #include "arm_compute/runtime/MemoryRegion.h"
 
+#include "support/Cast.h"
+
 namespace arm_compute
 {
 namespace experimental
@@ -48,7 +50,7 @@
     switch(_mem_type)
     {
         case MemoryType::CPU:
-            return (uint8_t *)dynamic_cast<MemoryRegion *>(_memory->region())->buffer();
+            return (uint8_t *)utils::cast::polymorphic_downcast<MemoryRegion *>(_memory->region())->buffer();
         default:
             ARM_COMPUTE_ERROR("Memory type not supported.");
     }