From afd38f0c617d6f89b2b4532c6c44f116617e2b6f Mon Sep 17 00:00:00 2001 From: Felix Thomasmathibalan Date: Wed, 27 Sep 2023 17:46:17 +0100 Subject: 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 Change-Id: Ib7eb1fcf4e7537b9feaefcfc15098a804a3fde0a Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10391 Benchmark: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Gunes Bayir --- examples/neon_gemm_qasymm8.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'examples/neon_gemm_qasymm8.cpp') diff --git a/examples/neon_gemm_qasymm8.cpp b/examples/neon_gemm_qasymm8.cpp index f6f5dc1026..3aaad02f8a 100644 --- a/examples/neon_gemm_qasymm8.cpp +++ b/examples/neon_gemm_qasymm8.cpp @@ -22,10 +22,11 @@ * SOFTWARE. */ #include "arm_compute/core/Types.h" -#include "arm_compute/core/WindowIterator.h" #include "arm_compute/core/utils/quantization/AsymmHelpers.h" +#include "arm_compute/core/WindowIterator.h" #include "arm_compute/runtime/NEON/NEFunctions.h" #include "arm_compute/runtime/NEON/NEScheduler.h" + #include "support/ToolchainSupport.h" #include "utils/Utils.h" @@ -38,7 +39,7 @@ using namespace utils; void find_min_max(int size, const float *data, float *min, float *max) { *min = *max = data[0]; - for(int i = 0; i < size; i++) + for (int i = 0; i < size; i++) { const float val = data[i]; *min = std::min(*min, val); @@ -66,11 +67,11 @@ QuantizationInfo choose_quantization_params(float min, float max) // But we need to nudge the zero_point to an integer (exact quantized value) std::uint8_t zero_point_nudged = 0; - if(zero_point_real < qmin) + if (zero_point_real < qmin) { zero_point_nudged = qmin; } - else if(zero_point_real > qmax) + else if (zero_point_real > qmax) { zero_point_nudged = qmax; } @@ -85,7 +86,7 @@ QuantizationInfo choose_quantization_params(float min, float max) void quantize_values(int size, qasymm8_t *output, float *input, const QuantizationInfo qinfo) { - for(int i = 0; i < size; i++) + for (int i = 0; i < size; i++) { output[i] = quantize_qasymm8(input[i], qinfo); } @@ -108,7 +109,7 @@ int main(int argc, char **argv) bool default_input = true; // Parse args - if(argc < 3) /* case default matrix sizes */ + if (argc < 3) /* case default matrix sizes */ { // Print help std::cout << "Usage: ./build/neon_gemm_qasymm8 M N K\n"; @@ -144,23 +145,23 @@ int main(int argc, char **argv) // Fill in: one is the identity matrix, other is sequential values // src1: Identity matrix - for(size_t i = 0; i < M * K; i++) + for (size_t i = 0; i < M * K; i++) { src1_ptr[i] = 0; } - for(size_t i = 0; i < M; i++) + for (size_t i = 0; i < M; i++) { src1_ptr[i * K + i] = 1.0f; } // src2: Sequential values matrix - for(size_t i = 0; i < K * N; i++) + for (size_t i = 0; i < K * N; i++) { src2_ptr[i] = i * 1.123f; } // Otherwise if M, N, K is given, fill in with random values - if(!default_input) + if (!default_input) { fill_random_tensor(src1, 0.f, 1.f); fill_random_tensor(src2, 0.f, 1.f); @@ -223,7 +224,7 @@ int main(int argc, char **argv) NEGEMMLowpOutputStage gemmlowp_output_stage; int output_multiplier; int output_shift; - float multiplier = (src1_qinfo.uniform().scale * src2_qinfo.uniform().scale) / dst0_qinfo.uniform().scale; + float multiplier = (src1_qinfo.uniform().scale * src2_qinfo.uniform().scale) / dst0_qinfo.uniform().scale; quantization::calculate_quantized_multiplier_less_than_one(multiplier, &output_multiplier, &output_shift); std::cout << "(q_multiplier, q_shift) = (" << output_multiplier << ", " << output_shift << ")\n\n"; -- cgit v1.2.1