Apply clang-format on repository

Code is formatted as per a revised clang format configuration
file(not part of this delivery). Version 14.0.6 is used.

Exclusion List:
- files with .cl extension
- files that are not strictly C/C++ (e.g. Android.bp, Sconscript ...)
And the following directories
- compute_kernel_writer/validation/
- tests/
- include/
- src/core/NEON/kernels/convolution/
- src/core/NEON/kernels/arm_gemm/
- src/core/NEON/kernels/arm_conv/
- data/

There will be a follow up for formatting of .cl files and the
files under tests/ and compute_kernel_writer/validation/.

Signed-off-by: Felix Thomasmathibalan <felixjohnny.thomasmathibalan@arm.com>
Change-Id: Ib7eb1fcf4e7537b9feaefcfc15098a804a3fde0a
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10391
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
diff --git a/utils/ImageLoader.h b/utils/ImageLoader.h
index aab0f5e..2ae1a41 100644
--- a/utils/ImageLoader.h
+++ b/utils/ImageLoader.h
@@ -68,8 +68,7 @@
      *
      * @param[in] fs Image file stream
      */
-    FileImageFeeder(std::ifstream &fs)
-        : _fs(fs)
+    FileImageFeeder(std::ifstream &fs) : _fs(fs)
     {
     }
     // Inherited overridden methods
@@ -94,8 +93,7 @@
      *
      * @param[in] data Pointer to data
      */
-    MemoryImageFeeder(const uint8_t *data)
-        : _data(data)
+    MemoryImageFeeder(const uint8_t *data) : _data(data)
     {
     }
     /** Prevent instances of this class from being copied (As this class contains pointers) */
@@ -127,8 +125,7 @@
 {
 public:
     /** Default Constructor */
-    IImageLoader()
-        : _feeder(nullptr), _width(0), _height(0)
+    IImageLoader() : _feeder(nullptr), _width(0), _height(0)
     {
     }
     /** Virtual base destructor */
@@ -188,7 +185,7 @@
             // Validate feeding data
             validate_info(image.info());
 
-            switch(image.info()->format())
+            switch (image.info()->format())
             {
                 case Format::U8:
                 {
@@ -204,15 +201,17 @@
                     unsigned char green = 0;
                     unsigned char blue  = 0;
 
-                    execute_window_loop(window, [&](const Coordinates &)
-                    {
-                        red   = _feeder->get();
-                        green = _feeder->get();
-                        blue  = _feeder->get();
+                    execute_window_loop(
+                        window,
+                        [&](const Coordinates &)
+                        {
+                            red   = _feeder->get();
+                            green = _feeder->get();
+                            blue  = _feeder->get();
 
-                        *out.ptr() = 0.2126f * red + 0.7152f * green + 0.0722f * blue;
-                    },
-                    out);
+                            *out.ptr() = 0.2126f * red + 0.7152f * green + 0.0722f * blue;
+                        },
+                        out);
 
                     break;
                 }
@@ -226,11 +225,8 @@
                     Iterator out(&image, window);
                     size_t   row_size = _width * image.info()->element_size();
 
-                    execute_window_loop(window, [&](const Coordinates &)
-                    {
-                        _feeder->get_row(out.ptr(), row_size);
-                    },
-                    out);
+                    execute_window_loop(
+                        window, [&](const Coordinates &) { _feeder->get_row(out.ptr(), row_size); }, out);
 
                     break;
                 }
@@ -241,7 +237,7 @@
             // Unmap buffer if creating a CLTensor
             unmap(image);
         }
-        catch(const std::ifstream::failure &e)
+        catch (const std::ifstream::failure &e)
         {
             ARM_COMPUTE_ERROR_VAR("Loading image file: %s", e.what());
         }
@@ -257,15 +253,19 @@
     void fill_planar_tensor(T &tensor, bool bgr = false)
     {
         ARM_COMPUTE_ERROR_ON(!is_open());
-        ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(&tensor, 1, DataType::U8, DataType::QASYMM8, DataType::F32, DataType::F16);
+        ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(&tensor, 1, DataType::U8, DataType::QASYMM8, DataType::F32,
+                                                      DataType::F16);
 
         const DataLayout  data_layout  = tensor.info()->data_layout();
         const TensorShape tensor_shape = tensor.info()->tensor_shape();
 
         ARM_COMPUTE_UNUSED(tensor_shape);
-        ARM_COMPUTE_ERROR_ON(tensor_shape[get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH)] != _width);
-        ARM_COMPUTE_ERROR_ON(tensor_shape[get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT)] != _height);
-        ARM_COMPUTE_ERROR_ON(tensor_shape[get_data_layout_dimension_index(data_layout, DataLayoutDimension::CHANNEL)] != 3);
+        ARM_COMPUTE_ERROR_ON(tensor_shape[get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH)] !=
+                             _width);
+        ARM_COMPUTE_ERROR_ON(tensor_shape[get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT)] !=
+                             _height);
+        ARM_COMPUTE_ERROR_ON(tensor_shape[get_data_layout_dimension_index(data_layout, DataLayoutDimension::CHANNEL)] !=
+                             3);
 
         ARM_COMPUTE_ERROR_ON(_feeder.get() == nullptr);
 
@@ -282,7 +282,7 @@
 
             // Iterate through every pixel of the image
             Window window;
-            if(data_layout == DataLayout::NCHW)
+            if (data_layout == DataLayout::NCHW)
             {
                 window.set(Window::DimX, Window::Dimension(0, _width, 1));
                 window.set(Window::DimY, Window::Dimension(0, _height, 1));
@@ -303,48 +303,50 @@
             unsigned char green = 0;
             unsigned char blue  = 0;
 
-            execute_window_loop(window, [&](const Coordinates &)
-            {
-                red   = _feeder->get();
-                green = _feeder->get();
-                blue  = _feeder->get();
-
-                switch(tensor.info()->data_type())
+            execute_window_loop(
+                window,
+                [&](const Coordinates &)
                 {
-                    case DataType::U8:
-                    case DataType::QASYMM8:
+                    red   = _feeder->get();
+                    green = _feeder->get();
+                    blue  = _feeder->get();
+
+                    switch (tensor.info()->data_type())
                     {
-                        *(out.ptr() + 0 * stride_z) = bgr ? blue : red;
-                        *(out.ptr() + 1 * stride_z) = green;
-                        *(out.ptr() + 2 * stride_z) = bgr ? red : blue;
-                        break;
+                        case DataType::U8:
+                        case DataType::QASYMM8:
+                        {
+                            *(out.ptr() + 0 * stride_z) = bgr ? blue : red;
+                            *(out.ptr() + 1 * stride_z) = green;
+                            *(out.ptr() + 2 * stride_z) = bgr ? red : blue;
+                            break;
+                        }
+                        case DataType::F32:
+                        {
+                            *reinterpret_cast<float *>(out.ptr() + 0 * stride_z) = static_cast<float>(bgr ? blue : red);
+                            *reinterpret_cast<float *>(out.ptr() + 1 * stride_z) = static_cast<float>(green);
+                            *reinterpret_cast<float *>(out.ptr() + 2 * stride_z) = static_cast<float>(bgr ? red : blue);
+                            break;
+                        }
+                        case DataType::F16:
+                        {
+                            *reinterpret_cast<half *>(out.ptr() + 0 * stride_z) = static_cast<half>(bgr ? blue : red);
+                            *reinterpret_cast<half *>(out.ptr() + 1 * stride_z) = static_cast<half>(green);
+                            *reinterpret_cast<half *>(out.ptr() + 2 * stride_z) = static_cast<half>(bgr ? red : blue);
+                            break;
+                        }
+                        default:
+                        {
+                            ARM_COMPUTE_ERROR("Unsupported data type");
+                        }
                     }
-                    case DataType::F32:
-                    {
-                        *reinterpret_cast<float *>(out.ptr() + 0 * stride_z) = static_cast<float>(bgr ? blue : red);
-                        *reinterpret_cast<float *>(out.ptr() + 1 * stride_z) = static_cast<float>(green);
-                        *reinterpret_cast<float *>(out.ptr() + 2 * stride_z) = static_cast<float>(bgr ? red : blue);
-                        break;
-                    }
-                    case DataType::F16:
-                    {
-                        *reinterpret_cast<half *>(out.ptr() + 0 * stride_z) = static_cast<half>(bgr ? blue : red);
-                        *reinterpret_cast<half *>(out.ptr() + 1 * stride_z) = static_cast<half>(green);
-                        *reinterpret_cast<half *>(out.ptr() + 2 * stride_z) = static_cast<half>(bgr ? red : blue);
-                        break;
-                    }
-                    default:
-                    {
-                        ARM_COMPUTE_ERROR("Unsupported data type");
-                    }
-                }
-            },
-            out);
+                },
+                out);
 
             // Unmap buffer if creating a CLTensor
             unmap(tensor);
         }
-        catch(const std::ifstream::failure &e)
+        catch (const std::ifstream::failure &e)
         {
             ARM_COMPUTE_ERROR_VAR("Loading image file: %s", e.what());
         }
@@ -368,8 +370,7 @@
 {
 public:
     /** Default Constructor */
-    PPMLoader()
-        : IImageLoader(), _fs()
+    PPMLoader() : IImageLoader(), _fs()
     {
     }
 
@@ -386,7 +387,7 @@
             _fs.exceptions(std::ifstream::failbit | std::ifstream::badbit);
             _fs.open(filename, std::ios::in | std::ios::binary);
 
-            unsigned int max_val = 0;
+            unsigned int max_val               = 0;
             std::tie(_width, _height, max_val) = parse_ppm_header(_fs);
 
             ARM_COMPUTE_ERROR_ON_MSG_VAR(max_val >= 256, "2 bytes per colour channel not supported in file %s",
@@ -394,14 +395,14 @@
 
             _feeder = std::make_unique<FileImageFeeder>(_fs);
         }
-        catch(std::runtime_error &e)
+        catch (std::runtime_error &e)
         {
             ARM_COMPUTE_ERROR_VAR("Accessing %s: %s", filename.c_str(), e.what());
         }
     }
     void close() override
     {
-        if(is_open())
+        if (is_open())
         {
             _fs.close();
             _feeder = nullptr;
@@ -443,8 +444,7 @@
 
 public:
     /** Default Constructor */
-    JPEGLoader()
-        : IImageLoader(), _is_loaded(false), _data(nullptr)
+    JPEGLoader() : IImageLoader(), _is_loaded(false), _data(nullptr)
     {
     }
 
@@ -457,7 +457,7 @@
     {
         int      bpp, width, height;
         uint8_t *rgb_image = stbi_load(filename.c_str(), &width, &height, &bpp, 3);
-        if(rgb_image == NULL)
+        if (rgb_image == NULL)
         {
             ARM_COMPUTE_ERROR_VAR("Accessing %s failed", filename.c_str());
         }
@@ -472,7 +472,7 @@
     }
     void close() override
     {
-        if(is_open())
+        if (is_open())
         {
             _width  = 0;
             _height = 0;
@@ -483,7 +483,7 @@
     /** Explicitly Releases the memory of the loaded data */
     void release()
     {
-        if(_is_loaded)
+        if (_is_loaded)
         {
             _data.reset();
             _is_loaded = false;
@@ -492,7 +492,7 @@
     }
 
 private:
-    bool _is_loaded;
+    bool                                     _is_loaded;
     std::unique_ptr<uint8_t, malloc_deleter> _data;
 };
 
@@ -509,7 +509,7 @@
     static std::unique_ptr<IImageLoader> create(const std::string &filename)
     {
         ImageType type = arm_compute::utils::get_image_type_from_file(filename);
-        switch(type)
+        switch (type)
         {
             case ImageType::PPM:
                 return std::make_unique<PPMLoader>();