Improve selection speed of CPU implementations

CPU micro-kernel to be used was picked during kernel execution.
Move selection during configuration to reduce runtime overhead.

Standardize kernel names as follows:
<simd_tech>_<data_type>_<data_layout>_<kernel_name>
e.g. sve_fp32_nhwc_scale

Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: I544f1c08c8fef0f130a3bde61882ccb9a1f47f21
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5855
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
diff --git a/src/core/cpu/kernels/CpuFloorKernel.cpp b/src/core/cpu/kernels/CpuFloorKernel.cpp
index c2e9d48..d41df6a 100644
--- a/src/core/cpu/kernels/CpuFloorKernel.cpp
+++ b/src/core/cpu/kernels/CpuFloorKernel.cpp
@@ -54,18 +54,18 @@
 {
     const char            *name;
     const FloorSelectorPtr is_selected;
-    FloorUKernelPtr        func;
+    FloorUKernelPtr        ukernel;
 };
 
 static const FloorUKernel available_kernels[] =
 {
     {
-        "fp16_neon_floor",
+        "neon_fp16_floor",
         [](const FloorSelectorData & data) { return data.dt == DataType::F16; },
         REGISTER_FP16_NEON(arm_compute::cpu::fp16_neon_floor)
     },
     {
-        "f32_neon_floor",
+        "neon_fp32_floor",
         [](const FloorSelectorData & data) { return data.dt == DataType::F32; },
         REGISTER_FP32_NEON(arm_compute::cpu::fp32_neon_floor)
     },
@@ -94,7 +94,7 @@
     ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(src, dst);
 
     const auto *uk = get_implementation(FloorSelectorData{ src->data_type() });
-    ARM_COMPUTE_RETURN_ERROR_ON(uk == nullptr || uk->func == nullptr);
+    ARM_COMPUTE_RETURN_ERROR_ON(uk == nullptr || uk->ukernel == nullptr);
 
     // Validate in case of configured output
     if(dst->total_size() > 0)
@@ -110,12 +110,15 @@
 void CpuFloorKernel::configure(const ITensorInfo *src, ITensorInfo *dst)
 {
     ARM_COMPUTE_ERROR_ON_NULLPTR(src, dst);
+    ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(src, dst));
 
-    // Auto initialize output
     auto_init_if_empty(*dst, src->tensor_shape(), 1, src->data_type());
 
-    // Validate
-    ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(src, dst));
+    const auto *uk = get_implementation(FloorSelectorData{ src->data_type() });
+    ARM_COMPUTE_ERROR_ON_NULLPTR(uk);
+
+    _run_method = uk->ukernel;
+    _name       = std::string("CpuFloorKernel").append("/").append(uk->name);
 
     // Configure kernel window
     const Window win = calculate_max_window(*src, Steps());
@@ -146,12 +149,11 @@
     ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(IKernel::window(), window);
 
     ARM_COMPUTE_ERROR_ON(tensors.empty());
+    ARM_COMPUTE_ERROR_ON(_run_method == nullptr);
 
     const ITensor *src = tensors.get_const_tensor(TensorType::ACL_SRC);
     ITensor       *dst = tensors.get_tensor(TensorType::ACL_DST);
-
-    const auto  len     = static_cast<int>(window.x().end()) - static_cast<int>(window.x().start());
-    const auto *ukernel = get_implementation(FloorSelectorData{ src->info()->data_type() });
+    const auto     len = static_cast<int>(window.x().end()) - static_cast<int>(window.x().start());
 
     Window win{ window };
     win.set(Window::DimX, Window::Dimension(0, 1, 1));
@@ -161,14 +163,14 @@
 
     execute_window_loop(win, [&](const Coordinates &)
     {
-        ukernel->func(src_it.ptr(), dst_it.ptr(), len);
+        _run_method(src_it.ptr(), dst_it.ptr(), len);
     },
     src_it, dst_it);
 }
 
 const char *CpuFloorKernel::name() const
 {
-    return "CpuFloorKernel";
+    return _name.c_str();
 }
 } // namespace kernels
 } // namespace cpu