aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/GraphUtils.cpp4
-rw-r--r--utils/GraphUtils.h2
-rw-r--r--utils/ImageLoader.h9
-rw-r--r--utils/Utils.cpp5
-rw-r--r--utils/Utils.h18
5 files changed, 27 insertions, 11 deletions
diff --git a/utils/GraphUtils.cpp b/utils/GraphUtils.cpp
index 3646facab2..eaa7d79778 100644
--- a/utils/GraphUtils.cpp
+++ b/utils/GraphUtils.cpp
@@ -28,7 +28,11 @@
#include "arm_compute/core/Types.h"
#include "arm_compute/graph/Logger.h"
#include "arm_compute/runtime/SubTensor.h"
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-parameter"
#include "utils/ImageLoader.h"
+#pragma GCC diagnostic pop
#include "utils/Utils.h"
#include <iomanip>
diff --git a/utils/GraphUtils.h b/utils/GraphUtils.h
index 4c25dd2460..826ffff8c3 100644
--- a/utils/GraphUtils.h
+++ b/utils/GraphUtils.h
@@ -518,6 +518,7 @@ inline std::unique_ptr<graph::ITensorAccessor> get_output_accessor(const arm_com
bool is_validation = false,
std::ostream &output_stream = std::cout)
{
+ ARM_COMPUTE_UNUSED(is_validation);
if(!graph_parameters.validation_file.empty())
{
return arm_compute::support::cpp14::make_unique<ValidationOutputAccessor>(graph_parameters.validation_file,
@@ -551,6 +552,7 @@ inline std::unique_ptr<graph::ITensorAccessor> get_detection_output_accessor(con
bool is_validation = false,
std::ostream &output_stream = std::cout)
{
+ ARM_COMPUTE_UNUSED(is_validation);
if(!graph_parameters.validation_file.empty())
{
return arm_compute::support::cpp14::make_unique<ValidationOutputAccessor>(graph_parameters.validation_file,
diff --git a/utils/ImageLoader.h b/utils/ImageLoader.h
index 5d3a84c59a..5a2825ebc3 100644
--- a/utils/ImageLoader.h
+++ b/utils/ImageLoader.h
@@ -203,7 +203,7 @@ public:
unsigned char green = 0;
unsigned char blue = 0;
- execute_window_loop(window, [&](const Coordinates & id)
+ execute_window_loop(window, [&](const Coordinates &)
{
red = _feeder->get();
green = _feeder->get();
@@ -225,7 +225,7 @@ public:
Iterator out(&image, window);
size_t row_size = _width * image.info()->element_size();
- execute_window_loop(window, [&](const Coordinates & id)
+ execute_window_loop(window, [&](const Coordinates &)
{
_feeder->get_row(out.ptr(), row_size);
},
@@ -302,7 +302,7 @@ public:
unsigned char green = 0;
unsigned char blue = 0;
- execute_window_loop(window, [&](const Coordinates & id)
+ execute_window_loop(window, [&](const Coordinates &)
{
red = _feeder->get();
green = _feeder->get();
@@ -352,6 +352,7 @@ protected:
/** Validate metadata */
virtual void validate_info(const ITensorInfo *tensor_info)
{
+ ARM_COMPUTE_UNUSED(tensor_info);
}
protected:
@@ -418,7 +419,7 @@ protected:
ARM_COMPUTE_ERROR_ON_MSG((end_position - current_position) < tensor_info->tensor_shape().total_size(),
"Not enough data in file");
- ARM_COMPUTE_UNUSED(end_position);
+ ARM_COMPUTE_UNUSED(end_position, tensor_info);
}
private:
diff --git a/utils/Utils.cpp b/utils/Utils.cpp
index baf829b473..b0e162accd 100644
--- a/utils/Utils.cpp
+++ b/utils/Utils.cpp
@@ -34,6 +34,7 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wswitch-default"
+#pragma GCC diagnostic ignored "-Wunused-parameter"
#define STB_IMAGE_IMPLEMENTATION
#include "stb/stb_image.h"
#pragma GCC diagnostic pop
@@ -313,6 +314,8 @@ void restore_program_cache_from_file(const std::string &filename)
}
cache_file.close();
}
+#else /* ARM_COMPUTE_CL */
+ ARM_COMPUTE_UNUSED(filename);
#endif /* ARM_COMPUTE_CL */
}
@@ -347,6 +350,8 @@ void save_program_cache_to_file(const std::string &filename)
ARM_COMPUTE_ERROR("Cannot open cache file");
}
}
+#else /* ARM_COMPUTE_CL */
+ ARM_COMPUTE_UNUSED(filename);
#endif /* ARM_COMPUTE_CL */
}
} // namespace utils
diff --git a/utils/Utils.h b/utils/Utils.h
index 7fa74ab08b..d669730a3e 100644
--- a/utils/Utils.h
+++ b/utils/Utils.h
@@ -30,7 +30,10 @@
#include "arm_compute/core/Validate.h"
#include "arm_compute/core/Window.h"
#include "arm_compute/runtime/Tensor.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-parameter"
#include "libnpy/npy.hpp"
+#pragma GCC diagnostic pop
#include "support/ToolchainSupport.h"
#ifdef ARM_COMPUTE_CL
@@ -79,6 +82,7 @@ public:
*/
virtual bool do_setup(int argc, char **argv)
{
+ ARM_COMPUTE_UNUSED(argc, argv);
return true;
};
/** Run the example. */
@@ -570,7 +574,7 @@ void save_to_ppm(T &tensor, const std::string &ppm_filename)
arm_compute::Iterator in(&tensor, window);
- arm_compute::execute_window_loop(window, [&](const arm_compute::Coordinates & id)
+ arm_compute::execute_window_loop(window, [&](const arm_compute::Coordinates &)
{
const unsigned char value = *in.ptr();
@@ -588,7 +592,7 @@ void save_to_ppm(T &tensor, const std::string &ppm_filename)
arm_compute::Iterator in(&tensor, window);
- arm_compute::execute_window_loop(window, [&](const arm_compute::Coordinates & id)
+ arm_compute::execute_window_loop(window, [&](const arm_compute::Coordinates &)
{
fs.write(reinterpret_cast<std::fstream::char_type *>(in.ptr()), width * tensor.info()->element_size());
},
@@ -653,7 +657,7 @@ void save_to_npy(T &tensor, const std::string &npy_filename, bool fortran_order)
arm_compute::Iterator in(&tensor, window);
- arm_compute::execute_window_loop(window, [&](const arm_compute::Coordinates & id)
+ arm_compute::execute_window_loop(window, [&](const arm_compute::Coordinates &)
{
stream.write(reinterpret_cast<const char *>(in.ptr()), sizeof(typestring_type));
},
@@ -705,7 +709,7 @@ void load_trained_data(T &tensor, const std::string &filename)
arm_compute::Iterator in(&tensor, window);
- execute_window_loop(window, [&](const Coordinates & id)
+ execute_window_loop(window, [&](const Coordinates &)
{
fs.read(reinterpret_cast<std::fstream::char_type *>(in.ptr()), tensor.info()->tensor_shape()[0] * tensor.info()->element_size());
},
@@ -739,7 +743,7 @@ void fill_random_tensor(T &tensor, float lower_bound, float upper_bound)
{
std::uniform_real_distribution<float> dist(lower_bound, upper_bound);
- execute_window_loop(window, [&](const Coordinates & id)
+ execute_window_loop(window, [&](const Coordinates &)
{
*reinterpret_cast<half *>(it.ptr()) = (half)dist(gen);
},
@@ -751,7 +755,7 @@ void fill_random_tensor(T &tensor, float lower_bound, float upper_bound)
{
std::uniform_real_distribution<float> dist(lower_bound, upper_bound);
- execute_window_loop(window, [&](const Coordinates & id)
+ execute_window_loop(window, [&](const Coordinates &)
{
*reinterpret_cast<float *>(it.ptr()) = dist(gen);
},
@@ -803,7 +807,7 @@ int compare_tensor(ITensor &tensor1, ITensor &tensor2, T tolerance)
Iterator itensor1(&tensor1, window);
Iterator itensor2(&tensor2, window);
- execute_window_loop(window, [&](const Coordinates & id)
+ execute_window_loop(window, [&](const Coordinates &)
{
if(std::abs(*reinterpret_cast<T *>(itensor1.ptr()) - *reinterpret_cast<T *>(itensor2.ptr())) > tolerance)
{