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/cl_sgemm.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'examples/cl_sgemm.cpp') diff --git a/examples/cl_sgemm.cpp b/examples/cl_sgemm.cpp index 27af228954..68955c52f7 100644 --- a/examples/cl_sgemm.cpp +++ b/examples/cl_sgemm.cpp @@ -29,6 +29,7 @@ #include "arm_compute/runtime/CL/CLScheduler.h" #include "arm_compute/runtime/CL/CLTuner.h" #include "arm_compute/runtime/CL/functions/CLGEMM.h" + #include "utils/Utils.h" #include @@ -50,15 +51,16 @@ public: CLScheduler::get().default_init(&tuner); 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/cl_sgemm input_matrix_1.npy input_matrix_2.npy [input_matrix_3.npy] [alpha = 1] [beta = 0]\n"; + std::cout << "Usage: 1) ./build/cl_sgemm input_matrix_1.npy input_matrix_2.npy [input_matrix_3.npy] [alpha " + "= 1] [beta = 0]\n"; std::cout << " 2) ./build/cl_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"; @@ -68,29 +70,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); @@ -101,7 +103,7 @@ public: { alpha = strtof(argv[3], nullptr); - if(argc > 4) + if (argc > 4) { beta = strtof(argv[4], nullptr); } @@ -118,11 +120,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); } @@ -141,7 +143,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); @@ -149,7 +151,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); @@ -179,7 +181,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