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_sgemm.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'examples/neon_sgemm.cpp') diff --git a/examples/neon_sgemm.cpp b/examples/neon_sgemm.cpp index 07696bd622..8cda65a400 100644 --- a/examples/neon_sgemm.cpp +++ b/examples/neon_sgemm.cpp @@ -24,6 +24,7 @@ #include "arm_compute/core/Types.h" #include "arm_compute/runtime/NEON/NEFunctions.h" #include "arm_compute/runtime/NEON/NEScheduler.h" + #include "utils/Utils.h" #include @@ -43,15 +44,16 @@ public: beta = 0.0f; std::ifstream stream; - if(argc > 1) + if (argc > 1) { stream.open(argv[1], std::fstream::in); } - if(argc < 3 || (argc < 4 && stream.bad())) + if (argc < 3 || (argc < 4 && stream.bad())) { // Print help - std::cout << "Usage: 1) ./build/neon_sgemm input_matrix_1.npy input_matrix_2.npy [input_matrix_3.npy] [alpha = 1] [beta = 0]\n"; + std::cout << "Usage: 1) ./build/neon_sgemm input_matrix_1.npy input_matrix_2.npy [input_matrix_3.npy] " + "[alpha = 1] [beta = 0]\n"; std::cout << " 2) ./build/neon_sgemm M N K [alpha = 1.0f] [beta = 0.0f]\n\n"; std::cout << "Too few or no input_matrices provided. Using M=7, N=3, K=5, alpha=1.0f and beta=0.0f\n\n"; @@ -61,29 +63,29 @@ public: } else { - if(stream.good()) /* case file1.npy file2.npy [file3.npy] [alpha = 1.0f] [beta = 0.0f] */ + if (stream.good()) /* case file1.npy file2.npy [file3.npy] [alpha = 1.0f] [beta = 0.0f] */ { npy0.open(argv[1]); npy0.init_tensor(src0, DataType::F32); npy1.open(argv[2]); npy1.init_tensor(src1, DataType::F32); - if(argc > 3) + if (argc > 3) { stream.close(); stream.clear(); stream.open(argv[3], std::fstream::in); - if(stream.good()) /* case with third file */ + if (stream.good()) /* case with third file */ { npy2.open(argv[3]); npy2.init_tensor(src2, DataType::F32); - if(argc > 4) + if (argc > 4) { // Convert string to float alpha = strtof(argv[4], nullptr); - if(argc > 5) + if (argc > 5) { // Convert string to float beta = strtof(argv[5], nullptr); @@ -94,7 +96,7 @@ public: { alpha = strtof(argv[3], nullptr); - if(argc > 4) + if (argc > 4) { beta = strtof(argv[4], nullptr); } @@ -111,11 +113,11 @@ public: src1.allocator()->init(TensorInfo(TensorShape(N, K), 1, DataType::F32)); src2.allocator()->init(TensorInfo(TensorShape(N, M), 1, DataType::F32)); - if(argc > 4) + if (argc > 4) { alpha = strtof(argv[4], nullptr); - if(argc > 5) + if (argc > 5) { beta = strtof(argv[5], nullptr); } @@ -134,7 +136,7 @@ public: dst.allocator()->allocate(); // Fill the input images with either the data provided or random data - if(npy0.is_open()) + if (npy0.is_open()) { npy0.fill_tensor(src0); npy1.fill_tensor(src1); @@ -142,7 +144,7 @@ public: output_filename = "sgemm_out.npy"; is_fortran = npy0.is_fortran(); - if(npy2.is_open()) + if (npy2.is_open()) { src2.allocator()->allocate(); npy2.fill_tensor(src2); @@ -169,7 +171,7 @@ public: } void do_teardown() override { - if(!output_filename.empty()) /* Save to .npy file */ + if (!output_filename.empty()) /* Save to .npy file */ { save_to_npy(dst, output_filename, is_fortran); } -- cgit v1.2.1