From d0ae8b8ac8a371fd552c46d4b3be3db8628a5ade Mon Sep 17 00:00:00 2001 From: Moritz Pflanzer Date: Thu, 29 Jun 2017 14:51:57 +0100 Subject: COMPMID-417: Extract common toolchain support file The support file is needed as Android toolchains are missing some C++11 functions. It further includes functions that have been introduced in C++14 but which we already need. Eventually the support file might become unnecessary if the Android compilers improve and we switch to C++14. Change-Id: Ib5ec506f1a17c78149c315ab2096b901b852c180 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/79247 Reviewed-by: Georgios Pinitas Tested-by: Kaizen Reviewed-by: Pablo Tello --- arm_compute/core/CL/CLHelpers.h | 5 +- arm_compute/core/Helpers.h | 40 --- arm_compute/runtime/Array.h | 4 +- src/runtime/CL/CLMultiHOG.cpp | 4 +- src/runtime/CL/CLPyramid.cpp | 4 +- src/runtime/CL/functions/CLAbsoluteDifference.cpp | 4 +- src/runtime/CL/functions/CLAccumulate.cpp | 8 +- src/runtime/CL/functions/CLActivationLayer.cpp | 4 +- src/runtime/CL/functions/CLArithmeticAddition.cpp | 4 +- .../CL/functions/CLArithmeticSubtraction.cpp | 4 +- src/runtime/CL/functions/CLBitwiseAnd.cpp | 4 +- src/runtime/CL/functions/CLBitwiseNot.cpp | 4 +- src/runtime/CL/functions/CLBitwiseOr.cpp | 4 +- src/runtime/CL/functions/CLBitwiseXor.cpp | 4 +- src/runtime/CL/functions/CLBox3x3.cpp | 4 +- src/runtime/CL/functions/CLCannyEdge.cpp | 8 +- src/runtime/CL/functions/CLChannelCombine.cpp | 6 +- src/runtime/CL/functions/CLChannelExtract.cpp | 6 +- src/runtime/CL/functions/CLColorConvert.cpp | 10 +- src/runtime/CL/functions/CLConvolution.cpp | 6 +- src/runtime/CL/functions/CLDepthConcatenate.cpp | 6 +- src/runtime/CL/functions/CLDepthConvert.cpp | 4 +- src/runtime/CL/functions/CLDerivative.cpp | 4 +- src/runtime/CL/functions/CLDilate.cpp | 4 +- src/runtime/CL/functions/CLErode.cpp | 4 +- src/runtime/CL/functions/CLFillBorder.cpp | 4 +- src/runtime/CL/functions/CLGEMMInterleave4x4.cpp | 4 +- src/runtime/CL/functions/CLGEMMTranspose1xW.cpp | 4 +- src/runtime/CL/functions/CLGaussian3x3.cpp | 4 +- src/runtime/CL/functions/CLGaussianPyramid.cpp | 12 +- src/runtime/CL/functions/CLHOGMultiDetection.cpp | 14 +- src/runtime/CL/functions/CLHarrisCorners.cpp | 10 +- src/runtime/CL/functions/CLLaplacianPyramid.cpp | 6 +- .../CL/functions/CLLaplacianReconstruct.cpp | 6 +- src/runtime/CL/functions/CLMagnitude.cpp | 4 +- src/runtime/CL/functions/CLMedian3x3.cpp | 4 +- src/runtime/CL/functions/CLNonLinearFilter.cpp | 4 +- .../CL/functions/CLNonMaximaSuppression3x3.cpp | 4 +- src/runtime/CL/functions/CLOpticalFlow.cpp | 22 +- src/runtime/CL/functions/CLPhase.cpp | 4 +- .../CL/functions/CLPixelWiseMultiplication.cpp | 4 +- src/runtime/CL/functions/CLPoolingLayer.cpp | 4 +- src/runtime/CL/functions/CLRemap.cpp | 4 +- src/runtime/CL/functions/CLScale.cpp | 4 +- src/runtime/CL/functions/CLScharr3x3.cpp | 4 +- src/runtime/CL/functions/CLSobel3x3.cpp | 4 +- src/runtime/CL/functions/CLTableLookup.cpp | 4 +- src/runtime/CL/functions/CLThreshold.cpp | 4 +- src/runtime/CL/functions/CLTranspose.cpp | 4 +- src/runtime/CL/functions/CLWarpAffine.cpp | 4 +- src/runtime/CL/functions/CLWarpPerspective.cpp | 4 +- src/runtime/Distribution1D.cpp | 4 +- src/runtime/HOG.cpp | 4 +- src/runtime/LutAllocator.cpp | 4 +- src/runtime/MultiHOG.cpp | 4 +- .../NEON/functions/NEAbsoluteDifference.cpp | 4 +- src/runtime/NEON/functions/NEAccumulate.cpp | 10 +- src/runtime/NEON/functions/NEActivationLayer.cpp | 4 +- .../NEON/functions/NEArithmeticAddition.cpp | 4 +- .../NEON/functions/NEArithmeticSubtraction.cpp | 4 +- src/runtime/NEON/functions/NEBitwiseAnd.cpp | 4 +- src/runtime/NEON/functions/NEBitwiseNot.cpp | 4 +- src/runtime/NEON/functions/NEBitwiseOr.cpp | 4 +- src/runtime/NEON/functions/NEBitwiseXor.cpp | 4 +- src/runtime/NEON/functions/NEBox3x3.cpp | 6 +- src/runtime/NEON/functions/NECannyEdge.cpp | 12 +- src/runtime/NEON/functions/NEChannelCombine.cpp | 6 +- src/runtime/NEON/functions/NEChannelExtract.cpp | 6 +- src/runtime/NEON/functions/NEColorConvert.cpp | 10 +- src/runtime/NEON/functions/NEConvolution.cpp | 6 +- src/runtime/NEON/functions/NEDepthConcatenate.cpp | 6 +- src/runtime/NEON/functions/NEDepthConvert.cpp | 5 +- src/runtime/NEON/functions/NEDilate.cpp | 4 +- src/runtime/NEON/functions/NEErode.cpp | 4 +- src/runtime/NEON/functions/NEGEMMInterleave4x4.cpp | 4 +- src/runtime/NEON/functions/NEGEMMTranspose1xW.cpp | 4 +- src/runtime/NEON/functions/NEGaussian3x3.cpp | 4 +- src/runtime/NEON/functions/NEGaussianPyramid.cpp | 14 +- src/runtime/NEON/functions/NEHOGDetector.cpp | 4 +- src/runtime/NEON/functions/NEHOGGradient.cpp | 6 +- src/runtime/NEON/functions/NEHOGMultiDetection.cpp | 15 +- src/runtime/NEON/functions/NEHarrisCorners.cpp | 22 +- src/runtime/NEON/functions/NEHistogram.cpp | 6 +- src/runtime/NEON/functions/NEIntegralImage.cpp | 4 +- src/runtime/NEON/functions/NELaplacianPyramid.cpp | 6 +- .../NEON/functions/NELaplacianReconstruct.cpp | 6 +- src/runtime/NEON/functions/NEMagnitude.cpp | 6 +- src/runtime/NEON/functions/NEMedian3x3.cpp | 4 +- src/runtime/NEON/functions/NENonLinearFilter.cpp | 4 +- .../NEON/functions/NENonMaximaSuppression3x3.cpp | 4 +- src/runtime/NEON/functions/NEOpticalFlow.cpp | 10 +- src/runtime/NEON/functions/NEPhase.cpp | 4 +- .../NEON/functions/NEPixelWiseMultiplication.cpp | 4 +- src/runtime/NEON/functions/NEPoolingLayer.cpp | 4 +- src/runtime/NEON/functions/NERemap.cpp | 4 +- src/runtime/NEON/functions/NEScale.cpp | 3 +- src/runtime/NEON/functions/NEScharr3x3.cpp | 4 +- src/runtime/NEON/functions/NESobel3x3.cpp | 4 +- src/runtime/NEON/functions/NETableLookup.cpp | 4 +- src/runtime/NEON/functions/NEThreshold.cpp | 4 +- src/runtime/NEON/functions/NETranspose.cpp | 4 +- src/runtime/NEON/functions/NEWarpAffine.cpp | 7 +- src/runtime/NEON/functions/NEWarpPerspective.cpp | 7 +- src/runtime/Pyramid.cpp | 4 +- support/ToolchainSupport.h | 310 +++++++++++++++++++++ tests/RawTensor.cpp | 7 +- tests/Utils.h | 277 +----------------- tests/benchmark/PMUCounter.cpp | 3 +- tests/benchmark/WallClockTimer.cpp | 3 +- tests/benchmark/main.cpp | 5 +- tests/validation/FixedPoint.h | 3 +- tests/validation/TensorOperations.h | 9 +- tests/validation/UNIT/FixedPoint.cpp | 5 +- tests/validation/UNIT/Utils.cpp | 5 +- tests/validation/main.cpp | 5 +- 115 files changed, 630 insertions(+), 614 deletions(-) create mode 100644 support/ToolchainSupport.h diff --git a/arm_compute/core/CL/CLHelpers.h b/arm_compute/core/CL/CLHelpers.h index 26253e3f38..7b3af33fee 100644 --- a/arm_compute/core/CL/CLHelpers.h +++ b/arm_compute/core/CL/CLHelpers.h @@ -26,6 +26,7 @@ #include "arm_compute/core/CL/OpenCL.h" #include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -70,7 +71,7 @@ const std::string &string_from_target(GPUTarget target); template std::unique_ptr create_configure_kernel(T &&... args) { - std::unique_ptr k = arm_compute::cpp14::make_unique(); + std::unique_ptr k = arm_compute::support::cpp14::make_unique(); k->configure(std::forward(args)...); return k; } @@ -82,7 +83,7 @@ std::unique_ptr create_configure_kernel(T &&... args) template std::unique_ptr create_kernel() { - std::unique_ptr k = arm_compute::cpp14::make_unique(); + std::unique_ptr k = arm_compute::support::cpp14::make_unique(); return k; } diff --git a/arm_compute/core/Helpers.h b/arm_compute/core/Helpers.h index 07318eaf7a..dfcca96eec 100644 --- a/arm_compute/core/Helpers.h +++ b/arm_compute/core/Helpers.h @@ -46,46 +46,6 @@ class IKernel; class ITensor; class ITensorInfo; -namespace cpp14 -{ -template -struct _Unique_if -{ - typedef std::unique_ptr _Single_object; -}; - -template -struct _Unique_if -{ - typedef std::unique_ptr _Unknown_bound; -}; - -template -struct _Unique_if -{ - typedef void _Known_bound; -}; - -template -typename _Unique_if::_Single_object -make_unique(Args &&... args) -{ - return std::unique_ptr(new T(std::forward(args)...)); -} - -template -typename _Unique_if::_Unknown_bound -make_unique(size_t n) -{ - typedef typename std::remove_extent::type U; - return std::unique_ptr(new U[n]()); -} - -template -typename _Unique_if::_Known_bound -make_unique(Args &&...) = delete; -} - template struct enable_bitwise_ops { diff --git a/arm_compute/runtime/Array.h b/arm_compute/runtime/Array.h index c8a240e428..61e0953edd 100644 --- a/arm_compute/runtime/Array.h +++ b/arm_compute/runtime/Array.h @@ -24,9 +24,9 @@ #ifndef __ARM_COMPUTE_ARRAY_H__ #define __ARM_COMPUTE_ARRAY_H__ -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/IArray.h" #include "arm_compute/core/Types.h" +#include "support/ToolchainSupport.h" #include @@ -47,7 +47,7 @@ public: * @param[in] max_num_values Maximum number of values the array will be able to stored */ Array(size_t max_num_values) - : IArray(max_num_values), _values(arm_compute::cpp14::make_unique(max_num_values)) + : IArray(max_num_values), _values(arm_compute::support::cpp14::make_unique(max_num_values)) { } diff --git a/src/runtime/CL/CLMultiHOG.cpp b/src/runtime/CL/CLMultiHOG.cpp index b9e8739454..88d45acd12 100644 --- a/src/runtime/CL/CLMultiHOG.cpp +++ b/src/runtime/CL/CLMultiHOG.cpp @@ -25,12 +25,12 @@ #include "arm_compute/core/CL/ICLHOG.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; CLMultiHOG::CLMultiHOG(size_t num_models) - : _num_models(num_models), _model(arm_compute::cpp14::make_unique(_num_models)) + : _num_models(num_models), _model(arm_compute::support::cpp14::make_unique(_num_models)) { } diff --git a/src/runtime/CL/CLPyramid.cpp b/src/runtime/CL/CLPyramid.cpp index 41d81ea0f8..865f389f7f 100644 --- a/src/runtime/CL/CLPyramid.cpp +++ b/src/runtime/CL/CLPyramid.cpp @@ -24,10 +24,10 @@ #include "arm_compute/runtime/CL/CLPyramid.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/PyramidInfo.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/TensorShape.h" +#include "support/ToolchainSupport.h" #include #include @@ -52,7 +52,7 @@ void CLPyramid::init_auto_padding(const PyramidInfo &info) void CLPyramid::internal_init(const PyramidInfo &info, bool auto_padding) { _info = info; - _pyramid = arm_compute::cpp14::make_unique(_info.num_levels()); + _pyramid = arm_compute::support::cpp14::make_unique(_info.num_levels()); size_t w = _info.width(); size_t h = _info.height(); diff --git a/src/runtime/CL/functions/CLAbsoluteDifference.cpp b/src/runtime/CL/functions/CLAbsoluteDifference.cpp index 5097dd4710..5613e6c78d 100644 --- a/src/runtime/CL/functions/CLAbsoluteDifference.cpp +++ b/src/runtime/CL/functions/CLAbsoluteDifference.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLAbsoluteDifference.h" #include "arm_compute/core/CL/kernels/CLAbsoluteDifferenceKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void CLAbsoluteDifference::configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLAccumulate.cpp b/src/runtime/CL/functions/CLAccumulate.cpp index 56c519984c..78f25fc015 100644 --- a/src/runtime/CL/functions/CLAccumulate.cpp +++ b/src/runtime/CL/functions/CLAccumulate.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLAccumulate.h" #include "arm_compute/core/CL/kernels/CLAccumulateKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,21 +32,21 @@ using namespace arm_compute; void CLAccumulate::configure(const ICLTensor *input, ICLTensor *accum) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, accum); _kernel = std::move(k); } void CLAccumulateWeighted::configure(const ICLTensor *input, float alpha, ICLTensor *accum) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, alpha, accum); _kernel = std::move(k); } void CLAccumulateSquared::configure(const ICLTensor *input, uint32_t shift, ICLTensor *accum) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, shift, accum); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLActivationLayer.cpp b/src/runtime/CL/functions/CLActivationLayer.cpp index 0d0da0ca9a..b64739a008 100644 --- a/src/runtime/CL/functions/CLActivationLayer.cpp +++ b/src/runtime/CL/functions/CLActivationLayer.cpp @@ -24,13 +24,13 @@ #include "arm_compute/runtime/CL/functions/CLActivationLayer.h" #include "arm_compute/core/CL/kernels/CLActivationLayerKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; void CLActivationLayer::configure(ICLTensor *input, ICLTensor *output, ActivationLayerInfo act_info) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, act_info); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLArithmeticAddition.cpp b/src/runtime/CL/functions/CLArithmeticAddition.cpp index 36bff4285c..5ca384d6a4 100644 --- a/src/runtime/CL/functions/CLArithmeticAddition.cpp +++ b/src/runtime/CL/functions/CLArithmeticAddition.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLArithmeticAddition.h" #include "arm_compute/core/CL/kernels/CLArithmeticAdditionKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void CLArithmeticAddition::configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, ConvertPolicy policy) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output, policy); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLArithmeticSubtraction.cpp b/src/runtime/CL/functions/CLArithmeticSubtraction.cpp index 97f0a1caf4..651f51a24a 100644 --- a/src/runtime/CL/functions/CLArithmeticSubtraction.cpp +++ b/src/runtime/CL/functions/CLArithmeticSubtraction.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLArithmeticSubtraction.h" #include "arm_compute/core/CL/kernels/CLArithmeticSubtractionKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void CLArithmeticSubtraction::configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, ConvertPolicy policy) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output, policy); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLBitwiseAnd.cpp b/src/runtime/CL/functions/CLBitwiseAnd.cpp index 7c85043206..f8a5a859bd 100644 --- a/src/runtime/CL/functions/CLBitwiseAnd.cpp +++ b/src/runtime/CL/functions/CLBitwiseAnd.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLBitwiseAnd.h" #include "arm_compute/core/CL/kernels/CLBitwiseAndKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void CLBitwiseAnd::configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLBitwiseNot.cpp b/src/runtime/CL/functions/CLBitwiseNot.cpp index 17ae5dea3c..dc002e5cac 100644 --- a/src/runtime/CL/functions/CLBitwiseNot.cpp +++ b/src/runtime/CL/functions/CLBitwiseNot.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLBitwiseNot.h" #include "arm_compute/core/CL/kernels/CLBitwiseNotKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void CLBitwiseNot::configure(const ICLTensor *input, ICLTensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLBitwiseOr.cpp b/src/runtime/CL/functions/CLBitwiseOr.cpp index c84a279bae..4a10bb2f36 100644 --- a/src/runtime/CL/functions/CLBitwiseOr.cpp +++ b/src/runtime/CL/functions/CLBitwiseOr.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLBitwiseOr.h" #include "arm_compute/core/CL/kernels/CLBitwiseOrKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void CLBitwiseOr::configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLBitwiseXor.cpp b/src/runtime/CL/functions/CLBitwiseXor.cpp index fd49c7d818..d23622ab01 100644 --- a/src/runtime/CL/functions/CLBitwiseXor.cpp +++ b/src/runtime/CL/functions/CLBitwiseXor.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLBitwiseXor.h" #include "arm_compute/core/CL/kernels/CLBitwiseXorKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void CLBitwiseXor::configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLBox3x3.cpp b/src/runtime/CL/functions/CLBox3x3.cpp index 20d5dae94e..f28be44d72 100644 --- a/src/runtime/CL/functions/CLBox3x3.cpp +++ b/src/runtime/CL/functions/CLBox3x3.cpp @@ -24,8 +24,8 @@ #include "arm_compute/runtime/CL/functions/CLBox3x3.h" #include "arm_compute/core/CL/kernels/CLBox3x3Kernel.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void CLBox3x3::configure(ICLTensor *input, ICLTensor *output, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, BorderSize(1), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/CL/functions/CLCannyEdge.cpp b/src/runtime/CL/functions/CLCannyEdge.cpp index 1d018b8347..6c321ad69a 100644 --- a/src/runtime/CL/functions/CLCannyEdge.cpp +++ b/src/runtime/CL/functions/CLCannyEdge.cpp @@ -26,12 +26,12 @@ #include "arm_compute/core/CL/ICLTensor.h" #include "arm_compute/core/CL/OpenCL.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/CL/CLScheduler.h" #include "arm_compute/runtime/CL/functions/CLSobel3x3.h" #include "arm_compute/runtime/CL/functions/CLSobel5x5.h" #include "arm_compute/runtime/CL/functions/CLSobel7x7.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; @@ -86,19 +86,19 @@ void CLCannyEdge::configure(ICLTensor *input, ICLTensor *output, int32_t upper_t // Configure/Init sobelNxN if(gradient_size == 3) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, &_gx, &_gy, border_mode, constant_border_value); _sobel = std::move(k); } else if(gradient_size == 5) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, &_gx, &_gy, border_mode, constant_border_value); _sobel = std::move(k); } else if(gradient_size == 7) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, &_gx, &_gy, border_mode, constant_border_value); _sobel = std::move(k); } diff --git a/src/runtime/CL/functions/CLChannelCombine.cpp b/src/runtime/CL/functions/CLChannelCombine.cpp index 79a3676bd7..11605cf95e 100644 --- a/src/runtime/CL/functions/CLChannelCombine.cpp +++ b/src/runtime/CL/functions/CLChannelCombine.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLChannelCombine.h" #include "arm_compute/core/CL/kernels/CLChannelCombineKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,14 +32,14 @@ using namespace arm_compute; void CLChannelCombine::configure(const ICLTensor *plane0, const ICLTensor *plane1, const ICLTensor *plane2, const ICLTensor *plane3, ICLTensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(plane0, plane1, plane2, plane3, output); _kernel = std::move(k); } void CLChannelCombine::configure(const ICLImage *plane0, const ICLImage *plane1, const ICLImage *plane2, ICLMultiImage *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(plane0, plane1, plane2, output); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLChannelExtract.cpp b/src/runtime/CL/functions/CLChannelExtract.cpp index 2c6174b9ee..50903826d3 100644 --- a/src/runtime/CL/functions/CLChannelExtract.cpp +++ b/src/runtime/CL/functions/CLChannelExtract.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLChannelExtract.h" #include "arm_compute/core/CL/kernels/CLChannelExtractKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,14 +32,14 @@ using namespace arm_compute; void CLChannelExtract::configure(const ICLTensor *input, Channel channel, ICLTensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, channel, output); _kernel = std::move(k); } void CLChannelExtract::configure(const ICLMultiImage *input, Channel channel, ICLImage *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, channel, output); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLColorConvert.cpp b/src/runtime/CL/functions/CLColorConvert.cpp index 2fe465aeb8..65f8ac3740 100644 --- a/src/runtime/CL/functions/CLColorConvert.cpp +++ b/src/runtime/CL/functions/CLColorConvert.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLColorConvert.h" #include "arm_compute/core/CL/kernels/CLColorConvertKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,28 +32,28 @@ using namespace arm_compute; void CLColorConvert::configure(const ICLTensor *input, ICLTensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } void CLColorConvert::configure(const ICLImage *input, ICLMultiImage *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } void CLColorConvert::configure(const ICLMultiImage *input, ICLImage *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } void CLColorConvert::configure(const ICLMultiImage *input, ICLMultiImage *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLConvolution.cpp b/src/runtime/CL/functions/CLConvolution.cpp index 21b5d47679..641044451d 100644 --- a/src/runtime/CL/functions/CLConvolution.cpp +++ b/src/runtime/CL/functions/CLConvolution.cpp @@ -26,13 +26,13 @@ #include "arm_compute/core/CL/ICLTensor.h" #include "arm_compute/core/CL/kernels/CLConvolutionKernel.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/PixelValue.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Utils.h" #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/CL/CLScheduler.h" #include "arm_compute/runtime/ITensorAllocator.h" +#include "support/ToolchainSupport.h" #include @@ -40,7 +40,7 @@ using namespace arm_compute; void CLConvolution3x3::configure(ICLTensor *input, ICLTensor *output, const int16_t *conv, uint32_t scale, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, conv, scale, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); @@ -107,7 +107,7 @@ template class arm_compute::CLConvolutionSquare<9>; void CLConvolutionRectangle::configure(ICLTensor *input, ICLTensor *output, const int16_t *conv, uint32_t rows, uint32_t cols, uint32_t scale, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, conv, rows, cols, scale, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/CL/functions/CLDepthConcatenate.cpp b/src/runtime/CL/functions/CLDepthConcatenate.cpp index d967d9865f..34778c6980 100644 --- a/src/runtime/CL/functions/CLDepthConcatenate.cpp +++ b/src/runtime/CL/functions/CLDepthConcatenate.cpp @@ -27,10 +27,10 @@ #include "arm_compute/core/CL/kernels/CLDepthConcatenateKernel.h" #include "arm_compute/core/CL/kernels/CLFillBorderKernel.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/PixelValue.h" #include "arm_compute/core/Types.h" #include "arm_compute/runtime/CL/CLScheduler.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; @@ -47,8 +47,8 @@ void CLDepthConcatenate::configure(std::vector inputs_vector, ICLTe unsigned int depth_offset = 0; - _concat_kernels_vector = arm_compute::cpp14::make_unique(_num_inputs); - _border_handlers_vector = arm_compute::cpp14::make_unique(_num_inputs); + _concat_kernels_vector = arm_compute::support::cpp14::make_unique(_num_inputs); + _border_handlers_vector = arm_compute::support::cpp14::make_unique(_num_inputs); for(unsigned int i = 0; i < _num_inputs; i++) { diff --git a/src/runtime/CL/functions/CLDepthConvert.cpp b/src/runtime/CL/functions/CLDepthConvert.cpp index edcd4928ab..b64d05b8b1 100644 --- a/src/runtime/CL/functions/CLDepthConvert.cpp +++ b/src/runtime/CL/functions/CLDepthConvert.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLDepthConvert.h" #include "arm_compute/core/CL/kernels/CLDepthConvertKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void CLDepthConvert::configure(const ICLTensor *input, ICLTensor *output, ConvertPolicy policy, uint32_t shift) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, policy, shift); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLDerivative.cpp b/src/runtime/CL/functions/CLDerivative.cpp index 9357de52f1..ae49996f3e 100644 --- a/src/runtime/CL/functions/CLDerivative.cpp +++ b/src/runtime/CL/functions/CLDerivative.cpp @@ -24,8 +24,8 @@ #include "arm_compute/runtime/CL/functions/CLDerivative.h" #include "arm_compute/core/CL/kernels/CLDerivativeKernel.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void CLDerivative::configure(ICLTensor *input, ICLTensor *output_x, ICLTensor *output_y, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output_x, output_y, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, BorderSize(1), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/CL/functions/CLDilate.cpp b/src/runtime/CL/functions/CLDilate.cpp index 0a4abe30c2..59c5ea5439 100644 --- a/src/runtime/CL/functions/CLDilate.cpp +++ b/src/runtime/CL/functions/CLDilate.cpp @@ -24,8 +24,8 @@ #include "arm_compute/runtime/CL/functions/CLDilate.h" #include "arm_compute/core/CL/kernels/CLDilateKernel.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void CLDilate::configure(ICLTensor *input, ICLTensor *output, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, BorderSize(1), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/CL/functions/CLErode.cpp b/src/runtime/CL/functions/CLErode.cpp index c41371cf9e..eb1f6e4bd8 100644 --- a/src/runtime/CL/functions/CLErode.cpp +++ b/src/runtime/CL/functions/CLErode.cpp @@ -24,8 +24,8 @@ #include "arm_compute/runtime/CL/functions/CLErode.h" #include "arm_compute/core/CL/kernels/CLErodeKernel.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void CLErode::configure(ICLTensor *input, ICLTensor *output, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, BorderSize(1), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/CL/functions/CLFillBorder.cpp b/src/runtime/CL/functions/CLFillBorder.cpp index 172f09da1a..54c096e25d 100644 --- a/src/runtime/CL/functions/CLFillBorder.cpp +++ b/src/runtime/CL/functions/CLFillBorder.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLFillBorder.h" #include "arm_compute/core/CL/kernels/CLFillBorderKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void CLFillBorder::configure(ICLTensor *tensor, unsigned int border_width, BorderMode border_mode, const PixelValue &constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(tensor, BorderSize(border_width), border_mode, constant_border_value); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLGEMMInterleave4x4.cpp b/src/runtime/CL/functions/CLGEMMInterleave4x4.cpp index 9dc77156ef..45547e4cb6 100644 --- a/src/runtime/CL/functions/CLGEMMInterleave4x4.cpp +++ b/src/runtime/CL/functions/CLGEMMInterleave4x4.cpp @@ -24,13 +24,13 @@ #include "arm_compute/runtime/CL/functions/CLGEMMInterleave4x4.h" #include "arm_compute/core/CL/kernels/CLGEMMInterleave4x4Kernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; void CLGEMMInterleave4x4::configure(const ICLTensor *input, ICLTensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLGEMMTranspose1xW.cpp b/src/runtime/CL/functions/CLGEMMTranspose1xW.cpp index 8f8a19e709..d054e01611 100644 --- a/src/runtime/CL/functions/CLGEMMTranspose1xW.cpp +++ b/src/runtime/CL/functions/CLGEMMTranspose1xW.cpp @@ -25,14 +25,14 @@ #include "arm_compute/core/CL/ICLTensor.h" #include "arm_compute/core/CL/kernels/CLGEMMTranspose1xWKernel.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/Types.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; void CLGEMMTranspose1xW::configure(const ICLTensor *input, ICLTensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } \ No newline at end of file diff --git a/src/runtime/CL/functions/CLGaussian3x3.cpp b/src/runtime/CL/functions/CLGaussian3x3.cpp index 362a3fe920..7ebabd756d 100644 --- a/src/runtime/CL/functions/CLGaussian3x3.cpp +++ b/src/runtime/CL/functions/CLGaussian3x3.cpp @@ -24,8 +24,8 @@ #include "arm_compute/runtime/CL/functions/CLGaussian3x3.h" #include "arm_compute/core/CL/kernels/CLGaussian3x3Kernel.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void CLGaussian3x3::configure(ICLTensor *input, ICLTensor *output, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/CL/functions/CLGaussianPyramid.cpp b/src/runtime/CL/functions/CLGaussianPyramid.cpp index 8a4279e99b..8450d5ee69 100644 --- a/src/runtime/CL/functions/CLGaussianPyramid.cpp +++ b/src/runtime/CL/functions/CLGaussianPyramid.cpp @@ -27,11 +27,11 @@ #include "arm_compute/core/CL/kernels/CLGaussianPyramidKernel.h" #include "arm_compute/core/CL/kernels/CLScaleKernel.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/PixelValue.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Validate.h" #include "arm_compute/core/Window.h" +#include "support/ToolchainSupport.h" #include "arm_compute/runtime/CL/CLPyramid.h" #include "arm_compute/runtime/CL/CLScheduler.h" @@ -70,9 +70,9 @@ void CLGaussianPyramidHalf::configure(ICLTensor *input, CLPyramid *pyramid, Bord if(num_levels > 1) { - _border_handler = arm_compute::cpp14::make_unique(num_levels - 1); - _horizontal_reduction = arm_compute::cpp14::make_unique(num_levels - 1); - _vertical_reduction = arm_compute::cpp14::make_unique(num_levels - 1); + _border_handler = arm_compute::support::cpp14::make_unique(num_levels - 1); + _horizontal_reduction = arm_compute::support::cpp14::make_unique(num_levels - 1); + _vertical_reduction = arm_compute::support::cpp14::make_unique(num_levels - 1); // Apply half scale to the X dimension of the tensor shape TensorShape tensor_shape = pyramid->info()->tensor_shape(); @@ -141,8 +141,8 @@ void CLGaussianPyramidOrb::configure(ICLTensor *input, CLPyramid *pyramid, Borde if(num_levels > 1) { - _gauss5x5 = arm_compute::cpp14::make_unique(num_levels - 1); - _scale_nearest = arm_compute::cpp14::make_unique(num_levels - 1); + _gauss5x5 = arm_compute::support::cpp14::make_unique(num_levels - 1); + _scale_nearest = arm_compute::support::cpp14::make_unique(num_levels - 1); PyramidInfo pyramid_info(num_levels - 1, SCALE_PYRAMID_ORB, pyramid->info()->tensor_shape(), Format::U8); diff --git a/src/runtime/CL/functions/CLHOGMultiDetection.cpp b/src/runtime/CL/functions/CLHOGMultiDetection.cpp index b8f2224ac8..6e864464a4 100644 --- a/src/runtime/CL/functions/CLHOGMultiDetection.cpp +++ b/src/runtime/CL/functions/CLHOGMultiDetection.cpp @@ -25,11 +25,11 @@ #include "arm_compute/core/CL/OpenCL.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/runtime/CL/CLArray.h" #include "arm_compute/runtime/CL/CLScheduler.h" #include "arm_compute/runtime/CL/CLTensor.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; @@ -114,12 +114,12 @@ void CLHOGMultiDetection::configure(ICLTensor *input, const ICLMultiHOG *multi_h _num_block_norm_kernel = input_block_norm.size(); // Number of CLHOGBlockNormalizationKernel kernels to compute _num_hog_detect_kernel = input_hog_detect.size(); // Number of CLHOGDetector functions to compute - _orient_bin_kernel = arm_compute::cpp14::make_unique(_num_orient_bin_kernel); - _block_norm_kernel = arm_compute::cpp14::make_unique(_num_block_norm_kernel); - _hog_detect_kernel = arm_compute::cpp14::make_unique(_num_hog_detect_kernel); - _non_maxima_kernel = arm_compute::cpp14::make_unique(); - _hog_space = arm_compute::cpp14::make_unique(_num_orient_bin_kernel); - _hog_norm_space = arm_compute::cpp14::make_unique(_num_block_norm_kernel); + _orient_bin_kernel = arm_compute::support::cpp14::make_unique(_num_orient_bin_kernel); + _block_norm_kernel = arm_compute::support::cpp14::make_unique(_num_block_norm_kernel); + _hog_detect_kernel = arm_compute::support::cpp14::make_unique(_num_hog_detect_kernel); + _non_maxima_kernel = arm_compute::support::cpp14::make_unique(); + _hog_space = arm_compute::support::cpp14::make_unique(_num_orient_bin_kernel); + _hog_norm_space = arm_compute::support::cpp14::make_unique(_num_block_norm_kernel); // Allocate tensors for magnitude and phase TensorInfo info_mag(shape_img, Format::S16); diff --git a/src/runtime/CL/functions/CLHarrisCorners.cpp b/src/runtime/CL/functions/CLHarrisCorners.cpp index e1c44416ae..87d573a7ad 100644 --- a/src/runtime/CL/functions/CLHarrisCorners.cpp +++ b/src/runtime/CL/functions/CLHarrisCorners.cpp @@ -27,7 +27,6 @@ #include "arm_compute/core/CL/kernels/CLFillBorderKernel.h" #include "arm_compute/core/CL/kernels/CLHarrisCornersKernel.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/CL/CLScheduler.h" @@ -36,6 +35,7 @@ #include "arm_compute/runtime/CL/functions/CLSobel7x7.h" #include "arm_compute/runtime/ITensorAllocator.h" #include "arm_compute/runtime/Scheduler.h" +#include "support/ToolchainSupport.h" #include #include @@ -69,28 +69,28 @@ void CLHarrisCorners::configure(ICLImage *input, float threshold, float min_dist _score.allocator()->init(info_f32); _nonmax.allocator()->init(info_f32); - _corners_list = arm_compute::cpp14::make_unique(shape.x() * shape.y()); + _corners_list = arm_compute::support::cpp14::make_unique(shape.x() * shape.y()); /* Set/init Sobel kernel accordingly with gradient_size */ switch(gradient_size) { case 3: { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, &_gx, &_gy, border_mode, constant_border_value); _sobel = std::move(k); break; } case 5: { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, &_gx, &_gy, border_mode, constant_border_value); _sobel = std::move(k); break; } case 7: { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, &_gx, &_gy, border_mode, constant_border_value); _sobel = std::move(k); break; diff --git a/src/runtime/CL/functions/CLLaplacianPyramid.cpp b/src/runtime/CL/functions/CLLaplacianPyramid.cpp index d7ce20653d..3fc93426ee 100644 --- a/src/runtime/CL/functions/CLLaplacianPyramid.cpp +++ b/src/runtime/CL/functions/CLLaplacianPyramid.cpp @@ -24,7 +24,6 @@ #include "arm_compute/runtime/CL/functions/CLLaplacianPyramid.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/IPyramid.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Validate.h" @@ -33,6 +32,7 @@ #include "arm_compute/runtime/CL/functions/CLDepthConvert.h" #include "arm_compute/runtime/CL/functions/CLGaussian5x5.h" #include "arm_compute/runtime/CL/functions/CLGaussianPyramid.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; @@ -64,8 +64,8 @@ void CLLaplacianPyramid::configure(ICLTensor *input, CLPyramid *pyramid, ICLTens // Create Gaussian Pyramid function _gaussian_pyr_function.configure(input, &_gauss_pyr, border_mode, constant_border_value); - _convf = arm_compute::cpp14::make_unique(_num_levels); - _subf = arm_compute::cpp14::make_unique(_num_levels); + _convf = arm_compute::support::cpp14::make_unique(_num_levels); + _subf = arm_compute::support::cpp14::make_unique(_num_levels); for(unsigned int i = 0; i < _num_levels; ++i) { diff --git a/src/runtime/CL/functions/CLLaplacianReconstruct.cpp b/src/runtime/CL/functions/CLLaplacianReconstruct.cpp index 1dfab740d7..7fd2273230 100644 --- a/src/runtime/CL/functions/CLLaplacianReconstruct.cpp +++ b/src/runtime/CL/functions/CLLaplacianReconstruct.cpp @@ -24,11 +24,11 @@ #include "arm_compute/runtime/CL/functions/CLLaplacianReconstruct.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/IPyramid.h" #include "arm_compute/core/ITensor.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Validate.h" +#include "support/ToolchainSupport.h" #include @@ -60,8 +60,8 @@ void CLLaplacianReconstruct::configure(const CLPyramid *pyramid, const ICLTensor _tmp_pyr.init(pyramid_info); // Allocate add and scale functions. Level 0 does not need to be scaled. - _addf = arm_compute::cpp14::make_unique(num_levels); - _scalef = arm_compute::cpp14::make_unique(num_levels - 1); + _addf = arm_compute::support::cpp14::make_unique(num_levels); + _scalef = arm_compute::support::cpp14::make_unique(num_levels - 1); const size_t last_level = num_levels - 1; diff --git a/src/runtime/CL/functions/CLMagnitude.cpp b/src/runtime/CL/functions/CLMagnitude.cpp index 51088cb71f..68b8c3545a 100644 --- a/src/runtime/CL/functions/CLMagnitude.cpp +++ b/src/runtime/CL/functions/CLMagnitude.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLMagnitude.h" #include "arm_compute/core/CL/kernels/CLMagnitudePhaseKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void CLMagnitude::configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, MagnitudeType mag_type) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output, nullptr, mag_type); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLMedian3x3.cpp b/src/runtime/CL/functions/CLMedian3x3.cpp index 0c10f9aa08..55f9eaa907 100644 --- a/src/runtime/CL/functions/CLMedian3x3.cpp +++ b/src/runtime/CL/functions/CLMedian3x3.cpp @@ -24,8 +24,8 @@ #include "arm_compute/runtime/CL/functions/CLMedian3x3.h" #include "arm_compute/core/CL/kernels/CLMedian3x3Kernel.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void CLMedian3x3::configure(ICLTensor *input, ICLTensor *output, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/CL/functions/CLNonLinearFilter.cpp b/src/runtime/CL/functions/CLNonLinearFilter.cpp index b593a6cced..d37412f47f 100644 --- a/src/runtime/CL/functions/CLNonLinearFilter.cpp +++ b/src/runtime/CL/functions/CLNonLinearFilter.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLNonLinearFilter.h" #include "arm_compute/core/CL/kernels/CLNonLinearFilterKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void CLNonLinearFilter::configure(ICLTensor *input, ICLTensor *output, NonLinearFilterFunction function, unsigned int mask_size, MatrixPattern pattern, const uint8_t *mask, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, function, mask_size, pattern, mask, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/CL/functions/CLNonMaximaSuppression3x3.cpp b/src/runtime/CL/functions/CLNonMaximaSuppression3x3.cpp index ca7d5aede7..c0a0cef885 100644 --- a/src/runtime/CL/functions/CLNonMaximaSuppression3x3.cpp +++ b/src/runtime/CL/functions/CLNonMaximaSuppression3x3.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLNonMaximaSuppression3x3.h" #include "arm_compute/core/CL/kernels/CLNonMaximaSuppression3x3Kernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void CLNonMaximaSuppression3x3::configure(ICLTensor *input, ICLTensor *output, BorderMode border_mode) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); diff --git a/src/runtime/CL/functions/CLOpticalFlow.cpp b/src/runtime/CL/functions/CLOpticalFlow.cpp index a6b0eb3bec..542f5961fa 100644 --- a/src/runtime/CL/functions/CLOpticalFlow.cpp +++ b/src/runtime/CL/functions/CLOpticalFlow.cpp @@ -26,7 +26,6 @@ #include "arm_compute/core/CL/ICLTensor.h" #include "arm_compute/core/CL/kernels/CLLKTrackerKernel.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Window.h" #include "arm_compute/runtime/CL/CLPyramid.h" @@ -34,6 +33,7 @@ #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/CLTensorAllocator.h" #include "arm_compute/runtime/CL/functions/CLScharr3x3.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; @@ -70,21 +70,21 @@ void CLOpticalFlow::configure(const CLPyramid *old_pyramid, const CLPyramid *new const int old_values_list_length = list_length * window_dimension * window_dimension; // Create kernels and tensors - _tracker_init_kernel = arm_compute::cpp14::make_unique(_num_levels); - _tracker_stage0_kernel = arm_compute::cpp14::make_unique(_num_levels); - _tracker_stage1_kernel = arm_compute::cpp14::make_unique(_num_levels); - _func_scharr = arm_compute::cpp14::make_unique(_num_levels); - _scharr_gx = arm_compute::cpp14::make_unique(_num_levels); - _scharr_gy = arm_compute::cpp14::make_unique(_num_levels); + _tracker_init_kernel = arm_compute::support::cpp14::make_unique(_num_levels); + _tracker_stage0_kernel = arm_compute::support::cpp14::make_unique(_num_levels); + _tracker_stage1_kernel = arm_compute::support::cpp14::make_unique(_num_levels); + _func_scharr = arm_compute::support::cpp14::make_unique(_num_levels); + _scharr_gx = arm_compute::support::cpp14::make_unique(_num_levels); + _scharr_gy = arm_compute::support::cpp14::make_unique(_num_levels); // Create internal keypoint arrays - _old_points_internal = arm_compute::cpp14::make_unique(list_length); + _old_points_internal = arm_compute::support::cpp14::make_unique(list_length); _old_points_internal->resize(list_length); - _new_points_internal = arm_compute::cpp14::make_unique(list_length); + _new_points_internal = arm_compute::support::cpp14::make_unique(list_length); _new_points_internal->resize(list_length); - _coefficient_table = arm_compute::cpp14::make_unique(list_length); + _coefficient_table = arm_compute::support::cpp14::make_unique(list_length); _coefficient_table->resize(list_length); - _old_values = arm_compute::cpp14::make_unique(old_values_list_length); + _old_values = arm_compute::support::cpp14::make_unique(old_values_list_length); _old_values->resize(old_values_list_length); _new_points->resize(list_length); diff --git a/src/runtime/CL/functions/CLPhase.cpp b/src/runtime/CL/functions/CLPhase.cpp index a8cb22b06e..cf3fa7e7fb 100644 --- a/src/runtime/CL/functions/CLPhase.cpp +++ b/src/runtime/CL/functions/CLPhase.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLPhase.h" #include "arm_compute/core/CL/kernels/CLMagnitudePhaseKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void CLPhase::configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, PhaseType phase_type) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, nullptr, output, MagnitudeType::L1NORM, phase_type); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLPixelWiseMultiplication.cpp b/src/runtime/CL/functions/CLPixelWiseMultiplication.cpp index 8a86c2e203..139d466b39 100644 --- a/src/runtime/CL/functions/CLPixelWiseMultiplication.cpp +++ b/src/runtime/CL/functions/CLPixelWiseMultiplication.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLPixelWiseMultiplication.h" #include "arm_compute/core/CL/kernels/CLPixelWiseMultiplicationKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void CLPixelWiseMultiplication::configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, float scale, ConvertPolicy overflow_policy, RoundingPolicy rounding_policy) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output, scale, overflow_policy, rounding_policy); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLPoolingLayer.cpp b/src/runtime/CL/functions/CLPoolingLayer.cpp index 1ef70f4a2b..2cb7d63aa8 100644 --- a/src/runtime/CL/functions/CLPoolingLayer.cpp +++ b/src/runtime/CL/functions/CLPoolingLayer.cpp @@ -24,14 +24,14 @@ #include "arm_compute/runtime/CL/functions/CLPoolingLayer.h" #include "arm_compute/core/CL/kernels/CLPoolingLayerKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; void CLPoolingLayer::configure(ICLTensor *input, ICLTensor *output, const PoolingLayerInfo &pool_info) { // Configure pooling kernel - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, pool_info); _kernel = std::move(k); diff --git a/src/runtime/CL/functions/CLRemap.cpp b/src/runtime/CL/functions/CLRemap.cpp index f6b1713c58..bc3fd4ed53 100644 --- a/src/runtime/CL/functions/CLRemap.cpp +++ b/src/runtime/CL/functions/CLRemap.cpp @@ -26,10 +26,10 @@ #include "arm_compute/core/CL/ICLTensor.h" #include "arm_compute/core/CL/kernels/CLRemapKernel.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/PixelValue.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Validate.h" +#include "support/ToolchainSupport.h" #include @@ -43,7 +43,7 @@ void CLRemap::configure(ICLTensor *input, const ICLTensor *map_x, const ICLTenso ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(map_y, 1, DataType::F32); ARM_COMPUTE_ERROR_ON_MSG(policy == InterpolationPolicy::AREA, "Area interpolation is not supported"); - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, map_x, map_y, output, policy, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/CL/functions/CLScale.cpp b/src/runtime/CL/functions/CLScale.cpp index 043f873028..05522b4af5 100644 --- a/src/runtime/CL/functions/CLScale.cpp +++ b/src/runtime/CL/functions/CLScale.cpp @@ -26,8 +26,8 @@ #include "arm_compute/core/CL/ICLTensor.h" #include "arm_compute/core/CL/kernels/CLScaleKernel.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/Validate.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; @@ -38,7 +38,7 @@ void CLScale::configure(ICLTensor *input, ICLTensor *output, InterpolationPolicy ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(output, 1, DataType::U8, DataType::S16); ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input, output); - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, policy, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, constant_border_value); diff --git a/src/runtime/CL/functions/CLScharr3x3.cpp b/src/runtime/CL/functions/CLScharr3x3.cpp index c8bc465be6..73f8673e78 100644 --- a/src/runtime/CL/functions/CLScharr3x3.cpp +++ b/src/runtime/CL/functions/CLScharr3x3.cpp @@ -24,8 +24,8 @@ #include "arm_compute/runtime/CL/functions/CLScharr3x3.h" #include "arm_compute/core/CL/kernels/CLScharr3x3Kernel.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void CLScharr3x3::configure(ICLTensor *input, ICLTensor *output_x, ICLTensor *output_y, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output_x, output_y, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/CL/functions/CLSobel3x3.cpp b/src/runtime/CL/functions/CLSobel3x3.cpp index 6b74ebaedb..e227e58bb2 100644 --- a/src/runtime/CL/functions/CLSobel3x3.cpp +++ b/src/runtime/CL/functions/CLSobel3x3.cpp @@ -24,8 +24,8 @@ #include "arm_compute/runtime/CL/functions/CLSobel3x3.h" #include "arm_compute/core/CL/kernels/CLSobel3x3Kernel.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void CLSobel3x3::configure(ICLTensor *input, ICLTensor *output_x, ICLTensor *output_y, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output_x, output_y, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/CL/functions/CLTableLookup.cpp b/src/runtime/CL/functions/CLTableLookup.cpp index 743ed5e73e..d18765093f 100644 --- a/src/runtime/CL/functions/CLTableLookup.cpp +++ b/src/runtime/CL/functions/CLTableLookup.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLTableLookup.h" #include "arm_compute/core/CL/kernels/CLTableLookupKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void CLTableLookup::configure(const ICLTensor *input, const ICLLut *lut, ICLTensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, lut, output); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLThreshold.cpp b/src/runtime/CL/functions/CLThreshold.cpp index e70f932d66..1b30b77f1d 100644 --- a/src/runtime/CL/functions/CLThreshold.cpp +++ b/src/runtime/CL/functions/CLThreshold.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLThreshold.h" #include "arm_compute/core/CL/kernels/CLThresholdKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void CLThreshold::configure(const ICLTensor *input, ICLTensor *output, uint8_t threshold, uint8_t false_value, uint8_t true_value, ThresholdType type, uint8_t upper) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, threshold, false_value, true_value, type, upper); _kernel = std::move(k); } diff --git a/src/runtime/CL/functions/CLTranspose.cpp b/src/runtime/CL/functions/CLTranspose.cpp index d802b4fe77..cd19e255bd 100644 --- a/src/runtime/CL/functions/CLTranspose.cpp +++ b/src/runtime/CL/functions/CLTranspose.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/CL/functions/CLTranspose.h" #include "arm_compute/core/CL/kernels/CLTransposeKernel.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void CLTranspose::configure(const ICLTensor *input, ICLTensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } \ No newline at end of file diff --git a/src/runtime/CL/functions/CLWarpAffine.cpp b/src/runtime/CL/functions/CLWarpAffine.cpp index 537e0d9397..f785c75a72 100644 --- a/src/runtime/CL/functions/CLWarpAffine.cpp +++ b/src/runtime/CL/functions/CLWarpAffine.cpp @@ -24,8 +24,8 @@ #include "arm_compute/runtime/CL/functions/CLWarpAffine.h" #include "arm_compute/core/CL/kernels/CLWarpAffineKernel.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void CLWarpAffine::configure(ICLTensor *input, ICLTensor *output, const float *matrix, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, matrix, policy); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/CL/functions/CLWarpPerspective.cpp b/src/runtime/CL/functions/CLWarpPerspective.cpp index a552ab480d..b445b3b9c5 100644 --- a/src/runtime/CL/functions/CLWarpPerspective.cpp +++ b/src/runtime/CL/functions/CLWarpPerspective.cpp @@ -24,8 +24,8 @@ #include "arm_compute/runtime/CL/functions/CLWarpPerspective.h" #include "arm_compute/core/CL/kernels/CLWarpPerspectiveKernel.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void CLWarpPerspective::configure(ICLTensor *input, ICLTensor *output, const float *matrix, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, matrix, policy); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/Distribution1D.cpp b/src/runtime/Distribution1D.cpp index b06767499b..3431834c48 100644 --- a/src/runtime/Distribution1D.cpp +++ b/src/runtime/Distribution1D.cpp @@ -24,14 +24,14 @@ #include "arm_compute/runtime/Distribution1D.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" #include using namespace arm_compute; Distribution1D::Distribution1D(size_t num_bins, int32_t offset, uint32_t range) - : IDistribution1D(num_bins, offset, range), _data(arm_compute::cpp14::make_unique(num_bins)) + : IDistribution1D(num_bins, offset, range), _data(arm_compute::support::cpp14::make_unique(num_bins)) { } diff --git a/src/runtime/HOG.cpp b/src/runtime/HOG.cpp index 5d533dded4..01640bb0ac 100644 --- a/src/runtime/HOG.cpp +++ b/src/runtime/HOG.cpp @@ -24,7 +24,7 @@ #include "arm_compute/runtime/HOG.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; @@ -37,7 +37,7 @@ void HOG::init(const HOGInfo &input) { ARM_COMPUTE_ERROR_ON(nullptr != _descriptor); _info = input; - _descriptor = arm_compute::cpp14::make_unique(_info.descriptor_size()); + _descriptor = arm_compute::support::cpp14::make_unique(_info.descriptor_size()); } float *HOG::descriptor() const diff --git a/src/runtime/LutAllocator.cpp b/src/runtime/LutAllocator.cpp index 17baf21f45..eb9051cc0a 100644 --- a/src/runtime/LutAllocator.cpp +++ b/src/runtime/LutAllocator.cpp @@ -23,7 +23,7 @@ */ #include "arm_compute/runtime/LutAllocator.h" -#include "arm_compute/core/Helpers.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; @@ -39,7 +39,7 @@ uint8_t *LutAllocator::data() const void LutAllocator::allocate() { - _buffer = arm_compute::cpp14::make_unique(size()); + _buffer = arm_compute::support::cpp14::make_unique(size()); } uint8_t *LutAllocator::lock() diff --git a/src/runtime/MultiHOG.cpp b/src/runtime/MultiHOG.cpp index 003dc93895..e0b60b1137 100644 --- a/src/runtime/MultiHOG.cpp +++ b/src/runtime/MultiHOG.cpp @@ -24,13 +24,13 @@ #include "arm_compute/runtime/MultiHOG.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/IMultiHOG.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; MultiHOG::MultiHOG(size_t num_models) - : _num_models(num_models), _model(arm_compute::cpp14::make_unique(_num_models)) + : _num_models(num_models), _model(arm_compute::support::cpp14::make_unique(_num_models)) { } diff --git a/src/runtime/NEON/functions/NEAbsoluteDifference.cpp b/src/runtime/NEON/functions/NEAbsoluteDifference.cpp index b39feb3a2b..b4620f16dd 100644 --- a/src/runtime/NEON/functions/NEAbsoluteDifference.cpp +++ b/src/runtime/NEON/functions/NEAbsoluteDifference.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NEAbsoluteDifference.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEAbsoluteDifferenceKernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void NEAbsoluteDifference::configure(const ITensor *input1, const ITensor *input2, ITensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEAccumulate.cpp b/src/runtime/NEON/functions/NEAccumulate.cpp index c39abfc540..49524d2202 100644 --- a/src/runtime/NEON/functions/NEAccumulate.cpp +++ b/src/runtime/NEON/functions/NEAccumulate.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NEAccumulate.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEAccumulateKernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void NEAccumulate::configure(const ITensor *input, ITensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } @@ -41,13 +41,13 @@ void NEAccumulateWeighted::configure(const ITensor *input, float alpha, ITensor { if(use_fp16) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, alpha, output); _kernel = std::move(k); } else { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, alpha, output); _kernel = std::move(k); } @@ -55,7 +55,7 @@ void NEAccumulateWeighted::configure(const ITensor *input, float alpha, ITensor void NEAccumulateSquared::configure(const ITensor *input, uint32_t shift, ITensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, shift, output); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEActivationLayer.cpp b/src/runtime/NEON/functions/NEActivationLayer.cpp index 447ae6411b..57a1738f85 100644 --- a/src/runtime/NEON/functions/NEActivationLayer.cpp +++ b/src/runtime/NEON/functions/NEActivationLayer.cpp @@ -23,14 +23,14 @@ */ #include "arm_compute/runtime/NEON/functions/NEActivationLayer.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEActivationLayerKernel.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; void NEActivationLayer::configure(ITensor *input, ITensor *output, ActivationLayerInfo activation_info) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, activation_info); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEArithmeticAddition.cpp b/src/runtime/NEON/functions/NEArithmeticAddition.cpp index 50cc38b489..11f5aa74e4 100644 --- a/src/runtime/NEON/functions/NEArithmeticAddition.cpp +++ b/src/runtime/NEON/functions/NEArithmeticAddition.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NEArithmeticAddition.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEArithmeticAdditionKernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void NEArithmeticAddition::configure(const ITensor *input1, const ITensor *input2, ITensor *output, ConvertPolicy policy) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output, policy); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEArithmeticSubtraction.cpp b/src/runtime/NEON/functions/NEArithmeticSubtraction.cpp index a3d27c0ed6..37586af751 100644 --- a/src/runtime/NEON/functions/NEArithmeticSubtraction.cpp +++ b/src/runtime/NEON/functions/NEArithmeticSubtraction.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NEArithmeticSubtraction.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEArithmeticSubtractionKernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void NEArithmeticSubtraction::configure(const ITensor *input1, const ITensor *input2, ITensor *output, ConvertPolicy policy) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output, policy); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEBitwiseAnd.cpp b/src/runtime/NEON/functions/NEBitwiseAnd.cpp index 5aafc51dc0..79820952bb 100644 --- a/src/runtime/NEON/functions/NEBitwiseAnd.cpp +++ b/src/runtime/NEON/functions/NEBitwiseAnd.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NEBitwiseAnd.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEBitwiseAndKernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void NEBitwiseAnd::configure(const ITensor *input1, const ITensor *input2, ITensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEBitwiseNot.cpp b/src/runtime/NEON/functions/NEBitwiseNot.cpp index af3df6e46a..c55957e2b4 100644 --- a/src/runtime/NEON/functions/NEBitwiseNot.cpp +++ b/src/runtime/NEON/functions/NEBitwiseNot.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NEBitwiseNot.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEBitwiseNotKernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void NEBitwiseNot::configure(const ITensor *input, ITensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEBitwiseOr.cpp b/src/runtime/NEON/functions/NEBitwiseOr.cpp index d12c5e5f6f..01036daaef 100644 --- a/src/runtime/NEON/functions/NEBitwiseOr.cpp +++ b/src/runtime/NEON/functions/NEBitwiseOr.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NEBitwiseOr.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEBitwiseOrKernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void NEBitwiseOr::configure(const ITensor *input1, const ITensor *input2, ITensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEBitwiseXor.cpp b/src/runtime/NEON/functions/NEBitwiseXor.cpp index 65c943e64c..45916984b0 100644 --- a/src/runtime/NEON/functions/NEBitwiseXor.cpp +++ b/src/runtime/NEON/functions/NEBitwiseXor.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NEBitwiseXor.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEBitwiseXorKernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void NEBitwiseXor::configure(const ITensor *input1, const ITensor *input2, ITensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEBox3x3.cpp b/src/runtime/NEON/functions/NEBox3x3.cpp index 7f0b45d34c..46cf259073 100644 --- a/src/runtime/NEON/functions/NEBox3x3.cpp +++ b/src/runtime/NEON/functions/NEBox3x3.cpp @@ -23,9 +23,9 @@ */ #include "arm_compute/runtime/NEON/functions/NEBox3x3.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEBox3x3Kernel.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -35,13 +35,13 @@ void NEBox3x3::configure(ITensor *input, ITensor *output, BorderMode border_mode { if(use_fp16) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); } else { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NECannyEdge.cpp b/src/runtime/NEON/functions/NECannyEdge.cpp index 26f31f557b..029d30c5d6 100644 --- a/src/runtime/NEON/functions/NECannyEdge.cpp +++ b/src/runtime/NEON/functions/NECannyEdge.cpp @@ -24,7 +24,6 @@ #include "arm_compute/runtime/NEON/functions/NECannyEdge.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensor.h" #include "arm_compute/core/NEON/kernels/NECannyEdgeKernel.h" #include "arm_compute/core/NEON/kernels/NEFillBorderKernel.h" @@ -35,6 +34,7 @@ #include "arm_compute/runtime/NEON/functions/NESobel5x5.h" #include "arm_compute/runtime/NEON/functions/NESobel7x7.h" #include "arm_compute/runtime/TensorAllocator.h" +#include "support/ToolchainSupport.h" #include #include @@ -85,19 +85,19 @@ void NECannyEdge::configure(ITensor *input, ITensor *output, int32_t upper_thr, // Configure/Init sobelNxN if(gradient_size == 3) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, &_gx, &_gy, border_mode, constant_border_value); _sobel = std::move(k); } else if(gradient_size == 5) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, &_gx, &_gy, border_mode, constant_border_value); _sobel = std::move(k); } else if(gradient_size == 7) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, &_gx, &_gy, border_mode, constant_border_value); _sobel = std::move(k); } @@ -109,13 +109,13 @@ void NECannyEdge::configure(ITensor *input, ITensor *output, int32_t upper_thr, // Configure gradient if(use_fp16) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(&_gx, &_gy, &_magnitude, &_phase, norm_type); _gradient = std::move(k); } else { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(&_gx, &_gy, &_magnitude, &_phase, norm_type); _gradient = std::move(k); } diff --git a/src/runtime/NEON/functions/NEChannelCombine.cpp b/src/runtime/NEON/functions/NEChannelCombine.cpp index 84d4fff4ff..9166aa97db 100644 --- a/src/runtime/NEON/functions/NEChannelCombine.cpp +++ b/src/runtime/NEON/functions/NEChannelCombine.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NEChannelCombine.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEChannelCombineKernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,14 +32,14 @@ using namespace arm_compute; void NEChannelCombine::configure(const ITensor *plane0, const ITensor *plane1, const ITensor *plane2, const ITensor *plane3, ITensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(plane0, plane1, plane2, plane3, output); _kernel = std::move(k); } void NEChannelCombine::configure(const IImage *plane0, const IImage *plane1, const IImage *plane2, IMultiImage *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(plane0, plane1, plane2, output); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEChannelExtract.cpp b/src/runtime/NEON/functions/NEChannelExtract.cpp index 634e918eac..7b8a99335f 100644 --- a/src/runtime/NEON/functions/NEChannelExtract.cpp +++ b/src/runtime/NEON/functions/NEChannelExtract.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NEChannelExtract.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEChannelExtractKernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,14 +32,14 @@ using namespace arm_compute; void NEChannelExtract::configure(const ITensor *input, Channel channel, ITensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, channel, output); _kernel = std::move(k); } void NEChannelExtract::configure(const IMultiImage *input, Channel channel, IImage *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, channel, output); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEColorConvert.cpp b/src/runtime/NEON/functions/NEColorConvert.cpp index bbaa832284..b9fe1ff11d 100644 --- a/src/runtime/NEON/functions/NEColorConvert.cpp +++ b/src/runtime/NEON/functions/NEColorConvert.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NEColorConvert.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEColorConvertKernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,28 +32,28 @@ using namespace arm_compute; void NEColorConvert::configure(const ITensor *input, ITensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } void NEColorConvert::configure(const IMultiImage *input, IImage *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } void NEColorConvert::configure(const IImage *input, IMultiImage *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } void NEColorConvert::configure(const IMultiImage *input, IMultiImage *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEConvolution.cpp b/src/runtime/NEON/functions/NEConvolution.cpp index 3f39ae2cbd..4ad6450c67 100644 --- a/src/runtime/NEON/functions/NEConvolution.cpp +++ b/src/runtime/NEON/functions/NEConvolution.cpp @@ -24,7 +24,6 @@ #include "arm_compute/runtime/NEON/functions/NEConvolution.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensor.h" #include "arm_compute/core/NEON/kernels/NEConvolutionKernel.h" #include "arm_compute/core/PixelValue.h" @@ -33,6 +32,7 @@ #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/NEON/NEScheduler.h" #include "arm_compute/runtime/TensorAllocator.h" +#include "support/ToolchainSupport.h" #include #include @@ -41,7 +41,7 @@ using namespace arm_compute; void NEConvolution3x3::configure(ITensor *input, ITensor *output, const int16_t *conv, uint32_t scale, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, conv, scale, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); @@ -113,7 +113,7 @@ template class arm_compute::NEConvolutionSquare<9>; void NEConvolutionRectangle::configure(ITensor *input, ITensor *output, const int16_t *conv, uint32_t rows, uint32_t cols, uint32_t scale, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, conv, rows, cols, scale, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/NEON/functions/NEDepthConcatenate.cpp b/src/runtime/NEON/functions/NEDepthConcatenate.cpp index 7d2c5494a9..8661fe5fda 100644 --- a/src/runtime/NEON/functions/NEDepthConcatenate.cpp +++ b/src/runtime/NEON/functions/NEDepthConcatenate.cpp @@ -24,13 +24,13 @@ #include "arm_compute/runtime/NEON/functions/NEDepthConcatenate.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensor.h" #include "arm_compute/core/NEON/kernels/NEDepthConcatenateKernel.h" #include "arm_compute/core/NEON/kernels/NEFillBorderKernel.h" #include "arm_compute/core/PixelValue.h" #include "arm_compute/core/Types.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; @@ -44,8 +44,8 @@ void NEDepthConcatenate::configure(std::vector inputs_vector, ITensor ARM_COMPUTE_ERROR_ON(inputs_vector.size() < 2); _num_inputs = inputs_vector.size(); - _concat_kernels_vector = arm_compute::cpp14::make_unique(_num_inputs); - _border_handlers_vector = arm_compute::cpp14::make_unique(_num_inputs); + _concat_kernels_vector = arm_compute::support::cpp14::make_unique(_num_inputs); + _border_handlers_vector = arm_compute::support::cpp14::make_unique(_num_inputs); unsigned int depth_offset = 0; for(unsigned int i = 0; i < _num_inputs; ++i) diff --git a/src/runtime/NEON/functions/NEDepthConvert.cpp b/src/runtime/NEON/functions/NEDepthConvert.cpp index a339cae316..011e366bf3 100644 --- a/src/runtime/NEON/functions/NEDepthConvert.cpp +++ b/src/runtime/NEON/functions/NEDepthConvert.cpp @@ -24,8 +24,9 @@ #include "arm_compute/runtime/NEON/functions/NEDepthConvert.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEDepthConvertKernel.h" +#include "arm_compute/core/Validate.h" +#include "support/ToolchainSupport.h" #include @@ -38,7 +39,7 @@ void NEDepthConvert::configure(const ITensor *input, ITensor *output, ConvertPol ARM_COMPUTE_ERROR_ON(input == output); ARM_COMPUTE_ERROR_ON(input->info()->data_type() == output->info()->data_type()); - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, policy, shift); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEDilate.cpp b/src/runtime/NEON/functions/NEDilate.cpp index 0c016f14f9..5c733a8278 100644 --- a/src/runtime/NEON/functions/NEDilate.cpp +++ b/src/runtime/NEON/functions/NEDilate.cpp @@ -23,9 +23,9 @@ */ #include "arm_compute/runtime/NEON/functions/NEDilate.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEDilateKernel.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void NEDilate::configure(ITensor *input, ITensor *output, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/NEON/functions/NEErode.cpp b/src/runtime/NEON/functions/NEErode.cpp index 9b011db845..3609572de6 100644 --- a/src/runtime/NEON/functions/NEErode.cpp +++ b/src/runtime/NEON/functions/NEErode.cpp @@ -23,9 +23,9 @@ */ #include "arm_compute/runtime/NEON/functions/NEErode.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEErodeKernel.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void NEErode::configure(ITensor *input, ITensor *output, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/NEON/functions/NEGEMMInterleave4x4.cpp b/src/runtime/NEON/functions/NEGEMMInterleave4x4.cpp index 4c77c88656..63f330be6c 100644 --- a/src/runtime/NEON/functions/NEGEMMInterleave4x4.cpp +++ b/src/runtime/NEON/functions/NEGEMMInterleave4x4.cpp @@ -23,14 +23,14 @@ */ #include "arm_compute/runtime/NEON/functions/NEGEMMInterleave4x4.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEGEMMInterleave4x4Kernel.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; void NEGEMMInterleave4x4::configure(const ITensor *input, ITensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEGEMMTranspose1xW.cpp b/src/runtime/NEON/functions/NEGEMMTranspose1xW.cpp index dc40ecec14..571bf2bc74 100644 --- a/src/runtime/NEON/functions/NEGEMMTranspose1xW.cpp +++ b/src/runtime/NEON/functions/NEGEMMTranspose1xW.cpp @@ -24,17 +24,17 @@ #include "arm_compute/runtime/NEON/functions/NEGEMMTranspose1xW.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensor.h" #include "arm_compute/core/NEON/kernels/NEGEMMTranspose1xWKernel.h" #include "arm_compute/core/Types.h" #include "arm_compute/core/Validate.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; void NEGEMMTranspose1xW::configure(const ITensor *input, ITensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEGaussian3x3.cpp b/src/runtime/NEON/functions/NEGaussian3x3.cpp index 95ba5cbdf9..db8eb63c90 100644 --- a/src/runtime/NEON/functions/NEGaussian3x3.cpp +++ b/src/runtime/NEON/functions/NEGaussian3x3.cpp @@ -23,9 +23,9 @@ */ #include "arm_compute/runtime/NEON/functions/NEGaussian3x3.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEGaussian3x3Kernel.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void NEGaussian3x3::configure(ITensor *input, ITensor *output, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/NEON/functions/NEGaussianPyramid.cpp b/src/runtime/NEON/functions/NEGaussianPyramid.cpp index e1d64f11f6..75c439511e 100644 --- a/src/runtime/NEON/functions/NEGaussianPyramid.cpp +++ b/src/runtime/NEON/functions/NEGaussianPyramid.cpp @@ -24,7 +24,6 @@ #include "arm_compute/runtime/NEON/functions/NEGaussianPyramid.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensor.h" #include "arm_compute/core/NEON/kernels/NEGaussianPyramidKernel.h" #include "arm_compute/core/NEON/kernels/NEScaleKernel.h" @@ -36,6 +35,7 @@ #include "arm_compute/runtime/Pyramid.h" #include "arm_compute/runtime/Tensor.h" #include "arm_compute/runtime/TensorAllocator.h" +#include "support/ToolchainSupport.h" #include @@ -68,9 +68,9 @@ void NEGaussianPyramidHalf::configure(const ITensor *input, IPyramid *pyramid, B if(num_levels > 1) { - _border_handler = arm_compute::cpp14::make_unique(num_levels - 1); - _horizontal_reduction = arm_compute::cpp14::make_unique(num_levels - 1); - _vertical_reduction = arm_compute::cpp14::make_unique(num_levels - 1); + _border_handler = arm_compute::support::cpp14::make_unique(num_levels - 1); + _horizontal_reduction = arm_compute::support::cpp14::make_unique(num_levels - 1); + _vertical_reduction = arm_compute::support::cpp14::make_unique(num_levels - 1); // Apply half scale to the X dimension of the tensor shape TensorShape tensor_shape = pyramid->info()->tensor_shape(); @@ -135,9 +135,9 @@ void NEGaussianPyramidOrb::configure(const ITensor *input, IPyramid *pyramid, Bo if(num_levels > 1) { - _gaus5x5 = arm_compute::cpp14::make_unique(num_levels - 1); - _scale_nearest = arm_compute::cpp14::make_unique(num_levels - 1); - _offsets = arm_compute::cpp14::make_unique(num_levels - 1); + _gaus5x5 = arm_compute::support::cpp14::make_unique(num_levels - 1); + _scale_nearest = arm_compute::support::cpp14::make_unique(num_levels - 1); + _offsets = arm_compute::support::cpp14::make_unique(num_levels - 1); PyramidInfo pyramid_info(num_levels - 1, SCALE_PYRAMID_ORB, pyramid->info()->tensor_shape(), Format::U8); _tmp.init(pyramid_info); diff --git a/src/runtime/NEON/functions/NEHOGDetector.cpp b/src/runtime/NEON/functions/NEHOGDetector.cpp index e8ed29d0b9..49d0778eaa 100644 --- a/src/runtime/NEON/functions/NEHOGDetector.cpp +++ b/src/runtime/NEON/functions/NEHOGDetector.cpp @@ -23,14 +23,14 @@ */ #include "arm_compute/runtime/NEON/functions/NEHOGDetector.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEHOGDetectorKernel.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; void NEHOGDetector::configure(const ITensor *input, const IHOG *hog, IDetectionWindowArray *detection_windows, const Size2D &detection_window_stride, float threshold, size_t idx_class) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, hog, detection_windows, detection_window_stride, threshold, idx_class); _kernel = std::move(k); } \ No newline at end of file diff --git a/src/runtime/NEON/functions/NEHOGGradient.cpp b/src/runtime/NEON/functions/NEHOGGradient.cpp index 2f4b8802e3..563d4c2640 100644 --- a/src/runtime/NEON/functions/NEHOGGradient.cpp +++ b/src/runtime/NEON/functions/NEHOGGradient.cpp @@ -23,10 +23,10 @@ */ #include "arm_compute/runtime/NEON/functions/NEHOGGradient.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEMagnitudePhaseKernel.h" #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; @@ -54,13 +54,13 @@ void NEHOGGradient::configure(ITensor *input, ITensor *output_magnitude, ITensor // Initialise magnitude/phase kernel if(PhaseType::UNSIGNED == phase_type) { - auto k = arm_compute::cpp14::make_unique>(); + auto k = arm_compute::support::cpp14::make_unique>(); k->configure(&_gx, &_gy, output_magnitude, output_phase); _mag_phase = std::move(k); } else { - auto k = arm_compute::cpp14::make_unique>(); + auto k = arm_compute::support::cpp14::make_unique>(); k->configure(&_gx, &_gy, output_magnitude, output_phase); _mag_phase = std::move(k); } diff --git a/src/runtime/NEON/functions/NEHOGMultiDetection.cpp b/src/runtime/NEON/functions/NEHOGMultiDetection.cpp index 173b8f4c42..635b793d0c 100644 --- a/src/runtime/NEON/functions/NEHOGMultiDetection.cpp +++ b/src/runtime/NEON/functions/NEHOGMultiDetection.cpp @@ -24,10 +24,11 @@ #include "arm_compute/runtime/NEON/functions/NEHOGMultiDetection.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/TensorInfo.h" +#include "arm_compute/core/Validate.h" #include "arm_compute/runtime/NEON/NEScheduler.h" #include "arm_compute/runtime/Tensor.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; @@ -112,12 +113,12 @@ void NEHOGMultiDetection::configure(ITensor *input, const IMultiHOG *multi_hog, _num_block_norm_kernel = input_block_norm.size(); // Number of NEHOGBlockNormalizationKernel kernels to compute _num_hog_detect_kernel = input_hog_detect.size(); // Number of NEHOGDetector functions to compute - _orient_bin_kernel = arm_compute::cpp14::make_unique(_num_orient_bin_kernel); - _block_norm_kernel = arm_compute::cpp14::make_unique(_num_block_norm_kernel); - _hog_detect_kernel = arm_compute::cpp14::make_unique(_num_hog_detect_kernel); - _non_maxima_kernel = arm_compute::cpp14::make_unique(); - _hog_space = arm_compute::cpp14::make_unique(_num_orient_bin_kernel); - _hog_norm_space = arm_compute::cpp14::make_unique(_num_block_norm_kernel); + _orient_bin_kernel = arm_compute::support::cpp14::make_unique(_num_orient_bin_kernel); + _block_norm_kernel = arm_compute::support::cpp14::make_unique(_num_block_norm_kernel); + _hog_detect_kernel = arm_compute::support::cpp14::make_unique(_num_hog_detect_kernel); + _non_maxima_kernel = arm_compute::support::cpp14::make_unique(); + _hog_space = arm_compute::support::cpp14::make_unique(_num_orient_bin_kernel); + _hog_norm_space = arm_compute::support::cpp14::make_unique(_num_block_norm_kernel); // Allocate tensors for magnitude and phase TensorInfo info_mag(shape_img, Format::S16); diff --git a/src/runtime/NEON/functions/NEHarrisCorners.cpp b/src/runtime/NEON/functions/NEHarrisCorners.cpp index b54fb67ab7..53b1968db2 100644 --- a/src/runtime/NEON/functions/NEHarrisCorners.cpp +++ b/src/runtime/NEON/functions/NEHarrisCorners.cpp @@ -24,7 +24,6 @@ #include "arm_compute/runtime/NEON/functions/NEHarrisCorners.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEFillBorderKernel.h" #include "arm_compute/core/NEON/kernels/NEHarrisCornersKernel.h" #include "arm_compute/core/TensorInfo.h" @@ -35,6 +34,7 @@ #include "arm_compute/runtime/NEON/functions/NESobel5x5.h" #include "arm_compute/runtime/NEON/functions/NESobel7x7.h" #include "arm_compute/runtime/TensorAllocator.h" +#include "support/ToolchainSupport.h" #include #include @@ -73,28 +73,28 @@ void NEHarrisCorners::configure(IImage *input, float threshold, float min_dist, _score.allocator()->init(tensor_info_score); _nonmax.allocator()->init(tensor_info_score); - _corners_list = arm_compute::cpp14::make_unique(shape.x() * shape.y()); + _corners_list = arm_compute::support::cpp14::make_unique(shape.x() * shape.y()); // Set/init Sobel kernel accordingly with gradient_size switch(gradient_size) { case 3: { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, &_gx, &_gy, border_mode, constant_border_value); _sobel = std::move(k); break; } case 5: { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, &_gx, &_gy, border_mode, constant_border_value); _sobel = std::move(k); break; } case 7: { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, &_gx, &_gy, border_mode, constant_border_value); _sobel = std::move(k); break; @@ -112,21 +112,21 @@ void NEHarrisCorners::configure(IImage *input, float threshold, float min_dist, { case 3: { - auto k = arm_compute::cpp14::make_unique>(); + auto k = arm_compute::support::cpp14::make_unique>(); k->configure(&_gx, &_gy, &_score, norm_factor, threshold, sensitivity, border_mode == BorderMode::UNDEFINED); _harris_score = std::move(k); } break; case 5: { - auto k = arm_compute::cpp14::make_unique>(); + auto k = arm_compute::support::cpp14::make_unique>(); k->configure(&_gx, &_gy, &_score, norm_factor, threshold, sensitivity, border_mode == BorderMode::UNDEFINED); _harris_score = std::move(k); } break; case 7: { - auto k = arm_compute::cpp14::make_unique>(); + auto k = arm_compute::support::cpp14::make_unique>(); k->configure(&_gx, &_gy, &_score, norm_factor, threshold, sensitivity, border_mode == BorderMode::UNDEFINED); _harris_score = std::move(k); } @@ -141,21 +141,21 @@ void NEHarrisCorners::configure(IImage *input, float threshold, float min_dist, { case 3: { - auto k = arm_compute::cpp14::make_unique>(); + auto k = arm_compute::support::cpp14::make_unique>(); k->configure(&_gx, &_gy, &_score, norm_factor, threshold, sensitivity, border_mode == BorderMode::UNDEFINED); _harris_score = std::move(k); } break; case 5: { - auto k = arm_compute::cpp14::make_unique>(); + auto k = arm_compute::support::cpp14::make_unique>(); k->configure(&_gx, &_gy, &_score, norm_factor, threshold, sensitivity, border_mode == BorderMode::UNDEFINED); _harris_score = std::move(k); } break; case 7: { - auto k = arm_compute::cpp14::make_unique>(); + auto k = arm_compute::support::cpp14::make_unique>(); k->configure(&_gx, &_gy, &_score, norm_factor, threshold, sensitivity, border_mode == BorderMode::UNDEFINED); _harris_score = std::move(k); } diff --git a/src/runtime/NEON/functions/NEHistogram.cpp b/src/runtime/NEON/functions/NEHistogram.cpp index c42b2a56e0..f333ecb1f8 100644 --- a/src/runtime/NEON/functions/NEHistogram.cpp +++ b/src/runtime/NEON/functions/NEHistogram.cpp @@ -24,17 +24,17 @@ #include "arm_compute/runtime/NEON/functions/NEHistogram.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/IDistribution1D.h" #include "arm_compute/core/ITensor.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; NEHistogram::NEHistogram() - : _histogram_kernel(), _local_hist(), _window_lut(arm_compute::cpp14::make_unique(window_lut_default_size)), _local_hist_size(0) + : _histogram_kernel(), _local_hist(), _window_lut(arm_compute::support::cpp14::make_unique(window_lut_default_size)), _local_hist_size(0) { } @@ -45,7 +45,7 @@ void NEHistogram::configure(const IImage *input, IDistribution1D *output) // Allocate space for threads local histograms _local_hist_size = output->num_bins() * NEScheduler::get().num_threads(); - _local_hist = arm_compute::cpp14::make_unique(_local_hist_size); + _local_hist = arm_compute::support::cpp14::make_unique(_local_hist_size); // Configure kernel _histogram_kernel.configure(input, output, _local_hist.get(), _window_lut.get()); diff --git a/src/runtime/NEON/functions/NEIntegralImage.cpp b/src/runtime/NEON/functions/NEIntegralImage.cpp index af604e9295..2e94ed5f9a 100644 --- a/src/runtime/NEON/functions/NEIntegralImage.cpp +++ b/src/runtime/NEON/functions/NEIntegralImage.cpp @@ -23,9 +23,9 @@ */ #include "arm_compute/runtime/NEON/functions/NEIntegralImage.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEIntegralImageKernel.h" #include "arm_compute/core/Types.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void NEIntegralImage::configure(const ITensor *input, ITensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); _border_handler.configure(output, _kernel->border_size(), BorderMode::CONSTANT, 0); diff --git a/src/runtime/NEON/functions/NELaplacianPyramid.cpp b/src/runtime/NEON/functions/NELaplacianPyramid.cpp index 8232c79f2d..ec93759869 100644 --- a/src/runtime/NEON/functions/NELaplacianPyramid.cpp +++ b/src/runtime/NEON/functions/NELaplacianPyramid.cpp @@ -24,7 +24,6 @@ #include "arm_compute/runtime/NEON/functions/NELaplacianPyramid.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/IPyramid.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Validate.h" @@ -33,6 +32,7 @@ #include "arm_compute/runtime/NEON/functions/NEGaussian5x5.h" #include "arm_compute/runtime/NEON/functions/NEGaussianPyramid.h" #include "arm_compute/runtime/Tensor.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; @@ -86,8 +86,8 @@ void NELaplacianPyramid::configure(const ITensor *input, IPyramid *pyramid, ITen // Create Gaussian Pyramid function _gaussian_pyr_function.configure(input, &_gauss_pyr, border_mode, constant_border_value); - _convf = arm_compute::cpp14::make_unique(_num_levels); - _subf = arm_compute::cpp14::make_unique(_num_levels); + _convf = arm_compute::support::cpp14::make_unique(_num_levels); + _subf = arm_compute::support::cpp14::make_unique(_num_levels); for(unsigned int i = 0; i < _num_levels; ++i) { diff --git a/src/runtime/NEON/functions/NELaplacianReconstruct.cpp b/src/runtime/NEON/functions/NELaplacianReconstruct.cpp index 36ac4a74d1..8366e2bfec 100644 --- a/src/runtime/NEON/functions/NELaplacianReconstruct.cpp +++ b/src/runtime/NEON/functions/NELaplacianReconstruct.cpp @@ -24,11 +24,11 @@ #include "arm_compute/runtime/NEON/functions/NELaplacianReconstruct.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/IPyramid.h" #include "arm_compute/core/ITensor.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Validate.h" +#include "support/ToolchainSupport.h" #include @@ -61,8 +61,8 @@ void NELaplacianReconstruct::configure(const IPyramid *pyramid, const ITensor *i _tmp_pyr.init(pyramid_info); // Allocate add and scale functions. Level 0 does not need to be scaled. - _addf = arm_compute::cpp14::make_unique(num_levels); - _scalef = arm_compute::cpp14::make_unique(num_levels - 1); + _addf = arm_compute::support::cpp14::make_unique(num_levels); + _scalef = arm_compute::support::cpp14::make_unique(num_levels - 1); const size_t last_level = num_levels - 1; diff --git a/src/runtime/NEON/functions/NEMagnitude.cpp b/src/runtime/NEON/functions/NEMagnitude.cpp index 9390ca2b6a..7877995d6b 100644 --- a/src/runtime/NEON/functions/NEMagnitude.cpp +++ b/src/runtime/NEON/functions/NEMagnitude.cpp @@ -23,9 +23,9 @@ */ #include "arm_compute/runtime/NEON/functions/NEMagnitude.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEMagnitudePhaseKernel.h" #include "arm_compute/core/Types.h" +#include "support/ToolchainSupport.h" #include @@ -35,13 +35,13 @@ void NEMagnitude::configure(const ITensor *input1, const ITensor *input2, ITenso { if(use_fp16) { - auto k = arm_compute::cpp14::make_unique>(); + auto k = arm_compute::support::cpp14::make_unique>(); k->configure(input1, input2, output, nullptr); _kernel = std::move(k); } else { - auto k = arm_compute::cpp14::make_unique>(); + auto k = arm_compute::support::cpp14::make_unique>(); k->configure(input1, input2, output, nullptr); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEMedian3x3.cpp b/src/runtime/NEON/functions/NEMedian3x3.cpp index aa7cc97081..627e5fb2a7 100644 --- a/src/runtime/NEON/functions/NEMedian3x3.cpp +++ b/src/runtime/NEON/functions/NEMedian3x3.cpp @@ -23,9 +23,9 @@ */ #include "arm_compute/runtime/NEON/functions/NEMedian3x3.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEMedian3x3Kernel.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void NEMedian3x3::configure(ITensor *input, ITensor *output, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/NEON/functions/NENonLinearFilter.cpp b/src/runtime/NEON/functions/NENonLinearFilter.cpp index 01aea3b671..57bd4e7aff 100644 --- a/src/runtime/NEON/functions/NENonLinearFilter.cpp +++ b/src/runtime/NEON/functions/NENonLinearFilter.cpp @@ -23,9 +23,9 @@ */ #include "arm_compute/runtime/NEON/functions/NENonLinearFilter.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NENonLinearFilterKernel.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -35,7 +35,7 @@ void NENonLinearFilter::configure(ITensor *input, ITensor *output, NonLinearFilt BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, function, mask_size, pattern, mask, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/NEON/functions/NENonMaximaSuppression3x3.cpp b/src/runtime/NEON/functions/NENonMaximaSuppression3x3.cpp index e92d567d52..3b59820d09 100644 --- a/src/runtime/NEON/functions/NENonMaximaSuppression3x3.cpp +++ b/src/runtime/NEON/functions/NENonMaximaSuppression3x3.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NENonMaximaSuppression3x3.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NENonMaximaSuppression3x3Kernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void NENonMaximaSuppression3x3::configure(ITensor *input, ITensor *output, BorderMode border_mode) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NEOpticalFlow.cpp b/src/runtime/NEON/functions/NEOpticalFlow.cpp index 49135e442c..d851e9a62b 100644 --- a/src/runtime/NEON/functions/NEOpticalFlow.cpp +++ b/src/runtime/NEON/functions/NEOpticalFlow.cpp @@ -24,7 +24,6 @@ #include "arm_compute/runtime/NEON/functions/NEOpticalFlow.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensor.h" #include "arm_compute/core/NEON/kernels/NELKTrackerKernel.h" #include "arm_compute/core/TensorInfo.h" @@ -34,6 +33,7 @@ #include "arm_compute/runtime/Pyramid.h" #include "arm_compute/runtime/Tensor.h" #include "arm_compute/runtime/TensorAllocator.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; @@ -65,10 +65,10 @@ void NEOpticalFlow::configure(const Pyramid *old_pyramid, const Pyramid *new_pyr const float pyr_scale = old_pyramid->info()->scale(); - _func_scharr = arm_compute::cpp14::make_unique(_num_levels); - _kernel_tracker = arm_compute::cpp14::make_unique(_num_levels); - _scharr_gx = arm_compute::cpp14::make_unique(_num_levels); - _scharr_gy = arm_compute::cpp14::make_unique(_num_levels); + _func_scharr = arm_compute::support::cpp14::make_unique(_num_levels); + _kernel_tracker = arm_compute::support::cpp14::make_unique(_num_levels); + _scharr_gx = arm_compute::support::cpp14::make_unique(_num_levels); + _scharr_gy = arm_compute::support::cpp14::make_unique(_num_levels); _old_points_internal = LKInternalKeypointArray(old_points->num_values()); _new_points_internal = LKInternalKeypointArray(old_points->num_values()); diff --git a/src/runtime/NEON/functions/NEPhase.cpp b/src/runtime/NEON/functions/NEPhase.cpp index 7683f461d3..436d22f3af 100644 --- a/src/runtime/NEON/functions/NEPhase.cpp +++ b/src/runtime/NEON/functions/NEPhase.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NEPhase.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEMagnitudePhaseKernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void NEPhase::configure(const ITensor *input1, const ITensor *input2, ITensor *output) { - auto k = arm_compute::cpp14::make_unique>(); + auto k = arm_compute::support::cpp14::make_unique>(); k->configure(input1, input2, nullptr, output); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEPixelWiseMultiplication.cpp b/src/runtime/NEON/functions/NEPixelWiseMultiplication.cpp index 056d33b370..2e2ea11e86 100644 --- a/src/runtime/NEON/functions/NEPixelWiseMultiplication.cpp +++ b/src/runtime/NEON/functions/NEPixelWiseMultiplication.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NEPixelWiseMultiplication.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEPixelWiseMultiplicationKernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void NEPixelWiseMultiplication::configure(const ITensor *input1, const ITensor *input2, ITensor *output, float scale, ConvertPolicy overflow_policy, RoundingPolicy rounding_policy) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output, scale, overflow_policy, rounding_policy); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEPoolingLayer.cpp b/src/runtime/NEON/functions/NEPoolingLayer.cpp index 6f0cc4f160..4c4e11f7db 100644 --- a/src/runtime/NEON/functions/NEPoolingLayer.cpp +++ b/src/runtime/NEON/functions/NEPoolingLayer.cpp @@ -23,15 +23,15 @@ */ #include "arm_compute/runtime/NEON/functions/NEPoolingLayer.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEPoolingLayerKernel.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; void NEPoolingLayer::configure(ITensor *input, ITensor *output, const PoolingLayerInfo &pool_info) { // Configure pooling kernel - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, pool_info); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NERemap.cpp b/src/runtime/NEON/functions/NERemap.cpp index 9f06fb699c..882e93beae 100644 --- a/src/runtime/NEON/functions/NERemap.cpp +++ b/src/runtime/NEON/functions/NERemap.cpp @@ -24,13 +24,13 @@ #include "arm_compute/runtime/NEON/functions/NERemap.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensor.h" #include "arm_compute/core/NEON/kernels/NERemapKernel.h" #include "arm_compute/core/PixelValue.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/TensorAllocator.h" +#include "support/ToolchainSupport.h" #include @@ -44,7 +44,7 @@ void NERemap::configure(ITensor *input, const ITensor *map_x, const ITensor *map ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(map_y, 1, DataType::F32); ARM_COMPUTE_ERROR_ON_MSG(policy == InterpolationPolicy::AREA, "Area interpolation is not supported"); - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, map_x, map_y, output, policy); diff --git a/src/runtime/NEON/functions/NEScale.cpp b/src/runtime/NEON/functions/NEScale.cpp index b70f626df0..0a551e937d 100644 --- a/src/runtime/NEON/functions/NEScale.cpp +++ b/src/runtime/NEON/functions/NEScale.cpp @@ -32,6 +32,7 @@ #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Window.h" #include "arm_compute/runtime/TensorAllocator.h" +#include "support/ToolchainSupport.h" #include #include @@ -116,7 +117,7 @@ void NEScale::configure(ITensor *input, ITensor *output, InterpolationPolicy pol policy = InterpolationPolicy::NEAREST_NEIGHBOR; } - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); // Check if the border mode is UNDEFINED const bool border_undefined = border_mode == BorderMode::UNDEFINED; diff --git a/src/runtime/NEON/functions/NEScharr3x3.cpp b/src/runtime/NEON/functions/NEScharr3x3.cpp index 04b3f14ce7..ba9985e1d2 100644 --- a/src/runtime/NEON/functions/NEScharr3x3.cpp +++ b/src/runtime/NEON/functions/NEScharr3x3.cpp @@ -23,9 +23,9 @@ */ #include "arm_compute/runtime/NEON/functions/NEScharr3x3.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEScharr3x3Kernel.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void NEScharr3x3::configure(ITensor *input, ITensor *output_x, ITensor *output_y, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output_x, output_y, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/NEON/functions/NESobel3x3.cpp b/src/runtime/NEON/functions/NESobel3x3.cpp index 3b46fd78c1..753b1f600f 100644 --- a/src/runtime/NEON/functions/NESobel3x3.cpp +++ b/src/runtime/NEON/functions/NESobel3x3.cpp @@ -23,9 +23,9 @@ */ #include "arm_compute/runtime/NEON/functions/NESobel3x3.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NESobel3x3Kernel.h" #include "arm_compute/core/PixelValue.h" +#include "support/ToolchainSupport.h" #include @@ -33,7 +33,7 @@ using namespace arm_compute; void NESobel3x3::configure(ITensor *input, ITensor *output_x, ITensor *output_y, BorderMode border_mode, uint8_t constant_border_value) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output_x, output_y, border_mode == BorderMode::UNDEFINED); _kernel = std::move(k); _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value)); diff --git a/src/runtime/NEON/functions/NETableLookup.cpp b/src/runtime/NEON/functions/NETableLookup.cpp index ebb8a0ac9b..cae117a13e 100644 --- a/src/runtime/NEON/functions/NETableLookup.cpp +++ b/src/runtime/NEON/functions/NETableLookup.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NETableLookup.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NETableLookupKernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void NETableLookup::configure(const ITensor *input, const ILut *lut, ITensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, lut, output); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEThreshold.cpp b/src/runtime/NEON/functions/NEThreshold.cpp index 93dc124880..37883e5387 100644 --- a/src/runtime/NEON/functions/NEThreshold.cpp +++ b/src/runtime/NEON/functions/NEThreshold.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NEThreshold.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEThresholdKernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void NEThreshold::configure(const ITensor *input, ITensor *output, uint8_t threshold, uint8_t false_value, uint8_t true_value, ThresholdType type, uint8_t upper) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, threshold, false_value, true_value, type, upper); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NETranspose.cpp b/src/runtime/NEON/functions/NETranspose.cpp index 53ac9c5ee3..eb81e02205 100644 --- a/src/runtime/NEON/functions/NETranspose.cpp +++ b/src/runtime/NEON/functions/NETranspose.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/runtime/NEON/functions/NETranspose.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NETransposeKernel.h" +#include "support/ToolchainSupport.h" #include @@ -32,7 +32,7 @@ using namespace arm_compute; void NETranspose::configure(const ITensor *input, ITensor *output) { - auto k = arm_compute::cpp14::make_unique(); + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output); _kernel = std::move(k); } diff --git a/src/runtime/NEON/functions/NEWarpAffine.cpp b/src/runtime/NEON/functions/NEWarpAffine.cpp index 24fb16f9e3..889d827ed0 100644 --- a/src/runtime/NEON/functions/NEWarpAffine.cpp +++ b/src/runtime/NEON/functions/NEWarpAffine.cpp @@ -24,8 +24,9 @@ #include "arm_compute/runtime/NEON/functions/NEWarpAffine.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEWarpKernel.h" +#include "arm_compute/core/Validate.h" +#include "support/ToolchainSupport.h" #include @@ -41,14 +42,14 @@ void NEWarpAffine::configure(ITensor *input, ITensor *output, const float *matri { case InterpolationPolicy::NEAREST_NEIGHBOR: { - auto k = arm_compute::cpp14::make_unique>(); + auto k = arm_compute::support::cpp14::make_unique>(); k->configure(input, output, matrix, border_mode, constant_border_value); _kernel = std::move(k); break; } case InterpolationPolicy::BILINEAR: { - auto k = arm_compute::cpp14::make_unique>(); + auto k = arm_compute::support::cpp14::make_unique>(); k->configure(input, output, matrix, border_mode, constant_border_value); _kernel = std::move(k); break; diff --git a/src/runtime/NEON/functions/NEWarpPerspective.cpp b/src/runtime/NEON/functions/NEWarpPerspective.cpp index 84b2df5bfa..ed5d6a0d27 100644 --- a/src/runtime/NEON/functions/NEWarpPerspective.cpp +++ b/src/runtime/NEON/functions/NEWarpPerspective.cpp @@ -24,8 +24,9 @@ #include "arm_compute/runtime/NEON/functions/NEWarpPerspective.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/NEON/kernels/NEWarpKernel.h" +#include "arm_compute/core/Validate.h" +#include "support/ToolchainSupport.h" #include @@ -41,14 +42,14 @@ void NEWarpPerspective::configure(ITensor *input, ITensor *output, const float * { case InterpolationPolicy::NEAREST_NEIGHBOR: { - auto k = arm_compute::cpp14::make_unique>(); + auto k = arm_compute::support::cpp14::make_unique>(); k->configure(input, output, matrix, border_mode, constant_border_value); _kernel = std::move(k); break; } case InterpolationPolicy::BILINEAR: { - auto k = arm_compute::cpp14::make_unique>(); + auto k = arm_compute::support::cpp14::make_unique>(); k->configure(input, output, matrix, border_mode, constant_border_value); _kernel = std::move(k); break; diff --git a/src/runtime/Pyramid.cpp b/src/runtime/Pyramid.cpp index f1b6c93b50..ebd65702a6 100644 --- a/src/runtime/Pyramid.cpp +++ b/src/runtime/Pyramid.cpp @@ -24,10 +24,10 @@ #include "arm_compute/runtime/Pyramid.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" #include "arm_compute/core/PyramidInfo.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/TensorShape.h" +#include "support/ToolchainSupport.h" #include @@ -46,7 +46,7 @@ void Pyramid::init_auto_padding(const PyramidInfo &info) void Pyramid::internal_init(const PyramidInfo &info, bool auto_padding) { _info = info; - _pyramid = arm_compute::cpp14::make_unique(_info.num_levels()); + _pyramid = arm_compute::support::cpp14::make_unique(_info.num_levels()); size_t w = _info.width(); size_t h = _info.height(); diff --git a/support/ToolchainSupport.h b/support/ToolchainSupport.h new file mode 100644 index 0000000000..36b08affb9 --- /dev/null +++ b/support/ToolchainSupport.h @@ -0,0 +1,310 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_TOOLCHAINSUPPORT +#define ARM_COMPUTE_TEST_TOOLCHAINSUPPORT + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace arm_compute +{ +namespace support +{ +namespace cpp11 +{ +#ifdef __ANDROID__ +/** Convert integer and float values to string. + * + * @note This function implements the same behaviour as std::to_string. The + * latter is missing in some Android toolchains. + * + * @param[in] value Value to be converted to string. + * + * @return String representation of @p value. + */ +template ::type>::value, int>::type = 0> +std::string to_string(T && value) +{ + std::stringstream stream; + stream << std::forward(value); + return stream.str(); +} + +/** Convert string values to integer. + * + * @note This function implements the same behaviour as std::stoi. The latter + * is missing in some Android toolchains. + * + * @param[in] str String to be converted to int. + * + * @return Integer representation of @p str. + */ +inline int stoi(const std::string &str) +{ + std::stringstream stream(str); + int value = 0; + stream >> value; + return value; +} + +/** Convert string values to unsigned long. + * + * @note This function implements the same behaviour as std::stoul. The latter + * is missing in some Android toolchains. + * + * @param[in] str String to be converted to unsigned long. + * + * @return Unsigned long representation of @p str. + */ +inline unsigned long stoul(const std::string &str) +{ + std::stringstream stream(str); + unsigned long value = 0; + stream >> value; + return value; +} + +/** Convert string values to float. + * + * @note This function implements the same behaviour as std::stof. The latter + * is missing in some Android toolchains. + * + * @param[in] str String to be converted to float. + * + * @return Float representation of @p str. + */ +inline float stof(const std::string &str) +{ + std::stringstream stream(str); + float value = 0.f; + stream >> value; + return value; +} + +/** Round floating-point value with half value rounding away from zero. + * + * @note This function implements the same behaviour as std::round except that it doesn't + * support Integral type. The latter is not in the namespace std in some Android toolchains. + * + * @param[in] value floating-point value to be rounded. + * + * @return Floating-point value of rounded @p value. + */ +template ::value>::type> +inline T round(T value) +{ + return ::round(value); +} + +/** Truncate floating-point value. + * + * @note This function implements the same behaviour as std::truncate except that it doesn't + * support Integral type. The latter is not in the namespace std in some Android toolchains. + * + * @param[in] value floating-point value to be truncated. + * + * @return Floating-point value of truncated @p value. + */ +template ::value>::type> +inline T trunc(T value) +{ + return ::trunc(value); +} + +/** Composes a floating point value with the magnitude of @p x and the sign of @p y. + * + * @note This function implements the same behaviour as std::copysign except that it doesn't + * support Integral type. The latter is not in the namespace std in some Android toolchains. + * + * @param[in] x value that contains the magnitued to be used in constructing the result. + * @param[in] y value that contains the sign to be used in constructin the result. + * + * @return Floating-point value with magnitude of @p x and sign of @p y. + */ +template ::value>::type> +inline T copysign(T x, T y) +{ + return ::copysign(x, y); +} +#else +/** Convert integer and float values to string. + * + * @note This function acts as a convenience wrapper around std::to_string. The + * latter is missing in some Android toolchains. + * + * @param[in] value Value to be converted to string. + * + * @return String representation of @p value. + */ +template +std::string to_string(T &&value) +{ + return ::std::to_string(std::forward(value)); +} + +/** Convert string values to integer. + * + * @note This function acts as a convenience wrapper around std::stoi. The + * latter is missing in some Android toolchains. + * + * @param[in] args Arguments forwarded to std::stoi. + * + * @return Integer representation of input string. + */ +template +int stoi(Ts &&... args) +{ + return ::std::stoi(std::forward(args)...); +} + +/** Convert string values to unsigned long. + * + * @note This function acts as a convenience wrapper around std::stoul. The + * latter is missing in some Android toolchains. + * + * @param[in] args Arguments forwarded to std::stoul. + * + * @return Unsigned long representation of input string. + */ +template +int stoul(Ts &&... args) +{ + return ::std::stoul(std::forward(args)...); +} + +/** Convert string values to float. + * + * @note This function acts as a convenience wrapper around std::stof. The + * latter is missing in some Android toolchains. + * + * @param[in] args Arguments forwarded to std::stof. + * + * @return Float representation of input string. + */ +template +int stof(Ts &&... args) +{ + return ::std::stof(std::forward(args)...); +} + +/** Round floating-point value with half value rounding away from zero. + * + * @note This function implements the same behaviour as std::round except that it doesn't + * support Integral type. The latter is not in the namespace std in some Android toolchains. + * + * @param[in] value floating-point value to be rounded. + * + * @return Floating-point value of rounded @p value. + */ +template ::value>::type> +inline T round(T value) +{ + return std::round(value); +} + +/** Truncate floating-point value. + * + * @note This function implements the same behaviour as std::truncate except that it doesn't + * support Integral type. The latter is not in the namespace std in some Android toolchains. + * + * @param[in] value floating-point value to be truncated. + * + * @return Floating-point value of truncated @p value. + */ +template ::value>::type> +inline T trunc(T value) +{ + return std::trunc(value); +} + +/** Composes a floating point value with the magnitude of @p x and the sign of @p y. + * + * @note This function implements the same behaviour as std::copysign except that it doesn't + * support Integral type. The latter is not in the namespace std in some Android toolchains. + * + * @param[in] x value that contains the magnitued to be used in constructing the result. + * @param[in] y value that contains the sign to be used in constructin the result. + * + * @return Floating-point value with magnitude of @p x and sign of @p y. + */ +template ::value>::type> +inline T copysign(T x, T y) +{ + return std::copysign(x, y); +} +#endif +} // namespace cpp11 + +namespace cpp14 +{ +/** make_unqiue is missing in CPP11. Reimplement it according to the standard + * proposal. + */ +template +struct _Unique_if +{ + typedef std::unique_ptr _Single_object; +}; + +template +struct _Unique_if +{ + typedef std::unique_ptr _Unknown_bound; +}; + +template +struct _Unique_if +{ + typedef void _Known_bound; +}; + +template +typename _Unique_if::_Single_object +make_unique(Args &&... args) +{ + return std::unique_ptr(new T(std::forward(args)...)); +} + +template +typename _Unique_if::_Unknown_bound +make_unique(size_t n) +{ + typedef typename std::remove_extent::type U; + return std::unique_ptr(new U[n]()); +} + +template +typename _Unique_if::_Known_bound +make_unique(Args &&...) = delete; +} // namespace cpp14 +} // namespace support +} // namespace arm_compute +#endif diff --git a/tests/RawTensor.cpp b/tests/RawTensor.cpp index 6bfdf57b36..402b5f3d0b 100644 --- a/tests/RawTensor.cpp +++ b/tests/RawTensor.cpp @@ -26,6 +26,7 @@ #include "Utils.h" #include "arm_compute/core/Utils.h" +#include "support/ToolchainSupport.h" #include #include @@ -43,7 +44,7 @@ RawTensor::RawTensor(TensorShape shape, Format format, int fixed_point_position) _format(format), _fixed_point_position(fixed_point_position) { - _buffer = ::arm_compute::test::cpp14::make_unique(size()); + _buffer = support::cpp14::make_unique(size()); } RawTensor::RawTensor(TensorShape shape, DataType data_type, int num_channels, int fixed_point_position) @@ -53,7 +54,7 @@ RawTensor::RawTensor(TensorShape shape, DataType data_type, int num_channels, in _num_channels(num_channels), _fixed_point_position(fixed_point_position) { - _buffer = ::arm_compute::test::cpp14::make_unique(size()); + _buffer = support::cpp14::make_unique(size()); } RawTensor::RawTensor(const RawTensor &tensor) @@ -62,7 +63,7 @@ RawTensor::RawTensor(const RawTensor &tensor) _format(tensor.format()), _fixed_point_position(tensor.fixed_point_position()) { - _buffer = ::arm_compute::test::cpp14::make_unique(tensor.size()); + _buffer = support::cpp14::make_unique(tensor.size()); std::copy(tensor.data(), tensor.data() + size(), _buffer.get()); } diff --git a/tests/Utils.h b/tests/Utils.h index 25023d46e6..3be046182a 100644 --- a/tests/Utils.h +++ b/tests/Utils.h @@ -27,8 +27,10 @@ #include "arm_compute/core/Coordinates.h" #include "arm_compute/core/Error.h" #include "arm_compute/core/FixedPoint.h" +#include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/TensorShape.h" #include "arm_compute/core/Types.h" +#include "support/ToolchainSupport.h" #include #include @@ -46,230 +48,6 @@ namespace arm_compute { namespace test { -namespace cpp11 -{ -#ifdef __ANDROID__ -/** Convert integer and float values to string. - * - * @note This function implements the same behaviour as std::to_string. The - * latter is missing in some Android toolchains. - * - * @param[in] value Value to be converted to string. - * - * @return String representation of @p value. - */ -template ::type>::value, int>::type = 0> -std::string to_string(T && value) -{ - std::stringstream stream; - stream << std::forward(value); - return stream.str(); -} - -/** Convert string values to integer. - * - * @note This function implements the same behaviour as std::stoi. The latter - * is missing in some Android toolchains. - * - * @param[in] str String to be converted to int. - * - * @return Integer representation of @p str. - */ -inline int stoi(const std::string &str) -{ - std::stringstream stream(str); - int value = 0; - stream >> value; - return value; -} - -/** Convert string values to unsigned long. - * - * @note This function implements the same behaviour as std::stoul. The latter - * is missing in some Android toolchains. - * - * @param[in] str String to be converted to unsigned long. - * - * @return Unsigned long representation of @p str. - */ -inline unsigned long stoul(const std::string &str) -{ - std::stringstream stream(str); - unsigned long value = 0; - stream >> value; - return value; -} - -/** Convert string values to float. - * - * @note This function implements the same behaviour as std::stof. The latter - * is missing in some Android toolchains. - * - * @param[in] str String to be converted to float. - * - * @return Float representation of @p str. - */ -inline float stof(const std::string &str) -{ - std::stringstream stream(str); - float value = 0.f; - stream >> value; - return value; -} - -/** Round floating-point value with half value rounding away from zero. - * - * @note This function implements the same behaviour as std::round except that it doesn't - * support Integral type. The latter is not in the namespace std in some Android toolchains. - * - * @param[in] value floating-point value to be rounded. - * - * @return Floating-point value of rounded @p value. - */ -template ::value>::type> -inline T round(T value) -{ - return ::round(value); -} - -/** Truncate floating-point value. - * - * @note This function implements the same behaviour as std::truncate except that it doesn't - * support Integral type. The latter is not in the namespace std in some Android toolchains. - * - * @param[in] value floating-point value to be truncated. - * - * @return Floating-point value of truncated @p value. - */ -template ::value>::type> -inline T trunc(T value) -{ - return ::trunc(value); -} - -/** Composes a floating point value with the magnitude of @p x and the sign of @p y. - * - * @note This function implements the same behaviour as std::copysign except that it doesn't - * support Integral type. The latter is not in the namespace std in some Android toolchains. - * - * @param[in] x value that contains the magnitued to be used in constructing the result. - * @param[in] y value that contains the sign to be used in constructin the result. - * - * @return Floating-point value with magnitude of @p x and sign of @p y. - */ -template ::value>::type> -inline T copysign(T x, T y) -{ - return ::copysign(x, y); -} -#else -/** Convert integer and float values to string. - * - * @note This function acts as a convenience wrapper around std::to_string. The - * latter is missing in some Android toolchains. - * - * @param[in] value Value to be converted to string. - * - * @return String representation of @p value. - */ -template -std::string to_string(T &&value) -{ - return ::std::to_string(std::forward(value)); -} - -/** Convert string values to integer. - * - * @note This function acts as a convenience wrapper around std::stoi. The - * latter is missing in some Android toolchains. - * - * @param[in] args Arguments forwarded to std::stoi. - * - * @return Integer representation of input string. - */ -template -int stoi(Ts &&... args) -{ - return ::std::stoi(std::forward(args)...); -} - -/** Convert string values to unsigned long. - * - * @note This function acts as a convenience wrapper around std::stoul. The - * latter is missing in some Android toolchains. - * - * @param[in] args Arguments forwarded to std::stoul. - * - * @return Unsigned long representation of input string. - */ -template -int stoul(Ts &&... args) -{ - return ::std::stoul(std::forward(args)...); -} - -/** Convert string values to float. - * - * @note This function acts as a convenience wrapper around std::stof. The - * latter is missing in some Android toolchains. - * - * @param[in] args Arguments forwarded to std::stof. - * - * @return Float representation of input string. - */ -template -int stof(Ts &&... args) -{ - return ::std::stof(std::forward(args)...); -} - -/** Round floating-point value with half value rounding away from zero. - * - * @note This function implements the same behaviour as std::round except that it doesn't - * support Integral type. The latter is not in the namespace std in some Android toolchains. - * - * @param[in] value floating-point value to be rounded. - * - * @return Floating-point value of rounded @p value. - */ -template ::value>::type> -inline T round(T value) -{ - return std::round(value); -} - -/** Truncate floating-point value. - * - * @note This function implements the same behaviour as std::truncate except that it doesn't - * support Integral type. The latter is not in the namespace std in some Android toolchains. - * - * @param[in] value floating-point value to be truncated. - * - * @return Floating-point value of truncated @p value. - */ -template ::value>::type> -inline T trunc(T value) -{ - return std::trunc(value); -} - -/** Composes a floating point value with the magnitude of @p x and the sign of @p y. - * - * @note This function implements the same behaviour as std::copysign except that it doesn't - * support Integral type. The latter is not in the namespace std in some Android toolchains. - * - * @param[in] x value that contains the magnitued to be used in constructing the result. - * @param[in] y value that contains the sign to be used in constructin the result. - * - * @return Floating-point value with magnitude of @p x and sign of @p y. - */ -template ::value>::type> -inline T copysign(T x, T y) -{ - return std::copysign(x, y); -} -#endif - /** Round floating-point value with half value rounding to positive infinity. * * @param[in] value floating-point value to be rounded. @@ -301,58 +79,14 @@ inline T round_half_even(T value, T epsilon = std::numeric_limits::epsilon()) // If 'ipart' is even then return 'ipart' if(std::fmod(ipart, 2.f) < epsilon) { - return cpp11::copysign(ipart, value); + return support::cpp11::copysign(ipart, value); } // Else return the nearest even integer - return cpp11::copysign(std::ceil(ipart + 0.5f), value); + return support::cpp11::copysign(std::ceil(ipart + 0.5f), value); } // Otherwise use the usual round to closest - return cpp11::copysign(cpp11::round(positive_value), value); + return support::cpp11::copysign(support::cpp11::round(positive_value), value); } -} // namespace cpp11 - -namespace cpp14 -{ -/** make_unqiue is missing in CPP11. Reimplement it according to the standard - * proposal. - */ -template -struct _Unique_if -{ - typedef std::unique_ptr _Single_object; -}; - -template -struct _Unique_if -{ - typedef std::unique_ptr _Unknown_bound; -}; - -template -struct _Unique_if -{ - typedef void _Known_bound; -}; - -template -typename _Unique_if::_Single_object -make_unique(Args &&... args) -{ - return std::unique_ptr(new T(std::forward(args)...)); -} - -template -typename _Unique_if::_Unknown_bound -make_unique(size_t n) -{ - typedef typename std::remove_extent::type U; - return std::unique_ptr(new U[n]()); -} - -template -typename _Unique_if::_Known_bound -make_unique(Args &&...) = delete; -} // namespace cpp14 namespace traits { @@ -663,7 +397,6 @@ inline bool is_in_valid_region(const ValidRegion &valid_region, const Coordinate } return true; } - } // namespace test } // namespace arm_compute #endif diff --git a/tests/benchmark/PMUCounter.cpp b/tests/benchmark/PMUCounter.cpp index e87dae82e6..6d59dae65d 100644 --- a/tests/benchmark/PMUCounter.cpp +++ b/tests/benchmark/PMUCounter.cpp @@ -24,6 +24,7 @@ #include "PMUCounter.h" #include "Utils.h" +#include "support/ToolchainSupport.h" #define _GNU_SOURCE 1 #include @@ -89,7 +90,7 @@ void CycleCounter::stop() std::unique_ptr CycleCounter::get_measurement() const { - return ::arm_compute::test::cpp14::make_unique>(_cycles); + return support::cpp14::make_unique>(_cycles); } InstructionCounter::InstructionCounter() diff --git a/tests/benchmark/WallClockTimer.cpp b/tests/benchmark/WallClockTimer.cpp index 9ab53d0b3c..717fe04b31 100644 --- a/tests/benchmark/WallClockTimer.cpp +++ b/tests/benchmark/WallClockTimer.cpp @@ -24,6 +24,7 @@ #include "WallClockTimer.h" #include "Utils.h" +#include "support/ToolchainSupport.h" namespace arm_compute { @@ -49,7 +50,7 @@ void WallClockTimer::stop() std::unique_ptr WallClockTimer::get_measurement() const { const std::chrono::duration delta = _stop - _start; - return ::arm_compute::test::cpp14::make_unique>(delta.count()); + return support::cpp14::make_unique>(delta.count()); } } // namespace benchmark } // namespace test diff --git a/tests/benchmark/main.cpp b/tests/benchmark/main.cpp index 7ce6a26acd..1b6bafb3a1 100644 --- a/tests/benchmark/main.cpp +++ b/tests/benchmark/main.cpp @@ -30,6 +30,7 @@ #include "WallClockTimer.h" #include "benchmark/benchmark_api.h" +#include "support/ToolchainSupport.h" #ifdef OPENCL #include "arm_compute/runtime/CL/CLScheduler.h" @@ -78,11 +79,11 @@ int main(int argc, char **argv) if(user_config.seed.is_set()) { - library = cpp14::make_unique(user_config.path.get(), user_config.seed); + library = arm_compute::support::cpp14::make_unique(user_config.path.get(), user_config.seed); } else { - library = cpp14::make_unique(user_config.path.get()); + library = arm_compute::support::cpp14::make_unique(user_config.path.get()); } #ifdef OPENCL diff --git a/tests/validation/FixedPoint.h b/tests/validation/FixedPoint.h index fa99ff84c2..dca6e7ed2f 100644 --- a/tests/validation/FixedPoint.h +++ b/tests/validation/FixedPoint.h @@ -25,6 +25,7 @@ #define __ARM_COMPUTE_TEST_VALIDATION_FIXEDPOINT_H__ #include "Utils.h" +#include "support/ToolchainSupport.h" #include #include @@ -147,7 +148,7 @@ public: * @param[in] p Fixed point precision */ fixed_point(std::string str, uint8_t p) - : _value(detail::constant_expr::to_fixed(arm_compute::test::cpp11::stof(str), p)), _fixed_point_position(p) + : _value(detail::constant_expr::to_fixed(support::cpp11::stof(str), p)), _fixed_point_position(p) { assert(p > 0 && p < std::numeric_limits::digits); } diff --git a/tests/validation/TensorOperations.h b/tests/validation/TensorOperations.h index 5557cfc2df..4f7765613c 100644 --- a/tests/validation/TensorOperations.h +++ b/tests/validation/TensorOperations.h @@ -28,6 +28,7 @@ #include "Tensor.h" #include "Types.h" #include "Utils.h" +#include "support/ToolchainSupport.h" #include "FixedPoint.h" #include "Types.h" @@ -257,7 +258,7 @@ void apply_2d_spatial_filter(Coordinates coord, const Tensor &in, Tensor } coord.set(0, x); coord.set(1, y); - const double rounded_val = cpp11::trunc(val * static_cast(scale)); + const double rounded_val = support::cpp11::trunc(val * static_cast(scale)); out[coord2index(in.shape(), coord)] = saturate_cast(rounded_val); } } // namespace @@ -790,13 +791,13 @@ void pixel_wise_multiplication(const Tensor &in1, const Tensor &in2, Ten switch(rounding_policy) { case(RoundingPolicy::TO_ZERO): - rounded_val = cpp11::trunc(val); + rounded_val = support::cpp11::trunc(val); break; case(RoundingPolicy::TO_NEAREST_UP): - rounded_val = cpp11::round_half_up(val); + rounded_val = round_half_up(val); break; case(RoundingPolicy::TO_NEAREST_EVEN): - rounded_val = cpp11::round_half_even(val); + rounded_val = round_half_even(val); break; default: ARM_COMPUTE_ERROR("Unsupported rounding policy"); diff --git a/tests/validation/UNIT/FixedPoint.cpp b/tests/validation/UNIT/FixedPoint.cpp index 8042bb6da8..9206863ec6 100644 --- a/tests/validation/UNIT/FixedPoint.cpp +++ b/tests/validation/UNIT/FixedPoint.cpp @@ -25,6 +25,7 @@ #include "TypePrinter.h" #include "Utils.h" +#include "support/ToolchainSupport.h" #include "validation/Validation.h" #include "validation/ValidationUserConfiguration.h" @@ -52,7 +53,7 @@ BOOST_AUTO_TEST_SUITE(FixedPoint) BOOST_TEST_DECORATOR(*boost::unit_test::label("precommit") * boost::unit_test::label("nightly")) BOOST_DATA_TEST_CASE(FixedPointQS8Inputs, boost::unit_test::data::make(func_names) * boost::unit_test::data::xrange(1, 7), func_name, frac_bits) { - const std::string base_file_name = user_config.path.get() + "/dumps/" + func_name + "_Q8." + cpp11::to_string(frac_bits); + const std::string base_file_name = user_config.path.get() + "/dumps/" + func_name + "_Q8." + support::cpp11::to_string(frac_bits); std::ifstream inputs_file{ base_file_name + ".in", std::ios::binary | std::ios::in }; BOOST_TEST_INFO(base_file_name + ".in"); @@ -84,7 +85,7 @@ BOOST_TEST_DECORATOR(*boost::unit_test::label("precommit") * boost::unit_test::l BOOST_DATA_TEST_CASE(FixedPointQS8Outputs, (boost::unit_test::data::make(func_names) * boost::unit_test::data::xrange(1, 7)) ^ (boost::unit_test::data::make({ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 32, 67 })), func_name, frac_bits, expected_failures) { - const std::string base_file_name = user_config.path.get() + "/dumps/" + func_name + "_Q8." + cpp11::to_string(frac_bits); + const std::string base_file_name = user_config.path.get() + "/dumps/" + func_name + "_Q8." + support::cpp11::to_string(frac_bits); std::ifstream inputs_file{ base_file_name + ".in", std::ios::binary | std::ios::in }; std::ifstream reference_file{ base_file_name + ".out", std::ios::binary | std::ios::in }; diff --git a/tests/validation/UNIT/Utils.cpp b/tests/validation/UNIT/Utils.cpp index 7a09be52b5..69523a5620 100644 --- a/tests/validation/UNIT/Utils.cpp +++ b/tests/validation/UNIT/Utils.cpp @@ -32,7 +32,6 @@ using namespace arm_compute; using namespace arm_compute::test; -using namespace arm_compute::test::cpp11; using namespace arm_compute::test::validation; #ifndef DOXYGEN_SKIP_THIS @@ -43,14 +42,14 @@ BOOST_TEST_DECORATOR(*boost::unit_test::label("precommit") * boost::unit_test::l BOOST_DATA_TEST_CASE(RoundHalfUp, boost::unit_test::data::make({ 1.f, 1.2f, 1.5f, 2.5f, 2.9f, -3.f, -3.5f, -3.8f, -4.3f, -4.5f }) ^ boost::unit_test::data::make({ 1.f, 1.f, 2.f, 3.f, 3.f, -3.f, -3.f, -4.f, -4.f, -4.f }), value, result) { - BOOST_TEST(cpp11::round_half_up(value) == result); + BOOST_TEST(round_half_up(value) == result); } BOOST_TEST_DECORATOR(*boost::unit_test::label("precommit") * boost::unit_test::label("nightly")) BOOST_DATA_TEST_CASE(RoundHalfEven, boost::unit_test::data::make({ 1.f, 1.2f, 1.5f, 2.5f, 2.9f, -3.f, -3.5f, -3.8f, -4.3f, -4.5f }) ^ boost::unit_test::data::make({ 1.f, 1.f, 2.f, 2.f, 3.f, -3.f, -4.f, -4.f, -4.f, -4.f }), value, result) { - BOOST_TEST(cpp11::round_half_even(value) == result); + BOOST_TEST(round_half_even(value) == result); } BOOST_TEST_DECORATOR(*boost::unit_test::label("precommit") * boost::unit_test::label("nightly")) diff --git a/tests/validation/main.cpp b/tests/validation/main.cpp index c89372637f..6ec6885159 100644 --- a/tests/validation/main.cpp +++ b/tests/validation/main.cpp @@ -28,6 +28,7 @@ #include "Utils.h" #include "ValidationProgramOptions.h" #include "ValidationUserConfiguration.h" +#include "support/ToolchainSupport.h" #include "arm_compute/runtime/Scheduler.h" @@ -55,11 +56,11 @@ struct GlobalFixture { if(user_config.seed.is_set()) { - library = cpp14::make_unique(user_config.path.get(), user_config.seed); + library = arm_compute::support::cpp14::make_unique(user_config.path.get(), user_config.seed); } else { - library = cpp14::make_unique(user_config.path.get()); + library = arm_compute::support::cpp14::make_unique(user_config.path.get()); } std::cout << "Seed: " << library->seed() << "\n"; -- cgit v1.2.1