diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-11-21 03:04:18 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-12-01 10:41:54 +0000 |
commit | 40f51a63c8e7258db15269427ae4fe1ad199c550 (patch) | |
tree | 353253a41863966995a45556731e7181a643c003 /utils | |
parent | 327800401c4185d98fcc01b9c9efbc038a4228ed (diff) | |
download | ComputeLibrary-40f51a63c8e7258db15269427ae4fe1ad199c550.tar.gz |
Update default C++ standard to C++14
(3RDPARTY_UPDATE)
Resolves: COMPMID-3849
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: I6369f112337310140e2d6c8e79630cd11138dfa0
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4544
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/GraphUtils.h | 60 | ||||
-rw-r--r-- | utils/ImageLoader.h | 10 | ||||
-rw-r--r-- | utils/Utils.h | 4 | ||||
-rw-r--r-- | utils/command_line/CommandLineParser.h | 6 |
4 files changed, 40 insertions, 40 deletions
diff --git a/utils/GraphUtils.h b/utils/GraphUtils.h index 9ab9e54ce0..acd924da28 100644 --- a/utils/GraphUtils.h +++ b/utils/GraphUtils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -459,7 +459,7 @@ private: */ inline std::unique_ptr<graph::ITensorAccessor> get_random_accessor(PixelValue lower, PixelValue upper, const std::random_device::result_type seed = 0) { - return arm_compute::support::cpp14::make_unique<RandomAccessor>(lower, upper, seed); + return std::make_unique<RandomAccessor>(lower, upper, seed); } /** Generates appropriate weights accessor according to the specified path @@ -478,11 +478,11 @@ inline std::unique_ptr<graph::ITensorAccessor> get_weights_accessor(const std::s { if(path.empty()) { - return arm_compute::support::cpp14::make_unique<DummyAccessor>(); + return std::make_unique<DummyAccessor>(); } else { - return arm_compute::support::cpp14::make_unique<NumPyBinLoader>(path + data_file, file_layout); + return std::make_unique<NumPyBinLoader>(path + data_file, file_layout); } } @@ -500,12 +500,12 @@ inline std::unique_ptr<graph::ITensorAccessor> get_input_accessor(const arm_comp { if(!graph_parameters.validation_file.empty()) { - return arm_compute::support::cpp14::make_unique<ValidationInputAccessor>(graph_parameters.validation_file, - graph_parameters.validation_path, - std::move(preprocessor), - bgr, - graph_parameters.validation_range_start, - graph_parameters.validation_range_end); + return std::make_unique<ValidationInputAccessor>(graph_parameters.validation_file, + graph_parameters.validation_path, + std::move(preprocessor), + bgr, + graph_parameters.validation_range_start, + graph_parameters.validation_range_end); } else { @@ -513,17 +513,17 @@ inline std::unique_ptr<graph::ITensorAccessor> get_input_accessor(const arm_comp const std::string &image_file_lower = lower_string(image_file); if(arm_compute::utility::endswith(image_file_lower, ".npy")) { - return arm_compute::support::cpp14::make_unique<NumPyBinLoader>(image_file, graph_parameters.data_layout); + return std::make_unique<NumPyBinLoader>(image_file, graph_parameters.data_layout); } else if(arm_compute::utility::endswith(image_file_lower, ".jpeg") || arm_compute::utility::endswith(image_file_lower, ".jpg") || arm_compute::utility::endswith(image_file_lower, ".ppm")) { - return arm_compute::support::cpp14::make_unique<ImageAccessor>(image_file, bgr, std::move(preprocessor)); + return std::make_unique<ImageAccessor>(image_file, bgr, std::move(preprocessor)); } else { - return arm_compute::support::cpp14::make_unique<DummyAccessor>(); + return std::make_unique<DummyAccessor>(); } } } @@ -548,18 +548,18 @@ inline std::unique_ptr<graph::ITensorAccessor> get_output_accessor(const arm_com ARM_COMPUTE_UNUSED(is_validation); if(!graph_parameters.validation_file.empty()) { - return arm_compute::support::cpp14::make_unique<ValidationOutputAccessor>(graph_parameters.validation_file, - output_stream, - graph_parameters.validation_range_start, - graph_parameters.validation_range_end); + return std::make_unique<ValidationOutputAccessor>(graph_parameters.validation_file, + output_stream, + graph_parameters.validation_range_start, + graph_parameters.validation_range_end); } else if(graph_parameters.labels.empty()) { - return arm_compute::support::cpp14::make_unique<DummyAccessor>(0); + return std::make_unique<DummyAccessor>(0); } else { - return arm_compute::support::cpp14::make_unique<TopNPredictionsAccessor>(graph_parameters.labels, top_n, output_stream); + return std::make_unique<TopNPredictionsAccessor>(graph_parameters.labels, top_n, output_stream); } } /** Generates appropriate output accessor according to the specified graph parameters @@ -582,18 +582,18 @@ inline std::unique_ptr<graph::ITensorAccessor> get_detection_output_accessor(con ARM_COMPUTE_UNUSED(is_validation); if(!graph_parameters.validation_file.empty()) { - return arm_compute::support::cpp14::make_unique<ValidationOutputAccessor>(graph_parameters.validation_file, - output_stream, - graph_parameters.validation_range_start, - graph_parameters.validation_range_end); + return std::make_unique<ValidationOutputAccessor>(graph_parameters.validation_file, + output_stream, + graph_parameters.validation_range_start, + graph_parameters.validation_range_end); } else if(graph_parameters.labels.empty()) { - return arm_compute::support::cpp14::make_unique<DummyAccessor>(0); + return std::make_unique<DummyAccessor>(0); } else { - return arm_compute::support::cpp14::make_unique<DetectionOutputAccessor>(graph_parameters.labels, tensor_shapes, output_stream); + return std::make_unique<DetectionOutputAccessor>(graph_parameters.labels, tensor_shapes, output_stream); } } /** Generates appropriate npy output accessor according to the specified npy_path @@ -613,11 +613,11 @@ inline std::unique_ptr<graph::ITensorAccessor> get_npy_output_accessor(const std { if(npy_path.empty()) { - return arm_compute::support::cpp14::make_unique<DummyAccessor>(0); + return std::make_unique<DummyAccessor>(0); } else { - return arm_compute::support::cpp14::make_unique<NumPyAccessor>(npy_path, shape, data_type, data_layout, output_stream); + return std::make_unique<NumPyAccessor>(npy_path, shape, data_type, data_layout, output_stream); } } @@ -634,11 +634,11 @@ inline std::unique_ptr<graph::ITensorAccessor> get_save_npy_output_accessor(cons { if(npy_name.empty()) { - return arm_compute::support::cpp14::make_unique<DummyAccessor>(0); + return std::make_unique<DummyAccessor>(0); } else { - return arm_compute::support::cpp14::make_unique<SaveNumPyAccessor>(npy_name, is_fortran); + return std::make_unique<SaveNumPyAccessor>(npy_name, is_fortran); } } @@ -650,7 +650,7 @@ inline std::unique_ptr<graph::ITensorAccessor> get_save_npy_output_accessor(cons */ inline std::unique_ptr<graph::ITensorAccessor> get_print_output_accessor(std::ostream &output_stream = std::cout) { - return arm_compute::support::cpp14::make_unique<PrintAccessor>(output_stream); + return std::make_unique<PrintAccessor>(output_stream); } /** Permutes a given tensor shape given the input and output data layout diff --git a/utils/ImageLoader.h b/utils/ImageLoader.h index 2dbb6f9421..5abcb7a60f 100644 --- a/utils/ImageLoader.h +++ b/utils/ImageLoader.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 Arm Limited. + * Copyright (c) 2018-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -392,7 +392,7 @@ public: ARM_COMPUTE_ERROR_ON_MSG_VAR(max_val >= 256, "2 bytes per colour channel not supported in file %s", filename.c_str()); - _feeder = support::cpp14::make_unique<FileImageFeeder>(_fs); + _feeder = std::make_unique<FileImageFeeder>(_fs); } catch(std::runtime_error &e) { @@ -467,7 +467,7 @@ public: _height = height; _data = std::unique_ptr<uint8_t, malloc_deleter>(rgb_image); _is_loaded = true; - _feeder = support::cpp14::make_unique<MemoryImageFeeder>(_data.get()); + _feeder = std::make_unique<MemoryImageFeeder>(_data.get()); } } void close() override @@ -512,9 +512,9 @@ public: switch(type) { case ImageType::PPM: - return support::cpp14::make_unique<PPMLoader>(); + return std::make_unique<PPMLoader>(); case ImageType::JPEG: - return support::cpp14::make_unique<JPEGLoader>(); + return std::make_unique<JPEGLoader>(); case ImageType::UNKNOWN: default: return nullptr; diff --git a/utils/Utils.h b/utils/Utils.h index e44d978b24..b10d18aca2 100644 --- a/utils/Utils.h +++ b/utils/Utils.h @@ -38,7 +38,6 @@ #pragma GCC diagnostic ignored "-Wstrict-overflow" #include "libnpy/npy.hpp" #pragma GCC diagnostic pop -#include "support/MemorySupport.h" #include "support/StringSupport.h" #ifdef ARM_COMPUTE_CL @@ -54,6 +53,7 @@ #include <cstring> #include <fstream> #include <iostream> +#include <memory> #include <random> #include <string> #include <tuple> @@ -110,7 +110,7 @@ int run_example(int argc, char **argv, std::unique_ptr<Example> example); template <typename T> int run_example(int argc, char **argv) { - return run_example(argc, argv, support::cpp14::make_unique<T>()); + return run_example(argc, argv, std::make_unique<T>()); } /** Draw a RGB rectangular window for the detected object diff --git a/utils/command_line/CommandLineParser.h b/utils/command_line/CommandLineParser.h index 5881723da8..e8fabc4251 100644 --- a/utils/command_line/CommandLineParser.h +++ b/utils/command_line/CommandLineParser.h @@ -26,11 +26,11 @@ #include "Option.h" #include "arm_compute/core/utils/misc/Utility.h" -#include "support/MemorySupport.h" #include <iostream> #include <map> #include <memory> +#include <memory> #include <regex> #include <string> #include <utility> @@ -102,14 +102,14 @@ private: template <typename T, typename... As> inline T *CommandLineParser::add_option(const std::string &name, As &&... args) { - auto result = _options.emplace(name, support::cpp14::make_unique<T>(name, std::forward<As>(args)...)); + auto result = _options.emplace(name, std::make_unique<T>(name, std::forward<As>(args)...)); return static_cast<T *>(result.first->second.get()); } template <typename T, typename... As> inline T *CommandLineParser::add_positional_option(As &&... args) { - _positional_options.emplace_back(support::cpp14::make_unique<T>(std::forward<As>(args)...)); + _positional_options.emplace_back(std::make_unique<T>(std::forward<As>(args)...)); return static_cast<T *>(_positional_options.back().get()); } |