aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2019-05-01 13:03:59 +0100
committerMichalis Spyrou <michalis.spyrou@arm.com>2019-05-10 14:42:02 +0100
commit9d0b5f82c2734444145718f12788f2dde436ef45 (patch)
treeb4771f8043f3da4af07c6f33fd803cdfcc394a20
parent4bcef43cb5665167c128f3e43f69239889ee34bc (diff)
downloadComputeLibrary-9d0b5f82c2734444145718f12788f2dde436ef45.tar.gz
COMPMID-2177 Fix clang warnings
Change-Id: I78039db8c58d7b14a042c41e54c25fb9cb509bf7 Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com> Reviewed-on: https://review.mlplatform.org/c/1092 Reviewed-by: VidhyaSudhan Loganathan <vidhyasudhan.loganathan@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r--.clang-tidy2
-rw-r--r--arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h4
-rw-r--r--arm_compute/core/NEON/kernels/NECropKernel.h6
-rw-r--r--arm_compute/core/utils/logging/LoggerRegistry.h2
-rw-r--r--arm_compute/runtime/CL/CLMemory.h4
-rw-r--r--arm_compute/runtime/CL/CLMultiHOG.h6
-rw-r--r--arm_compute/runtime/CL/CLPyramid.h6
-rw-r--r--arm_compute/runtime/CL/functions/CLDepthConcatenateLayer.h7
-rw-r--r--arm_compute/runtime/CL/functions/CLFFT1D.h16
-rw-r--r--arm_compute/runtime/CL/functions/CLGaussianPyramid.h14
-rw-r--r--arm_compute/runtime/CL/functions/CLHOGMultiDetection.h32
-rw-r--r--arm_compute/runtime/CL/functions/CLHarrisCorners.h32
-rw-r--r--arm_compute/runtime/CL/functions/CLLaplacianPyramid.h16
-rw-r--r--arm_compute/runtime/CL/functions/CLLaplacianReconstruct.h10
-rw-r--r--arm_compute/runtime/CL/functions/CLOpticalFlow.h14
-rw-r--r--arm_compute/runtime/CL/functions/CLPadLayer.h18
-rw-r--r--arm_compute/runtime/CL/functions/CLReduceMean.h14
-rw-r--r--arm_compute/runtime/CL/functions/CLReductionOperation.h14
-rw-r--r--arm_compute/runtime/CL/functions/CLSplit.h8
-rw-r--r--arm_compute/runtime/CL/functions/CLStackLayer.h6
-rw-r--r--arm_compute/runtime/CL/functions/CLUnstack.h6
-rw-r--r--arm_compute/runtime/CL/functions/CLWidthConcatenateLayer.h8
-rw-r--r--arm_compute/runtime/Distribution1D.h5
-rw-r--r--arm_compute/runtime/GLES_COMPUTE/GCMemory.h4
-rw-r--r--arm_compute/runtime/HOG.h6
-rw-r--r--arm_compute/runtime/LutAllocator.h4
-rw-r--r--arm_compute/runtime/Memory.h4
-rw-r--r--arm_compute/runtime/MultiHOG.h6
-rw-r--r--arm_compute/runtime/NEON/functions/NEHarrisCorners.h4
-rw-r--r--arm_compute/runtime/NEON/functions/NEHistogram.h10
-rw-r--r--arm_compute/runtime/NEON/functions/NELaplacianPyramid.h16
-rw-r--r--arm_compute/runtime/NEON/functions/NELaplacianReconstruct.h10
-rw-r--r--arm_compute/runtime/NEON/functions/NEPadLayer.h20
-rw-r--r--arm_compute/runtime/NEON/functions/NEReduceMean.h14
-rw-r--r--arm_compute/runtime/NEON/functions/NESplit.h6
-rw-r--r--arm_compute/runtime/NEON/functions/NEStackLayer.h6
-rw-r--r--arm_compute/runtime/NEON/functions/NEUnstack.h4
-rw-r--r--arm_compute/runtime/NEON/functions/NEWidthConcatenateLayer.h4
-rw-r--r--arm_compute/runtime/Pyramid.h6
-rw-r--r--examples/gc_absdiff.cpp5
-rw-r--r--examples/gc_dc.cpp4
-rw-r--r--examples/graph_deepspeech_v0_4_1.cpp23
-rw-r--r--examples/neon_convolution.cpp10
-rw-r--r--examples/neon_sgemm.cpp6
-rwxr-xr-xscripts/clang_tidy_rules.py8
-rw-r--r--src/core/AccessWindowAutoPadding.cpp6
-rw-r--r--src/core/CL/kernels/CLComparisonKernel.cpp4
-rw-r--r--src/core/CL/kernels/CLElementwiseOperationKernel.cpp4
-rw-r--r--src/core/CL/kernels/CLGaussian5x5Kernel.cpp12
-rw-r--r--src/core/CL/kernels/CLGaussianPyramidKernel.cpp6
-rw-r--r--src/core/CL/kernels/CLMinMaxLayerKernel.cpp4
-rw-r--r--src/core/CPP/kernels/CPPUpsampleKernel.cpp2
-rw-r--r--src/core/Error.cpp11
-rw-r--r--src/core/GLES_COMPUTE/GCKernelLibrary.cpp6
-rw-r--r--src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp7
-rw-r--r--src/core/NEON/kernels/NECropKernel.cpp2
-rw-r--r--src/core/NEON/kernels/NEDilateKernel.cpp5
-rw-r--r--src/core/NEON/kernels/NEDirectConvolutionLayerKernel.cpp14
-rw-r--r--src/core/NEON/kernels/NEErodeKernel.cpp5
-rw-r--r--src/core/NEON/kernels/NEFillBorderKernel.cpp8
-rw-r--r--src/core/NEON/kernels/NEGEMMInterleave4x4Kernel.cpp4
-rw-r--r--src/core/NEON/kernels/NELKTrackerKernel.cpp12
-rw-r--r--src/core/NEON/kernels/NEPoolingLayerKernel.cpp3
-rw-r--r--src/core/NEON/kernels/NERemapKernel.cpp10
-rw-r--r--src/core/NEON/kernels/NEScaleKernel.cpp5
-rw-r--r--src/core/utils/helpers/tensor_transform.cpp1
-rw-r--r--src/core/utils/logging/LoggerRegistry.cpp4
-rw-r--r--src/runtime/BlobLifetimeManager.cpp4
-rw-r--r--src/runtime/CL/CLHelpers.cpp18
-rw-r--r--src/runtime/CL/CLMemory.cpp6
-rw-r--r--src/runtime/CL/CLMultiHOG.cpp9
-rw-r--r--src/runtime/CL/CLPyramid.cpp14
-rw-r--r--src/runtime/CL/CLTensorAllocator.cpp2
-rw-r--r--src/runtime/CL/CLTuner.cpp2
-rw-r--r--src/runtime/CL/functions/CLConvolution.cpp12
-rw-r--r--src/runtime/CL/functions/CLDepthConcatenateLayer.cpp7
-rw-r--r--src/runtime/CL/functions/CLDepthwiseConvolutionLayer.cpp3
-rw-r--r--src/runtime/CL/functions/CLFFT1D.cpp2
-rw-r--r--src/runtime/CL/functions/CLGEMMConvolutionLayer.cpp4
-rw-r--r--src/runtime/CL/functions/CLGaussianPyramid.cpp14
-rw-r--r--src/runtime/CL/functions/CLHOGMultiDetection.cpp29
-rw-r--r--src/runtime/CL/functions/CLHarrisCorners.cpp8
-rw-r--r--src/runtime/CL/functions/CLLaplacianPyramid.cpp6
-rw-r--r--src/runtime/CL/functions/CLLaplacianReconstruct.cpp8
-rw-r--r--src/runtime/CL/functions/CLOpticalFlow.cpp16
-rw-r--r--src/runtime/CL/functions/CLPadLayer.cpp17
-rw-r--r--src/runtime/CL/functions/CLReduceMean.cpp18
-rw-r--r--src/runtime/CL/functions/CLReductionOperation.cpp28
-rw-r--r--src/runtime/CL/functions/CLSplit.cpp6
-rw-r--r--src/runtime/CL/functions/CLStackLayer.cpp4
-rw-r--r--src/runtime/CL/functions/CLUnstack.cpp4
-rw-r--r--src/runtime/CL/functions/CLWidthConcatenateLayer.cpp2
-rw-r--r--src/runtime/CL/tuners/CLLWSList.cpp4
-rw-r--r--src/runtime/CPP/functions/CPPDetectionOutputLayer.cpp4
-rw-r--r--src/runtime/CPUUtils.cpp38
-rw-r--r--src/runtime/Distribution1D.cpp7
-rw-r--r--src/runtime/GLES_COMPUTE/GCMemory.cpp6
-rw-r--r--src/runtime/GLES_COMPUTE/GCScheduler.cpp10
-rw-r--r--src/runtime/HOG.cpp11
-rw-r--r--src/runtime/LutAllocator.cpp10
-rw-r--r--src/runtime/Memory.cpp6
-rw-r--r--src/runtime/MultiHOG.cpp9
-rw-r--r--src/runtime/NEON/functions/NEConcatenateLayer.cpp1
-rw-r--r--src/runtime/NEON/functions/NEGEMMAssemblyDispatch.cpp2
-rw-r--r--src/runtime/NEON/functions/NEHarrisCorners.cpp6
-rw-r--r--src/runtime/NEON/functions/NEHistogram.cpp8
-rw-r--r--src/runtime/NEON/functions/NELaplacianPyramid.cpp6
-rw-r--r--src/runtime/NEON/functions/NELaplacianReconstruct.cpp8
-rw-r--r--src/runtime/NEON/functions/NEPadLayer.cpp22
-rw-r--r--src/runtime/NEON/functions/NEReduceMean.cpp18
-rw-r--r--src/runtime/NEON/functions/NESplit.cpp4
-rw-r--r--src/runtime/NEON/functions/NEStackLayer.cpp4
-rw-r--r--src/runtime/NEON/functions/NEUnstack.cpp2
-rw-r--r--src/runtime/NEON/functions/NEWidthConcatenateLayer.cpp4
-rw-r--r--src/runtime/Pyramid.cpp26
-rw-r--r--tests/framework/instruments/OpenCLMemoryUsage.cpp4
-rw-r--r--tests/framework/instruments/OpenCLTimer.cpp7
-rw-r--r--tests/framework/instruments/SchedulerTimer.cpp8
-rw-r--r--tests/framework/printers/JSONPrinter.cpp4
-rw-r--r--tests/framework/printers/PrettyPrinter.cpp4
-rw-r--r--tests/validation/CL/Convolution.cpp20
-rw-r--r--tests/validation/CL/DepthConcatenateLayer.cpp1
-rw-r--r--tests/validation/CL/NonLinearFilter.cpp6
-rw-r--r--tests/validation/CL/Split.cpp4
-rw-r--r--tests/validation/CL/WidthConcatenateLayer.cpp1
-rw-r--r--tests/validation/Helpers.cpp2
-rw-r--r--tests/validation/NEON/DepthConcatenateLayer.cpp1
-rw-r--r--tests/validation/NEON/HeightConcatenateLayer.cpp1
-rw-r--r--tests/validation/NEON/NonLinearFilter.cpp6
-rw-r--r--tests/validation/NEON/Split.cpp2
-rw-r--r--tests/validation/NEON/WidthConcatenateLayer.cpp1
-rw-r--r--tests/validation/reference/ArithmeticDivision.cpp6
-rw-r--r--tests/validation/reference/ArithmeticOperations.cpp14
-rw-r--r--tests/validation/reference/CannyEdgeDetector.cpp8
-rw-r--r--tests/validation/reference/Comparisons.cpp13
-rw-r--r--tests/validation/reference/ConcatenateLayer.cpp1
-rw-r--r--tests/validation/reference/DepthConcatenateLayer.cpp4
-rw-r--r--tests/validation/reference/ElementwiseOperations.cpp12
-rw-r--r--tests/validation/reference/HOGDetector.cpp6
-rw-r--r--tests/validation/reference/PixelWiseMultiplication.cpp8
-rw-r--r--tests/validation/reference/SliceOperations.cpp6
-rw-r--r--tests/validation/reference/Sobel.cpp2
-rw-r--r--tests/validation/reference/StackLayer.cpp6
-rw-r--r--tests/validation/reference/Winograd.cpp96
144 files changed, 671 insertions, 607 deletions
diff --git a/.clang-tidy b/.clang-tidy
index ad2dbb7a1..e7896360b 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -1,5 +1,5 @@
---
-Checks: 'clang-diagnostic-*,clang-analyzer-*,*,-abseil-*,-fuchsia-*,-bugprone-*,-hicpp-*,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cert-err58-cpp,-cppcoreguidelines-pro-type-reinterpret-cast,-google-runtime-references,-google-build-using-namespace,-readability-redundant-member-init,-readability-redundant-declaration,-readability-else-after-return,-performance-type-promotion-in-math-fn,-cert-err60-cpp,-cppcoreguidelines-narrowing-conversions,-readability-magic-numbers,-cppcoreguidelines-avoid-magic-numbers,-readability-named-parameter,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-clang-analyzer-optin.cplusplus.VirtualCall'
+Checks: 'clang-diagnostic-*,clang-analyzer-*,*,-abseil-*,-fuchsia-*,-bugprone-*,-hicpp-*,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cert-err58-cpp,-cppcoreguidelines-pro-type-reinterpret-cast,-google-runtime-references,-google-build-using-namespace,-readability-redundant-member-init,-readability-redundant-declaration,-readability-else-after-return,-performance-type-promotion-in-math-fn,-cert-err60-cpp,-cppcoreguidelines-narrowing-conversions,-readability-magic-numbers,-cppcoreguidelines-avoid-magic-numbers,-readability-named-parameter,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-clang-analyzer-optin.cplusplus.VirtualCall,-cppcoreguidelines-macro-usage'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
diff --git a/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h b/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h
index c0d64e2ed..89d6d17eb 100644
--- a/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h
+++ b/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -271,7 +271,7 @@ private:
*
* @return Preprocessed GLES shader object.
*/
- const std::string preprocess_shader(const std::string &shader_source) const;
+ std::string preprocess_shader(const std::string &shader_source) const;
/** Load program and its dependencies.
*
* @param[in] program_name Name of the program to load.
diff --git a/arm_compute/core/NEON/kernels/NECropKernel.h b/arm_compute/core/NEON/kernels/NECropKernel.h
index 6713a40c8..ef89d112f 100644
--- a/arm_compute/core/NEON/kernels/NECropKernel.h
+++ b/arm_compute/core/NEON/kernels/NECropKernel.h
@@ -107,14 +107,14 @@ private:
uint32_t _crop_box_ind;
float _extrapolation_value;
/** The number of rows out of bounds at the start and end of output. */
- uint32_t _rows_out_of_bounds[2];
+ std::array<uint32_t, 2> _rows_out_of_bounds;
/** The number of columns out of bounds at the start and end of output. */
- uint32_t _cols_out_of_bounds[2];
+ std::array<uint32_t, 2> _cols_out_of_bounds;
std::pair<NECropKernel::InBoundsCropFunction *, NECropKernel::InBoundsCropFunction *> _in_bounds_crop_functions;
NECropKernel::InBoundsCropFunction *_in_bounds_crop_function;
- using CropFunction = void(const ITensor *, const ITensor *, Coordinates, float, const uint32_t *, const uint32_t *,
+ using CropFunction = void(const ITensor *, const ITensor *, Coordinates, float, const std::array<uint32_t, 2> &, const std::array<uint32_t, 2> &,
NECropKernel::InBoundsCropFunction *);
NECropKernel::CropFunction *_crop_function;
diff --git a/arm_compute/core/utils/logging/LoggerRegistry.h b/arm_compute/core/utils/logging/LoggerRegistry.h
index c841020c2..0e223ff66 100644
--- a/arm_compute/core/utils/logging/LoggerRegistry.h
+++ b/arm_compute/core/utils/logging/LoggerRegistry.h
@@ -55,7 +55,7 @@ public:
* @param[in] printers Printers to attach to the system loggers. Defaults with a @ref StdPrinter.
*/
void create_logger(const std::string &name, LogLevel log_level = LogLevel::INFO,
- std::vector<std::shared_ptr<Printer>> printers = { std::make_shared<StdPrinter>() });
+ const std::vector<std::shared_ptr<Printer>> &printers = { std::make_shared<StdPrinter>() });
/** Remove a logger
*
* @param name Logger's name
diff --git a/arm_compute/runtime/CL/CLMemory.h b/arm_compute/runtime/CL/CLMemory.h
index 02d36614a..48692e17a 100644
--- a/arm_compute/runtime/CL/CLMemory.h
+++ b/arm_compute/runtime/CL/CLMemory.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -44,7 +44,7 @@ public:
*
* @param[in] memory Memory to be imported
*/
- CLMemory(std::shared_ptr<ICLMemoryRegion> memory);
+ CLMemory(const std::shared_ptr<ICLMemoryRegion> &memory);
/** Default Constructor
*
* @note Ownership of the memory is not transferred to this object.
diff --git a/arm_compute/runtime/CL/CLMultiHOG.h b/arm_compute/runtime/CL/CLMultiHOG.h
index 17bb4e03c..b7d03bfa3 100644
--- a/arm_compute/runtime/CL/CLMultiHOG.h
+++ b/arm_compute/runtime/CL/CLMultiHOG.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -49,8 +49,8 @@ public:
const ICLHOG *cl_model(size_t index) const override;
private:
- size_t _num_models;
- std::unique_ptr<CLHOG[]> _model;
+ size_t _num_models;
+ std::vector<CLHOG> _model;
};
}
#endif /*__ARM_COMPUTE_CLMULTIHOG_H__ */
diff --git a/arm_compute/runtime/CL/CLPyramid.h b/arm_compute/runtime/CL/CLPyramid.h
index 5e0afb3c6..b66bc3b71 100644
--- a/arm_compute/runtime/CL/CLPyramid.h
+++ b/arm_compute/runtime/CL/CLPyramid.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -75,8 +75,8 @@ private:
*/
void internal_init(const PyramidInfo &info, bool auto_padding);
- PyramidInfo _info;
- std::unique_ptr<CLTensor[]> _pyramid;
+ PyramidInfo _info;
+ mutable std::vector<CLTensor> _pyramid;
};
}
#endif /*__ARM_COMPUTE_CLPYRAMID_H__ */
diff --git a/arm_compute/runtime/CL/functions/CLDepthConcatenateLayer.h b/arm_compute/runtime/CL/functions/CLDepthConcatenateLayer.h
index 33f751f6d..9ef21f32d 100644
--- a/arm_compute/runtime/CL/functions/CLDepthConcatenateLayer.h
+++ b/arm_compute/runtime/CL/functions/CLDepthConcatenateLayer.h
@@ -87,10 +87,9 @@ public:
void run() override;
private:
- std::vector<ICLTensor *> _inputs_vector;
- std::unique_ptr<CLDepthConcatenateLayerKernel[]> _concat_kernels_vector;
- std::unique_ptr<CLFillBorderKernel[]> _border_handlers_vector;
- unsigned int _num_inputs;
+ std::vector<CLDepthConcatenateLayerKernel> _concat_kernels_vector;
+ std::vector<CLFillBorderKernel> _border_handlers_vector;
+ unsigned int _num_inputs;
};
}
#endif /* __ARM_COMPUTE_CLDEPTHCONCATENATE_H__ */
diff --git a/arm_compute/runtime/CL/functions/CLFFT1D.h b/arm_compute/runtime/CL/functions/CLFFT1D.h
index 029023c52..c7f90dd0f 100644
--- a/arm_compute/runtime/CL/functions/CLFFT1D.h
+++ b/arm_compute/runtime/CL/functions/CLFFT1D.h
@@ -70,14 +70,14 @@ public:
void run() override;
protected:
- CLMemoryGroup _memory_group;
- CLFFTDigitReverseKernel _digit_reverse_kernel;
- std::unique_ptr<CLFFTRadixStageKernel[]> _fft_kernels;
- CLFFTScaleKernel _scale_kernel;
- CLTensor _digit_reversed_input;
- CLTensor _digit_reverse_indices;
- unsigned int _num_ffts;
- bool _run_scale;
+ CLMemoryGroup _memory_group;
+ CLFFTDigitReverseKernel _digit_reverse_kernel;
+ std::vector<CLFFTRadixStageKernel> _fft_kernels;
+ CLFFTScaleKernel _scale_kernel;
+ CLTensor _digit_reversed_input;
+ CLTensor _digit_reverse_indices;
+ unsigned int _num_ffts;
+ bool _run_scale;
};
} // namespace arm_compute
#endif /*__ARM_COMPUTE_CLFFT1D_H__ */
diff --git a/arm_compute/runtime/CL/functions/CLGaussianPyramid.h b/arm_compute/runtime/CL/functions/CLGaussianPyramid.h
index 0110adfa2..332f806a2 100644
--- a/arm_compute/runtime/CL/functions/CLGaussianPyramid.h
+++ b/arm_compute/runtime/CL/functions/CLGaussianPyramid.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -90,10 +90,10 @@ public:
void run() override;
private:
- std::unique_ptr<CLFillBorderKernel[]> _horizontal_border_handler;
- std::unique_ptr<CLFillBorderKernel[]> _vertical_border_handler;
- std::unique_ptr<CLGaussianPyramidHorKernel[]> _horizontal_reduction;
- std::unique_ptr<CLGaussianPyramidVertKernel[]> _vertical_reduction;
+ std::vector<CLFillBorderKernel> _horizontal_border_handler;
+ std::vector<CLFillBorderKernel> _vertical_border_handler;
+ std::vector<CLGaussianPyramidHorKernel> _horizontal_reduction;
+ std::vector<CLGaussianPyramidVertKernel> _vertical_reduction;
};
/** Basic function to execute gaussian pyramid with ORB scale factor. This function calls the following OpenCL kernels and functions:
@@ -113,8 +113,8 @@ public:
void run() override;
private:
- std::unique_ptr<CLGaussian5x5[]> _gauss5x5;
- std::unique_ptr<CLScaleKernel[]> _scale_nearest;
+ std::vector<CLGaussian5x5> _gauss5x5;
+ std::vector<CLScaleKernel> _scale_nearest;
};
}
#endif /*__ARM_COMPUTE_CLGAUSSIANPYRAMID_H__ */
diff --git a/arm_compute/runtime/CL/functions/CLHOGMultiDetection.h b/arm_compute/runtime/CL/functions/CLHOGMultiDetection.h
index 1ff986511..924172377 100644
--- a/arm_compute/runtime/CL/functions/CLHOGMultiDetection.h
+++ b/arm_compute/runtime/CL/functions/CLHOGMultiDetection.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -89,21 +89,21 @@ public:
void run() override;
private:
- CLMemoryGroup _memory_group;
- CLHOGGradient _gradient_kernel;
- std::unique_ptr<CLHOGOrientationBinningKernel[]> _orient_bin_kernel;
- std::unique_ptr<CLHOGBlockNormalizationKernel[]> _block_norm_kernel;
- std::unique_ptr<CLHOGDetector[]> _hog_detect_kernel;
- std::unique_ptr<CPPDetectionWindowNonMaximaSuppressionKernel> _non_maxima_kernel;
- std::unique_ptr<CLTensor[]> _hog_space;
- std::unique_ptr<CLTensor[]> _hog_norm_space;
- ICLDetectionWindowArray *_detection_windows;
- CLTensor _mag;
- CLTensor _phase;
- bool _non_maxima_suppression;
- size_t _num_orient_bin_kernel;
- size_t _num_block_norm_kernel;
- size_t _num_hog_detect_kernel;
+ CLMemoryGroup _memory_group;
+ CLHOGGradient _gradient_kernel;
+ std::vector<CLHOGOrientationBinningKernel> _orient_bin_kernel;
+ std::vector<CLHOGBlockNormalizationKernel> _block_norm_kernel;
+ std::vector<CLHOGDetector> _hog_detect_kernel;
+ CPPDetectionWindowNonMaximaSuppressionKernel _non_maxima_kernel;
+ std::vector<CLTensor> _hog_space;
+ std::vector<CLTensor> _hog_norm_space;
+ ICLDetectionWindowArray *_detection_windows;
+ CLTensor _mag;
+ CLTensor _phase;
+ bool _non_maxima_suppression;
+ size_t _num_orient_bin_kernel;
+ size_t _num_block_norm_kernel;
+ size_t _num_hog_detect_kernel;
};
}
diff --git a/arm_compute/runtime/CL/functions/CLHarrisCorners.h b/arm_compute/runtime/CL/functions/CLHarrisCorners.h
index 4cb7fbd30..52041a96f 100644
--- a/arm_compute/runtime/CL/functions/CLHarrisCorners.h
+++ b/arm_compute/runtime/CL/functions/CLHarrisCorners.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -87,21 +87,21 @@ public:
void run() override;
private:
- CLMemoryGroup _memory_group; /**< Function's memory group */
- std::unique_ptr<IFunction> _sobel; /**< Sobel function */
- CLHarrisScoreKernel _harris_score; /**< Harris score kernel */
- CLNonMaximaSuppression3x3 _non_max_suppr; /**< Non-maxima suppression function */
- CPPCornerCandidatesKernel _candidates; /**< Sort kernel */
- CPPSortEuclideanDistanceKernel _sort_euclidean; /**< Euclidean distance kernel */
- CLFillBorderKernel _border_gx; /**< Border handler before running harris score */
- CLFillBorderKernel _border_gy; /**< Border handler before running harris score */
- CLImage _gx; /**< Source image - Gx component */
- CLImage _gy; /**< Source image - Gy component */
- CLImage _score; /**< Source image - Harris score */
- CLImage _nonmax; /**< Source image - Non-Maxima suppressed image */
- std::unique_ptr<InternalKeypoint[]> _corners_list; /**< Array of InternalKeypoint. It stores the potential corner candidates */
- int32_t _num_corner_candidates; /**< Number of potential corner candidates */
- ICLKeyPointArray *_corners; /**< Output corners array */
+ CLMemoryGroup _memory_group; /**< Function's memory group */
+ std::unique_ptr<IFunction> _sobel; /**< Sobel function */
+ CLHarrisScoreKernel _harris_score; /**< Harris score kernel */
+ CLNonMaximaSuppression3x3 _non_max_suppr; /**< Non-maxima suppression function */
+ CPPCornerCandidatesKernel _candidates; /**< Sort kernel */
+ CPPSortEuclideanDistanceKernel _sort_euclidean; /**< Euclidean distance kernel */
+ CLFillBorderKernel _border_gx; /**< Border handler before running harris score */
+ CLFillBorderKernel _border_gy; /**< Border handler before running harris score */
+ CLImage _gx; /**< Source image - Gx component */
+ CLImage _gy; /**< Source image - Gy component */
+ CLImage _score; /**< Source image - Harris score */
+ CLImage _nonmax; /**< Source image - Non-Maxima suppressed image */
+ std::vector<InternalKeypoint> _corners_list; /**< Array of InternalKeypoint. It stores the potential corner candidates */
+ int32_t _num_corner_candidates; /**< Number of potential corner candidates */
+ ICLKeyPointArray *_corners; /**< Output corners array */
};
}
#endif /*__ARM_COMPUTE_CLHARRISCORNERS_H__ */
diff --git a/arm_compute/runtime/CL/functions/CLLaplacianPyramid.h b/arm_compute/runtime/CL/functions/CLLaplacianPyramid.h
index ae86e931d..72872045f 100644
--- a/arm_compute/runtime/CL/functions/CLLaplacianPyramid.h
+++ b/arm_compute/runtime/CL/functions/CLLaplacianPyramid.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -73,13 +73,13 @@ public:
void run() override;
private:
- size_t _num_levels;
- CLGaussianPyramidHalf _gaussian_pyr_function;
- std::unique_ptr<CLGaussian5x5[]> _convf;
- std::unique_ptr<CLArithmeticSubtraction[]> _subf;
- CLDepthConvertLayer _depth_function;
- CLPyramid _gauss_pyr;
- CLPyramid _conv_pyr;
+ size_t _num_levels;
+ CLGaussianPyramidHalf _gaussian_pyr_function;
+ std::vector<CLGaussian5x5> _convf;
+ std::vector<CLArithmeticSubtraction> _subf;
+ CLDepthConvertLayer _depth_function;
+ CLPyramid _gauss_pyr;
+ CLPyramid _conv_pyr;
};
}
#endif /*__ARM_COMPUTE_CLLAPLACIANPYRAMID_H__ */
diff --git a/arm_compute/runtime/CL/functions/CLLaplacianReconstruct.h b/arm_compute/runtime/CL/functions/CLLaplacianReconstruct.h
index 622b049f1..8bae1199a 100644
--- a/arm_compute/runtime/CL/functions/CLLaplacianReconstruct.h
+++ b/arm_compute/runtime/CL/functions/CLLaplacianReconstruct.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -82,10 +82,10 @@ public:
void run() override;
private:
- CLPyramid _tmp_pyr;
- std::unique_ptr<CLArithmeticAddition[]> _addf;
- std::unique_ptr<CLScale[]> _scalef;
- CLDepthConvertLayer _depthf;
+ CLPyramid _tmp_pyr;
+ std::vector<CLArithmeticAddition> _addf;
+ std::vector<CLScale> _scalef;
+ CLDepthConvertLayer _depthf;
};
}
#endif /*__ARM_COMPUTE_CLLAPLACIANRECONSTRUCT_H__ */
diff --git a/arm_compute/runtime/CL/functions/CLOpticalFlow.h b/arm_compute/runtime/CL/functions/CLOpticalFlow.h
index e2aaf404c..a0a947188 100644
--- a/arm_compute/runtime/CL/functions/CLOpticalFlow.h
+++ b/arm_compute/runtime/CL/functions/CLOpticalFlow.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -97,13 +97,13 @@ public:
private:
CLMemoryGroup _memory_group;
- std::unique_ptr<CLLKTrackerInitKernel[]> _tracker_init_kernel;
- std::unique_ptr<CLLKTrackerStage0Kernel[]> _tracker_stage0_kernel;
- std::unique_ptr<CLLKTrackerStage1Kernel[]> _tracker_stage1_kernel;
+ std::vector<CLLKTrackerInitKernel> _tracker_init_kernel;
+ std::vector<CLLKTrackerStage0Kernel> _tracker_stage0_kernel;
+ std::vector<CLLKTrackerStage1Kernel> _tracker_stage1_kernel;
CLLKTrackerFinalizeKernel _tracker_finalize_kernel;
- std::unique_ptr<CLScharr3x3[]> _func_scharr;
- std::unique_ptr<CLTensor[]> _scharr_gx;
- std::unique_ptr<CLTensor[]> _scharr_gy;
+ std::vector<CLScharr3x3> _func_scharr;
+ std::vector<CLTensor> _scharr_gx;
+ std::vector<CLTensor> _scharr_gy;
const ICLKeyPointArray *_old_points;
const ICLKeyPointArray *_new_points_estimates;
ICLKeyPointArray *_new_points;
diff --git a/arm_compute/runtime/CL/functions/CLPadLayer.h b/arm_compute/runtime/CL/functions/CLPadLayer.h
index 33b09d60a..7f140d9e1 100644
--- a/arm_compute/runtime/CL/functions/CLPadLayer.h
+++ b/arm_compute/runtime/CL/functions/CLPadLayer.h
@@ -83,15 +83,15 @@ private:
void configure_constant_mode(ICLTensor *input, ICLTensor *output, const PaddingList &padding, const PixelValue constant_value);
void configure_reflect_symmetric_mode(ICLTensor *input, ICLTensor *output);
- CLCopyKernel _copy_kernel;
- PaddingMode _mode;
- PaddingList _padding;
- CLMemsetKernel _memset_kernel;
- size_t _num_dimensions;
- std::unique_ptr<CLStridedSlice[]> _slice_functions;
- std::unique_ptr<CLConcatenateLayer[]> _concat_functions;
- std::unique_ptr<CLTensor[]> _slice_results;
- std::unique_ptr<CLTensor[]> _concat_results;
+ CLCopyKernel _copy_kernel;
+ PaddingMode _mode;
+ PaddingList _padding;
+ CLMemsetKernel _memset_kernel;
+ size_t _num_dimensions;
+ std::vector<CLStridedSlice> _slice_functions;
+ std::vector<CLConcatenateLayer> _concat_functions;
+ std::vector<CLTensor> _slice_results;
+ std::vector<CLTensor> _concat_results;
};
} // namespace arm_compute
#endif /*__ARM_COMPUTE_PADLAYER_H__ */
diff --git a/arm_compute/runtime/CL/functions/CLReduceMean.h b/arm_compute/runtime/CL/functions/CLReduceMean.h
index ba10134a0..9c087eadf 100644
--- a/arm_compute/runtime/CL/functions/CLReduceMean.h
+++ b/arm_compute/runtime/CL/functions/CLReduceMean.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -67,12 +67,12 @@ public:
void run() override;
private:
- CLMemoryGroup _memory_group;
- std::unique_ptr<CLReductionOperation[]> _reduction_kernels{ nullptr };
- std::unique_ptr<CLTensor[]> _reduced_outs{ nullptr };
- CLReshapeLayer _reshape;
- unsigned int _reduction_ops;
- bool _keep_dims;
+ CLMemoryGroup _memory_group;
+ std::vector<CLReductionOperation> _reduction_kernels;
+ std::vector<CLTensor> _reduced_outs;
+ CLReshapeLayer _reshape;
+ unsigned int _reduction_ops;
+ bool _keep_dims;
};
} // namespace arm_compute
#endif /* __ARM_COMPUTE_CL_REDUCE_MEAN_H__ */
diff --git a/arm_compute/runtime/CL/functions/CLReductionOperation.h b/arm_compute/runtime/CL/functions/CLReductionOperation.h
index 977562d99..4b0adc243 100644
--- a/arm_compute/runtime/CL/functions/CLReductionOperation.h
+++ b/arm_compute/runtime/CL/functions/CLReductionOperation.h
@@ -75,13 +75,13 @@ public:
void run() override;
private:
- CLMemoryGroup _memory_group;
- std::unique_ptr<CLTensor[]> _results_vector{ nullptr };
- std::unique_ptr<CLReductionOperationKernel[]> _reduction_kernels_vector{ nullptr };
- std::unique_ptr<CLFillBorderKernel[]> _border_handlers_vector{ nullptr };
- unsigned int _num_of_stages;
- unsigned int _reduction_axis;
- bool _is_serial;
+ CLMemoryGroup _memory_group;
+ std::vector<CLTensor> _results_vector;
+ std::vector<CLReductionOperationKernel> _reduction_kernels_vector;
+ std::vector<CLFillBorderKernel> _border_handlers_vector;
+ unsigned int _num_of_stages;
+ unsigned int _reduction_axis;
+ bool _is_serial;
};
} // namespace arm_compute
#endif /*__ARM_COMPUTE_CLREDUCTIONOPERATION_H__ */
diff --git a/arm_compute/runtime/CL/functions/CLSplit.h b/arm_compute/runtime/CL/functions/CLSplit.h
index 47da17793..709be3bb3 100644
--- a/arm_compute/runtime/CL/functions/CLSplit.h
+++ b/arm_compute/runtime/CL/functions/CLSplit.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -68,9 +68,9 @@ public:
void run() override;
private:
- std::vector<ICLTensor *> _outputs_vector;
- std::unique_ptr<CLSlice[]> _slice_functions;
- unsigned int _num_outputs;
+ std::vector<ICLTensor *> _outputs_vector;
+ std::vector<CLSlice> _slice_functions;
+ unsigned int _num_outputs;
};
} // namespace arm_compute
#endif /* __ARM_COMPUTE_CLSPLIT_H__ */
diff --git a/arm_compute/runtime/CL/functions/CLStackLayer.h b/arm_compute/runtime/CL/functions/CLStackLayer.h
index 5b821b863..30676e1dd 100644
--- a/arm_compute/runtime/CL/functions/CLStackLayer.h
+++ b/arm_compute/runtime/CL/functions/CLStackLayer.h
@@ -73,9 +73,9 @@ public:
void run() override;
private:
- std::vector<ICLTensor *> _input;
- std::unique_ptr<CLStackLayerKernel[]> _stack_kernels;
- unsigned int _num_inputs;
+ std::vector<ICLTensor *> _input;
+ std::vector<CLStackLayerKernel> _stack_kernels;
+ unsigned int _num_inputs;
};
} // namespace arm_compute
#endif /* __ARM_COMPUTE_CLSTACKLAYER_H__ */
diff --git a/arm_compute/runtime/CL/functions/CLUnstack.h b/arm_compute/runtime/CL/functions/CLUnstack.h
index feed430c5..bc32a3db1 100644
--- a/arm_compute/runtime/CL/functions/CLUnstack.h
+++ b/arm_compute/runtime/CL/functions/CLUnstack.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -69,8 +69,8 @@ public:
void run() override;
private:
- unsigned int _num_slices;
- std::unique_ptr<CLStridedSlice[]> _strided_slice_vector;
+ unsigned int _num_slices;
+ std::vector<CLStridedSlice> _strided_slice_vector;
};
} // namespace arm_compute
#endif /* __ARM_COMPUTE_CLUNSTACK_H__ */
diff --git a/arm_compute/runtime/CL/functions/CLWidthConcatenateLayer.h b/arm_compute/runtime/CL/functions/CLWidthConcatenateLayer.h
index a87ec3094..6a30fcfa9 100644
--- a/arm_compute/runtime/CL/functions/CLWidthConcatenateLayer.h
+++ b/arm_compute/runtime/CL/functions/CLWidthConcatenateLayer.h
@@ -79,10 +79,10 @@ public:
void run() override;
private:
- std::unique_ptr<CLWidthConcatenateLayerKernel[]> _concat_kernels_vector;
- CLWidthConcatenate2TensorsKernel _concat_x2_kernel;
- CLWidthConcatenate4TensorsKernel _concat_x4_kernel;
- unsigned int _num_inputs;
+ std::vector<CLWidthConcatenateLayerKernel> _concat_kernels_vector;
+ CLWidthConcatenate2TensorsKernel _concat_x2_kernel;
+ CLWidthConcatenate4TensorsKernel _concat_x4_kernel;
+ unsigned int _num_inputs;
};
} // namespace arm_compute
#endif /* __ARM_COMPUTE_CLWIDTHCONCATENATELAYER_H__ */
diff --git a/arm_compute/runtime/Distribution1D.h b/arm_compute/runtime/Distribution1D.h
index 7080e8807..180abdcf2 100644
--- a/arm_compute/runtime/Distribution1D.h
+++ b/arm_compute/runtime/Distribution1D.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -29,6 +29,7 @@
#include <cstddef>
#include <cstdint>
#include <memory>
+#include <vector>
namespace arm_compute
{
@@ -49,7 +50,7 @@ public:
uint32_t *buffer() const override;
private:
- std::unique_ptr<uint32_t[]> _data; /**< The distribution data. */
+ mutable std::vector<uint32_t> _data; /**< The distribution data. */
};
}
#endif /* __ARM_COMPUTE_DISTRIBUTION1D_H__ */
diff --git a/arm_compute/runtime/GLES_COMPUTE/GCMemory.h b/arm_compute/runtime/GLES_COMPUTE/GCMemory.h
index bf0428a34..d8de80085 100644
--- a/arm_compute/runtime/GLES_COMPUTE/GCMemory.h
+++ b/arm_compute/runtime/GLES_COMPUTE/GCMemory.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -43,7 +43,7 @@ public:
*
* @param[in] memory Memory to be imported
*/
- GCMemory(std::shared_ptr<IGCMemoryRegion> memory);
+ GCMemory(const std::shared_ptr<IGCMemoryRegion> &memory);
/** Default Constructor
*
* @note Ownership of the memory is not transferred to this object.
diff --git a/arm_compute/runtime/HOG.h b/arm_compute/runtime/HOG.h
index 70d8034be..3dc2f32b6 100644
--- a/arm_compute/runtime/HOG.h
+++ b/arm_compute/runtime/HOG.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -49,8 +49,8 @@ public:
float *descriptor() const override;
private:
- HOGInfo _info;
- std::unique_ptr<float[]> _descriptor;
+ HOGInfo _info;
+ mutable std::vector<float> _descriptor;
};
}
#endif /* __ARM_COMPUTE_HOG_H__ */
diff --git a/arm_compute/runtime/LutAllocator.h b/arm_compute/runtime/LutAllocator.h
index 077b4693a..11589daa7 100644
--- a/arm_compute/runtime/LutAllocator.h
+++ b/arm_compute/runtime/LutAllocator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -55,7 +55,7 @@ protected:
void unlock() override;
private:
- std::unique_ptr<uint8_t[]> _buffer; /**< CPU memory allocation. */
+ mutable std::vector<uint8_t> _buffer; /**< CPU memory allocation. */
};
}
#endif /* __ARM_COMPUTE_LUTALLOCATOR_H__ */
diff --git a/arm_compute/runtime/Memory.h b/arm_compute/runtime/Memory.h
index 6f5254a68..1a00ed2f5 100644
--- a/arm_compute/runtime/Memory.h
+++ b/arm_compute/runtime/Memory.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -43,7 +43,7 @@ public:
*
* @param[in] memory Memory to be imported
*/
- Memory(std::shared_ptr<IMemoryRegion> memory);
+ Memory(const std::shared_ptr<IMemoryRegion> &memory);
/** Default Constructor
*
* @note Ownership of the memory is not transferred to this object.
diff --git a/arm_compute/runtime/MultiHOG.h b/arm_compute/runtime/MultiHOG.h
index 32bad7073..45b3947ed 100644
--- a/arm_compute/runtime/MultiHOG.h
+++ b/arm_compute/runtime/MultiHOG.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -50,8 +50,8 @@ public:
const IHOG *model(size_t index) const override;
private:
- size_t _num_models;
- std::unique_ptr<HOG[]> _model;
+ size_t _num_models;
+ std::vector<HOG> _model;
};
}
diff --git a/arm_compute/runtime/NEON/functions/NEHarrisCorners.h b/arm_compute/runtime/NEON/functions/NEHarrisCorners.h
index b35a9add0..03ab1d0c2 100644
--- a/arm_compute/runtime/NEON/functions/NEHarrisCorners.h
+++ b/arm_compute/runtime/NEON/functions/NEHarrisCorners.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -100,7 +100,7 @@ private:
Image _gy; /**< Source image - Gy component */
Image _score; /**< Source image - Harris score */
Image _nonmax; /**< Source image - Non-Maxima suppressed image */
- std::unique_ptr<InternalKeypoint[]> _corners_list; /**< Array of InternalKeypoint. It stores the potential corner candidates */
+ std::vector<InternalKeypoint> _corners_list; /**< Array of InternalKeypoint. It stores the potential corner candidates */
int32_t _num_corner_candidates; /**< Number of potential corner candidates */
};
}
diff --git a/arm_compute/runtime/NEON/functions/NEHistogram.h b/arm_compute/runtime/NEON/functions/NEHistogram.h
index c24510dcb..dbed4a065 100644
--- a/arm_compute/runtime/NEON/functions/NEHistogram.h
+++ b/arm_compute/runtime/NEON/functions/NEHistogram.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -52,10 +52,10 @@ public:
void run() override;
private:
- NEHistogramKernel _histogram_kernel;
- std::unique_ptr<uint32_t[]> _local_hist;
- std::unique_ptr<uint32_t[]> _window_lut;
- size_t _local_hist_size;
+ NEHistogramKernel _histogram_kernel;
+ std::vector<uint32_t> _local_hist;
+ std::vector<uint32_t> _window_lut;
+ size_t _local_hist_size;
/** 256 possible pixel values as we handle only U8 images */
static constexpr unsigned int window_lut_default_size = 256;
};
diff --git a/arm_compute/runtime/NEON/functions/NELaplacianPyramid.h b/arm_compute/runtime/NEON/functions/NELaplacianPyramid.h
index baa4b7b1a..decd91863 100644
--- a/arm_compute/runtime/NEON/functions/NELaplacianPyramid.h
+++ b/arm_compute/runtime/NEON/functions/NELaplacianPyramid.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -73,13 +73,13 @@ public:
void run() override;
private:
- size_t _num_levels;
- NEGaussianPyramidHalf _gaussian_pyr_function;
- std::unique_ptr<NEGaussian5x5[]> _convf;
- std::unique_ptr<NEArithmeticSubtraction[]> _subf;
- Pyramid _gauss_pyr;
- Pyramid _conv_pyr;
- NEDepthConvertLayer _depth_function;
+ size_t _num_levels;
+ NEGaussianPyramidHalf _gaussian_pyr_function;
+ std::vector<NEGaussian5x5> _convf;
+ std::vector<NEArithmeticSubtraction> _subf;
+ Pyramid _gauss_pyr;
+ Pyramid _conv_pyr;
+ NEDepthConvertLayer _depth_function;
};
}
#endif /*__ARM_COMPUTE_NELAPLACIANPYRAMID_H__ */
diff --git a/arm_compute/runtime/NEON/functions/NELaplacianReconstruct.h b/arm_compute/runtime/NEON/functions/NELaplacianReconstruct.h
index 2143042bd..533903a72 100644
--- a/arm_compute/runtime/NEON/functions/NELaplacianReconstruct.h
+++ b/arm_compute/runtime/NEON/functions/NELaplacianReconstruct.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -82,10 +82,10 @@ public:
void run() override;
private:
- Pyramid _tmp_pyr;
- std::unique_ptr<NEArithmeticAddition[]> _addf;
- std::unique_ptr<NEScale[]> _scalef;
- NEDepthConvertLayer _depthf;
+ Pyramid _tmp_pyr;
+ std::vector<NEArithmeticAddition> _addf;
+ std::vector<NEScale> _scalef;
+ NEDepthConvertLayer _depthf;
};
}
#endif /*__ARM_COMPUTE_NELAPLACIANRECONSTRUCT_H__ */
diff --git a/arm_compute/runtime/NEON/functions/NEPadLayer.h b/arm_compute/runtime/NEON/functions/NEPadLayer.h
index 78dbc1f1f..67f68b86d 100644
--- a/arm_compute/runtime/NEON/functions/NEPadLayer.h
+++ b/arm_compute/runtime/NEON/functions/NEPadLayer.h
@@ -92,16 +92,16 @@ private:
void configure_reflect_symmetric_mode(ITensor *input, ITensor *output);
private:
- NECopyKernel _copy_kernel;
- PaddingMode _mode;
- PaddingList _padding;
- NEMemsetKernel _memset_kernel;
- uint32_t _num_dimensions;
- std::unique_ptr<NEStridedSlice[]> _slice_functions;
- std::unique_ptr<NEConcatenateLayer[]> _concat_functions;
- std::unique_ptr<Tensor[]> _slice_results;
- std::unique_ptr<Tensor[]> _concat_results;
- SubTensor _output_subtensor;
+ NECopyKernel _copy_kernel;
+ PaddingMode _mode;
+ PaddingList _padding;
+ NEMemsetKernel _memset_kernel;
+ uint32_t _num_dimensions;
+ std::vector<NEStridedSlice> _slice_functions;
+ std::vector<NEConcatenateLayer> _concat_functions;
+ std::vector<Tensor> _slice_results;
+ std::vector<Tensor> _concat_results;
+ SubTensor _output_subtensor;
};
} // namespace arm_compute
#endif /*__ARM_COMPUTE_NEPADLAYER_H__ */
diff --git a/arm_compute/runtime/NEON/functions/NEReduceMean.h b/arm_compute/runtime/NEON/functions/NEReduceMean.h
index b20ca9cc1..fdd8edfe8 100644
--- a/arm_compute/runtime/NEON/functions/NEReduceMean.h
+++ b/arm_compute/runtime/NEON/functions/NEReduceMean.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -68,12 +68,12 @@ public:
void run() override;
private:
- MemoryGroup _memory_group;
- std::unique_ptr<NEReductionOperation[]> _reduction_kernels{ nullptr };
- std::unique_ptr<Tensor[]> _reduced_outs{ nullptr };
- NEReshapeLayer _reshape;
- unsigned int _reduction_ops;
- bool _keep_dims;
+ MemoryGroup _memory_group;
+ std::vector<NEReductionOperation> _reduction_kernels;
+ std::vector<Tensor> _reduced_outs;
+ NEReshapeLayer _reshape;
+ unsigned int _reduction_ops;
+ bool _keep_dims;
};
} // namespace arm_compute
#endif /* __ARM_COMPUTE_NEON_REDUCE_MEAN_H__ */
diff --git a/arm_compute/runtime/NEON/functions/NESplit.h b/arm_compute/runtime/NEON/functions/NESplit.h
index 9f8aea41e..06686a666 100644
--- a/arm_compute/runtime/NEON/functions/NESplit.h
+++ b/arm_compute/runtime/NEON/functions/NESplit.h
@@ -68,9 +68,9 @@ public:
void run() override;
private:
- std::vector<ITensor *> _outputs_vector;
- std::unique_ptr<NESlice[]> _slice_functions;
- unsigned int _num_outputs;
+ std::vector<ITensor *> _outputs_vector;
+ std::vector<NESlice> _slice_functions;
+ unsigned int _num_outputs;
};
} // namespace arm_compute
#endif /* __ARM_COMPUTE_NESPLIT_H__ */
diff --git a/arm_compute/runtime/NEON/functions/NEStackLayer.h b/arm_compute/runtime/NEON/functions/NEStackLayer.h
index 6032dae0c..ba262371c 100644
--- a/arm_compute/runtime/NEON/functions/NEStackLayer.h
+++ b/arm_compute/runtime/NEON/functions/NEStackLayer.h
@@ -73,9 +73,9 @@ public:
void run() override;
private:
- std::vector<ITensor *> _input;
- std::unique_ptr<NEStackLayerKernel[]> _stack_kernels;
- unsigned int _num_inputs;
+ std::vector<ITensor *> _input;
+ std::vector<NEStackLayerKernel> _stack_kernels;
+ unsigned int _num_inputs;
};
} // namespace arm_compute
#endif /* __ARM_COMPUTE_NESTACKLAYER_H__ */
diff --git a/arm_compute/runtime/NEON/functions/NEUnstack.h b/arm_compute/runtime/NEON/functions/NEUnstack.h
index 7210afa91..4fd4a3503 100644
--- a/arm_compute/runtime/NEON/functions/NEUnstack.h
+++ b/arm_compute/runtime/NEON/functions/NEUnstack.h
@@ -68,8 +68,8 @@ public:
void run() override;
private:
- unsigned int _num_slices;
- std::unique_ptr<NEStridedSlice[]> _strided_slice_vector;
+ unsigned int _num_slices;
+ std::vector<NEStridedSlice> _strided_slice_vector;
};
} // namespace arm_compute
#endif /* __ARM_COMPUTE_NEUNSTACK_H__ */
diff --git a/arm_compute/runtime/NEON/functions/NEWidthConcatenateLayer.h b/arm_compute/runtime/NEON/functions/NEWidthConcatenateLayer.h
index 0aaba7987..8d221766c 100644
--- a/arm_compute/runtime/NEON/functions/NEWidthConcatenateLayer.h
+++ b/arm_compute/runtime/NEON/functions/NEWidthConcatenateLayer.h
@@ -79,8 +79,8 @@ public:
void run() override;
private:
- std::unique_ptr<NEWidthConcatenateLayerKernel[]> _concat_kernels_vector;
- unsigned int _num_inputs;
+ std::vector<NEWidthConcatenateLayerKernel> _concat_kernels_vector;
+ unsigned int _num_inputs;
template <typename TensorType, REQUIRES_TA(std::is_same<typename std::remove_cv<TensorType>::type, ITensor>::value)>
void configure_internal(std::vector<TensorType *> &&inputs_vector, ITensor *output);
template <typename TensorInfoType, REQUIRES_TA(std::is_same<typename std::remove_cv<TensorInfoType>::type, ITensorInfo>::value)>
diff --git a/arm_compute/runtime/Pyramid.h b/arm_compute/runtime/Pyramid.h
index 2e7613759..9efd6548e 100644
--- a/arm_compute/runtime/Pyramid.h
+++ b/arm_compute/runtime/Pyramid.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -69,8 +69,8 @@ private:
*/
void internal_init(const PyramidInfo &info, bool auto_padding);
- PyramidInfo _info{};
- std::unique_ptr<Tensor[]> _pyramid{ nullptr };
+ PyramidInfo _info{};
+ mutable std::vector<Tensor> _pyramid{};
};
}
#endif /*__ARM_COMPUTE_PYRAMID_H__ */
diff --git a/examples/gc_absdiff.cpp b/examples/gc_absdiff.cpp
index f53459231..6793df040 100644
--- a/examples/gc_absdiff.cpp
+++ b/examples/gc_absdiff.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -40,7 +40,8 @@ class GCAbsDiffExample : public Example
public:
bool do_setup(int argc, char **argv) override
{
- PPMLoader ppm1, ppm2;
+ PPMLoader ppm1{};
+ PPMLoader ppm2{};
GCScheduler::get().default_init();
if(argc < 2)
diff --git a/examples/gc_dc.cpp b/examples/gc_dc.cpp
index f3f194252..6d09eba87 100644
--- a/examples/gc_dc.cpp
+++ b/examples/gc_dc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -81,7 +81,7 @@ public:
Window window;
window.use_tensor_dimensions(src_shape);
Iterator it(&src, window);
- execute_window_loop(window, [&](const Coordinates & id)
+ execute_window_loop(window, [&](const Coordinates &)
{
*reinterpret_cast<half_float::half *>(it.ptr()) = half_float::half(1.f);
});
diff --git a/examples/graph_deepspeech_v0_4_1.cpp b/examples/graph_deepspeech_v0_4_1.cpp
index f280393e5..a69d23594 100644
--- a/examples/graph_deepspeech_v0_4_1.cpp
+++ b/examples/graph_deepspeech_v0_4_1.cpp
@@ -308,19 +308,22 @@ private:
graph.graph().add_connection(split_nid, 3, sigmoid_2_nid, 0);
set_node_params(graph.graph(), sigmoid_2_nid, sigmoid_2_params);
- SubStream mul_1_ss(graph);
- mul_1_ss.forward_tail(sigmoid_1_nid);
- mul_1_ss << EltwiseLayer(std::move(mul_1_ss), std::move(tanh_ss), EltwiseOperation::Mul)
+ SubStream sigmoid_1_ss(graph);
+ sigmoid_1_ss.forward_tail(sigmoid_1_nid);
+ SubStream mul_1_ss(sigmoid_1_ss);
+ mul_1_ss << EltwiseLayer(std::move(sigmoid_1_ss), std::move(tanh_ss), EltwiseOperation::Mul)
.set_name(cell_name + "/mul_1");
- SubStream tanh_1_ss(graph);
- tanh_1_ss.forward_tail(add_nid);
- tanh_1_ss << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC))
- .set_name(cell_name + "/Sigmoid");
- tanh_1_ss << EltwiseLayer(std::move(tanh_1_ss), std::move(previous_state_c), EltwiseOperation::Mul)
- .set_name(cell_name + "/mul");
+ SubStream tanh_1_ss_tmp(graph);
+ tanh_1_ss_tmp.forward_tail(add_nid);
- tanh_1_ss << EltwiseLayer(std::move(tanh_1_ss), std::move(mul_1_ss), EltwiseOperation::Add)
+ tanh_1_ss_tmp << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC))
+ .set_name(cell_name + "/Sigmoid");
+ SubStream tanh_1_ss_tmp2(tanh_1_ss_tmp);
+ tanh_1_ss_tmp2 << EltwiseLayer(std::move(tanh_1_ss_tmp), std::move(previous_state_c), EltwiseOperation::Mul)
+ .set_name(cell_name + "/mul");
+ SubStream tanh_1_ss(tanh_1_ss_tmp2);
+ tanh_1_ss << EltwiseLayer(std::move(tanh_1_ss_tmp2), std::move(mul_1_ss), EltwiseOperation::Add)
.set_name(cell_name + "/new_state_c");
SubStream new_state_c(tanh_1_ss);
diff --git a/examples/neon_convolution.cpp b/examples/neon_convolution.cpp
index 1a7e86590..56b4ddc0b 100644
--- a/examples/neon_convolution.cpp
+++ b/examples/neon_convolution.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -32,7 +32,7 @@ using namespace utils;
/** Gaussian 3x3 matrix
*/
-const int16_t gaussian3x3[] =
+const std::array<int16_t, 9> gaussian3x3 =
{
1, 2, 1,
2, 4, 2,
@@ -41,7 +41,7 @@ const int16_t gaussian3x3[] =
/** Gaussian 5x5 matrix
*/
-const int16_t gaussian5x5[] =
+const std::array<int16_t, 25> gaussian5x5 =
{
1, 4, 6, 4, 1,
4, 16, 24, 16, 4,
@@ -79,8 +79,8 @@ public:
// Apply a Gaussian 3x3 filter to the source image followed by a Gaussian 5x5:
// The function will automatically update the padding information inside input and output to match its requirements
- conv3x3.configure(&src, &tmp, gaussian3x3, 0 /* Let arm_compute calculate the scale */, BorderMode::UNDEFINED);
- conv5x5.configure(&tmp, &dst, gaussian5x5, 0 /* Let arm_compute calculate the scale */, BorderMode::UNDEFINED);
+ conv3x3.configure(&src, &tmp, gaussian3x3.data(), 0 /* Let arm_compute calculate the scale */, BorderMode::UNDEFINED);
+ conv5x5.configure(&tmp, &dst, gaussian5x5.data(), 0 /* Let arm_compute calculate the scale */, BorderMode::UNDEFINED);
// Now that the padding requirements are known we can allocate the images:
src.allocator()->allocate();
diff --git a/examples/neon_sgemm.cpp b/examples/neon_sgemm.cpp
index f6f93dd50..8f395dec9 100644
--- a/examples/neon_sgemm.cpp
+++ b/examples/neon_sgemm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -36,7 +36,9 @@ class NESGEMMExample : public Example
public:
bool do_setup(int argc, char **argv) override
{
- NPYLoader npy0, npy1, npy2;
+ NPYLoader npy0;
+ NPYLoader npy1;
+ NPYLoader npy2;
alpha = 1.0f;
beta = 0.0f;
diff --git a/scripts/clang_tidy_rules.py b/scripts/clang_tidy_rules.py
index d35273d54..cba226f5d 100755
--- a/scripts/clang_tidy_rules.py
+++ b/scripts/clang_tidy_rules.py
@@ -42,6 +42,9 @@ def filter_clang_tidy_lines( lines ):
if "/convolution/" in line:
continue
+ if "/validate_examples/" in line:
+ continue
+
if "error:" in line:
if (("Utils.cpp" in line and "'arm_compute_version.embed' file not found" in line) or
("arm_fp16.h" in line) or
@@ -62,11 +65,14 @@ def filter_clang_tidy_lines( lines ):
elif "warning:" in line:
if ("uninitialized record type: '__ret'" in line or
"local variable '__bound_functor' is still referred to by the global variable '__once_callable'" in line or
+ "assigning newly created 'gsl::owner<>'" in line or
(any(f in line for f in ["Error.cpp","Error.h"]) and "thrown exception type is not nothrow copy constructible" in line) or
(any(f in line for f in ["Error.cpp","Error.h"]) and "uninitialized record type: 'args'" in line) or
(any(f in line for f in ["Error.cpp","Error.h"]) and "do not call c-style vararg functions" in line) or
(any(f in line for f in ["Error.cpp","Error.h"]) and "do not define a C-style variadic function" in line) or
("TensorAllocator.cpp" in line and "warning: pointer parameter 'ptr' can be pointer to const" in line) or
+ ("TensorAllocator.cpp" in line and "warning: do not declare C-style arrays" in line) or
+ ("RawTensor.cpp" in line and "warning: pointer parameter 'ptr' can be pointer to const" in line) or
("NEMinMaxLocationKernel.cpp" in line and "move constructors should be marked noexcept" in line) or
("NEMinMaxLocationKernel.cpp" in line and "move assignment operators should be marked noexcept" in line) or
("CLMinMaxLocationKernel.cpp" in line and "Forming reference to null pointer" in line) or
@@ -95,6 +101,8 @@ def filter_clang_tidy_lines( lines ):
("CPUUtils.cpp" in line and "consider replacing 'unsigned long' with 'uint64'" in line) or
("CPUUtils.cpp" in line and "parameter 'cpusv' is unused" in line) or
("CPUUtils.cpp" in line and "warning: uninitialized record type" in line) or
+ ("GCKernelLibrary.cpp" in line and "warning: do not declare C-style arrays" in line) or
+ ("Utils.h" in line and "warning: Use of zero-allocated memory" in line) or
"3rdparty" in line):
print_context=False
continue
diff --git a/src/core/AccessWindowAutoPadding.cpp b/src/core/AccessWindowAutoPadding.cpp
index 74af99bbb..cfb36e1da 100644
--- a/src/core/AccessWindowAutoPadding.cpp
+++ b/src/core/AccessWindowAutoPadding.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -47,10 +47,10 @@ ValidRegion AccessWindowAutoPadding::compute_valid_region() const
{
if(_info == nullptr)
{
- return ValidRegion();
+ return ValidRegion{};
}
- return ValidRegion(Coordinates(), _info->tensor_shape());
+ return ValidRegion{ Coordinates(), _info->tensor_shape() };
}
void AccessWindowAutoPadding::set_valid_region()
diff --git a/src/core/CL/kernels/CLComparisonKernel.cpp b/src/core/CL/kernels/CLComparisonKernel.cpp
index f5f5a0fbd..4f44851ef 100644
--- a/src/core/CL/kernels/CLComparisonKernel.cpp
+++ b/src/core/CL/kernels/CLComparisonKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -219,6 +219,6 @@ BorderSize CLComparisonKernel::border_size() const
const unsigned int replicateSize = _output->info()->dimension(0) - std::min(_input1->info()->dimension(0), _input2->info()->dimension(0));
const unsigned int border = std::min<unsigned int>(num_elems_processed_per_iteration - 1U, replicateSize);
- return BorderSize(0, border, 0, 0);
+ return BorderSize{ 0, border, 0, 0 };
}
} // namespace arm_compute
diff --git a/src/core/CL/kernels/CLElementwiseOperationKernel.cpp b/src/core/CL/kernels/CLElementwiseOperationKernel.cpp
index 37eeeb78b..63c924496 100644
--- a/src/core/CL/kernels/CLElementwiseOperationKernel.cpp
+++ b/src/core/CL/kernels/CLElementwiseOperationKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -281,7 +281,7 @@ BorderSize CLElementwiseOperationKernel::border_size() const
{
const unsigned int replicateSize = _output->info()->dimension(0) - std::min(_input1->info()->dimension(0), _input2->info()->dimension(0));
const unsigned int border = std::min<unsigned int>(num_elems_processed_per_iteration - 1U, replicateSize);
- return BorderSize(0, border, 0, 0);
+ return BorderSize{ 0, border, 0, 0 };
}
/** Arithmetic operations with saturation*/
diff --git a/src/core/CL/kernels/CLGaussian5x5Kernel.cpp b/src/core/CL/kernels/CLGaussian5x5Kernel.cpp
index bd523c883..3b45b07ed 100644
--- a/src/core/CL/kernels/CLGaussian5x5Kernel.cpp
+++ b/src/core/CL/kernels/CLGaussian5x5Kernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -29,17 +29,17 @@ using namespace arm_compute;
void CLGaussian5x5HorKernel::configure(const ICLTensor *input, ICLTensor *output, bool border_undefined)
{
- const int16_t matrix[] = { 1, 4, 6, 4, 1 };
+ const std::array<int16_t, 5> matrix = { 1, 4, 6, 4, 1 };
// Set arguments
- CLSeparableConvolution5x5HorKernel::configure(input, output, matrix, border_undefined);
+ CLSeparableConvolution5x5HorKernel::configure(input, output, matrix.data(), border_undefined);
}
void CLGaussian5x5VertKernel::configure(const ICLTensor *input, ICLTensor *output, bool border_undefined)
{
- const uint32_t scale = 256;
- const int16_t matrix[] = { 1, 4, 6, 4, 1 };
+ const uint32_t scale = 256;
+ const std::array<int16_t, 5> matrix = { 1, 4, 6, 4, 1 };
// Set arguments
- CLSeparableConvolution5x5VertKernel::configure(input, output, matrix, scale, border_undefined);
+ CLSeparableConvolution5x5VertKernel::configure(input, output, matrix.data(), scale, border_undefined);
}
diff --git a/src/core/CL/kernels/CLGaussianPyramidKernel.cpp b/src/core/CL/kernels/CLGaussianPyramidKernel.cpp
index 6b729c858..c9c7bf39a 100644
--- a/src/core/CL/kernels/CLGaussianPyramidKernel.cpp
+++ b/src/core/CL/kernels/CLGaussianPyramidKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -38,7 +38,7 @@ CLGaussianPyramidHorKernel::CLGaussianPyramidHorKernel()
BorderSize CLGaussianPyramidHorKernel::border_size() const
{
- return BorderSize(0, 2);
+ return BorderSize{ 0, 2 };
}
void CLGaussianPyramidHorKernel::configure(const ICLTensor *input, ICLTensor *output)
@@ -130,7 +130,7 @@ CLGaussianPyramidVertKernel::CLGaussianPyramidVertKernel()
BorderSize CLGaussianPyramidVertKernel::border_size() const
{
- return BorderSize(2, 0);
+ return BorderSize{ 2, 0 };
}
void CLGaussianPyramidVertKernel::configure(const ICLTensor *input, ICLTensor *output)
diff --git a/src/core/CL/kernels/CLMinMaxLayerKernel.cpp b/src/core/CL/kernels/CLMinMaxLayerKernel.cpp
index fa7b678e8..92b5f8d50 100644
--- a/src/core/CL/kernels/CLMinMaxLayerKernel.cpp
+++ b/src/core/CL/kernels/CLMinMaxLayerKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -127,7 +127,7 @@ void CLMinMaxLayerKernel::reset(cl::CommandQueue &queue)
Iterator output(_output, window_output);
// Reset output
- execute_window_loop(window_output, [&](const Coordinates & id)
+ execute_window_loop(window_output, [&](const Coordinates &)
{
auto *ptr = reinterpret_cast<float *>(output.ptr());
ptr[0] = std::numeric_limits<float>::max();
diff --git a/src/core/CPP/kernels/CPPUpsampleKernel.cpp b/src/core/CPP/kernels/CPPUpsampleKernel.cpp
index f04728d30..d29c0f72f 100644
--- a/src/core/CPP/kernels/CPPUpsampleKernel.cpp
+++ b/src/core/CPP/kernels/CPPUpsampleKernel.cpp
@@ -94,7 +94,7 @@ void CPPUpsampleKernel::run(const Window &window, const ThreadInfo &info)
Iterator in(_input, window);
Iterator out(_output, window_out);
- execute_window_loop(window, [&](const Coordinates & id)
+ execute_window_loop(window, [&](const Coordinates &)
{
memcpy(out.ptr(), in.ptr(), element_size);
},
diff --git a/src/core/Error.cpp b/src/core/Error.cpp
index e7b43655a..45cce6680 100644
--- a/src/core/Error.cpp
+++ b/src/core/Error.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -23,6 +23,7 @@
*/
#include "arm_compute/core/Error.h"
+#include <array>
#include <cstdarg>
#include <cstdio>
#include <iostream>
@@ -32,11 +33,11 @@ using namespace arm_compute;
Status arm_compute::create_error_va_list(ErrorCode error_code, const char *function, const char *file, const int line, const char *msg, va_list args)
{
- char out[512];
- int offset = snprintf(out, sizeof(out), "in %s %s:%d: ", function, file, line);
- vsnprintf(out + offset, sizeof(out) - offset, msg, args);
+ std::array<char, 512> out{ 0 };
+ int offset = snprintf(out.data(), out.size(), "in %s %s:%d: ", function, file, line);
+ vsnprintf(out.data() + offset, out.size() - offset, msg, args);
- return Status(error_code, std::string(out));
+ return Status(error_code, std::string(out.data()));
}
Status arm_compute::create_error(ErrorCode error_code, const char *function, const char *file, const int line, const char *msg, ...)
diff --git a/src/core/GLES_COMPUTE/GCKernelLibrary.cpp b/src/core/GLES_COMPUTE/GCKernelLibrary.cpp
index 25ac02e8f..0af8c7d4c 100644
--- a/src/core/GLES_COMPUTE/GCKernelLibrary.cpp
+++ b/src/core/GLES_COMPUTE/GCKernelLibrary.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -387,7 +387,7 @@ GCKernel GCKernelLibrary::create_kernel(const std::string &shader_name, const St
return kernel;
}
-const std::string GCKernelLibrary::preprocess_shader(const std::string &shader_source) const
+std::string GCKernelLibrary::preprocess_shader(const std::string &shader_source) const
{
enum class ParserStage
{
@@ -399,7 +399,7 @@ const std::string GCKernelLibrary::preprocess_shader(const std::string &shader_s
// Define a GLES compute shader parser function
std::function<std::string(const std::string &, ParserStage, int)> cs_parser;
- cs_parser = [&](const std::string & src, ParserStage stage, int nested_level) -> std::string
+ cs_parser = [&](const std::string & src, ParserStage stage, int) -> std::string
{
std::string dst;
diff --git a/src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp b/src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp
index f225ebde6..50171a101 100644
--- a/src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp
+++ b/src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -333,7 +333,10 @@ void GCPoolingLayerKernel::run(const Window &window)
ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this);
ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(IKernel::window(), window);
- unsigned int pool_pad_x, pool_pad_y, pool_stride_x, pool_stride_y = 0;
+ unsigned int pool_pad_x;
+ unsigned int pool_pad_y;
+ unsigned int pool_stride_x;
+ unsigned int pool_stride_y;
std::tie(pool_pad_x, pool_pad_y) = _pool_info.pad_stride_info().pad();
std::tie(pool_stride_x, pool_stride_y) = _pool_info.pad_stride_info().stride();
diff --git a/src/core/NEON/kernels/NECropKernel.cpp b/src/core/NEON/kernels/NECropKernel.cpp
index b6fe5819e..f16eb3e6b 100644
--- a/src/core/NEON/kernels/NECropKernel.cpp
+++ b/src/core/NEON/kernels/NECropKernel.cpp
@@ -178,7 +178,7 @@ inline void out_of_bounds_crop_window(const ITensor *output, float *output_ptr,
template <bool is_height_flipped, bool has_cols_in_bounds, bool has_cols_out_of_bounds_before, bool has_cols_out_of_bounds_after>
inline void execute_window(const ITensor *input, const ITensor *output, Coordinates input_offset, float extrapolation_value,
- const uint32_t rows_out_of_bounds[], const uint32_t cols_out_of_bounds[], NECropKernel::InBoundsCropFunction *in_bounds_crop_function)
+ const std::array<uint32_t, 2> &rows_out_of_bounds, const std::array<uint32_t, 2> &cols_out_of_bounds, NECropKernel::InBoundsCropFunction *in_bounds_crop_function)
{
// Output is always float.
const int window_step_x = 16 / sizeof(float);
diff --git a/src/core/NEON/kernels/NEDilateKernel.cpp b/src/core/NEON/kernels/NEDilateKernel.cpp
index 3ee00a47d..e761815f9 100644
--- a/src/core/NEON/kernels/NEDilateKernel.cpp
+++ b/src/core/NEON/kernels/NEDilateKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -94,7 +94,8 @@ void NEDilateKernel::run(const Window &window, const ThreadInfo &info)
uint8x8_t bot_high_data = vget_high_u8(bot_data);
uint8x8_t bot_low_data = vget_low_u8(bot_data);
- uint8x8_t p0, p1;
+ uint8x8_t p0;
+ uint8x8_t p1;
p0 = top_low_data;
p1 = vext_u8(top_low_data, top_high_data, 1);
diff --git a/src/core/NEON/kernels/NEDirectConvolutionLayerKernel.cpp b/src/core/NEON/kernels/NEDirectConvolutionLayerKernel.cpp
index 162c4b1ac..d557cfa1b 100644
--- a/src/core/NEON/kernels/NEDirectConvolutionLayerKernel.cpp
+++ b/src/core/NEON/kernels/NEDirectConvolutionLayerKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -192,12 +192,12 @@ public:
execute_window_loop(window_out, [&](const Coordinates & id)
{
- const uint8_t *input_ptr = in.ptr() - conv_pad_left * input_stride_x - conv_pad_top * input_stride_y;
- uint8_t *out_ptr = out.ptr();
- int ih = 0;
- int oh = 0;
- float32x4_t accum0[small_tensor_size_optim] = { vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0) };
- float32x4_t accum1[small_tensor_size_optim] = { vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0) };
+ const uint8_t *input_ptr = in.ptr() - conv_pad_left * input_stride_x - conv_pad_top * input_stride_y;
+ uint8_t *out_ptr = out.ptr();
+ int ih = 0;
+ int oh = 0;
+ std::array<float32x4_t, 8> accum0 = { vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0) };
+ std::array<float32x4_t, 8> accum1 = { vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0) };
for(int oz = 0; oz < range_z; ++oz)
{
accum0[0] = accum0[1] = accum0[2] = accum0[3] = accum0[4] = accum0[5] = accum0[6] = accum0[7] = vdupq_n_f32(0.f);
diff --git a/src/core/NEON/kernels/NEErodeKernel.cpp b/src/core/NEON/kernels/NEErodeKernel.cpp
index 88c20f817..2a538ecd0 100644
--- a/src/core/NEON/kernels/NEErodeKernel.cpp
+++ b/src/core/NEON/kernels/NEErodeKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -94,7 +94,8 @@ void NEErodeKernel::run(const Window &window, const ThreadInfo &info)
uint8x8_t bot_high_data = vget_high_u8(bot_data);
uint8x8_t bot_low_data = vget_low_u8(bot_data);
- uint8x8_t p0, p1;
+ uint8x8_t p0;
+ uint8x8_t p1;
p0 = top_low_data;
p1 = vext_u8(top_low_data, top_high_data, 1);
diff --git a/src/core/NEON/kernels/NEFillBorderKernel.cpp b/src/core/NEON/kernels/NEFillBorderKernel.cpp
index f4046e085..4127dc8fb 100644
--- a/src/core/NEON/kernels/NEFillBorderKernel.cpp
+++ b/src/core/NEON/kernels/NEFillBorderKernel.cpp
@@ -168,7 +168,7 @@ void NEFillBorderKernel::fill_replicate_single_channel(const Window &window)
Iterator vertical_it(_tensor, vertical);
- execute_window_loop(vertical, [&](const Coordinates & id)
+ execute_window_loop(vertical, [&](const Coordinates &)
{
uint8_t *base_addr = start_valid_region + vertical_it.offset();
// Fill left and right borders
@@ -188,7 +188,7 @@ void NEFillBorderKernel::fill_replicate_single_channel(const Window &window)
Iterator plane_it(_tensor, window);
// Iterate over all XY planes
- execute_window_loop(window, [&](const Coordinates & id)
+ execute_window_loop(window, [&](const Coordinates &)
{
uint8_t *base_addr = start_valid_region + plane_it.offset();
// Top border
@@ -224,7 +224,7 @@ void NEFillBorderKernel::fill_constant_value_single_channel(const Window &window
Iterator vertical_it(_tensor, vertical);
- execute_window_loop(vertical, [&](const Coordinates & id)
+ execute_window_loop(vertical, [&](const Coordinates &)
{
uint8_t *base_addr = start_valid_region + vertical_it.offset();
// Fill left and right borders
@@ -244,7 +244,7 @@ void NEFillBorderKernel::fill_constant_value_single_channel(const Window &window
Iterator plane_it(_tensor, window);
// Iterate over all XY planes
- execute_window_loop(window, [&](const Coordinates & id)
+ execute_window_loop(window, [&](const Coordinates &)
{
uint8_t *base_addr = start_valid_region + plane_it.offset();
// Top border
diff --git a/src/core/NEON/kernels/NEGEMMInterleave4x4Kernel.cpp b/src/core/NEON/kernels/NEGEMMInterleave4x4Kernel.cpp
index 7769d9eb8..c92998316 100644
--- a/src/core/NEON/kernels/NEGEMMInterleave4x4Kernel.cpp
+++ b/src/core/NEON/kernels/NEGEMMInterleave4x4Kernel.cpp
@@ -126,7 +126,7 @@ void gemm_interleave_16bit_elements(const ITensor *input, ITensor *output, const
win_out.set_dimension_step(Window::DimX, 16);
Iterator out(output, win_out);
- execute_window_loop(window, [&](const Coordinates & id)
+ execute_window_loop(window, [&](const Coordinates &)
{
const uint16x4x4_t data =
{
@@ -154,7 +154,7 @@ void gemm_interleave_32bit_elements(const ITensor *input, ITensor *output, const
win_out.set_dimension_step(Window::DimX, 16);
Iterator out(output, win_out);
- execute_window_loop(window, [&](const Coordinates & id)
+ execute_window_loop(window, [&](const Coordinates &)
{
const uint32x4x4_t data =
{
diff --git a/src/core/NEON/kernels/NELKTrackerKernel.cpp b/src/core/NEON/kernels/NELKTrackerKernel.cpp
index 83593e7f0..ddf869e30 100644
--- a/src/core/NEON/kernels/NELKTrackerKernel.cpp
+++ b/src/core/NEON/kernels/NELKTrackerKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -405,9 +405,9 @@ void NELKTrackerKernel::run(const Window &window, const ThreadInfo &info)
init_keypoints(list_start, list_end);
- const int buffer_size = _window_dimension * _window_dimension;
- int32_t bilinear_ix[buffer_size];
- int32_t bilinear_iy[buffer_size];
+ const int buffer_size = _window_dimension * _window_dimension;
+ std::vector<int32_t> bilinear_ix(buffer_size);
+ std::vector<int32_t> bilinear_iy(buffer_size);
const int half_window = _window_dimension / 2;
@@ -444,7 +444,7 @@ void NELKTrackerKernel::run(const Window &window, const ThreadInfo &info)
int iA12 = 0;
int iA22 = 0;
- std::tie(iA11, iA12, iA22) = compute_spatial_gradient_matrix(old_keypoint, bilinear_ix, bilinear_iy);
+ std::tie(iA11, iA12, iA22) = compute_spatial_gradient_matrix(old_keypoint, bilinear_ix.data(), bilinear_iy.data());
const float A11 = iA11 * FLT_SCALE;
const float A12 = iA12 * FLT_SCALE;
@@ -490,7 +490,7 @@ void NELKTrackerKernel::run(const Window &window, const ThreadInfo &info)
int ib1 = 0;
int ib2 = 0;
- std::tie(ib1, ib2) = compute_image_mismatch_vector(old_keypoint, new_keypoint, bilinear_ix, bilinear_iy);
+ std::tie(ib1, ib2) = compute_image_mismatch_vector(old_keypoint, new_keypoint, bilinear_ix.data(), bilinear_iy.data());
double b1 = ib1 * FLT_SCALE;
double b2 = ib2 * FLT_SCALE;
diff --git a/src/core/NEON/kernels/NEPoolingLayerKernel.cpp b/src/core/NEON/kernels/NEPoolingLayerKernel.cpp
index 0b90d9f29..ac2ffa198 100644
--- a/src/core/NEON/kernels/NEPoolingLayerKernel.cpp
+++ b/src/core/NEON/kernels/NEPoolingLayerKernel.cpp
@@ -352,7 +352,8 @@ void NEPoolingLayerKernel::configure(const ITensor *input, ITensor *output, cons
ARM_COMPUTE_ERROR_THROW_ON(validate_arguments_pool_info(pool_size.x(), pool_size.y()));
// Check output dimensions
- unsigned int pooled_w, pooled_h;
+ unsigned int pooled_w;
+ unsigned int pooled_h;
std::tie(pooled_w, pooled_h) = scaled_dimensions(input->info()->dimension(idx_width),
input->info()->dimension(idx_height),
pool_size.x(),
diff --git a/src/core/NEON/kernels/NERemapKernel.cpp b/src/core/NEON/kernels/NERemapKernel.cpp
index edb3ffe1d..3c871de73 100644
--- a/src/core/NEON/kernels/NERemapKernel.cpp
+++ b/src/core/NEON/kernels/NERemapKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -113,8 +113,8 @@ void NERemapKernel::configure(const ITensor *input, const ITensor *map_x, const
AccessWindowStatic input_access(input->info(), -border_size().left, -border_size().top, access_right, input->info()->dimension(1) + border_size().bottom);
AccessWindowHorizontal output_access(output->info(), 0, num_elems_processed_per_iteration);
- AccessWindowHorizontal mapx_access(map_x->info(), 0, num_elems_processed_per_iteration);
- AccessWindowHorizontal mapy_access(map_y->info(), 0, num_elems_processed_per_iteration);
+ AccessWindowHorizontal mapx_access(map_x->info(), 0, num_elems_processed_per_iteration);
+ AccessWindowHorizontal mapy_access(map_y->info(), 0, num_elems_processed_per_iteration);
update_window_and_padding(win, input_access, mapx_access, mapy_access, output_access);
@@ -140,7 +140,7 @@ void NERemapKernel::remap_nearest(const Window &window)
const float32x4_t height = vdupq_n_f32(static_cast<float>(_input->info()->dimension(1)));
const int32x4_t in_stride = vdupq_n_s32(static_cast<int32_t>(_input->info()->strides_in_bytes()[1]));
- execute_window_loop(window, [&](const Coordinates & id)
+ execute_window_loop(window, [&](const Coordinates &)
{
const auto mapx_ptr = reinterpret_cast<const float *>(mapx.ptr());
const auto mapy_ptr = reinterpret_cast<const float *>(mapy.ptr());
@@ -190,7 +190,7 @@ void NERemapKernel::remap_bilinear(const Window &window)
const size_t height = _input->info()->dimension(1);
const size_t in_stride = _input->info()->strides_in_bytes()[1];
- execute_window_loop(window, [&](const Coordinates & id)
+ execute_window_loop(window, [&](const Coordinates &)
{
const auto mapx_ptr = reinterpret_cast<float *>(mapx.ptr());
const auto mapy_ptr = reinterpret_cast<float *>(mapy.ptr());
diff --git a/src/core/NEON/kernels/NEScaleKernel.cpp b/src/core/NEON/kernels/NEScaleKernel.cpp
index 8c4a70cda..33540393e 100644
--- a/src/core/NEON/kernels/NEScaleKernel.cpp
+++ b/src/core/NEON/kernels/NEScaleKernel.cpp
@@ -249,7 +249,10 @@ inline void scale_bilinear_nhwc_core(const ITensor *input, const ITensor *offset
if(is_valid(offset, -border_size, input_width - 1 + border_size, in_yi, -border_size, input_height - 1 + border_size))
{
- T a00 = 0, a01 = 0, a10 = 0, a11 = 0;
+ T a00 = 0;
+ T a01 = 0;
+ T a10 = 0;
+ T a11 = 0;
if(border_mode == BorderMode::CONSTANT)
{
diff --git a/src/core/utils/helpers/tensor_transform.cpp b/src/core/utils/helpers/tensor_transform.cpp
index 7c56390fe..f6a54a59e 100644
--- a/src/core/utils/helpers/tensor_transform.cpp
+++ b/src/core/utils/helpers/tensor_transform.cpp
@@ -117,6 +117,7 @@ std::tuple<Coordinates, Coordinates, Coordinates> calculate_strided_slice_coords
Coordinates starts_abs{};
Coordinates ends_abs{};
Coordinates final_strides{};
+
for(unsigned int i = 0; i < input_shape.num_dimensions(); ++i)
{
const int start_i = calculate_start_on_index(input_shape, i, starts, strides, begin_mask);
diff --git a/src/core/utils/logging/LoggerRegistry.cpp b/src/core/utils/logging/LoggerRegistry.cpp
index 3a466963f..055e770c7 100644
--- a/src/core/utils/logging/LoggerRegistry.cpp
+++ b/src/core/utils/logging/LoggerRegistry.cpp
@@ -42,12 +42,12 @@ LoggerRegistry &LoggerRegistry::get()
return _instance;
}
-void LoggerRegistry::create_logger(const std::string &name, LogLevel log_level, std::vector<std::shared_ptr<Printer>> printers)
+void LoggerRegistry::create_logger(const std::string &name, LogLevel log_level, const std::vector<std::shared_ptr<Printer>> &printers)
{
std::lock_guard<arm_compute::Mutex> lock(_mtx);
if((_loggers.find(name) == _loggers.end()) && (_reserved_loggers.find(name) == _reserved_loggers.end()))
{
- _loggers[name] = std::make_shared<Logger>(name, log_level, std::move(printers));
+ _loggers[name] = std::make_shared<Logger>(name, log_level, printers);
}
}
diff --git a/src/runtime/BlobLifetimeManager.cpp b/src/runtime/BlobLifetimeManager.cpp
index c5d42b1be..1323bb3f8 100644
--- a/src/runtime/BlobLifetimeManager.cpp
+++ b/src/runtime/BlobLifetimeManager.cpp
@@ -66,7 +66,7 @@ void BlobLifetimeManager::update_blobs_and_mappings()
std::vector<BlobInfo> group_sizes;
std::transform(std::begin(_free_blobs), std::end(_free_blobs), std::back_inserter(group_sizes), [](const Blob & b)
{
- return BlobInfo(b.max_size, b.max_alignment);
+ return BlobInfo{ b.max_size, b.max_alignment };
});
// Update blob sizes
@@ -75,7 +75,7 @@ void BlobLifetimeManager::update_blobs_and_mappings()
group_sizes.resize(max_size);
std::transform(std::begin(_blobs), std::end(_blobs), std::begin(group_sizes), std::begin(_blobs), [](BlobInfo lhs, BlobInfo rhs)
{
- return BlobInfo(std::max(lhs.size, rhs.size), std::max(lhs.alignment, rhs.alignment));
+ return BlobInfo{ std::max(lhs.size, rhs.size), std::max(lhs.alignment, rhs.alignment) };
});
// Calculate group mappings
diff --git a/src/runtime/CL/CLHelpers.cpp b/src/runtime/CL/CLHelpers.cpp
index 533e6fabf..8bc7b8eb7 100644
--- a/src/runtime/CL/CLHelpers.cpp
+++ b/src/runtime/CL/CLHelpers.cpp
@@ -47,7 +47,7 @@ void printf_callback(const char *buffer, unsigned int len, size_t complete, void
* @return A pointer to the context properties which can be used to create an opencl context
*/
-void initialise_context_properties(const cl::Platform &platform, const cl::Device &device, cl_context_properties prop[7])
+void initialise_context_properties(const cl::Platform &platform, const cl::Device &device, std::array<cl_context_properties, 7> &prop)
{
ARM_COMPUTE_UNUSED(device);
#if defined(ARM_COMPUTE_ASSERTS_ENABLED)
@@ -55,7 +55,7 @@ void initialise_context_properties(const cl::Platform &platform, const cl::Devic
if(arm_compute::device_supports_extension(device, "cl_arm_printf"))
{
// Create a cl_context with a printf_callback and user specified buffer size.
- cl_context_properties properties_printf[] =
+ std::array<cl_context_properties, 7> properties_printf =
{
CL_CONTEXT_PLATFORM, reinterpret_cast<cl_context_properties>(platform()),
// Enable a printf callback function for this context.
@@ -65,17 +65,17 @@ void initialise_context_properties(const cl::Platform &platform, const cl::Devic
CL_PRINTF_BUFFERSIZE_ARM, 0x1000,
0
};
- std::copy_n(properties_printf, 7, prop);
+ prop = properties_printf;
}
else
#endif // defined(ARM_COMPUTE_ASSERTS_ENABLED)
{
- cl_context_properties properties[] =
+ std::array<cl_context_properties, 3> properties =
{
CL_CONTEXT_PLATFORM, reinterpret_cast<cl_context_properties>(platform()),
0
};
- std::copy_n(properties, 3, prop);
+ std::copy(properties.begin(), properties.end(), prop.begin());
};
}
} //namespace
@@ -94,11 +94,11 @@ create_opencl_context_and_device()
std::vector<cl::Device> platform_devices;
p.getDevices(CL_DEVICE_TYPE_DEFAULT, &platform_devices);
ARM_COMPUTE_ERROR_ON_MSG(platform_devices.size() == 0, "Couldn't find any OpenCL device");
- device = platform_devices[0];
- cl_int err = CL_SUCCESS;
- cl_context_properties properties[7] = { 0, 0, 0, 0, 0, 0, 0 };
+ device = platform_devices[0];
+ cl_int err = CL_SUCCESS;
+ std::array<cl_context_properties, 7> properties = { 0, 0, 0, 0, 0, 0, 0 };
initialise_context_properties(p, device, properties);
- cl::Context cl_context = cl::Context(device, properties, nullptr, nullptr, &err);
+ cl::Context cl_context = cl::Context(device, properties.data(), nullptr, nullptr, &err);
ARM_COMPUTE_ERROR_ON_MSG(err != CL_SUCCESS, "Failed to create OpenCL context");
return std::make_tuple(cl_context, device, err);
}
diff --git a/src/runtime/CL/CLMemory.cpp b/src/runtime/CL/CLMemory.cpp
index 5bea85cfa..557378b6f 100644
--- a/src/runtime/CL/CLMemory.cpp
+++ b/src/runtime/CL/CLMemory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -33,8 +33,8 @@ CLMemory::CLMemory()
{
}
-CLMemory::CLMemory(std::shared_ptr<ICLMemoryRegion> memory)
- : _region(nullptr), _region_owned(std::move(memory))
+CLMemory::CLMemory(const std::shared_ptr<ICLMemoryRegion> &memory)
+ : _region(nullptr), _region_owned(memory)
{
_region_owned = memory;
_region = _region_owned.get();
diff --git a/src/runtime/CL/CLMultiHOG.cpp b/src/runtime/CL/CLMultiHOG.cpp
index 88d45acd1..2577ec08a 100644
--- a/src/runtime/CL/CLMultiHOG.cpp
+++ b/src/runtime/CL/CLMultiHOG.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -30,8 +30,9 @@
using namespace arm_compute;
CLMultiHOG::CLMultiHOG(size_t num_models)
- : _num_models(num_models), _model(arm_compute::support::cpp14::make_unique<CLHOG[]>(_num_models))
+ : _num_models(num_models), _model()
{
+ _model.resize(_num_models);
}
size_t CLMultiHOG::num_models() const
@@ -42,11 +43,11 @@ size_t CLMultiHOG::num_models() const
ICLHOG *CLMultiHOG::cl_model(size_t index)
{
ARM_COMPUTE_ERROR_ON(index >= _num_models);
- return (_model.get() + index);
+ return (&_model[index]);
}
const ICLHOG *CLMultiHOG::cl_model(size_t index) const
{
ARM_COMPUTE_ERROR_ON(index >= _num_models);
- return (_model.get() + index);
+ return (&_model[index]);
} \ No newline at end of file
diff --git a/src/runtime/CL/CLPyramid.cpp b/src/runtime/CL/CLPyramid.cpp
index 865f389f7..6d5dba003 100644
--- a/src/runtime/CL/CLPyramid.cpp
+++ b/src/runtime/CL/CLPyramid.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -35,7 +35,7 @@
using namespace arm_compute;
CLPyramid::CLPyramid()
- : _info(), _pyramid(nullptr)
+ : _info(), _pyramid()
{
}
@@ -51,8 +51,8 @@ void CLPyramid::init_auto_padding(const PyramidInfo &info)
void CLPyramid::internal_init(const PyramidInfo &info, bool auto_padding)
{
- _info = info;
- _pyramid = arm_compute::support::cpp14::make_unique<CLTensor[]>(_info.num_levels());
+ _info = info;
+ _pyramid.resize(_info.num_levels());
size_t w = _info.width();
size_t h = _info.height();
@@ -109,11 +109,9 @@ void CLPyramid::internal_init(const PyramidInfo &info, bool auto_padding)
void CLPyramid::allocate()
{
- ARM_COMPUTE_ERROR_ON(_pyramid == nullptr);
-
for(size_t i = 0; i < _info.num_levels(); ++i)
{
- (_pyramid.get() + i)->allocator()->allocate();
+ _pyramid[i].allocator()->allocate();
}
}
@@ -126,5 +124,5 @@ CLTensor *CLPyramid::get_pyramid_level(size_t index) const
{
ARM_COMPUTE_ERROR_ON(index >= _info.num_levels());
- return (_pyramid.get() + index);
+ return &_pyramid[index];
}
diff --git a/src/runtime/CL/CLTensorAllocator.cpp b/src/runtime/CL/CLTensorAllocator.cpp
index 2ce64551a..101e4f1cd 100644
--- a/src/runtime/CL/CLTensorAllocator.cpp
+++ b/src/runtime/CL/CLTensorAllocator.cpp
@@ -34,7 +34,7 @@ const cl::Buffer CLTensorAllocator::_empty_buffer = cl::Buffer();
namespace
{
-std::unique_ptr<ICLMemoryRegion> allocate_region(cl::Context context, size_t size, cl_uint alignment)
+std::unique_ptr<ICLMemoryRegion> allocate_region(const cl::Context &context, size_t size, cl_uint alignment)
{
// Try fine-grain SVM
std::unique_ptr<ICLMemoryRegion> region = support::cpp14::make_unique<CLFineSVMMemoryRegion>(context,
diff --git a/src/runtime/CL/CLTuner.cpp b/src/runtime/CL/CLTuner.cpp
index 8f8d3e7c3..929def24c 100644
--- a/src/runtime/CL/CLTuner.cpp
+++ b/src/runtime/CL/CLTuner.cpp
@@ -275,7 +275,7 @@ void CLTuner::save_to_file(const std::string &filename) const
std::ofstream fs;
fs.exceptions(std::ifstream::failbit | std::ifstream::badbit);
fs.open(filename, std::ios::out);
- for(auto kernel_data : _lws_table)
+ for(auto const &kernel_data : _lws_table)
{
fs << kernel_data.first << ";" << kernel_data.second[0] << ";" << kernel_data.second[1] << ";" << kernel_data.second[2] << std::endl;
}
diff --git a/src/runtime/CL/functions/CLConvolution.cpp b/src/runtime/CL/functions/CLConvolution.cpp
index 2f43ce197..f09585e7e 100644
--- a/src/runtime/CL/functions/CLConvolution.cpp
+++ b/src/runtime/CL/functions/CLConvolution.cpp
@@ -58,13 +58,13 @@ void CLConvolutionSquare<matrix_size>::configure(ICLTensor *input, ICLTensor *ou
{
ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::U8);
ARM_COMPUTE_ERROR_ON(conv == nullptr);
- int16_t conv_col[matrix_size];
- int16_t conv_row[matrix_size];
- _is_separable = separate_matrix(conv, conv_col, conv_row, matrix_size);
+ std::array<int16_t, matrix_size> conv_col{ 0 };
+ std::array<int16_t, matrix_size> conv_row{ 0 };
+ _is_separable = separate_matrix(conv, conv_col.data(), conv_row.data(), matrix_size);
if(_is_separable)
{
- std::pair<DataType, DataType> type_pair = data_type_for_convolution(conv_col, conv_row, matrix_size);
+ std::pair<DataType, DataType> type_pair = data_type_for_convolution(conv_col.data(), conv_row.data(), matrix_size);
_tmp.allocator()->init(TensorInfo(input->info()->tensor_shape(), 1, type_pair.first));
// Manage intermediate buffers
@@ -75,8 +75,8 @@ void CLConvolutionSquare<matrix_size>::configure(ICLTensor *input, ICLTensor *ou
scale = calculate_matrix_scale(conv, matrix_size);
}
- _kernel_hor.configure(input, &_tmp, conv_row, border_mode == BorderMode::UNDEFINED);
- _kernel_vert.configure(&_tmp, output, conv_col, scale, border_mode == BorderMode::UNDEFINED, type_pair.second);
+ _kernel_hor.configure(input, &_tmp, conv_row.data(), border_mode == BorderMode::UNDEFINED);
+ _kernel_vert.configure(&_tmp, output, conv_col.data(), scale, border_mode == BorderMode::UNDEFINED, type_pair.second);
_border_handler.configure(input, _kernel_hor.border_size(), border_mode, PixelValue(constant_border_value));
// Allocate intermediate buffer
diff --git a/src/runtime/CL/functions/CLDepthConcatenateLayer.cpp b/src/runtime/CL/functions/CLDepthConcatenateLayer.cpp
index 4a5f84563..f687e5455 100644
--- a/src/runtime/CL/functions/CLDepthConcatenateLayer.cpp
+++ b/src/runtime/CL/functions/CLDepthConcatenateLayer.cpp
@@ -36,8 +36,7 @@
using namespace arm_compute;
CLDepthConcatenateLayer::CLDepthConcatenateLayer() // NOLINT
- : _inputs_vector(),
- _concat_kernels_vector(),
+ : _concat_kernels_vector(),
_border_handlers_vector(),
_num_inputs(0)
{
@@ -53,8 +52,8 @@ void CLDepthConcatenateLayer::configure(const std::vector<ICLTensor *> &inputs_v
inputs_vector_info.emplace_back(inputs_vector.at(i)->info());
}
- _concat_kernels_vector = arm_compute::support::cpp14::make_unique<CLDepthConcatenateLayerKernel[]>(_num_inputs);
- _border_handlers_vector = arm_compute::support::cpp14::make_unique<CLFillBorderKernel[]>(_num_inputs);
+ _concat_kernels_vector.resize(_num_inputs);
+ _border_handlers_vector.resize(_num_inputs);
TensorShape output_shape = arm_compute::misc::shape_calculator::calculate_concatenate_shape(inputs_vector_info, Window::DimZ);
diff --git a/src/runtime/CL/functions/CLDepthwiseConvolutionLayer.cpp b/src/runtime/CL/functions/CLDepthwiseConvolutionLayer.cpp
index 8211104bd..97b0a0133 100644
--- a/src/runtime/CL/functions/CLDepthwiseConvolutionLayer.cpp
+++ b/src/runtime/CL/functions/CLDepthwiseConvolutionLayer.cpp
@@ -322,7 +322,8 @@ void CLDepthwiseConvolutionLayer::configure(ICLTensor *input, const ICLTensor *w
const QuantizationInfo output_quant_info = (output->info()->total_size() == 0) ? input->info()->quantization_info() : output->info()->quantization_info();
float multiplier = input->info()->quantization_info().scale * weights->info()->quantization_info().scale / output_quant_info.scale;
- int output_multiplier, output_shift;
+ int output_multiplier;
+ int output_shift;
quantization::calculate_quantized_multiplier_less_than_one(multiplier, &output_multiplier, &output_shift);
_output_stage_kernel.configure(&_output_reshaped, biases, output, output_multiplier, output_shift, output_quant_info.offset);
_output_reshaped.allocator()->allocate();
diff --git a/src/runtime/CL/functions/CLFFT1D.cpp b/src/runtime/CL/functions/CLFFT1D.cpp
index 67111e7e5..49b5a2a2e 100644
--- a/src/runtime/CL/functions/CLFFT1D.cpp
+++ b/src/runtime/CL/functions/CLFFT1D.cpp
@@ -62,7 +62,7 @@ void CLFFT1D::configure(const ICLTensor *input, ICLTensor *output, const FFT1DIn
// Create and configure FFT kernels
unsigned int Nx = 1;
_num_ffts = decomposed_vector.size();
- _fft_kernels = arm_compute::support::cpp14::make_unique<CLFFTRadixStageKernel[]>(_num_ffts);
+ _fft_kernels.resize(_num_ffts);
for(unsigned int i = 0; i < _num_ffts; ++i)
{
const unsigned int radix_for_stage = decomposed_vector.at(i);
diff --git a/src/runtime/CL/functions/CLGEMMConvolutionLayer.cpp b/src/runtime/CL/functions/CLGEMMConvolutionLayer.cpp
index 40ce6b4e0..03d516f70 100644
--- a/src/runtime/CL/functions/CLGEMMConvolutionLayer.cpp
+++ b/src/runtime/CL/functions/CLGEMMConvolutionLayer.cpp
@@ -372,7 +372,9 @@ Status CLGEMMConvolutionLayer::validate(const ITensorInfo *input, const ITensorI
const unsigned int kernel_width = weights->dimension(idx_width);
const unsigned int kernel_height = weights->dimension(idx_height);
- TensorInfo im2col_reshaped_info, info_gemm, weights_reshaped_info;
+ TensorInfo im2col_reshaped_info{};
+ TensorInfo info_gemm{};
+ TensorInfo weights_reshaped_info{};
const ITensorInfo *gemm_input_to_use = input;
const ITensorInfo *gemm_output_to_use = output;
const ITensorInfo *weights_to_use = weights;
diff --git a/src/runtime/CL/functions/CLGaussianPyramid.cpp b/src/runtime/CL/functions/CLGaussianPyramid.cpp
index fd8276900..b671b23c8 100644
--- a/src/runtime/CL/functions/CLGaussianPyramid.cpp
+++ b/src/runtime/CL/functions/CLGaussianPyramid.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -76,10 +76,10 @@ void CLGaussianPyramidHalf::configure(ICLTensor *input, CLPyramid *pyramid, Bord
if(num_levels > 1)
{
- _horizontal_border_handler = arm_compute::support::cpp14::make_unique<CLFillBorderKernel[]>(num_levels - 1);
- _vertical_border_handler = arm_compute::support::cpp14::make_unique<CLFillBorderKernel[]>(num_levels - 1);
- _horizontal_reduction = arm_compute::support::cpp14::make_unique<CLGaussianPyramidHorKernel[]>(num_levels - 1);
- _vertical_reduction = arm_compute::support::cpp14::make_unique<CLGaussianPyramidVertKernel[]>(num_levels - 1);
+ _horizontal_border_handler.resize(num_levels - 1);
+ _vertical_border_handler.resize(num_levels - 1);
+ _horizontal_reduction.resize(num_levels - 1);
+ _vertical_reduction.resize(num_levels - 1);
// Apply half scale to the X dimension of the tensor shape
TensorShape tensor_shape = pyramid->info()->tensor_shape();
@@ -153,8 +153,8 @@ void CLGaussianPyramidOrb::configure(ICLTensor *input, CLPyramid *pyramid, Borde
if(num_levels > 1)
{
- _gauss5x5 = arm_compute::support::cpp14::make_unique<CLGaussian5x5[]>(num_levels - 1);
- _scale_nearest = arm_compute::support::cpp14::make_unique<CLScaleKernel[]>(num_levels - 1);
+ _gauss5x5.resize(num_levels - 1);
+ _scale_nearest.resize(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 0865f50fd..f799d61b1 100644
--- a/src/runtime/CL/functions/CLHOGMultiDetection.cpp
+++ b/src/runtime/CL/functions/CLHOGMultiDetection.cpp
@@ -128,12 +128,11 @@ 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::support::cpp14::make_unique<CLHOGOrientationBinningKernel[]>(_num_orient_bin_kernel);
- _block_norm_kernel = arm_compute::support::cpp14::make_unique<CLHOGBlockNormalizationKernel[]>(_num_block_norm_kernel);
- _hog_detect_kernel = arm_compute::support::cpp14::make_unique<CLHOGDetector[]>(_num_hog_detect_kernel);
- _non_maxima_kernel = arm_compute::support::cpp14::make_unique<CPPDetectionWindowNonMaximaSuppressionKernel>();
- _hog_space = arm_compute::support::cpp14::make_unique<CLTensor[]>(_num_orient_bin_kernel);
- _hog_norm_space = arm_compute::support::cpp14::make_unique<CLTensor[]>(_num_block_norm_kernel);
+ _orient_bin_kernel.resize(_num_orient_bin_kernel);
+ _block_norm_kernel.resize(_num_block_norm_kernel);
+ _hog_detect_kernel.resize(_num_hog_detect_kernel);
+ _hog_space.resize(_num_orient_bin_kernel);
+ _hog_norm_space.resize(_num_block_norm_kernel);
// Allocate tensors for magnitude and phase
TensorInfo info_mag(shape_img, Format::S16);
@@ -172,10 +171,10 @@ void CLHOGMultiDetection::configure(ICLTensor *input, const ICLMultiHOG *multi_h
_hog_space[i].allocator()->init(info_space);
// Manage intermediate buffers
- _memory_group.manage(_hog_space.get() + i);
+ _memory_group.manage(&_hog_space[i]);
// Initialise orientation binning kernel
- _orient_bin_kernel[i].configure(&_mag, &_phase, _hog_space.get() + i, multi_hog->model(idx_multi_hog)->info());
+ _orient_bin_kernel[i].configure(&_mag, &_phase, &_hog_space[i], multi_hog->model(idx_multi_hog)->info());
}
// Allocate intermediate tensors
@@ -193,10 +192,10 @@ void CLHOGMultiDetection::configure(ICLTensor *input, const ICLMultiHOG *multi_h
_hog_norm_space[i].allocator()->init(tensor_info);
// Manage intermediate buffers
- _memory_group.manage(_hog_norm_space.get() + i);
+ _memory_group.manage(&_hog_norm_space[i]);
// Initialize block normalization kernel
- _block_norm_kernel[i].configure(_hog_space.get() + idx_orient_bin, _hog_norm_space.get() + i, multi_hog->model(idx_multi_hog)->info());
+ _block_norm_kernel[i].configure(&_hog_space[idx_orient_bin], &_hog_norm_space[i], multi_hog->model(idx_multi_hog)->info());
}
// Allocate intermediate tensors
@@ -212,13 +211,13 @@ void CLHOGMultiDetection::configure(ICLTensor *input, const ICLMultiHOG *multi_h
{
const size_t idx_block_norm = input_hog_detect[i];
- _hog_detect_kernel[i].configure(_hog_norm_space.get() + idx_block_norm, multi_hog->cl_model(i), detection_windows, detection_window_strides->at(i), threshold, i);
+ _hog_detect_kernel[i].configure(&_hog_norm_space[idx_block_norm], multi_hog->cl_model(i), detection_windows, detection_window_strides->at(i), threshold, i);
}
detection_window_strides->unmap(CLScheduler::get().queue());
// Configure non maxima suppression kernel
- _non_maxima_kernel->configure(_detection_windows, min_distance);
+ _non_maxima_kernel.configure(_detection_windows, min_distance);
// Allocate intermediate tensors
for(size_t i = 0; i < _num_block_norm_kernel; ++i)
@@ -242,13 +241,13 @@ void CLHOGMultiDetection::run()
// Run orientation binning kernel
for(size_t i = 0; i < _num_orient_bin_kernel; ++i)
{
- CLScheduler::get().enqueue(*(_orient_bin_kernel.get() + i), false);
+ CLScheduler::get().enqueue(_orient_bin_kernel[i], false);
}
// Run block normalization kernel
for(size_t i = 0; i < _num_block_norm_kernel; ++i)
{
- CLScheduler::get().enqueue(*(_block_norm_kernel.get() + i), false);
+ CLScheduler::get().enqueue(_block_norm_kernel[i], false);
}
// Run HOG detector kernel
@@ -262,7 +261,7 @@ void CLHOGMultiDetection::run()
{
// Map detection windows array before computing non maxima suppression
_detection_windows->map(CLScheduler::get().queue(), true);
- Scheduler::get().schedule(_non_maxima_kernel.get(), Window::DimY);
+ Scheduler::get().schedule(&_non_maxima_kernel, Window::DimY);
_detection_windows->unmap(CLScheduler::get().queue());
}
}
diff --git a/src/runtime/CL/functions/CLHarrisCorners.cpp b/src/runtime/CL/functions/CLHarrisCorners.cpp
index 342d1cad4..67f550d31 100644
--- a/src/runtime/CL/functions/CLHarrisCorners.cpp
+++ b/src/runtime/CL/functions/CLHarrisCorners.cpp
@@ -55,7 +55,7 @@ CLHarrisCorners::CLHarrisCorners(std::shared_ptr<IMemoryManager> memory_manager)
_gy(),
_score(),
_nonmax(),
- _corners_list(nullptr),
+ _corners_list(),
_num_corner_candidates(0),
_corners(nullptr)
{
@@ -84,7 +84,7 @@ void CLHarrisCorners::configure(ICLImage *input, float threshold, float min_dist
_score.allocator()->init(info_f32);
_nonmax.allocator()->init(info_f32);
- _corners_list = arm_compute::support::cpp14::make_unique<InternalKeypoint[]>(shape.x() * shape.y());
+ _corners_list.resize(shape.x() * shape.y());
// Manage intermediate buffers
_memory_group.manage(&_gx);
@@ -146,13 +146,13 @@ void CLHarrisCorners::configure(ICLImage *input, float threshold, float min_dist
_score.allocator()->allocate();
// Init corner candidates kernel
- _candidates.configure(&_nonmax, _corners_list.get(), &_num_corner_candidates);
+ _candidates.configure(&_nonmax, _corners_list.data(), &_num_corner_candidates);
// Allocate intermediate buffers
_nonmax.allocator()->allocate();
// Init euclidean distance
- _sort_euclidean.configure(_corners_list.get(), _corners, &_num_corner_candidates, min_dist);
+ _sort_euclidean.configure(_corners_list.data(), _corners, &_num_corner_candidates, min_dist);
}
void CLHarrisCorners::run()
diff --git a/src/runtime/CL/functions/CLLaplacianPyramid.cpp b/src/runtime/CL/functions/CLLaplacianPyramid.cpp
index 559b57fd8..a11851898 100644
--- a/src/runtime/CL/functions/CLLaplacianPyramid.cpp
+++ b/src/runtime/CL/functions/CLLaplacianPyramid.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -70,8 +70,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::support::cpp14::make_unique<CLGaussian5x5[]>(_num_levels);
- _subf = arm_compute::support::cpp14::make_unique<CLArithmeticSubtraction[]>(_num_levels);
+ _convf.resize(_num_levels);
+ _subf.resize(_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 911c9b3b2..13116bf08 100644
--- a/src/runtime/CL/functions/CLLaplacianReconstruct.cpp
+++ b/src/runtime/CL/functions/CLLaplacianReconstruct.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -63,8 +63,8 @@ void CLLaplacianReconstruct::configure(const CLPyramid *pyramid, ICLTensor *inpu
_tmp_pyr.init(pyramid_info);
// Allocate add and scale functions. Level 0 does not need to be scaled.
- _addf = arm_compute::support::cpp14::make_unique<CLArithmeticAddition[]>(num_levels);
- _scalef = arm_compute::support::cpp14::make_unique<CLScale[]>(num_levels - 1);
+ _addf.resize(num_levels);
+ _scalef.resize(num_levels - 1);
const size_t last_level = num_levels - 1;
@@ -85,7 +85,7 @@ void CLLaplacianReconstruct::configure(const CLPyramid *pyramid, ICLTensor *inpu
void CLLaplacianReconstruct::run()
{
- ARM_COMPUTE_ERROR_ON_MSG(_addf == nullptr, "Unconfigured function");
+ ARM_COMPUTE_ERROR_ON_MSG(_addf.empty(), "Unconfigured function");
const size_t last_level = _tmp_pyr.info()->num_levels() - 1;
diff --git a/src/runtime/CL/functions/CLOpticalFlow.cpp b/src/runtime/CL/functions/CLOpticalFlow.cpp
index 7ef1c83d0..a013a1fe1 100644
--- a/src/runtime/CL/functions/CLOpticalFlow.cpp
+++ b/src/runtime/CL/functions/CLOpticalFlow.cpp
@@ -84,12 +84,12 @@ 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::support::cpp14::make_unique<CLLKTrackerInitKernel[]>(_num_levels);
- _tracker_stage0_kernel = arm_compute::support::cpp14::make_unique<CLLKTrackerStage0Kernel[]>(_num_levels);
- _tracker_stage1_kernel = arm_compute::support::cpp14::make_unique<CLLKTrackerStage1Kernel[]>(_num_levels);
- _func_scharr = arm_compute::support::cpp14::make_unique<CLScharr3x3[]>(_num_levels);
- _scharr_gx = arm_compute::support::cpp14::make_unique<CLTensor[]>(_num_levels);
- _scharr_gy = arm_compute::support::cpp14::make_unique<CLTensor[]>(_num_levels);
+ _tracker_init_kernel.resize(_num_levels);
+ _tracker_stage0_kernel.resize(_num_levels);
+ _tracker_stage1_kernel.resize(_num_levels);
+ _func_scharr.resize(_num_levels);
+ _scharr_gx.resize(_num_levels);
+ _scharr_gy.resize(_num_levels);
// Create internal keypoint arrays
_old_points_internal = arm_compute::support::cpp14::make_unique<CLLKInternalKeypointArray>(list_length);
@@ -118,8 +118,8 @@ void CLOpticalFlow::configure(const CLPyramid *old_pyramid, const CLPyramid *new
_scharr_gy[i].allocator()->init(tensor_info);
// Manage intermediate buffers
- _memory_group.manage(_scharr_gx.get() + i);
- _memory_group.manage(_scharr_gy.get() + i);
+ _memory_group.manage(&_scharr_gx[i]);
+ _memory_group.manage(&_scharr_gy[i]);
// Init Scharr kernel
_func_scharr[i].configure(old_ith_input, &_scharr_gx[i], &_scharr_gy[i], border_mode, constant_border_value);
diff --git a/src/runtime/CL/functions/CLPadLayer.cpp b/src/runtime/CL/functions/CLPadLayer.cpp
index dba7f23f3..99e312183 100644
--- a/src/runtime/CL/functions/CLPadLayer.cpp
+++ b/src/runtime/CL/functions/CLPadLayer.cpp
@@ -31,7 +31,7 @@
namespace arm_compute
{
CLPadLayer::CLPadLayer()
- : _copy_kernel(), _mode(), _padding(), _memset_kernel(), _num_dimensions(0), _slice_functions(nullptr), _concat_functions(nullptr), _slice_results(nullptr), _concat_results(nullptr)
+ : _copy_kernel(), _mode(), _padding(), _memset_kernel(), _num_dimensions(0), _slice_functions(), _concat_functions(), _slice_results(), _concat_results()
{
}
@@ -67,11 +67,16 @@ void CLPadLayer::configure_reflect_symmetric_mode(ICLTensor *input, ICLTensor *o
// Two strided slice functions will be required for each dimension padded as well as a
// concatenate function and the tensors to hold the temporary results.
- _slice_functions = arm_compute::support::cpp14::make_unique<CLStridedSlice[]>(2 * _num_dimensions);
- _slice_results = arm_compute::support::cpp14::make_unique<CLTensor[]>(2 * _num_dimensions);
- _concat_functions = arm_compute::support::cpp14::make_unique<CLConcatenateLayer[]>(_num_dimensions);
- _concat_results = arm_compute::support::cpp14::make_unique<CLTensor[]>(_num_dimensions - 1);
- Coordinates starts_before, ends_before, starts_after, ends_after, strides;
+ _slice_functions.resize(2 * _num_dimensions);
+ _slice_results.resize(2 * _num_dimensions);
+ _concat_functions.resize(_num_dimensions);
+ _concat_results.resize(_num_dimensions - 1);
+
+ Coordinates starts_before{};
+ Coordinates ends_before{};
+ Coordinates starts_after{};
+ Coordinates ends_after{};
+ Coordinates strides{};
ICLTensor *prev = input;
for(uint32_t i = 0; i < _num_dimensions; ++i)
{
diff --git a/src/runtime/CL/functions/CLReduceMean.cpp b/src/runtime/CL/functions/CLReduceMean.cpp
index 702ce34a4..15091f906 100644
--- a/src/runtime/CL/functions/CLReduceMean.cpp
+++ b/src/runtime/CL/functions/CLReduceMean.cpp
@@ -40,10 +40,10 @@ void CLReduceMean::configure(ICLTensor *input, const Coordinates &reduction_axis
{
ARM_COMPUTE_ERROR_ON_NULLPTR(input);
- _reduction_ops = reduction_axis.num_dimensions();
- _reduction_kernels = arm_compute::support::cpp14::make_unique<CLReductionOperation[]>(_reduction_ops);
- _reduced_outs = arm_compute::support::cpp14::make_unique<CLTensor[]>(_reduction_ops - (keep_dims ? 1 : 0));
- _keep_dims = keep_dims;
+ _reduction_ops = reduction_axis.num_dimensions();
+ _reduction_kernels.resize(_reduction_ops);
+ _reduced_outs.resize(_reduction_ops - (keep_dims ? 1 : 0));
+ _keep_dims = keep_dims;
Coordinates axis_local = reduction_axis;
const int input_dims = input->info()->num_dimensions();
@@ -57,9 +57,9 @@ void CLReduceMean::configure(ICLTensor *input, const Coordinates &reduction_axis
// Perform reduction for every axis
for(unsigned int i = 0; i < _reduction_ops; ++i)
{
- TensorShape out_shape = i == 0 ? input->info()->tensor_shape() : (_reduced_outs.get() + i - 1)->info()->tensor_shape();
+ TensorShape out_shape = i == 0 ? input->info()->tensor_shape() : (&_reduced_outs[i - 1])->info()->tensor_shape();
out_shape.set(axis_local[i], 1);
- auto in = (i == 0) ? input : (_reduced_outs.get() + i - 1);
+ auto in = (i == 0) ? input : (&_reduced_outs[i - 1]);
if(i == _reduction_ops - 1 && keep_dims)
{
@@ -68,8 +68,8 @@ void CLReduceMean::configure(ICLTensor *input, const Coordinates &reduction_axis
else
{
_reduced_outs[i].allocator()->init(TensorInfo(out_shape, input->info()->num_channels(), input->info()->data_type(), input->info()->quantization_info()));
- _memory_group.manage(_reduced_outs.get() + i);
- _reduction_kernels[i].configure(in, _reduced_outs.get() + i, axis_local[i], ReductionOperation::MEAN_SUM);
+ _memory_group.manage(&_reduced_outs[i]);
+ _reduction_kernels[i].configure(in, &_reduced_outs[i], axis_local[i], ReductionOperation::MEAN_SUM);
}
}
@@ -92,7 +92,7 @@ void CLReduceMean::configure(ICLTensor *input, const Coordinates &reduction_axis
out_shape.remove_dimension(axis_local[i] - i);
}
auto_init_if_empty(*output->info(), input->info()->clone()->set_tensor_shape(out_shape));
- _reshape.configure(_reduced_outs.get() + _reduction_ops - 1, output);
+ _reshape.configure(&_reduced_outs[_reduction_ops - 1], output);
}
}
diff --git a/src/runtime/CL/functions/CLReductionOperation.cpp b/src/runtime/CL/functions/CLReductionOperation.cpp
index bb285d7cc..9f99d2db6 100644
--- a/src/runtime/CL/functions/CLReductionOperation.cpp
+++ b/src/runtime/CL/functions/CLReductionOperation.cpp
@@ -71,7 +71,7 @@ Status CLReductionOperation::validate(const ITensorInfo *input, const ITensorInf
else
{
// Create temporary tensor infos
- auto sums_vector = arm_compute::support::cpp14::make_unique<TensorInfo[]>(num_of_stages - 1);
+ std::vector<TensorInfo> sums_vector(num_of_stages - 1);
// Create intermediate tensor info
TensorShape shape{ input->tensor_shape() };
@@ -110,17 +110,17 @@ Status CLReductionOperation::validate(const ITensorInfo *input, const ITensorInf
}
// Validate ReductionOperation only on first kernel
- ARM_COMPUTE_RETURN_ON_ERROR(CLReductionOperationKernel::validate(input, sums_vector.get(), axis, first_kernel_op));
+ ARM_COMPUTE_RETURN_ON_ERROR(CLReductionOperationKernel::validate(input, &sums_vector[0], axis, first_kernel_op));
// Validate ReductionOperation on intermediate stages
for(unsigned int i = 1; i < num_of_stages - 1; ++i)
{
- ARM_COMPUTE_RETURN_ON_ERROR(CLReductionOperationKernel::validate(sums_vector.get() + i - 1, sums_vector.get() + i, axis, intermediate_kernel_op));
+ ARM_COMPUTE_RETURN_ON_ERROR(CLReductionOperationKernel::validate(&sums_vector[i - 1], &sums_vector[i], axis, intermediate_kernel_op));
}
// Validate ReductionOperation on the last stage
const unsigned int last_stage = num_of_stages - 1;
- ARM_COMPUTE_RETURN_ON_ERROR(CLReductionOperationKernel::validate(sums_vector.get() + last_stage - 1, output, axis, last_kernel_op, input->dimension(0)));
+ ARM_COMPUTE_RETURN_ON_ERROR(CLReductionOperationKernel::validate(&sums_vector[last_stage - 1], output, axis, last_kernel_op, input->dimension(0)));
}
return Status{};
@@ -133,7 +133,7 @@ void CLReductionOperation::configure(ICLTensor *input, ICLTensor *output, unsign
_is_serial = is_data_type_quantized(input->info()->data_type()) || axis != 0;
// Configure reduction operation kernels
- _reduction_kernels_vector = arm_compute::support::cpp14::make_unique<CLReductionOperationKernel[]>(_num_of_stages);
+ _reduction_kernels_vector.resize(_num_of_stages);
// Create temporary tensors
if(_is_serial)
@@ -142,8 +142,8 @@ void CLReductionOperation::configure(ICLTensor *input, ICLTensor *output, unsign
}
else
{
- _border_handlers_vector = arm_compute::support::cpp14::make_unique<CLFillBorderKernel[]>(_num_of_stages);
- _results_vector = arm_compute::support::cpp14::make_unique<CLTensor[]>(_num_of_stages - 1);
+ _border_handlers_vector.resize(_num_of_stages);
+ _results_vector.resize(_num_of_stages - 1);
TensorShape shape{ input->info()->tensor_shape() };
for(unsigned int i = 0; i < _num_of_stages - 1; i++)
{
@@ -152,7 +152,7 @@ void CLReductionOperation::configure(ICLTensor *input, ICLTensor *output, unsign
}
// Apply ReductionOperation only on first kernel
- _memory_group.manage(_results_vector.get());
+ _memory_group.manage(&_results_vector[0]);
ReductionOperation first_kernel_op;
ReductionOperation intermediate_kernel_op;
@@ -183,23 +183,23 @@ void CLReductionOperation::configure(ICLTensor *input, ICLTensor *output, unsign
ARM_COMPUTE_ERROR("Not supported");
}
- _reduction_kernels_vector[0].configure(input, _results_vector.get(), axis, first_kernel_op);
+ _reduction_kernels_vector[0].configure(input, &_results_vector[0], axis, first_kernel_op);
_border_handlers_vector[0].configure(input, _reduction_kernels_vector[0].border_size(), BorderMode::CONSTANT, pixelValue);
// Apply ReductionOperation on intermediate stages
for(unsigned int i = 1; i < _num_of_stages - 1; ++i)
{
- _memory_group.manage(_results_vector.get() + i);
- _reduction_kernels_vector[i].configure(_results_vector.get() + i - 1, _results_vector.get() + i, axis, intermediate_kernel_op);
- _border_handlers_vector[i].configure(_results_vector.get() + i - 1, _reduction_kernels_vector[i].border_size(), BorderMode::CONSTANT, pixelValue);
+ _memory_group.manage(&_results_vector[i]);
+ _reduction_kernels_vector[i].configure(&_results_vector[i - 1], &_results_vector[i], axis, intermediate_kernel_op);
+ _border_handlers_vector[i].configure(&_results_vector[i - 1], _reduction_kernels_vector[i].border_size(), BorderMode::CONSTANT, pixelValue);
_results_vector[i - 1].allocator()->allocate();
}
// Apply ReductionOperation on the last stage
const unsigned int last_stage = _num_of_stages - 1;
const unsigned int input_width = input->info()->dimension(0);
- _reduction_kernels_vector[last_stage].configure(_results_vector.get() + last_stage - 1, output, axis, last_kernel_op, input_width);
- _border_handlers_vector[last_stage].configure(_results_vector.get() + last_stage - 1, _reduction_kernels_vector[last_stage].border_size(), BorderMode::CONSTANT, pixelValue);
+ _reduction_kernels_vector[last_stage].configure(&_results_vector[last_stage - 1], output, axis, last_kernel_op, input_width);
+ _border_handlers_vector[last_stage].configure(&_results_vector[last_stage - 1], _reduction_kernels_vector[last_stage].border_size(), BorderMode::CONSTANT, pixelValue);
_results_vector[last_stage - 1].allocator()->allocate();
}
}
diff --git a/src/runtime/CL/functions/CLSplit.cpp b/src/runtime/CL/functions/CLSplit.cpp
index f0843517e..8d37d538c 100644
--- a/src/runtime/CL/functions/CLSplit.cpp
+++ b/src/runtime/CL/functions/CLSplit.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -42,8 +42,8 @@ CLSplit::CLSplit()
void CLSplit::configure(const ICLTensor *input, const std::vector<ICLTensor *> &outputs, unsigned int axis)
{
// Create Slice functions
- _num_outputs = outputs.size();
- _slice_functions = arm_compute::support::cpp14::make_unique<CLSlice[]>(_num_outputs);
+ _num_outputs = outputs.size();
+ _slice_functions.resize(_num_outputs);
// Get output shape
const TensorShape output_shape = arm_compute::misc::shape_calculator::compute_split_shape(input->info(), axis, _num_outputs);
diff --git a/src/runtime/CL/functions/CLStackLayer.cpp b/src/runtime/CL/functions/CLStackLayer.cpp
index 71327fead..2700b4927 100644
--- a/src/runtime/CL/functions/CLStackLayer.cpp
+++ b/src/runtime/CL/functions/CLStackLayer.cpp
@@ -46,8 +46,8 @@ CLStackLayer::CLStackLayer() // NOLINT
void CLStackLayer::configure(const std::vector<ICLTensor *> &input, int axis, ICLTensor *output)
{
- _num_inputs = input.size();
- _stack_kernels = arm_compute::support::cpp14::make_unique<CLStackLayerKernel[]>(_num_inputs);
+ _num_inputs = input.size();
+ _stack_kernels.resize(_num_inputs);
// Wrap around negative values
const unsigned int axis_u = wrap_around(axis, static_cast<int>(input[0]->info()->num_dimensions() + 1));
diff --git a/src/runtime/CL/functions/CLUnstack.cpp b/src/runtime/CL/functions/CLUnstack.cpp
index 428d09148..eb1dd8cd4 100644
--- a/src/runtime/CL/functions/CLUnstack.cpp
+++ b/src/runtime/CL/functions/CLUnstack.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -74,7 +74,7 @@ void CLUnstack::configure(const ICLTensor *input, const std::vector<ICLTensor *>
// Wrap around negative values
const unsigned int axis_u = wrap_axis(axis, input->info());
_num_slices = std::min(outputs_vector_info.size(), input->info()->dimension(axis_u));
- _strided_slice_vector = arm_compute::support::cpp14::make_unique<CLStridedSlice[]>(_num_slices);
+ _strided_slice_vector.resize(_num_slices);
Coordinates slice_start;
int32_t slice_end_mask;
diff --git a/src/runtime/CL/functions/CLWidthConcatenateLayer.cpp b/src/runtime/CL/functions/CLWidthConcatenateLayer.cpp
index 6e42377a0..a8667c313 100644
--- a/src/runtime/CL/functions/CLWidthConcatenateLayer.cpp
+++ b/src/runtime/CL/functions/CLWidthConcatenateLayer.cpp
@@ -109,7 +109,7 @@ void CLWidthConcatenateLayer::configure(std::vector<ICLTensor *> inputs_vector,
break;
default:
// Configure generic case WidthConcatenate kernels
- _concat_kernels_vector = arm_compute::support::cpp14::make_unique<CLWidthConcatenateLayerKernel[]>(_num_inputs);
+ _concat_kernels_vector.resize(_num_inputs);
unsigned int width_offset = 0;
for(unsigned int i = 0; i < _num_inputs; ++i)
diff --git a/src/runtime/CL/tuners/CLLWSList.cpp b/src/runtime/CL/tuners/CLLWSList.cpp
index 97134b1b2..6eb251420 100644
--- a/src/runtime/CL/tuners/CLLWSList.cpp
+++ b/src/runtime/CL/tuners/CLLWSList.cpp
@@ -36,7 +36,7 @@ cl::NDRange CLLWSListExhaustive::operator[](size_t index)
{
ARM_COMPUTE_ERROR_ON(index >= size());
auto coords = index2coords(search_space_shape, index);
- return cl::NDRange(coords[0] + 1, coords[1] + 1, coords[2] + 1);
+ return cl::NDRange{ coords[0] + 1U, coords[1] + 1U, coords[2] + 1U };
}
CLLWSListExhaustive::CLLWSListExhaustive(const cl::NDRange &gws)
@@ -49,7 +49,7 @@ cl::NDRange CLLWSListNormal::operator[](size_t index)
{
ARM_COMPUTE_ERROR_ON(index >= size());
auto coords = index2coords(search_space_shape, index);
- return cl::NDRange(_lws_x[coords[0]], _lws_y[coords[1]], _lws_z[coords[2]]);
+ return cl::NDRange{ _lws_x[coords[0]], _lws_y[coords[1]], _lws_z[coords[2]] };
}
CLLWSListNormal::CLLWSListNormal(const cl::NDRange &gws)
diff --git a/src/runtime/CPP/functions/CPPDetectionOutputLayer.cpp b/src/runtime/CPP/functions/CPPDetectionOutputLayer.cpp
index 79e619cfd..9a141cb73 100644
--- a/src/runtime/CPP/functions/CPPDetectionOutputLayer.cpp
+++ b/src/runtime/CPP/functions/CPPDetectionOutputLayer.cpp
@@ -600,7 +600,7 @@ void CPPDetectionOutputLayer::run()
if(_info.keep_top_k() > -1 && num_det > _info.keep_top_k())
{
std::vector<std::pair<float, std::pair<int, int>>> score_index_pairs;
- for(auto it : indices)
+ for(auto const &it : indices)
{
const int label = it.first;
const std::vector<int> &label_indices = it.second;
@@ -614,7 +614,7 @@ void CPPDetectionOutputLayer::run()
for(auto idx : label_indices)
{
ARM_COMPUTE_ERROR_ON(idx > static_cast<int>(scores.size()));
- score_index_pairs.push_back(std::make_pair(scores[idx], std::make_pair(label, idx)));
+ score_index_pairs.emplace_back(std::make_pair(scores[idx], std::make_pair(label, idx)));
}
}
diff --git a/src/runtime/CPUUtils.cpp b/src/runtime/CPUUtils.cpp
index f3355a740..f7240db99 100644
--- a/src/runtime/CPUUtils.cpp
+++ b/src/runtime/CPUUtils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -54,16 +54,16 @@
/* Make sure the bits we care about are defined, just in case asm/hwcap.h is
* out of date (or for bare metal mode) */
#ifndef HWCAP_ASIMDHP
-#define HWCAP_ASIMDHP (1 << 10)
-#endif /* HWCAP_ASIMDHP */
+#define HWCAP_ASIMDHP (1 << 10) // NOLINT
+#endif /* HWCAP_ASIMDHP */
#ifndef HWCAP_CPUID
-#define HWCAP_CPUID (1 << 11)
-#endif /* HWCAP_CPUID */
+#define HWCAP_CPUID (1 << 11) // NOLINT
+#endif /* HWCAP_CPUID */
#ifndef HWCAP_ASIMDDP
-#define HWCAP_ASIMDDP (1 << 20)
-#endif /* HWCAP_ASIMDDP */
+#define HWCAP_ASIMDDP (1 << 20) // NOLINT
+#endif /* HWCAP_ASIMDDP */
namespace
{
@@ -146,12 +146,12 @@ CPUModel midr_to_model(const unsigned int midr)
break;
}
}
- else if(implementer == 0x48) // HiSilicon CPUs
+ else if(implementer == 0x48)
{
// Only CPUs we have code paths for are detected. All other CPUs can be safely classed as "GENERIC"
switch(cpunum)
{
- case 0xd40: // A76 (Kirin 980)
+ case 0xd40: // A76
model = CPUModel::GENERIC_FP16_DOT;
break;
default:
@@ -220,8 +220,8 @@ void populate_models_cpuinfo(std::vector<CPUModel> &cpusv)
while(bool(getline(file, line)))
{
- regmatch_t match[2];
- ret_status = regexec(&proc_regex, line.c_str(), 2, match, 0);
+ std::array<regmatch_t, 2> match;
+ ret_status = regexec(&proc_regex, line.c_str(), 2, match.data(), 0);
if(ret_status == 0)
{
std::string id = line.substr(match[1].rm_so, (match[1].rm_eo - match[1].rm_so));
@@ -244,7 +244,7 @@ void populate_models_cpuinfo(std::vector<CPUModel> &cpusv)
continue;
}
- ret_status = regexec(&imp_regex, line.c_str(), 2, match, 0);
+ ret_status = regexec(&imp_regex, line.c_str(), 2, match.data(), 0);
if(ret_status == 0)
{
std::string subexp = line.substr(match[1].rm_so, (match[1].rm_eo - match[1].rm_so));
@@ -254,7 +254,7 @@ void populate_models_cpuinfo(std::vector<CPUModel> &cpusv)
continue;
}
- ret_status = regexec(&var_regex, line.c_str(), 2, match, 0);
+ ret_status = regexec(&var_regex, line.c_str(), 2, match.data(), 0);
if(ret_status == 0)
{
std::string subexp = line.substr(match[1].rm_so, (match[1].rm_eo - match[1].rm_so));
@@ -264,7 +264,7 @@ void populate_models_cpuinfo(std::vector<CPUModel> &cpusv)
continue;
}
- ret_status = regexec(&part_regex, line.c_str(), 2, match, 0);
+ ret_status = regexec(&part_regex, line.c_str(), 2, match.data(), 0);
if(ret_status == 0)
{
std::string subexp = line.substr(match[1].rm_so, (match[1].rm_eo - match[1].rm_so));
@@ -274,7 +274,7 @@ void populate_models_cpuinfo(std::vector<CPUModel> &cpusv)
continue;
}
- ret_status = regexec(&rev_regex, line.c_str(), 2, match, 0);
+ ret_status = regexec(&rev_regex, line.c_str(), 2, match.data(), 0);
if(ret_status == 0)
{
std::string subexp = line.substr(match[1].rm_so, (match[1].rm_eo - match[1].rm_so));
@@ -302,8 +302,7 @@ void populate_models_cpuinfo(std::vector<CPUModel> &cpusv)
int get_max_cpus()
{
- int max_cpus = 1;
-#if !defined(BARE_METAL) && (defined(__arm__) || defined(__aarch64__))
+ int max_cpus = 1;
std::ifstream CPUspresent;
CPUspresent.open("/sys/devices/system/cpu/present", std::ios::in);
bool success = false;
@@ -341,7 +340,6 @@ int get_max_cpus()
{
max_cpus = std::thread::hardware_concurrency();
}
-#endif /* BARE_METAL */
return max_cpus;
}
#endif /* !defined(BARE_METAL) && (defined(__arm__) || defined(__aarch64__)) */
@@ -427,8 +425,8 @@ unsigned int get_threads_hint()
std::string line;
while(bool(getline(cpuinfo, line)))
{
- regmatch_t match[2];
- ret_status = regexec(&cpu_part_rgx, line.c_str(), 2, match, 0);
+ std::array<regmatch_t, 2> match;
+ ret_status = regexec(&cpu_part_rgx, line.c_str(), 2, match.data(), 0);
if(ret_status == 0)
{
std::string cpu_part = line.substr(match[1].rm_so, (match[1].rm_eo - match[1].rm_so));
diff --git a/src/runtime/Distribution1D.cpp b/src/runtime/Distribution1D.cpp
index 3431834c4..9e6fce4e0 100644
--- a/src/runtime/Distribution1D.cpp
+++ b/src/runtime/Distribution1D.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -31,12 +31,11 @@
using namespace arm_compute;
Distribution1D::Distribution1D(size_t num_bins, int32_t offset, uint32_t range)
- : IDistribution1D(num_bins, offset, range), _data(arm_compute::support::cpp14::make_unique<uint32_t[]>(num_bins))
+ : IDistribution1D(num_bins, offset, range), _data(num_bins)
{
}
uint32_t *Distribution1D::buffer() const
{
- ARM_COMPUTE_ERROR_ON(nullptr == _data);
- return _data.get();
+ return _data.data();
}
diff --git a/src/runtime/GLES_COMPUTE/GCMemory.cpp b/src/runtime/GLES_COMPUTE/GCMemory.cpp
index fed4a158a..f1457c4d6 100644
--- a/src/runtime/GLES_COMPUTE/GCMemory.cpp
+++ b/src/runtime/GLES_COMPUTE/GCMemory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -33,8 +33,8 @@ GCMemory::GCMemory()
{
}
-GCMemory::GCMemory(std::shared_ptr<IGCMemoryRegion> memory)
- : _region(nullptr), _region_owned(std::move(memory))
+GCMemory::GCMemory(const std::shared_ptr<IGCMemoryRegion> &memory)
+ : _region(nullptr), _region_owned(memory)
{
_region_owned = memory;
_region = _region_owned.get();
diff --git a/src/runtime/GLES_COMPUTE/GCScheduler.cpp b/src/runtime/GLES_COMPUTE/GCScheduler.cpp
index f7812730f..6a39e7c36 100644
--- a/src/runtime/GLES_COMPUTE/GCScheduler.cpp
+++ b/src/runtime/GLES_COMPUTE/GCScheduler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -97,7 +97,7 @@ void GCScheduler::setup_context()
ARM_COMPUTE_ERROR_ON_MSG((strstr(egl_extension_st, "EGL_KHR_surfaceless_context") == nullptr), "Failed to query EGL_KHR_surfaceless_context");
ARM_COMPUTE_UNUSED(egl_extension_st);
- const EGLint config_attribs[] =
+ const std::array<EGLint, 3> config_attribs =
{
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT_KHR,
EGL_NONE
@@ -105,7 +105,7 @@ void GCScheduler::setup_context()
EGLConfig cfg;
EGLint count;
- res = eglChooseConfig(_display, config_attribs, &cfg, 1, &count);
+ res = eglChooseConfig(_display, config_attribs.data(), &cfg, 1, &count);
ARM_COMPUTE_ERROR_ON_MSG(res == EGL_FALSE, "Failed to choose config: 0x%x.", eglGetError());
ARM_COMPUTE_UNUSED(res);
@@ -114,7 +114,7 @@ void GCScheduler::setup_context()
ARM_COMPUTE_ERROR_ON_MSG(res == EGL_FALSE, "Failed to bind api: 0x%x.", eglGetError());
- const EGLint attribs[] =
+ const std::array<EGLint, 3> attribs =
{
EGL_CONTEXT_CLIENT_VERSION, 3,
EGL_NONE
@@ -122,7 +122,7 @@ void GCScheduler::setup_context()
_context = eglCreateContext(_display,
cfg,
EGL_NO_CONTEXT,
- attribs);
+ attribs.data());
ARM_COMPUTE_ERROR_ON_MSG(_context == EGL_NO_CONTEXT, "Failed to create context: 0x%x.", eglGetError());
ARM_COMPUTE_UNUSED(res);
diff --git a/src/runtime/HOG.cpp b/src/runtime/HOG.cpp
index 01640bb0a..e9f38c4d2 100644
--- a/src/runtime/HOG.cpp
+++ b/src/runtime/HOG.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -29,20 +29,19 @@
using namespace arm_compute;
HOG::HOG()
- : IHOG(), _info(), _descriptor(nullptr)
+ : IHOG(), _info(), _descriptor()
{
}
void HOG::init(const HOGInfo &input)
{
- ARM_COMPUTE_ERROR_ON(nullptr != _descriptor);
- _info = input;
- _descriptor = arm_compute::support::cpp14::make_unique<float[]>(_info.descriptor_size());
+ _info = input;
+ _descriptor.resize(_info.descriptor_size());
}
float *HOG::descriptor() const
{
- return _descriptor.get();
+ return _descriptor.data();
}
const HOGInfo *HOG::info() const
diff --git a/src/runtime/LutAllocator.cpp b/src/runtime/LutAllocator.cpp
index eb9051cc0..0db5217c9 100644
--- a/src/runtime/LutAllocator.cpp
+++ b/src/runtime/LutAllocator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -28,23 +28,23 @@
using namespace arm_compute;
LutAllocator::LutAllocator()
- : _buffer(nullptr)
+ : _buffer()
{
}
uint8_t *LutAllocator::data() const
{
- return _buffer.get();
+ return _buffer.data();
}
void LutAllocator::allocate()
{
- _buffer = arm_compute::support::cpp14::make_unique<uint8_t[]>(size());
+ _buffer.resize(size());
}
uint8_t *LutAllocator::lock()
{
- return _buffer.get();
+ return _buffer.data();
}
void LutAllocator::unlock()
diff --git a/src/runtime/Memory.cpp b/src/runtime/Memory.cpp
index d11662467..c6b956d92 100644
--- a/src/runtime/Memory.cpp
+++ b/src/runtime/Memory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -32,8 +32,8 @@ Memory::Memory()
{
}
-Memory::Memory(std::shared_ptr<IMemoryRegion> memory)
- : _region(nullptr), _region_owned(std::move(memory))
+Memory::Memory(const std::shared_ptr<IMemoryRegion> &memory)
+ : _region(nullptr), _region_owned(memory)
{
_region_owned = memory;
_region = _region_owned.get();
diff --git a/src/runtime/MultiHOG.cpp b/src/runtime/MultiHOG.cpp
index e0b60b113..154bbd7ac 100644
--- a/src/runtime/MultiHOG.cpp
+++ b/src/runtime/MultiHOG.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -30,8 +30,9 @@
using namespace arm_compute;
MultiHOG::MultiHOG(size_t num_models)
- : _num_models(num_models), _model(arm_compute::support::cpp14::make_unique<HOG[]>(_num_models))
+ : _num_models(num_models), _model()
{
+ _model.resize(_num_models);
}
size_t MultiHOG::num_models() const
@@ -42,11 +43,11 @@ size_t MultiHOG::num_models() const
IHOG *MultiHOG::model(size_t index)
{
ARM_COMPUTE_ERROR_ON(index >= _num_models);
- return (_model.get() + index);
+ return (&_model[index]);
}
const IHOG *MultiHOG::model(size_t index) const
{
ARM_COMPUTE_ERROR_ON(index >= _num_models);
- return (_model.get() + index);
+ return (&_model[index]);
}
diff --git a/src/runtime/NEON/functions/NEConcatenateLayer.cpp b/src/runtime/NEON/functions/NEConcatenateLayer.cpp
index b8cfa2b8f..71af560fb 100644
--- a/src/runtime/NEON/functions/NEConcatenateLayer.cpp
+++ b/src/runtime/NEON/functions/NEConcatenateLayer.cpp
@@ -51,6 +51,7 @@ void NEConcatenateLayer::configure(const std::vector<ITensor *> &inputs_vector,
_num_inputs = inputs_vector.size();
std::vector<ITensorInfo *> inputs_vector_info;
+ inputs_vector_info.reserve(_num_inputs);
for(unsigned int i = 0; i < _num_inputs; ++i)
{
ARM_COMPUTE_ERROR_ON_NULLPTR(inputs_vector.at(i));
diff --git a/src/runtime/NEON/functions/NEGEMMAssemblyDispatch.cpp b/src/runtime/NEON/functions/NEGEMMAssemblyDispatch.cpp
index fe1f2da45..55e067f52 100644
--- a/src/runtime/NEON/functions/NEGEMMAssemblyDispatch.cpp
+++ b/src/runtime/NEON/functions/NEGEMMAssemblyDispatch.cpp
@@ -35,7 +35,7 @@ namespace arm_compute
{
namespace
{
-std::unique_ptr<IFunction> create_function_all_types(arm_gemm::KernelDescription gemm_kernel_info,
+std::unique_ptr<IFunction> create_function_all_types(const arm_gemm::KernelDescription &gemm_kernel_info,
const ITensor *a, const ITensor *b, ITensor *d, float alpha, float beta, bool pretranspose_hint,
std::shared_ptr<IMemoryManager> memory_manager)
diff --git a/src/runtime/NEON/functions/NEHarrisCorners.cpp b/src/runtime/NEON/functions/NEHarrisCorners.cpp
index 15cecc25a..3eadbee45 100644
--- a/src/runtime/NEON/functions/NEHarrisCorners.cpp
+++ b/src/runtime/NEON/functions/NEHarrisCorners.cpp
@@ -90,7 +90,7 @@ 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::support::cpp14::make_unique<InternalKeypoint[]>(shape.x() * shape.y());
+ _corners_list.resize(shape.x() * shape.y());
// Set/init Sobel kernel accordingly with gradient_size
switch(gradient_size)
@@ -171,13 +171,13 @@ void NEHarrisCorners::configure(IImage *input, float threshold, float min_dist,
_score.allocator()->allocate();
// Init corner candidates kernel
- _candidates.configure(&_nonmax, _corners_list.get(), &_num_corner_candidates);
+ _candidates.configure(&_nonmax, _corners_list.data(), &_num_corner_candidates);
// Allocate once all the configure methods have been called
_nonmax.allocator()->allocate();
// Init euclidean distance
- _sort_euclidean.configure(_corners_list.get(), corners, &_num_corner_candidates, min_dist);
+ _sort_euclidean.configure(_corners_list.data(), corners, &_num_corner_candidates, min_dist);
}
void NEHarrisCorners::run()
diff --git a/src/runtime/NEON/functions/NEHistogram.cpp b/src/runtime/NEON/functions/NEHistogram.cpp
index f333ecb1f..d56bd7cb1 100644
--- a/src/runtime/NEON/functions/NEHistogram.cpp
+++ b/src/runtime/NEON/functions/NEHistogram.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -34,7 +34,7 @@
using namespace arm_compute;
NEHistogram::NEHistogram()
- : _histogram_kernel(), _local_hist(), _window_lut(arm_compute::support::cpp14::make_unique<uint32_t[]>(window_lut_default_size)), _local_hist_size(0)
+ : _histogram_kernel(), _local_hist(), _window_lut(window_lut_default_size), _local_hist_size(0)
{
}
@@ -45,10 +45,10 @@ 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::support::cpp14::make_unique<uint32_t[]>(_local_hist_size);
+ _local_hist.resize(_local_hist_size);
// Configure kernel
- _histogram_kernel.configure(input, output, _local_hist.get(), _window_lut.get());
+ _histogram_kernel.configure(input, output, _local_hist.data(), _window_lut.data());
}
void NEHistogram::run()
diff --git a/src/runtime/NEON/functions/NELaplacianPyramid.cpp b/src/runtime/NEON/functions/NELaplacianPyramid.cpp
index 0e149d417..5174a1357 100644
--- a/src/runtime/NEON/functions/NELaplacianPyramid.cpp
+++ b/src/runtime/NEON/functions/NELaplacianPyramid.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -92,8 +92,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::support::cpp14::make_unique<NEGaussian5x5[]>(_num_levels);
- _subf = arm_compute::support::cpp14::make_unique<NEArithmeticSubtraction[]>(_num_levels);
+ _convf.resize(_num_levels);
+ _subf.resize(_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 9ad9689b1..b2d889b07 100644
--- a/src/runtime/NEON/functions/NELaplacianReconstruct.cpp
+++ b/src/runtime/NEON/functions/NELaplacianReconstruct.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -64,8 +64,8 @@ void NELaplacianReconstruct::configure(const IPyramid *pyramid, ITensor *input,
_tmp_pyr.init(pyramid_info);
// Allocate add and scale functions. Level 0 does not need to be scaled.
- _addf = arm_compute::support::cpp14::make_unique<NEArithmeticAddition[]>(num_levels);
- _scalef = arm_compute::support::cpp14::make_unique<NEScale[]>(num_levels - 1);
+ _addf.resize(num_levels);
+ _scalef.resize(num_levels - 1);
const size_t last_level = num_levels - 1;
@@ -86,7 +86,7 @@ void NELaplacianReconstruct::configure(const IPyramid *pyramid, ITensor *input,
void NELaplacianReconstruct::run()
{
- ARM_COMPUTE_ERROR_ON_MSG(_addf == nullptr, "Unconfigured function");
+ ARM_COMPUTE_ERROR_ON_MSG(_addf.empty(), "Unconfigured function");
const size_t last_level = _tmp_pyr.info()->num_levels() - 1;
diff --git a/src/runtime/NEON/functions/NEPadLayer.cpp b/src/runtime/NEON/functions/NEPadLayer.cpp
index 6af2ee886..c608edfde 100644
--- a/src/runtime/NEON/functions/NEPadLayer.cpp
+++ b/src/runtime/NEON/functions/NEPadLayer.cpp
@@ -76,8 +76,7 @@ uint32_t last_padding_dimension(const PaddingList &padding)
} // namespace
NEPadLayer::NEPadLayer()
- : _copy_kernel(), _mode(), _padding(), _memset_kernel(), _num_dimensions(0), _slice_functions(nullptr), _concat_functions(nullptr), _slice_results(nullptr), _concat_results(nullptr),
- _output_subtensor()
+ : _copy_kernel(), _mode(), _padding(), _memset_kernel(), _num_dimensions(0), _slice_functions(), _concat_functions(), _slice_results(), _concat_results(), _output_subtensor()
{
}
@@ -108,11 +107,16 @@ void NEPadLayer::configure_reflect_symmetric_mode(ITensor *input, ITensor *outpu
// Two strided slice functions will be required for each dimension padded as well as a
// concatenate function and the tensors to hold the temporary results.
- _slice_functions = arm_compute::support::cpp14::make_unique<NEStridedSlice[]>(2 * _num_dimensions);
- _slice_results = arm_compute::support::cpp14::make_unique<Tensor[]>(2 * _num_dimensions);
- _concat_functions = arm_compute::support::cpp14::make_unique<NEConcatenateLayer[]>(_num_dimensions);
- _concat_results = arm_compute::support::cpp14::make_unique<Tensor[]>(_num_dimensions - 1);
- Coordinates starts_before, ends_before, starts_after, ends_after, strides;
+ _slice_functions.resize(2 * _num_dimensions);
+ _slice_results.resize(2 * _num_dimensions);
+ _concat_functions.resize(_num_dimensions);
+ _concat_results.resize(_num_dimensions - 1);
+
+ Coordinates starts_before{};
+ Coordinates ends_before{};
+ Coordinates starts_after{};
+ Coordinates ends_after{};
+ Coordinates strides{};
ITensor *prev = input;
for(uint32_t i = 0; i < _num_dimensions; ++i)
{
@@ -158,7 +162,7 @@ void NEPadLayer::configure_reflect_symmetric_mode(ITensor *input, ITensor *outpu
if(i < prev->info()->num_dimensions())
{
_slice_functions[2 * i].configure(prev, &_slice_results[2 * i], starts_before, ends_before, strides, begin_mask_before, end_mask_before);
- concat_vector.push_back(&_slice_results[2 * i]);
+ concat_vector.emplace_back(&_slice_results[2 * i]);
}
else
{
@@ -172,7 +176,7 @@ void NEPadLayer::configure_reflect_symmetric_mode(ITensor *input, ITensor *outpu
if(i < prev->info()->num_dimensions())
{
_slice_functions[2 * i + 1].configure(prev, &_slice_results[2 * i + 1], starts_after, ends_after, strides, begin_mask_after, end_mask_after);
- concat_vector.push_back(&_slice_results[2 * i + 1]);
+ concat_vector.emplace_back(&_slice_results[2 * i + 1]);
}
else
{
diff --git a/src/runtime/NEON/functions/NEReduceMean.cpp b/src/runtime/NEON/functions/NEReduceMean.cpp
index 98d3ab943..38adaa2a9 100644
--- a/src/runtime/NEON/functions/NEReduceMean.cpp
+++ b/src/runtime/NEON/functions/NEReduceMean.cpp
@@ -78,10 +78,10 @@ void NEReduceMean::configure(ITensor *input, const Coordinates &reduction_axis,
{
ARM_COMPUTE_ERROR_ON_NULLPTR(input);
- _reduction_ops = reduction_axis.num_dimensions();
- _reduction_kernels = arm_compute::support::cpp14::make_unique<NEReductionOperation[]>(_reduction_ops);
- _reduced_outs = arm_compute::support::cpp14::make_unique<Tensor[]>(_reduction_ops - (keep_dims ? 1 : 0));
- _keep_dims = keep_dims;
+ _reduction_ops = reduction_axis.num_dimensions();
+ _reduction_kernels.resize(_reduction_ops);
+ _reduced_outs.resize(_reduction_ops - (keep_dims ? 1 : 0));
+ _keep_dims = keep_dims;
Coordinates axis_local = reduction_axis;
const int input_dims = input->info()->num_dimensions();
@@ -96,9 +96,9 @@ void NEReduceMean::configure(ITensor *input, const Coordinates &reduction_axis,
// Perform reduction for every axis
for(unsigned int i = 0; i < _reduction_ops; ++i)
{
- TensorShape out_shape = i == 0 ? input->info()->tensor_shape() : (_reduced_outs.get() + i - 1)->info()->tensor_shape();
+ TensorShape out_shape = i == 0 ? input->info()->tensor_shape() : (&_reduced_outs[i - 1])->info()->tensor_shape();
out_shape.set(axis_local[i], 1);
- auto in = (i == 0) ? input : (_reduced_outs.get() + i - 1);
+ auto in = (i == 0) ? input : (&_reduced_outs[i - 1]);
if(i == _reduction_ops - 1 && keep_dims)
{
@@ -107,8 +107,8 @@ void NEReduceMean::configure(ITensor *input, const Coordinates &reduction_axis,
else
{
_reduced_outs[i].allocator()->init(TensorInfo(out_shape, input->info()->num_channels(), input->info()->data_type(), input->info()->quantization_info()));
- _memory_group.manage(_reduced_outs.get() + i);
- _reduction_kernels[i].configure(in, _reduced_outs.get() + i, axis_local[i], ReductionOperation::MEAN_SUM);
+ _memory_group.manage(&_reduced_outs[i]);
+ _reduction_kernels[i].configure(in, &_reduced_outs[i], axis_local[i], ReductionOperation::MEAN_SUM);
}
}
@@ -131,7 +131,7 @@ void NEReduceMean::configure(ITensor *input, const Coordinates &reduction_axis,
out_shape.remove_dimension(axis_local[i] - i);
}
auto_init_if_empty(*output->info(), input->info()->clone()->set_tensor_shape(out_shape));
- _reshape.configure(_reduced_outs.get() + _reduction_ops - 1, output);
+ _reshape.configure(&_reduced_outs[_reduction_ops - 1], output);
}
}
diff --git a/src/runtime/NEON/functions/NESplit.cpp b/src/runtime/NEON/functions/NESplit.cpp
index e94765793..0373ab6f8 100644
--- a/src/runtime/NEON/functions/NESplit.cpp
+++ b/src/runtime/NEON/functions/NESplit.cpp
@@ -42,8 +42,8 @@ NESplit::NESplit()
void NESplit::configure(const ITensor *input, const std::vector<ITensor *> &outputs, unsigned int axis)
{
// Create Slice functions
- _num_outputs = outputs.size();
- _slice_functions = arm_compute::support::cpp14::make_unique<NESlice[]>(_num_outputs);
+ _num_outputs = outputs.size();
+ _slice_functions.resize(_num_outputs);
// Get output shape
const TensorShape output_shape = arm_compute::misc::shape_calculator::compute_split_shape(input->info(), axis, _num_outputs);
diff --git a/src/runtime/NEON/functions/NEStackLayer.cpp b/src/runtime/NEON/functions/NEStackLayer.cpp
index 2f49c225a..32350b052 100644
--- a/src/runtime/NEON/functions/NEStackLayer.cpp
+++ b/src/runtime/NEON/functions/NEStackLayer.cpp
@@ -43,8 +43,8 @@ NEStackLayer::NEStackLayer() // NOLINT
void NEStackLayer::configure(const std::vector<ITensor *> &input, int axis, ITensor *output)
{
- _num_inputs = input.size();
- _stack_kernels = arm_compute::support::cpp14::make_unique<NEStackLayerKernel[]>(_num_inputs);
+ _num_inputs = input.size();
+ _stack_kernels.resize(_num_inputs);
// Wrap around negative values
const unsigned int axis_u = wrap_around(axis, static_cast<int>(input[0]->info()->num_dimensions() + 1));
diff --git a/src/runtime/NEON/functions/NEUnstack.cpp b/src/runtime/NEON/functions/NEUnstack.cpp
index 753202097..21f35f831 100644
--- a/src/runtime/NEON/functions/NEUnstack.cpp
+++ b/src/runtime/NEON/functions/NEUnstack.cpp
@@ -74,7 +74,7 @@ void NEUnstack::configure(const ITensor *input, const std::vector<ITensor *> &ou
// Wrap around negative values
const unsigned int axis_u = wrap_axis(axis, input->info());
_num_slices = std::min(outputs_vector_info.size(), input->info()->dimension(axis_u));
- _strided_slice_vector = arm_compute::support::cpp14::make_unique<NEStridedSlice[]>(_num_slices);
+ _strided_slice_vector.resize(_num_slices);
Coordinates slice_start;
int32_t slice_end_mask;
diff --git a/src/runtime/NEON/functions/NEWidthConcatenateLayer.cpp b/src/runtime/NEON/functions/NEWidthConcatenateLayer.cpp
index 9fce13cbd..25b521630 100644
--- a/src/runtime/NEON/functions/NEWidthConcatenateLayer.cpp
+++ b/src/runtime/NEON/functions/NEWidthConcatenateLayer.cpp
@@ -79,7 +79,7 @@ inline void NEWidthConcatenateLayer::configure_internal(std::vector<TensorType *
unsigned int width_offset = 0;
- _concat_kernels_vector = arm_compute::support::cpp14::make_unique<NEWidthConcatenateLayerKernel[]>(_num_inputs);
+ _concat_kernels_vector.resize(_num_inputs);
for(unsigned int i = 0; i < _num_inputs; ++i)
{
@@ -112,6 +112,6 @@ void NEWidthConcatenateLayer::run()
{
for(unsigned i = 0; i < _num_inputs; ++i)
{
- NEScheduler::get().schedule(_concat_kernels_vector.get() + i, Window::DimY);
+ NEScheduler::get().schedule(&_concat_kernels_vector[i], Window::DimY);
}
}
diff --git a/src/runtime/Pyramid.cpp b/src/runtime/Pyramid.cpp
index ebd65702a..bc7b5501a 100644
--- a/src/runtime/Pyramid.cpp
+++ b/src/runtime/Pyramid.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -45,8 +45,8 @@ void Pyramid::init_auto_padding(const PyramidInfo &info)
void Pyramid::internal_init(const PyramidInfo &info, bool auto_padding)
{
- _info = info;
- _pyramid = arm_compute::support::cpp14::make_unique<Tensor[]>(_info.num_levels());
+ _info = info;
+ _pyramid.resize(_info.num_levels());
size_t w = _info.width();
size_t h = _info.height();
@@ -56,11 +56,11 @@ void Pyramid::internal_init(const PyramidInfo &info, bool auto_padding)
TensorShape tensor_shape = _info.tensor_shape();
// Note: Look-up table used by the OpenVX sample implementation
- const float c_orbscale[4] = { 0.5f,
- SCALE_PYRAMID_ORB,
- SCALE_PYRAMID_ORB * SCALE_PYRAMID_ORB,
- SCALE_PYRAMID_ORB *SCALE_PYRAMID_ORB * SCALE_PYRAMID_ORB
- };
+ const std::array<float, 4> c_orbscale = { 0.5f,
+ SCALE_PYRAMID_ORB,
+ SCALE_PYRAMID_ORB * SCALE_PYRAMID_ORB,
+ SCALE_PYRAMID_ORB *SCALE_PYRAMID_ORB * SCALE_PYRAMID_ORB
+ };
for(size_t i = 0; i < _info.num_levels(); ++i)
{
@@ -71,7 +71,7 @@ void Pyramid::internal_init(const PyramidInfo &info, bool auto_padding)
tensor_info.auto_padding();
}
- (_pyramid.get() + i)->allocator()->init(tensor_info);
+ _pyramid[i].allocator()->init(tensor_info);
if(is_orb_scale)
{
@@ -99,11 +99,9 @@ void Pyramid::internal_init(const PyramidInfo &info, bool auto_padding)
void Pyramid::allocate()
{
- ARM_COMPUTE_ERROR_ON(_pyramid == nullptr);
-
for(size_t i = 0; i < _info.num_levels(); ++i)
{
- (_pyramid.get() + i)->allocator()->allocate();
+ _pyramid[i].allocator()->allocate();
}
}
@@ -116,5 +114,5 @@ Tensor *Pyramid::get_pyramid_level(size_t index) const
{
ARM_COMPUTE_ERROR_ON(index >= _info.num_levels());
- return (_pyramid.get() + index);
-}
+ return &_pyramid[index];
+} \ No newline at end of file
diff --git a/tests/framework/instruments/OpenCLMemoryUsage.cpp b/tests/framework/instruments/OpenCLMemoryUsage.cpp
index 119ad4cad..7b08e2d85 100644
--- a/tests/framework/instruments/OpenCLMemoryUsage.cpp
+++ b/tests/framework/instruments/OpenCLMemoryUsage.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -192,7 +192,7 @@ Instrument::MeasurementsMap OpenCLMemoryUsage::test_measurements() const
size_t num_programs = CLKernelLibrary::get().get_built_programs().size();
size_t total_size = 0;
- for(auto it : CLKernelLibrary::get().get_built_programs())
+ for(auto const &it : CLKernelLibrary::get().get_built_programs())
{
std::vector<size_t> binary_sizes = it.second.getInfo<CL_PROGRAM_BINARY_SIZES>();
total_size = std::accumulate(binary_sizes.begin(), binary_sizes.end(), total_size);
diff --git a/tests/framework/instruments/OpenCLTimer.cpp b/tests/framework/instruments/OpenCLTimer.cpp
index ca859b6fd..ca4c13ce6 100644
--- a/tests/framework/instruments/OpenCLTimer.cpp
+++ b/tests/framework/instruments/OpenCLTimer.cpp
@@ -185,9 +185,12 @@ Instrument::MeasurementsMap OpenCLClock<output_timestamps>::measurements() const
{
MeasurementsMap measurements;
unsigned int kernel_number = 0;
- for(auto kernel : _kernels)
+ for(auto const &kernel : _kernels)
{
- cl_ulong queued, flushed, start, end;
+ cl_ulong queued;
+ cl_ulong flushed;
+ cl_ulong start;
+ cl_ulong end;
kernel.event.getProfilingInfo(CL_PROFILING_COMMAND_QUEUED, &queued);
kernel.event.getProfilingInfo(CL_PROFILING_COMMAND_SUBMIT, &flushed);
kernel.event.getProfilingInfo(CL_PROFILING_COMMAND_START, &start);
diff --git a/tests/framework/instruments/SchedulerTimer.cpp b/tests/framework/instruments/SchedulerTimer.cpp
index f9d4dd5fc..c114dfbd9 100644
--- a/tests/framework/instruments/SchedulerTimer.cpp
+++ b/tests/framework/instruments/SchedulerTimer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -67,9 +67,9 @@ public:
return _real_scheduler.num_threads();
}
- void set_prefix(std::string prefix)
+ void set_prefix(const std::string &prefix)
{
- _prefix = std::move(prefix);
+ _prefix = prefix;
}
void schedule(ICPPKernel *kernel, const Hints &hints) override
@@ -188,7 +188,7 @@ Instrument::MeasurementsMap SchedulerClock<output_timestamps>::measurements() co
if(output_timestamps)
{
ARM_COMPUTE_ERROR_ON(kernel.measurements.size() != 2);
- for(auto m : kernel.measurements)
+ for(auto const &m : kernel.measurements)
{
if(m.first.find("[start]") != std::string::npos)
{
diff --git a/tests/framework/printers/JSONPrinter.cpp b/tests/framework/printers/JSONPrinter.cpp
index 6b982f5bb..179cdf960 100644
--- a/tests/framework/printers/JSONPrinter.cpp
+++ b/tests/framework/printers/JSONPrinter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -117,7 +117,7 @@ void JSONPrinter::print_list_tests(const std::vector<TestInfo> &infos)
{
*_stream << R"(, "list_tests" : {)";
bool first = true;
- for(auto info : infos)
+ for(auto const &info : infos)
{
if(!first)
{
diff --git a/tests/framework/printers/PrettyPrinter.cpp b/tests/framework/printers/PrettyPrinter.cpp
index 318195109..fe0540a62 100644
--- a/tests/framework/printers/PrettyPrinter.cpp
+++ b/tests/framework/printers/PrettyPrinter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -111,7 +111,7 @@ void PrettyPrinter::print_error(const std::exception &error, bool expected)
void PrettyPrinter::print_list_tests(const std::vector<TestInfo> &infos)
{
- for(auto info : infos)
+ for(auto const &info : infos)
{
*_stream << "[" << info.id << ", " << info.mode << ", " << info.status << "] " << info.name << "\n";
}
diff --git a/tests/validation/CL/Convolution.cpp b/tests/validation/CL/Convolution.cpp
index 0c00ee301..9c33d45f9 100644
--- a/tests/validation/CL/Convolution.cpp
+++ b/tests/validation/CL/Convolution.cpp
@@ -54,14 +54,14 @@ DATA_TEST_CASE(Configuration, framework::DatasetMode::NIGHTLY, combine(combine(c
CLTensor dst = create_tensor<CLTensor>(shape, output_data_type);
// Create conv matrix
- int16_t conv[9];
+ std::array<int16_t, 9> conv = { 0 };
ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
// Create and configure function
CLConvolution3x3 convolution;
- convolution.configure(&src, &dst, conv, 0, border_mode);
+ convolution.configure(&src, &dst, conv.data(), 0, border_mode);
// Validate valid region
const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), BorderSize(filter_size / 2));
@@ -122,14 +122,14 @@ DATA_TEST_CASE(Configuration, framework::DatasetMode::NIGHTLY, combine(combine(c
CLTensor dst = create_tensor<CLTensor>(shape, output_data_type);
// Create conv matrix
- int16_t conv[25];
+ std::array<int16_t, 25> conv = { 0 };
ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
// Create and configure function
CLConvolution5x5 convolution;
- convolution.configure(&src, &dst, conv, 0, border_mode);
+ convolution.configure(&src, &dst, conv.data(), 0, border_mode);
// Validate valid region
const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), BorderSize(filter_size / 2));
@@ -190,14 +190,14 @@ DATA_TEST_CASE(Configuration, framework::DatasetMode::NIGHTLY, combine(combine(c
CLTensor dst = create_tensor<CLTensor>(shape, output_data_type);
// Create conv matrix
- int16_t conv[49];
+ std::array<int16_t, 49> conv = { 0 };
ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
// Create and configure function
CLConvolution7x7 convolution;
- convolution.configure(&src, &dst, conv, 0, border_mode);
+ convolution.configure(&src, &dst, conv.data(), 0, border_mode);
// Validate valid region
const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), BorderSize(filter_size / 2));
@@ -258,14 +258,14 @@ DATA_TEST_CASE(Configuration, framework::DatasetMode::NIGHTLY, combine(combine(c
CLTensor dst = create_tensor<CLTensor>(shape, output_data_type);
// Create conv matrix
- int16_t conv[81];
+ std::array<int16_t, 81> conv = { 0 };
ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
// Create and configure function
CLConvolution9x9 convolution;
- convolution.configure(&src, &dst, conv, 0, border_mode);
+ convolution.configure(&src, &dst, conv.data(), 0, border_mode);
// Validate valid region
const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), BorderSize(filter_size / 2));
@@ -328,14 +328,14 @@ shape, output_data_type, border_mode, filter_width, filter_height)
CLTensor dst = create_tensor<CLTensor>(shape, output_data_type);
// Create conv matrix
- int16_t conv[filter_width * filter_height];
+ std::vector<int16_t> conv(filter_width * filter_height);
ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
// Create and configure function
CLConvolutionRectangle convolution;
- convolution.configure(&src, &dst, conv, filter_width, filter_height, 1, border_mode);
+ convolution.configure(&src, &dst, conv.data(), filter_width, filter_height, 1, border_mode);
// Validate valid region
const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), BorderSize(filter_height / 2, filter_width / 2));
diff --git a/tests/validation/CL/DepthConcatenateLayer.cpp b/tests/validation/CL/DepthConcatenateLayer.cpp
index beda637ef..8cbfda382 100644
--- a/tests/validation/CL/DepthConcatenateLayer.cpp
+++ b/tests/validation/CL/DepthConcatenateLayer.cpp
@@ -68,6 +68,7 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(
inputs_vector_info.emplace_back(std::move(input_info2));
std::vector<ITensorInfo *> inputs_vector_info_raw;
+ inputs_vector_info_raw.reserve(inputs_vector_info.size());
for(auto &input : inputs_vector_info)
{
inputs_vector_info_raw.emplace_back(&input);
diff --git a/tests/validation/CL/NonLinearFilter.cpp b/tests/validation/CL/NonLinearFilter.cpp
index 286cc483b..536b45897 100644
--- a/tests/validation/CL/NonLinearFilter.cpp
+++ b/tests/validation/CL/NonLinearFilter.cpp
@@ -52,8 +52,8 @@ DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combi
const uint8_t constant_border_value = distribution_u8(generator);
// Create the mask
- uint8_t mask[mask_size * mask_size];
- fill_mask_from_pattern(mask, mask_size, mask_size, pattern);
+ std::vector<uint8_t> mask(mask_size * mask_size);
+ fill_mask_from_pattern(mask.data(), mask_size, mask_size, pattern);
const auto half_mask_size = static_cast<int>(mask_size / 2);
// Create tensors
@@ -65,7 +65,7 @@ DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combi
// Create and configure function
CLNonLinearFilter filter;
- filter.configure(&src, &dst, function, mask_size, pattern, mask, border_mode, constant_border_value);
+ filter.configure(&src, &dst, function, mask_size, pattern, mask.data(), border_mode, constant_border_value);
// Validate valid region
const ValidRegion dst_valid_region = shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, BorderSize(half_mask_size));
diff --git a/tests/validation/CL/Split.cpp b/tests/validation/CL/Split.cpp
index 77363189c..e038b8985 100644
--- a/tests/validation/CL/Split.cpp
+++ b/tests/validation/CL/Split.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -57,6 +57,7 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(
{
std::vector<TensorInfo> outputs_info(splits);
std::vector<ITensorInfo*> outputs_info_ptr;
+ outputs_info_ptr.reserve(splits);
for(auto &output_info : outputs_info)
{
outputs_info_ptr.emplace_back(&output_info);
@@ -76,6 +77,7 @@ DATA_TEST_CASE(Configuration,
CLTensor src = create_tensor<CLTensor>(shape, data_type);
std::vector<CLTensor> dsts(splits);
std::vector<ICLTensor *> dsts_ptrs;
+ dsts_ptrs.reserve(splits);
for(auto &dst : dsts)
{
dsts_ptrs.emplace_back(&dst);
diff --git a/tests/validation/CL/WidthConcatenateLayer.cpp b/tests/validation/CL/WidthConcatenateLayer.cpp
index 2c1eb7fad..52a4e4ccd 100644
--- a/tests/validation/CL/WidthConcatenateLayer.cpp
+++ b/tests/validation/CL/WidthConcatenateLayer.cpp
@@ -72,6 +72,7 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(
inputs_vector_info.emplace_back(std::move(input_info2));
std::vector<ITensorInfo *> inputs_vector_info_raw;
+ inputs_vector_info_raw.reserve(inputs_vector_info.size());
for(auto &input : inputs_vector_info)
{
inputs_vector_info_raw.emplace_back(&input);
diff --git a/tests/validation/Helpers.cpp b/tests/validation/Helpers.cpp
index 504dbfd3a..71a674b51 100644
--- a/tests/validation/Helpers.cpp
+++ b/tests/validation/Helpers.cpp
@@ -269,7 +269,7 @@ std::pair<int, int> get_quantized_bounds(const QuantizationInfo &quant_info, flo
const int min_bound = quant_info.quantize(min, RoundingPolicy::TO_NEAREST_UP);
const int max_bound = quant_info.quantize(max, RoundingPolicy::TO_NEAREST_UP);
- return std::pair<int, int>(min_bound, max_bound);
+ return std::pair<int, int> { min_bound, max_bound };
}
template void get_tile(const SimpleTensor<float> &in, SimpleTensor<float> &roi, const Coordinates &coord);
diff --git a/tests/validation/NEON/DepthConcatenateLayer.cpp b/tests/validation/NEON/DepthConcatenateLayer.cpp
index 0ddb220d3..844c3987d 100644
--- a/tests/validation/NEON/DepthConcatenateLayer.cpp
+++ b/tests/validation/NEON/DepthConcatenateLayer.cpp
@@ -68,6 +68,7 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(
inputs_vector_info.emplace_back(std::move(input_info2));
std::vector<ITensorInfo *> inputs_vector_info_raw;
+ inputs_vector_info_raw.reserve(inputs_vector_info.size());
for(auto &input : inputs_vector_info)
{
inputs_vector_info_raw.emplace_back(&input);
diff --git a/tests/validation/NEON/HeightConcatenateLayer.cpp b/tests/validation/NEON/HeightConcatenateLayer.cpp
index 9c23fb9bd..075dfa3b2 100644
--- a/tests/validation/NEON/HeightConcatenateLayer.cpp
+++ b/tests/validation/NEON/HeightConcatenateLayer.cpp
@@ -72,6 +72,7 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(
inputs_vector_info.emplace_back(std::move(input_info2));
std::vector<ITensorInfo *> inputs_vector_info_raw;
+ inputs_vector_info_raw.reserve(inputs_vector_info.size());
for(auto &input : inputs_vector_info)
{
inputs_vector_info_raw.emplace_back(&input);
diff --git a/tests/validation/NEON/NonLinearFilter.cpp b/tests/validation/NEON/NonLinearFilter.cpp
index b3d4c9374..08ad1e240 100644
--- a/tests/validation/NEON/NonLinearFilter.cpp
+++ b/tests/validation/NEON/NonLinearFilter.cpp
@@ -52,8 +52,8 @@ DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combi
const uint8_t constant_border_value = distribution_u8(generator);
// Create the mask
- uint8_t mask[mask_size * mask_size];
- fill_mask_from_pattern(mask, mask_size, mask_size, pattern);
+ std::vector<uint8_t> mask(mask_size * mask_size);
+ fill_mask_from_pattern(mask.data(), mask_size, mask_size, pattern);
const auto half_mask_size = static_cast<int>(mask_size / 2);
// Create tensors
@@ -65,7 +65,7 @@ DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combi
// Create and configure function
NENonLinearFilter filter;
- filter.configure(&src, &dst, function, mask_size, pattern, mask, border_mode, constant_border_value);
+ filter.configure(&src, &dst, function, mask_size, pattern, mask.data(), border_mode, constant_border_value);
// Validate valid region
const ValidRegion dst_valid_region = shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, BorderSize(half_mask_size));
diff --git a/tests/validation/NEON/Split.cpp b/tests/validation/NEON/Split.cpp
index 17360960e..91b3b9a04 100644
--- a/tests/validation/NEON/Split.cpp
+++ b/tests/validation/NEON/Split.cpp
@@ -57,6 +57,7 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(
{
std::vector<TensorInfo> outputs_info(splits);
std::vector<ITensorInfo*> outputs_info_ptr;
+ outputs_info_ptr.reserve(splits);
for(auto &output_info : outputs_info)
{
outputs_info_ptr.emplace_back(&output_info);
@@ -76,6 +77,7 @@ DATA_TEST_CASE(Configuration,
Tensor src = create_tensor<Tensor>(shape, data_type);
std::vector<Tensor> dsts(splits);
std::vector<ITensor *> dsts_ptrs;
+ dsts_ptrs.reserve(splits);
for(auto &dst : dsts)
{
dsts_ptrs.emplace_back(&dst);
diff --git a/tests/validation/NEON/WidthConcatenateLayer.cpp b/tests/validation/NEON/WidthConcatenateLayer.cpp
index ed840ef32..ba0ff1bd8 100644
--- a/tests/validation/NEON/WidthConcatenateLayer.cpp
+++ b/tests/validation/NEON/WidthConcatenateLayer.cpp
@@ -70,6 +70,7 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(
inputs_vector_info.emplace_back(std::move(input_info2));
std::vector<ITensorInfo *> inputs_vector_info_raw;
+ inputs_vector_info_raw.reserve(inputs_vector_info.size());
for(auto &input : inputs_vector_info)
{
inputs_vector_info_raw.emplace_back(&input);
diff --git a/tests/validation/reference/ArithmeticDivision.cpp b/tests/validation/reference/ArithmeticDivision.cpp
index 010223199..0ced43940 100644
--- a/tests/validation/reference/ArithmeticDivision.cpp
+++ b/tests/validation/reference/ArithmeticDivision.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -77,7 +77,9 @@ SimpleTensor<T> arithmetic_division(const SimpleTensor<T> &src1, const SimpleTen
{
SimpleTensor<T> dst(TensorShape::broadcast_shape(src1.shape(), src2.shape()), data_type);
- Coordinates id_src1, id_src2, id_dst;
+ Coordinates id_src1{};
+ Coordinates id_src2{};
+ Coordinates id_dst{};
BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(src1, src2, dst, id_src1, id_src2, id_dst);
diff --git a/tests/validation/reference/ArithmeticOperations.cpp b/tests/validation/reference/ArithmeticOperations.cpp
index 062be93b9..a6205af2c 100644
--- a/tests/validation/reference/ArithmeticOperations.cpp
+++ b/tests/validation/reference/ArithmeticOperations.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -88,7 +88,9 @@ struct BroadcastUnroll<0>
template <typename T>
SimpleTensor<T> arithmetic_operation(ArithmeticOperation op, const SimpleTensor<T> &src1, const SimpleTensor<T> &src2, SimpleTensor<T> &dst, ConvertPolicy convert_policy)
{
- Coordinates id_src1, id_src2, id_dst;
+ Coordinates id_src1{};
+ Coordinates id_src2{};
+ Coordinates id_dst{};
BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1, src2, dst, convert_policy, id_src1, id_src2, id_dst);
@@ -98,14 +100,16 @@ SimpleTensor<T> arithmetic_operation(ArithmeticOperation op, const SimpleTensor<
template <>
SimpleTensor<uint8_t> arithmetic_operation(ArithmeticOperation op, const SimpleTensor<uint8_t> &src1, const SimpleTensor<uint8_t> &src2, SimpleTensor<uint8_t> &dst, ConvertPolicy convert_policy)
{
+ Coordinates id_src1{};
+ Coordinates id_src2{};
+ Coordinates id_dst{};
+
if(dst.data_type() == DataType::QASYMM8)
{
SimpleTensor<float> src1_tmp = convert_from_asymmetric(src1);
SimpleTensor<float> src2_tmp = convert_from_asymmetric(src2);
SimpleTensor<float> dst_tmp(TensorShape::broadcast_shape(src1.shape(), src2.shape()), dst.data_type());
- Coordinates id_src1, id_src2, id_dst;
-
BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1_tmp, src2_tmp, dst_tmp, convert_policy, id_src1, id_src2, id_dst);
dst = convert_to_asymmetric(dst_tmp, dst.quantization_info());
@@ -114,8 +118,6 @@ SimpleTensor<uint8_t> arithmetic_operation(ArithmeticOperation op, const SimpleT
else
{
// DataType::U8
- Coordinates id_src1, id_src2, id_dst;
-
BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1, src2, dst, convert_policy, id_src1, id_src2, id_dst);
return dst;
diff --git a/tests/validation/reference/CannyEdgeDetector.cpp b/tests/validation/reference/CannyEdgeDetector.cpp
index 92a11db0b..a952ddedb 100644
--- a/tests/validation/reference/CannyEdgeDetector.cpp
+++ b/tests/validation/reference/CannyEdgeDetector.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -117,7 +117,8 @@ SimpleTensor<T> canny_edge_detector_impl(const SimpleTensor<T> &src, int32_t upp
ValidRegion valid_region = shape_to_valid_region(src.shape(), border_mode == BorderMode::UNDEFINED, BorderSize(gradient_size / 2 + 1));
// Sobel computation: U == int16_t or int32_t
- SimpleTensor<U> gx, gy;
+ SimpleTensor<U> gx{};
+ SimpleTensor<U> gy{};
std::tie(gx, gy) = sobel<U>(src, gradient_size, border_mode, constant_border_value, GradientDimension::GRAD_XY);
using unsigned_U = typename traits::make_unsigned_conditional_t<U>::type;
@@ -178,7 +179,8 @@ SimpleTensor<T> canny_edge_detector_impl(const SimpleTensor<T> &src, int32_t upp
continue;
}
- unsigned_U mag_90, mag90;
+ unsigned_U mag_90;
+ unsigned_U mag90;
switch(grad_dir[i])
{
case 0: // North/South edge direction, compare against East/West pixels (left & right)
diff --git a/tests/validation/reference/Comparisons.cpp b/tests/validation/reference/Comparisons.cpp
index a83c365a2..6d08daf89 100644
--- a/tests/validation/reference/Comparisons.cpp
+++ b/tests/validation/reference/Comparisons.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -109,7 +109,9 @@ SimpleTensor<uint8_t> compare(ComparisonOperation op, const SimpleTensor<T> &src
{
SimpleTensor<uint8_t> dst(TensorShape::broadcast_shape(src1.shape(), src2.shape()), DataType::U8);
- Coordinates id_src1, id_src2, id_dst;
+ Coordinates id_src1{};
+ Coordinates id_src2{};
+ Coordinates id_dst{};
BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1, src2, dst, id_src1, id_src2, id_dst);
return dst;
}
@@ -119,18 +121,19 @@ SimpleTensor<uint8_t> compare(ComparisonOperation op, const SimpleTensor<uint8_t
{
SimpleTensor<uint8_t> dst(TensorShape::broadcast_shape(src1.shape(), src2.shape()), DataType::U8);
+ Coordinates id_src1{};
+ Coordinates id_src2{};
+ Coordinates id_dst{};
+
if(src1.data_type() == DataType::QASYMM8)
{
SimpleTensor<float> src1_tmp = convert_from_asymmetric(src1);
SimpleTensor<float> src2_tmp = convert_from_asymmetric(src2);
-
- Coordinates id_src1, id_src2, id_dst;
BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1_tmp, src2_tmp, dst, id_src1, id_src2, id_dst);
}
else
{
// DataType::U8
- Coordinates id_src1, id_src2, id_dst;
BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1, src2, dst, id_src1, id_src2, id_dst);
}
return dst;
diff --git a/tests/validation/reference/ConcatenateLayer.cpp b/tests/validation/reference/ConcatenateLayer.cpp
index 93b1768eb..af818a576 100644
--- a/tests/validation/reference/ConcatenateLayer.cpp
+++ b/tests/validation/reference/ConcatenateLayer.cpp
@@ -41,6 +41,7 @@ SimpleTensor<T> widthconcatenate_layer(const std::vector<SimpleTensor<T>> &srcs,
{
// Create reference
std::vector<TensorShape> shapes;
+ shapes.reserve(srcs.size());
for(const auto &src : srcs)
{
shapes.emplace_back(src.shape());
diff --git a/tests/validation/reference/DepthConcatenateLayer.cpp b/tests/validation/reference/DepthConcatenateLayer.cpp
index 139675d10..22271a0d1 100644
--- a/tests/validation/reference/DepthConcatenateLayer.cpp
+++ b/tests/validation/reference/DepthConcatenateLayer.cpp
@@ -38,7 +38,7 @@ SimpleTensor<T> depthconcatenate_layer(const std::vector<SimpleTensor<T>> &srcs,
{
// Create reference
std::vector<TensorShape> shapes;
-
+ shapes.reserve(srcs.size());
for(const auto &src : srcs)
{
shapes.emplace_back(src.shape());
@@ -66,7 +66,7 @@ SimpleTensor<T> depthconcatenate_layer(const std::vector<SimpleTensor<T>> &srcs,
{
auto ptr_slice = static_cast<T *>(dst(Coordinates(0, 0, slice, b)));
const auto num_elems_in_slice((dst.num_elements() / depth_out) * src.shape().z());
- std::transform(ptr_slice, ptr_slice + num_elems_in_slice, ptr_slice, [src, dst](T t)
+ std::transform(ptr_slice, ptr_slice + num_elems_in_slice, ptr_slice, [src, dst](T)
{
return dst.quantization_info().quantize(src.quantization_info().dequantize(0), RoundingPolicy::TO_NEAREST_UP);
});
diff --git a/tests/validation/reference/ElementwiseOperations.cpp b/tests/validation/reference/ElementwiseOperations.cpp
index 6d533edea..2ffb0faa7 100644
--- a/tests/validation/reference/ElementwiseOperations.cpp
+++ b/tests/validation/reference/ElementwiseOperations.cpp
@@ -124,7 +124,9 @@ struct BroadcastUnroll<0>
template <typename T>
SimpleTensor<T> arithmetic_operation(ArithmeticOperation op, const SimpleTensor<T> &src1, const SimpleTensor<T> &src2, SimpleTensor<T> &dst, ConvertPolicy convert_policy)
{
- Coordinates id_src1, id_src2, id_dst;
+ Coordinates id_src1{};
+ Coordinates id_src2{};
+ Coordinates id_dst{};
BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1, src2, dst, convert_policy, id_src1, id_src2, id_dst);
@@ -140,7 +142,9 @@ SimpleTensor<uint8_t> arithmetic_operation(ArithmeticOperation op, const SimpleT
SimpleTensor<float> src2_tmp = convert_from_asymmetric(src2);
SimpleTensor<float> dst_tmp(TensorShape::broadcast_shape(src1.shape(), src2.shape()), dst.data_type());
- Coordinates id_src1, id_src2, id_dst;
+ Coordinates id_src1{};
+ Coordinates id_src2{};
+ Coordinates id_dst{};
BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1_tmp, src2_tmp, dst_tmp, convert_policy, id_src1, id_src2, id_dst);
@@ -150,7 +154,9 @@ SimpleTensor<uint8_t> arithmetic_operation(ArithmeticOperation op, const SimpleT
else
{
// DataType::U8
- Coordinates id_src1, id_src2, id_dst;
+ Coordinates id_src1{};
+ Coordinates id_src2{};
+ Coordinates id_dst{};
BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1, src2, dst, convert_policy, id_src1, id_src2, id_dst);
diff --git a/tests/validation/reference/HOGDetector.cpp b/tests/validation/reference/HOGDetector.cpp
index 5a5ae3700..8ca1b0c20 100644
--- a/tests/validation/reference/HOGDetector.cpp
+++ b/tests/validation/reference/HOGDetector.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -39,8 +39,8 @@ Size2D num_detection_windows(const TensorShape &shape, const Size2D &window_step
const size_t num_block_strides_width = hog_info.detection_window_size().width / hog_info.block_stride().width;
const size_t num_block_strides_height = hog_info.detection_window_size().height / hog_info.block_stride().height;
- return Size2D(floor_to_multiple(shape.x() - num_block_strides_width, window_step.width) + window_step.width,
- floor_to_multiple(shape.y() - num_block_strides_height, window_step.height) + window_step.height);
+ return Size2D{ floor_to_multiple(shape.x() - num_block_strides_width, window_step.width) + window_step.width,
+ floor_to_multiple(shape.y() - num_block_strides_height, window_step.height) + window_step.height };
}
} // namespace
diff --git a/tests/validation/reference/PixelWiseMultiplication.cpp b/tests/validation/reference/PixelWiseMultiplication.cpp
index 3470de241..ea058ecdb 100644
--- a/tests/validation/reference/PixelWiseMultiplication.cpp
+++ b/tests/validation/reference/PixelWiseMultiplication.cpp
@@ -139,7 +139,9 @@ SimpleTensor<T2> pixel_wise_multiplication(const SimpleTensor<T1> &src1, const S
ARM_COMPUTE_ERROR("Scale of pixel-wise multiplication must be non-negative");
}
- Coordinates id_src1, id_src2, id_dst;
+ Coordinates id_src1{};
+ Coordinates id_src2{};
+ Coordinates id_dst{};
BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(src1, src2, dst, scale, convert_policy, rounding_policy, id_src1, id_src2, id_dst);
@@ -166,7 +168,9 @@ SimpleTensor<uint8_t> pixel_wise_multiplication(const SimpleTensor<uint8_t> &src
ARM_COMPUTE_ERROR("Scale of pixel-wise multiplication must be non-negative");
}
- Coordinates id_src1, id_src2, id_dst;
+ Coordinates id_src1{};
+ Coordinates id_src2{};
+ Coordinates id_dst{};
BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(src1, src2, dst, scale, convert_policy, rounding_policy, id_src1, id_src2, id_dst);
}
return dst;
diff --git a/tests/validation/reference/SliceOperations.cpp b/tests/validation/reference/SliceOperations.cpp
index 40ca9de92..b34afdc92 100644
--- a/tests/validation/reference/SliceOperations.cpp
+++ b/tests/validation/reference/SliceOperations.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -103,7 +103,9 @@ SimpleTensor<T> strided_slice(const SimpleTensor<T> &src,
SimpleTensor<T> dst{ dst_shape, src.data_type(), 1 };
// Get coordinates
- Coordinates starts_abs, ends_abs, final_strides;
+ Coordinates starts_abs{};
+ Coordinates ends_abs{};
+ Coordinates final_strides{};
std::tie(starts_abs, ends_abs, final_strides) = calculate_strided_slice_coords(src_shape,
starts, ends, strides,
begin_mask, end_mask, shrink_axis_mask);
diff --git a/tests/validation/reference/Sobel.cpp b/tests/validation/reference/Sobel.cpp
index ff0e11d3a..233f1ad4f 100644
--- a/tests/validation/reference/Sobel.cpp
+++ b/tests/validation/reference/Sobel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
diff --git a/tests/validation/reference/StackLayer.cpp b/tests/validation/reference/StackLayer.cpp
index 50e440c91..9e9e43423 100644
--- a/tests/validation/reference/StackLayer.cpp
+++ b/tests/validation/reference/StackLayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -56,11 +56,11 @@ SimpleTensor<T> stack_layer(const std::vector<SimpleTensor<T>> &in, const Tensor
// i_coordinates[0] = xi, i_coordinates[1] = yi, i_coordinates[2] = zi
// i_coordinates[3] = bi, i_coordinates[4] = i, i_coordinates[5] = 0
// i_coordinates[5] will be always zero and used for not incrementing the output when the input has less than 4 dimensions
- int i_coordinates[6] = { 0 };
+ std::array<int, 6> i_coordinates{ 0 };
// Array of pointers used to map the output coordinates to the input ones accordingly with the axis
// This array is initialized with &i_coordinates[5] since this will be always zero
- int *o_coordinates[5] = { &i_coordinates[5], &i_coordinates[5], &i_coordinates[5], &i_coordinates[5], &i_coordinates[5] };
+ std::array<int *, 5> o_coordinates = { &i_coordinates[5], &i_coordinates[5], &i_coordinates[5], &i_coordinates[5], &i_coordinates[5] };
// Set the axis coordinate
o_coordinates[axis] = &i_coordinates[4];
diff --git a/tests/validation/reference/Winograd.cpp b/tests/validation/reference/Winograd.cpp
index 06463d577..47f5ac7a7 100644
--- a/tests/validation/reference/Winograd.cpp
+++ b/tests/validation/reference/Winograd.cpp
@@ -45,7 +45,7 @@ template <typename T>
void initialize_matrix_transform(SimpleTensor<T> &src, const Size2D &output_tile_size, const Size2D &kernel_size, WinogradTransformType winograd_transform_type)
{
// Winograd input transform matrices
- static const float imatrix2x2_3x3[] =
+ static const std::array<float, 16> imatrix2x2_3x3 =
{
1.0f, 0.0f, -1.0f, 0.0f,
0.0f, 1.0f, 1.0f, 0.0f,
@@ -53,7 +53,7 @@ void initialize_matrix_transform(SimpleTensor<T> &src, const Size2D &output_tile
0.0f, 1.0f, 0.0f, -1.0f
};
- static const float imatrix4x4_3x3[] =
+ static const std::array<float, 36> imatrix4x4_3x3 =
{
4.0f, 0.0f, -5.0f, 0.0f, 1.0f, 0.0f,
0.0f, -4.0f, -4.0f, 1.0f, 1.0f, 0.0f,
@@ -63,7 +63,7 @@ void initialize_matrix_transform(SimpleTensor<T> &src, const Size2D &output_tile
0.0f, 4.0f, 0.0f, -5.0f, 0.0f, 1.0f,
};
- static const float imatrix4x4_5x5[] =
+ static const std::array<float, 64> imatrix4x4_5x5 =
{
1.f, 0.f, -21.f / 4.f, 0.f, 21.f / 4.f, 0.f, -1.f, 0.f,
0.f, 1.f, 1.f, -17.f / 4.f, -17.f / 4.f, 1.f, 1.f, 0.f,
@@ -75,7 +75,7 @@ void initialize_matrix_transform(SimpleTensor<T> &src, const Size2D &output_tile
0.f, -1.f, 0.f, 21.f / 4.f, 0.f, -21.f / 4.f, 0.f, 1.f
};
- static const float imatrix2x1_7x7[] =
+ static const std::array<float, 64> imatrix2x1_7x7 =
{
-36.0f, 0.0f, 49.0f, 0.0f, -14.0f, 0.0f, 1.0f, 0.0f,
0.0f, -36.0f, 36.0f, 13.0f, -13.0f, -1.0f, 1.0f, 0.0f,
@@ -90,7 +90,7 @@ void initialize_matrix_transform(SimpleTensor<T> &src, const Size2D &output_tile
// ------------------------------------------
// Winograd filter transform matrices
- static const float fmatrix2x2_3x3[] =
+ static const std::array<float, 12> fmatrix2x2_3x3 =
{
1.0f, 0.0f, 0.0f,
0.5f, 0.5f, 0.5f,
@@ -98,7 +98,7 @@ void initialize_matrix_transform(SimpleTensor<T> &src, const Size2D &output_tile
0.0f, 0.0f, 1.0f
};
- static const float fmatrix4x4_3x3[] =
+ static const std::array<float, 18> fmatrix4x4_3x3 =
{
0.25f, 0.0f, 0.0f,
-1.0f / 6.0f, -1.0f / 6.0f, -1.0f / 6.0f,
@@ -108,7 +108,7 @@ void initialize_matrix_transform(SimpleTensor<T> &src, const Size2D &output_tile
0.0f, 0.0f, 1.0f
};
- static const float fmatrix4x4_5x5[] =
+ static const std::array<float, 40> fmatrix4x4_5x5 =
{
1.0f, 0.0f, 0.0f, 0.0f, 0.0f,
-2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
@@ -121,7 +121,7 @@ void initialize_matrix_transform(SimpleTensor<T> &src, const Size2D &output_tile
};
- static const float fmatrix2x1_7x7[] =
+ static const std::array<float, 56> fmatrix2x1_7x7 =
{
-1.0f / 36.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
1.0f / 48.0f, -1.0f / 48.0f, 1.0f / 48.0f, -1.0f / 48.0f, 1.0f / 48.0f, -1.0f / 48.0f, 1.0f / 48.0f,
@@ -136,13 +136,13 @@ void initialize_matrix_transform(SimpleTensor<T> &src, const Size2D &output_tile
// ------------------------------------------
// Winograd output transform matrices
- static const float omatrix2x2_3x3[] =
+ static const std::array<float, 8> omatrix2x2_3x3 =
{
1.0f, 1.0f, 1.0f, 0.0f,
0.0f, 1.0f, -1.0f, -1.0f
};
- static const float omatrix4x4_3x3[] =
+ static const std::array<float, 24> omatrix4x4_3x3 =
{
1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f,
0.0f, 1.0f, -1.0f, 2.0f, -2.0f, 0.0f,
@@ -150,7 +150,7 @@ void initialize_matrix_transform(SimpleTensor<T> &src, const Size2D &output_tile
0.0f, 1.0f, -1.0f, 8.0f, -8.0f, 1.0f
};
- static const float omatrix4x4_5x5[] =
+ static const std::array<float, 36> omatrix4x4_5x5 =
{
1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 8.0f, 8.0f, 0.0f,
0.0f, 1.0f, -1.0f, 2.0f, -2.0f, 4.0f, -4.0f, 0.0f,
@@ -158,7 +158,7 @@ void initialize_matrix_transform(SimpleTensor<T> &src, const Size2D &output_tile
0.0f, 1.0f, -1.0f, 8.0f, -8.0f, 1.0f, -1.0f, 1.0f
};
- static const float omatrix2x1_7x7[] =
+ static const std::array<float, 16> omatrix2x1_7x7 =
{
1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f,
0.0f, -1.0f, 1.0f, -2.0f, 2.0f, -3.0f, 3.0f, 1.0f
@@ -171,42 +171,42 @@ void initialize_matrix_transform(SimpleTensor<T> &src, const Size2D &output_tile
// Key = (Output tile size, Kernel size, Winograd transform type)
static std::map<WinogradKey, const float *> matrix_map =
{
- { WinogradKey(std::pair<int, int>(2, 2), std::pair<int, int>(3, 3), WinogradTransformType::INPUT), imatrix2x2_3x3 },
- { WinogradKey(std::pair<int, int>(4, 4), std::pair<int, int>(3, 3), WinogradTransformType::INPUT), imatrix4x4_3x3 },
- { WinogradKey(std::pair<int, int>(2, 1), std::pair<int, int>(3, 1), WinogradTransformType::INPUT), imatrix2x2_3x3 },
- { WinogradKey(std::pair<int, int>(4, 1), std::pair<int, int>(3, 1), WinogradTransformType::INPUT), imatrix4x4_3x3 },
- { WinogradKey(std::pair<int, int>(1, 2), std::pair<int, int>(1, 3), WinogradTransformType::INPUT), imatrix2x2_3x3 },
- { WinogradKey(std::pair<int, int>(1, 4), std::pair<int, int>(1, 3), WinogradTransformType::INPUT), imatrix4x4_3x3 },
- { WinogradKey(std::pair<int, int>(4, 4), std::pair<int, int>(5, 5), WinogradTransformType::INPUT), imatrix4x4_5x5 },
- { WinogradKey(std::pair<int, int>(4, 1), std::pair<int, int>(5, 1), WinogradTransformType::INPUT), imatrix4x4_5x5 },
- { WinogradKey(std::pair<int, int>(2, 1), std::pair<int, int>(7, 1), WinogradTransformType::INPUT), imatrix2x1_7x7 },
- { WinogradKey(std::pair<int, int>(1, 2), std::pair<int, int>(1, 7), WinogradTransformType::INPUT), imatrix2x1_7x7 },
- { WinogradKey(std::pair<int, int>(2, 2), std::pair<int, int>(7, 7), WinogradTransformType::INPUT), imatrix2x1_7x7 },
- { WinogradKey(std::pair<int, int>(1, 4), std::pair<int, int>(1, 5), WinogradTransformType::INPUT), imatrix4x4_5x5 },
- { WinogradKey(std::pair<int, int>(2, 2), std::pair<int, int>(3, 3), WinogradTransformType::FILTER), fmatrix2x2_3x3 },
- { WinogradKey(std::pair<int, int>(4, 4), std::pair<int, int>(3, 3), WinogradTransformType::FILTER), fmatrix4x4_3x3 },
- { WinogradKey(std::pair<int, int>(2, 1), std::pair<int, int>(3, 1), WinogradTransformType::FILTER), fmatrix2x2_3x3 },
- { WinogradKey(std::pair<int, int>(4, 1), std::pair<int, int>(3, 1), WinogradTransformType::FILTER), fmatrix4x4_3x3 },
- { WinogradKey(std::pair<int, int>(1, 2), std::pair<int, int>(1, 3), WinogradTransformType::FILTER), fmatrix2x2_3x3 },
- { WinogradKey(std::pair<int, int>(1, 4), std::pair<int, int>(1, 3), WinogradTransformType::FILTER), fmatrix4x4_3x3 },
- { WinogradKey(std::pair<int, int>(4, 4), std::pair<int, int>(5, 5), WinogradTransformType::FILTER), fmatrix4x4_5x5 },
- { WinogradKey(std::pair<int, int>(4, 1), std::pair<int, int>(5, 1), WinogradTransformType::FILTER), fmatrix4x4_5x5 },
- { WinogradKey(std::pair<int, int>(2, 1), std::pair<int, int>(7, 1), WinogradTransformType::FILTER), fmatrix2x1_7x7 },
- { WinogradKey(std::pair<int, int>(1, 2), std::pair<int, int>(1, 7), WinogradTransformType::FILTER), fmatrix2x1_7x7 },
- { WinogradKey(std::pair<int, int>(2, 2), std::pair<int, int>(7, 7), WinogradTransformType::FILTER), fmatrix2x1_7x7 },
- { WinogradKey(std::pair<int, int>(1, 4), std::pair<int, int>(1, 5), WinogradTransformType::FILTER), fmatrix4x4_5x5 },
- { WinogradKey(std::pair<int, int>(2, 2), std::pair<int, int>(3, 3), WinogradTransformType::OUTPUT), omatrix2x2_3x3 },
- { WinogradKey(std::pair<int, int>(4, 4), std::pair<int, int>(3, 3), WinogradTransformType::OUTPUT), omatrix4x4_3x3 },
- { WinogradKey(std::pair<int, int>(2, 1), std::pair<int, int>(3, 1), WinogradTransformType::OUTPUT), omatrix2x2_3x3 },
- { WinogradKey(std::pair<int, int>(4, 1), std::pair<int, int>(3, 1), WinogradTransformType::OUTPUT), omatrix4x4_3x3 },
- { WinogradKey(std::pair<int, int>(1, 2), std::pair<int, int>(1, 3), WinogradTransformType::OUTPUT), omatrix2x2_3x3 },
- { WinogradKey(std::pair<int, int>(1, 4), std::pair<int, int>(1, 3), WinogradTransformType::OUTPUT), omatrix4x4_3x3 },
- { WinogradKey(std::pair<int, int>(4, 4), std::pair<int, int>(5, 5), WinogradTransformType::OUTPUT), omatrix4x4_5x5 },
- { WinogradKey(std::pair<int, int>(4, 1), std::pair<int, int>(5, 1), WinogradTransformType::OUTPUT), omatrix4x4_5x5 },
- { WinogradKey(std::pair<int, int>(2, 1), std::pair<int, int>(7, 1), WinogradTransformType::OUTPUT), omatrix2x1_7x7 },
- { WinogradKey(std::pair<int, int>(1, 2), std::pair<int, int>(1, 7), WinogradTransformType::OUTPUT), omatrix2x1_7x7 },
- { WinogradKey(std::pair<int, int>(2, 2), std::pair<int, int>(7, 7), WinogradTransformType::OUTPUT), omatrix2x1_7x7 },
- { WinogradKey(std::pair<int, int>(1, 4), std::pair<int, int>(1, 5), WinogradTransformType::OUTPUT), omatrix4x4_5x5 },
+ { WinogradKey(std::pair<int, int>(2, 2), std::pair<int, int>(3, 3), WinogradTransformType::INPUT), imatrix2x2_3x3.data() },
+ { WinogradKey(std::pair<int, int>(4, 4), std::pair<int, int>(3, 3), WinogradTransformType::INPUT), imatrix4x4_3x3.data() },
+ { WinogradKey(std::pair<int, int>(2, 1), std::pair<int, int>(3, 1), WinogradTransformType::INPUT), imatrix2x2_3x3.data() },
+ { WinogradKey(std::pair<int, int>(4, 1), std::pair<int, int>(3, 1), WinogradTransformType::INPUT), imatrix4x4_3x3.data() },
+ { WinogradKey(std::pair<int, int>(1, 2), std::pair<int, int>(1, 3), WinogradTransformType::INPUT), imatrix2x2_3x3.data() },
+ { WinogradKey(std::pair<int, int>(1, 4), std::pair<int, int>(1, 3), WinogradTransformType::INPUT), imatrix4x4_3x3.data() },
+ { WinogradKey(std::pair<int, int>(4, 4), std::pair<int, int>(5, 5), WinogradTransformType::INPUT), imatrix4x4_5x5.data() },
+ { WinogradKey(std::pair<int, int>(4, 1), std::pair<int, int>(5, 1), WinogradTransformType::INPUT), imatrix4x4_5x5.data() },
+ { WinogradKey(std::pair<int, int>(2, 1), std::pair<int, int>(7, 1), WinogradTransformType::INPUT), imatrix2x1_7x7.data() },
+ { WinogradKey(std::pair<int, int>(1, 2), std::pair<int, int>(1, 7), WinogradTransformType::INPUT), imatrix2x1_7x7.data() },
+ { WinogradKey(std::pair<int, int>(2, 2), std::pair<int, int>(7, 7), WinogradTransformType::INPUT), imatrix2x1_7x7.data() },
+ { WinogradKey(std::pair<int, int>(1, 4), std::pair<int, int>(1, 5), WinogradTransformType::INPUT), imatrix4x4_5x5.data() },
+ { WinogradKey(std::pair<int, int>(2, 2), std::pair<int, int>(3, 3), WinogradTransformType::FILTER), fmatrix2x2_3x3.data() },
+ { WinogradKey(std::pair<int, int>(4, 4), std::pair<int, int>(3, 3), WinogradTransformType::FILTER), fmatrix4x4_3x3.data() },
+ { WinogradKey(std::pair<int, int>(2, 1), std::pair<int, int>(3, 1), WinogradTransformType::FILTER), fmatrix2x2_3x3.data() },
+ { WinogradKey(std::pair<int, int>(4, 1), std::pair<int, int>(3, 1), WinogradTransformType::FILTER), fmatrix4x4_3x3.data() },
+ { WinogradKey(std::pair<int, int>(1, 2), std::pair<int, int>(1, 3), WinogradTransformType::FILTER), fmatrix2x2_3x3.data() },
+ { WinogradKey(std::pair<int, int>(1, 4), std::pair<int, int>(1, 3), WinogradTransformType::FILTER), fmatrix4x4_3x3.data() },
+ { WinogradKey(std::pair<int, int>(4, 4), std::pair<int, int>(5, 5), WinogradTransformType::FILTER), fmatrix4x4_5x5.data() },
+ { WinogradKey(std::pair<int, int>(4, 1), std::pair<int, int>(5, 1), WinogradTransformType::FILTER), fmatrix4x4_5x5.data() },
+ { WinogradKey(std::pair<int, int>(2, 1), std::pair<int, int>(7, 1), WinogradTransformType::FILTER), fmatrix2x1_7x7.data() },
+ { WinogradKey(std::pair<int, int>(1, 2), std::pair<int, int>(1, 7), WinogradTransformType::FILTER), fmatrix2x1_7x7.data() },
+ { WinogradKey(std::pair<int, int>(2, 2), std::pair<int, int>(7, 7), WinogradTransformType::FILTER), fmatrix2x1_7x7.data() },
+ { WinogradKey(std::pair<int, int>(1, 4), std::pair<int, int>(1, 5), WinogradTransformType::FILTER), fmatrix4x4_5x5.data() },
+ { WinogradKey(std::pair<int, int>(2, 2), std::pair<int, int>(3, 3), WinogradTransformType::OUTPUT), omatrix2x2_3x3.data() },
+ { WinogradKey(std::pair<int, int>(4, 4), std::pair<int, int>(3, 3), WinogradTransformType::OUTPUT), omatrix4x4_3x3.data() },
+ { WinogradKey(std::pair<int, int>(2, 1), std::pair<int, int>(3, 1), WinogradTransformType::OUTPUT), omatrix2x2_3x3.data() },
+ { WinogradKey(std::pair<int, int>(4, 1), std::pair<int, int>(3, 1), WinogradTransformType::OUTPUT), omatrix4x4_3x3.data() },
+ { WinogradKey(std::pair<int, int>(1, 2), std::pair<int, int>(1, 3), WinogradTransformType::OUTPUT), omatrix2x2_3x3.data() },
+ { WinogradKey(std::pair<int, int>(1, 4), std::pair<int, int>(1, 3), WinogradTransformType::OUTPUT), omatrix4x4_3x3.data() },
+ { WinogradKey(std::pair<int, int>(4, 4), std::pair<int, int>(5, 5), WinogradTransformType::OUTPUT), omatrix4x4_5x5.data() },
+ { WinogradKey(std::pair<int, int>(4, 1), std::pair<int, int>(5, 1), WinogradTransformType::OUTPUT), omatrix4x4_5x5.data() },
+ { WinogradKey(std::pair<int, int>(2, 1), std::pair<int, int>(7, 1), WinogradTransformType::OUTPUT), omatrix2x1_7x7.data() },
+ { WinogradKey(std::pair<int, int>(1, 2), std::pair<int, int>(1, 7), WinogradTransformType::OUTPUT), omatrix2x1_7x7.data() },
+ { WinogradKey(std::pair<int, int>(2, 2), std::pair<int, int>(7, 7), WinogradTransformType::OUTPUT), omatrix2x1_7x7.data() },
+ { WinogradKey(std::pair<int, int>(1, 4), std::pair<int, int>(1, 5), WinogradTransformType::OUTPUT), omatrix4x4_5x5.data() },
};
// Find transformation matrix