aboutsummaryrefslogtreecommitdiff
path: root/examples/cl_sgemm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cl_sgemm.cpp')
-rw-r--r--examples/cl_sgemm.cpp30
1 files changed, 16 insertions, 14 deletions
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 <cstdlib>
@@ -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);
}