From a4f378dcd39addd4a63db1c0848f2c120804f4eb Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Fri, 26 Apr 2019 14:54:54 +0100 Subject: COMPMID-1995: Fix clang-tidy warnings - Remove VirtualCall checks - Fix some unused variables errors - Use std::array insted of C style arrays - Various fixes Change-Id: Ife6170b7102de42b8f04e298dcf8476bf90779f0 Signed-off-by: Michalis Spyrou Reviewed-on: https://review.mlplatform.org/c/1049 Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio --- examples/cl_convolution.cpp | 16 ++++++++++------ examples/cl_sgemm.cpp | 11 ++++++++--- 2 files changed, 18 insertions(+), 9 deletions(-) (limited to 'examples') diff --git a/examples/cl_convolution.cpp b/examples/cl_convolution.cpp index b15bbb6cb4..f2d19ef0cc 100644 --- a/examples/cl_convolution.cpp +++ b/examples/cl_convolution.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 ARM Limited. + * Copyright (c) 2016-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -36,7 +36,7 @@ using namespace utils; /** Gaussian 3x3 matrix */ -const int16_t gaussian3x3[] = +const std::array gaussian3x3 = { 1, 2, 1, 2, 4, 2, @@ -45,7 +45,7 @@ const int16_t gaussian3x3[] = /** Gaussian 5x5 matrix */ -const int16_t gaussian5x5[] = +const std::array gaussian5x5 = { 1, 4, 6, 4, 1, 4, 16, 24, 16, 4, @@ -82,8 +82,8 @@ public: dst.allocator()->init(*src.info()); // Apply a Gaussian 3x3 filter to the source image followed by a Gaussian 5x5: - conv3x3.configure(&src, &tmp, gaussian3x3, 0 /* Let arm_compute calculate the scale */, BorderMode::UNDEFINED); - conv5x5.configure(&tmp, &dst, gaussian5x5, 0 /* Let arm_compute calculate the scale */, BorderMode::UNDEFINED); + conv3x3.configure(&src, &tmp, gaussian3x3.data(), 0 /* Let arm_compute calculate the scale */, BorderMode::UNDEFINED); + conv5x5.configure(&tmp, &dst, gaussian5x5.data(), 0 /* Let arm_compute calculate the scale */, BorderMode::UNDEFINED); // Allocate all the images src.allocator()->allocate(); @@ -115,7 +115,11 @@ public: save_to_ppm(dst, output_filename); // save_to_ppm maps and unmaps the image to store as PPM } } - CLImage src{}, tmp{}, dst{}; + +private: + CLImage src{}; + CLImage tmp{}; + CLImage dst{}; CLConvolution3x3 conv3x3{}; CLConvolution5x5 conv5x5{}; std::string output_filename{}; diff --git a/examples/cl_sgemm.cpp b/examples/cl_sgemm.cpp index 805aec1cf3..8e0263dde2 100644 --- a/examples/cl_sgemm.cpp +++ b/examples/cl_sgemm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -41,7 +41,9 @@ class CLSGEMMExample : public Example public: bool do_setup(int argc, char **argv) override { - NPYLoader npy0, npy1, npy2; + NPYLoader npy0; + NPYLoader npy1; + NPYLoader npy2; alpha = 1.0f; beta = 0.0f; @@ -184,7 +186,10 @@ public: } private: - CLTensor src0{}, src1{}, src2{}, dst{}; + CLTensor src0{}; + CLTensor src1{}; + CLTensor src2{}; + CLTensor dst{}; CLGEMM sgemm{}; CLTuner tuner{}; float alpha{}, beta{}; -- cgit v1.2.1