From cbbb03813b79b7f0274b18436a78a79ff31e469e Mon Sep 17 00:00:00 2001 From: ramelg01 Date: Fri, 17 Sep 2021 17:36:57 +0100 Subject: Provide logging for configure functions in all NEON functions Partially Resolves: COMPMID-4718 Signed-off-by: Ramy Elgammal Change-Id: I655268c57fa126d9c99981c49d345a3aac75646e Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6286 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Pablo Marquez Tello Reviewed-by: SiCong Li --- arm_compute/core/Types.h | 14 +- src/common/utils/Log.h | 10 +- src/runtime/NEON/functions/NEArgMinMaxLayer.cpp | 4 +- .../NEON/functions/NEBatchNormalizationLayer.cpp | 4 +- src/runtime/NEON/functions/NEBatchToSpaceLayer.cpp | 4 +- src/runtime/NEON/functions/NEBitwiseAnd.cpp | 5 +- src/runtime/NEON/functions/NEBitwiseNot.cpp | 5 +- src/runtime/NEON/functions/NEBitwiseOr.cpp | 5 +- src/runtime/NEON/functions/NEBitwiseXor.cpp | 5 +- .../NEON/functions/NEBoundingBoxTransform.cpp | 4 +- src/runtime/NEON/functions/NECast.cpp | 3 +- .../NEON/functions/NEChannelShuffleLayer.cpp | 4 +- src/runtime/NEON/functions/NEConvolutionLayer.cpp | 2 + src/runtime/NEON/functions/NECropResize.cpp | 2 + .../NEON/functions/NEDeconvolutionLayer.cpp | 2 + src/runtime/NEON/functions/NEDepthToSpaceLayer.cpp | 5 +- .../NEON/functions/NEDepthwiseConvolutionLayer.cpp | 3 + .../NEON/functions/NEDetectionPostProcessLayer.cpp | 4 +- src/runtime/NEON/functions/NEFFT1D.cpp | 4 +- src/runtime/NEON/functions/NEFFT2D.cpp | 2 + .../NEON/functions/NEFFTConvolutionLayer.cpp | 2 + src/runtime/NEON/functions/NEFillBorder.cpp | 4 +- .../NEON/functions/NEFullyConnectedLayer.cpp | 2 + .../NEON/functions/NEFuseBatchNormalization.cpp | 6 +- src/runtime/NEON/functions/NEGather.cpp | 5 +- .../NEON/functions/NEGenerateProposalsLayer.cpp | 2 + .../functions/NEInstanceNormalizationLayer.cpp | 5 +- src/runtime/NEON/functions/NEL2NormalizeLayer.cpp | 5 +- src/runtime/NEON/functions/NELSTMLayer.cpp | 8 + .../NEON/functions/NELSTMLayerQuantized.cpp | 5 + src/runtime/NEON/functions/NELogical.cpp | 4 + src/runtime/NEON/functions/NEMaxUnpoolingLayer.cpp | 3 + .../functions/NEMeanStdDevNormalizationLayer.cpp | 6 +- .../NEON/functions/NENormalizationLayer.cpp | 4 +- src/runtime/NEON/functions/NEPadLayer.cpp | 2 + src/runtime/NEON/functions/NEPriorBoxLayer.cpp | 5 +- src/runtime/NEON/functions/NEQLSTMLayer.cpp | 7 + src/runtime/NEON/functions/NERNNLayer.cpp | 2 + src/runtime/NEON/functions/NEROIAlignLayer.cpp | 5 +- src/runtime/NEON/functions/NEROIPoolingLayer.cpp | 3 + src/runtime/NEON/functions/NERange.cpp | 4 +- src/runtime/NEON/functions/NEReduceMean.cpp | 5 +- .../NEON/functions/NEReductionOperation.cpp | 4 +- src/runtime/NEON/functions/NERemap.cpp | 2 + src/runtime/NEON/functions/NEReorgLayer.cpp | 6 +- src/runtime/NEON/functions/NEReverse.cpp | 6 +- src/runtime/NEON/functions/NEScale.cpp | 3 + src/runtime/NEON/functions/NESelect.cpp | 5 +- src/runtime/NEON/functions/NESlice.cpp | 4 +- src/runtime/NEON/functions/NESpaceToBatchLayer.cpp | 2 + src/runtime/NEON/functions/NESpaceToDepthLayer.cpp | 5 +- src/runtime/NEON/functions/NEStackLayer.cpp | 5 +- src/runtime/NEON/functions/NEStridedSlice.cpp | 5 +- src/runtime/NEON/functions/NETile.cpp | 6 +- src/runtime/NEON/functions/NETranspose.cpp | 2 + src/runtime/NEON/functions/NEUnstack.cpp | 4 +- utils/TypePrinter.h | 217 +++++++++++++++++---- 57 files changed, 372 insertions(+), 89 deletions(-) diff --git a/arm_compute/core/Types.h b/arm_compute/core/Types.h index 0dd1afc240..0acbb3f59e 100644 --- a/arm_compute/core/Types.h +++ b/arm_compute/core/Types.h @@ -1964,7 +1964,7 @@ public: _fast_math(false), _fp_mixed_precision(false), _broadcast_bias(false), - _pretranpose_B(true), + _pretranspose_B(true), _activation_info(), _constant_weights(true) { @@ -1999,7 +1999,7 @@ public: _fast_math(fast_math), _fp_mixed_precision(fp_mixed_precision), _broadcast_bias(broadcast_bias), - _pretranpose_B(reshape_b_only_on_first_run), + _pretranspose_B(reshape_b_only_on_first_run), _activation_info(activation_info), _constant_weights(constant_weights) { @@ -2098,17 +2098,17 @@ public: * * @return True if b should be pre-transposed else false. */ - bool pretranpose_B() const + bool pretranspose_B() const { - return _pretranpose_B; + return _pretranspose_B; }; /** Set pre-transpose b flag * * @param[in] flag Flag to set */ - void set_pretranpose_B(bool flag) + void set_pretranspose_B(bool flag) { - _pretranpose_B = flag; + _pretranspose_B = flag; } /** Activation layer to apply after the matrix multiplication * @@ -2146,7 +2146,7 @@ private: bool _fast_math; bool _fp_mixed_precision; bool _broadcast_bias; - bool _pretranpose_B; + bool _pretranspose_B; ActivationLayerInfo _activation_info; bool _constant_weights; }; diff --git a/src/common/utils/Log.h b/src/common/utils/Log.h index a9d0d79876..5b049d0de6 100644 --- a/src/common/utils/Log.h +++ b/src/common/utils/Log.h @@ -138,7 +138,7 @@ logParamsImpl(std::vector &data_registry, const std::tuple & * detecting T as an abstract data type when passing any of these parameters as L-value reference * to an abstract type. * - * @return Vector of the parameters' data in a string format + * @return Vector of the parameters' data in a string format */ template const std::vector logParams(Ts &&... ins) @@ -156,9 +156,9 @@ const std::vector logParams(Ts &&... ins) * It is Inline to avoid the redefinition of this function each time this header is included * * @param[in] in_params_str Constant reference to a string consists of the names of the input parameters provided - * as:ARM_COMPUTE_LOG_PARAMS(src0, src1) the params_names = "src0, src1" + * as:ARM_COMPUTE_LOG_PARAMS(src0, src1) the params_names = "src0, src1" * - * @return Vector of strings containing all the names of the input parameters + * @return Vector of strings containing all the names of the input parameters */ inline const std::vector getParamsNames(const std::string &in_params_str) { @@ -188,9 +188,9 @@ inline const std::vector getParamsNames(const std::string &in_param * @param[in] params_names Constant reference to a string consists of the the input parameters' names * provided e.g.: ARM_COMPUTE_LOG_PARAMS(src0, src1) then params_names = "src0, src1" * @param[in] data_registry Constant reference to a registry of all parameters' data in string format, - * stringnized by arm_compute::to_string() + * stringnized by arm_compute::to_string() * - * @return Log message string to be displayed + * @return Log message string to be displayed */ inline const std::string constructDataLog(const std::vector ¶ms_names, const std::vector &data_registry) diff --git a/src/runtime/NEON/functions/NEArgMinMaxLayer.cpp b/src/runtime/NEON/functions/NEArgMinMaxLayer.cpp index 7bca20d46c..3876ae6e87 100644 --- a/src/runtime/NEON/functions/NEArgMinMaxLayer.cpp +++ b/src/runtime/NEON/functions/NEArgMinMaxLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -29,6 +29,7 @@ #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Types.h" #include "arm_compute/core/Validate.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEReductionOperationKernel.h" namespace arm_compute @@ -42,6 +43,7 @@ NEArgMinMaxLayer::NEArgMinMaxLayer(std::shared_ptr memory_manage } void NEArgMinMaxLayer::configure(ITensor *input, int axis, ITensor *output, const ReductionOperation &op) { + ARM_COMPUTE_LOG_PARAMS(input, axis, output, op); _reduction_function->configure(input, output, axis, op, false); } diff --git a/src/runtime/NEON/functions/NEBatchNormalizationLayer.cpp b/src/runtime/NEON/functions/NEBatchNormalizationLayer.cpp index b90a38b47f..db49f4c1a0 100644 --- a/src/runtime/NEON/functions/NEBatchNormalizationLayer.cpp +++ b/src/runtime/NEON/functions/NEBatchNormalizationLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -29,6 +29,7 @@ #include "arm_compute/core/Types.h" #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEBatchNormalizationLayerKernel.h" namespace arm_compute @@ -43,6 +44,7 @@ NEBatchNormalizationLayer::NEBatchNormalizationLayer() void NEBatchNormalizationLayer::configure(ITensor *input, ITensor *output, const ITensor *mean, const ITensor *var, const ITensor *beta, const ITensor *gamma, float epsilon, ActivationLayerInfo act_info) { + ARM_COMPUTE_LOG_PARAMS(input, output, mean, var, beta, gamma, epsilon, act_info); // Configure kernel _norm_kernel = std::make_unique(); _norm_kernel->configure(input, output, mean, var, beta, gamma, epsilon, act_info); diff --git a/src/runtime/NEON/functions/NEBatchToSpaceLayer.cpp b/src/runtime/NEON/functions/NEBatchToSpaceLayer.cpp index 8f537a650a..5a2e37a517 100644 --- a/src/runtime/NEON/functions/NEBatchToSpaceLayer.cpp +++ b/src/runtime/NEON/functions/NEBatchToSpaceLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -28,12 +28,14 @@ #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Types.h" #include "arm_compute/core/Validate.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEBatchToSpaceLayerKernel.h" namespace arm_compute { void NEBatchToSpaceLayer::configure(const ITensor *input, const ITensor *block_shape, ITensor *output) { + ARM_COMPUTE_LOG_PARAMS(input, block_shape, output); auto k = std::make_unique(); k->configure(input, block_shape, output); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NEBitwiseAnd.cpp b/src/runtime/NEON/functions/NEBitwiseAnd.cpp index 81c087988a..90eb72706e 100644 --- a/src/runtime/NEON/functions/NEBitwiseAnd.cpp +++ b/src/runtime/NEON/functions/NEBitwiseAnd.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,12 +25,15 @@ #include "src/core/NEON/kernels/NEBitwiseAndKernel.h" +#include "src/common/utils/Log.h" + #include using namespace arm_compute; void NEBitwiseAnd::configure(const ITensor *input1, const ITensor *input2, ITensor *output) { + ARM_COMPUTE_LOG_PARAMS(input1, input2, output); auto k = std::make_unique(); k->configure(input1, input2, output); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NEBitwiseNot.cpp b/src/runtime/NEON/functions/NEBitwiseNot.cpp index 3155df5db3..69e5288b88 100644 --- a/src/runtime/NEON/functions/NEBitwiseNot.cpp +++ b/src/runtime/NEON/functions/NEBitwiseNot.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,12 +25,15 @@ #include "src/core/NEON/kernels/NEBitwiseNotKernel.h" +#include "src/common/utils/Log.h" + #include using namespace arm_compute; void NEBitwiseNot::configure(const ITensor *input, ITensor *output) { + ARM_COMPUTE_LOG_PARAMS(input, output); auto k = std::make_unique(); k->configure(input, output); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NEBitwiseOr.cpp b/src/runtime/NEON/functions/NEBitwiseOr.cpp index 793eb25d80..0b19e919ee 100644 --- a/src/runtime/NEON/functions/NEBitwiseOr.cpp +++ b/src/runtime/NEON/functions/NEBitwiseOr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,12 +25,15 @@ #include "src/core/NEON/kernels/NEBitwiseOrKernel.h" +#include "src/common/utils/Log.h" + #include using namespace arm_compute; void NEBitwiseOr::configure(const ITensor *input1, const ITensor *input2, ITensor *output) { + ARM_COMPUTE_LOG_PARAMS(input1, input2, output); auto k = std::make_unique(); k->configure(input1, input2, output); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NEBitwiseXor.cpp b/src/runtime/NEON/functions/NEBitwiseXor.cpp index 2d0af63e35..cc9df9f1c4 100644 --- a/src/runtime/NEON/functions/NEBitwiseXor.cpp +++ b/src/runtime/NEON/functions/NEBitwiseXor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,12 +25,15 @@ #include "src/core/NEON/kernels/NEBitwiseXorKernel.h" +#include "src/common/utils/Log.h" + #include using namespace arm_compute; void NEBitwiseXor::configure(const ITensor *input1, const ITensor *input2, ITensor *output) { + ARM_COMPUTE_LOG_PARAMS(input1, input2, output); auto k = std::make_unique(); k->configure(input1, input2, output); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NEBoundingBoxTransform.cpp b/src/runtime/NEON/functions/NEBoundingBoxTransform.cpp index cfd14faca0..af00171be6 100644 --- a/src/runtime/NEON/functions/NEBoundingBoxTransform.cpp +++ b/src/runtime/NEON/functions/NEBoundingBoxTransform.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -22,12 +22,14 @@ * SOFTWARE. */ #include "arm_compute/runtime/NEON/functions/NEBoundingBoxTransform.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEBoundingBoxTransformKernel.h" namespace arm_compute { void NEBoundingBoxTransform::configure(const ITensor *boxes, ITensor *pred_boxes, const ITensor *deltas, const BoundingBoxTransformInfo &info) { + ARM_COMPUTE_LOG_PARAMS(boxes, pred_boxes, deltas, info); // Configure Bounding Box kernel auto k = std::make_unique(); k->configure(boxes, pred_boxes, deltas, info); diff --git a/src/runtime/NEON/functions/NECast.cpp b/src/runtime/NEON/functions/NECast.cpp index a39e639ad4..a58d4e5f69 100644 --- a/src/runtime/NEON/functions/NECast.cpp +++ b/src/runtime/NEON/functions/NECast.cpp @@ -24,6 +24,7 @@ #include "arm_compute/runtime/NEON/functions/NECast.h" #include "arm_compute/core/Validate.h" +#include "src/common/utils/Log.h" #include "src/cpu/operators/CpuCast.h" namespace arm_compute @@ -49,7 +50,7 @@ void NECast::configure(ITensor *input, ITensor *output, ConvertPolicy policy) _impl->dst = output; ARM_COMPUTE_ERROR_ON_NULLPTR(_impl->src, _impl->dst); - + ARM_COMPUTE_LOG_PARAMS(input, output, policy); _impl->op = std::make_unique(); _impl->op->configure(_impl->src->info(), _impl->dst->info(), policy); } diff --git a/src/runtime/NEON/functions/NEChannelShuffleLayer.cpp b/src/runtime/NEON/functions/NEChannelShuffleLayer.cpp index bf4af83a0d..8b96fadb74 100644 --- a/src/runtime/NEON/functions/NEChannelShuffleLayer.cpp +++ b/src/runtime/NEON/functions/NEChannelShuffleLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -24,12 +24,14 @@ #include "arm_compute/runtime/NEON/functions/NEChannelShuffleLayer.h" #include "arm_compute/core/Types.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEChannelShuffleLayerKernel.h" namespace arm_compute { void NEChannelShuffleLayer::configure(const ITensor *input, ITensor *output, unsigned int num_groups) { + ARM_COMPUTE_LOG_PARAMS(input, output, num_groups); auto k = std::make_unique(); k->configure(input, output, num_groups); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NEConvolutionLayer.cpp b/src/runtime/NEON/functions/NEConvolutionLayer.cpp index ca62a40cc8..317f463c29 100644 --- a/src/runtime/NEON/functions/NEConvolutionLayer.cpp +++ b/src/runtime/NEON/functions/NEConvolutionLayer.cpp @@ -27,6 +27,7 @@ #include "arm_compute/core/Utils.h" #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/NEON/functions/NEFFTConvolutionLayer.h" +#include "src/common/utils/Log.h" #include "src/core/helpers/MemoryHelpers.h" #include "src/cpu/operators/CpuConv2d.h" #include "src/cpu/operators/CpuDirectConv2d.h" @@ -66,6 +67,7 @@ void NEConvolutionLayer::configure(ITensor *input, const ITensor *weights, const ARM_COMPUTE_UNUSED(num_groups); ARM_COMPUTE_ERROR_THROW_ON(NEConvolutionLayer::validate(input->info(), weights->info(), ((biases != nullptr) ? biases->info() : nullptr), output->info(), conv_info, weights_info, dilation, act_info, enable_fast_math, num_groups)); + ARM_COMPUTE_LOG_PARAMS(input, weights, biases, output, conv_info, weights_info, dilation, act_info, enable_fast_math, num_groups); const Conv2dInfo info(conv_info, dilation, act_info, enable_fast_math, num_groups); switch(cpu::CpuConv2d::get_convolution_method(input->info(), weights->info(), output->info(), conv_info, weights_info, dilation, act_info, enable_fast_math)) diff --git a/src/runtime/NEON/functions/NECropResize.cpp b/src/runtime/NEON/functions/NECropResize.cpp index 1e1070d961..cca8b400ee 100644 --- a/src/runtime/NEON/functions/NECropResize.cpp +++ b/src/runtime/NEON/functions/NECropResize.cpp @@ -25,6 +25,7 @@ #include "arm_compute/runtime/NEON/functions/NECropResize.h" #include "arm_compute/runtime/Tensor.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NECropKernel.h" #include @@ -60,6 +61,7 @@ void NECropResize::configure(const ITensor *input, const ITensor *boxes, const I { ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); ARM_COMPUTE_ERROR_THROW_ON(NECropResize::validate(input->info(), boxes->info(), box_ind->info(), output->info(), crop_size, method, extrapolation_value)); + ARM_COMPUTE_LOG_PARAMS(input, boxes, box_ind, output, crop_size, method, extrapolation_value); _num_boxes = boxes->info()->tensor_shape()[1]; TensorShape out_shape(input->info()->tensor_shape()[0], crop_size.x, crop_size.y); diff --git a/src/runtime/NEON/functions/NEDeconvolutionLayer.cpp b/src/runtime/NEON/functions/NEDeconvolutionLayer.cpp index 712f41f369..e04c6467eb 100644 --- a/src/runtime/NEON/functions/NEDeconvolutionLayer.cpp +++ b/src/runtime/NEON/functions/NEDeconvolutionLayer.cpp @@ -28,6 +28,7 @@ #include "arm_compute/core/Validate.h" #include "arm_compute/core/utils/misc/ShapeCalculator.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/helpers/AutoConfiguration.h" using namespace arm_compute::misc::shape_calculator; @@ -157,6 +158,7 @@ void NEDeconvolutionLayer::configure(ITensor *input, const ITensor *weights, con // Perform validation step ARM_COMPUTE_ERROR_ON_NULLPTR(input, weights, output); ARM_COMPUTE_ERROR_THROW_ON(NEDeconvolutionLayer::validate(input->info(), weights->info(), (bias == nullptr) ? nullptr : bias->info(), output->info(), info)); + ARM_COMPUTE_LOG_PARAMS(input, weights, bias, output, info); const DataLayout data_layout = input->info()->data_layout(); const unsigned int width_idx = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH); diff --git a/src/runtime/NEON/functions/NEDepthToSpaceLayer.cpp b/src/runtime/NEON/functions/NEDepthToSpaceLayer.cpp index 2793c3f27e..f4a8a17e05 100644 --- a/src/runtime/NEON/functions/NEDepthToSpaceLayer.cpp +++ b/src/runtime/NEON/functions/NEDepthToSpaceLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -28,12 +28,15 @@ #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Types.h" #include "arm_compute/core/Validate.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEDepthToSpaceLayerKernel.h" namespace arm_compute { void NEDepthToSpaceLayer::configure(const ITensor *input, ITensor *output, int32_t block_shape) { + ARM_COMPUTE_LOG_PARAMS(input, output, block_shape); + auto k = std::make_unique(); k->configure(input, output, block_shape); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NEDepthwiseConvolutionLayer.cpp b/src/runtime/NEON/functions/NEDepthwiseConvolutionLayer.cpp index ed6dec3850..fb6a2b08da 100644 --- a/src/runtime/NEON/functions/NEDepthwiseConvolutionLayer.cpp +++ b/src/runtime/NEON/functions/NEDepthwiseConvolutionLayer.cpp @@ -27,6 +27,7 @@ #include "arm_compute/core/utils/misc/ShapeCalculator.h" #include "arm_compute/core/utils/quantization/AsymmHelpers.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/cpu/operators/CpuDepthwiseConv2d.h" using namespace arm_compute::misc; @@ -309,6 +310,8 @@ struct NEDepthwiseConvolutionLayer::NEDepthwiseConvolutionLayer::Impl void NEDepthwiseConvolutionLayer::configure(ITensor *input, const ITensor *weights, const ITensor *biases, ITensor *output, const PadStrideInfo &conv_info, unsigned int depth_multiplier, const ActivationLayerInfo &act_info, const Size2D &dilation) { + ARM_COMPUTE_LOG_PARAMS(input, weights, output, conv_info, depth_multiplier, biases, act_info, dilation); + const ConvolutionInfo info{ conv_info, depth_multiplier, act_info, dilation }; _impl->op = std::make_shared(); _impl->depth_conv_func = _impl->op->get_depthwiseconvolution_function(input->info(), weights->info(), (biases != nullptr) ? biases->info() : nullptr, output->info(), diff --git a/src/runtime/NEON/functions/NEDetectionPostProcessLayer.cpp b/src/runtime/NEON/functions/NEDetectionPostProcessLayer.cpp index 9e63800728..1da8b012b3 100644 --- a/src/runtime/NEON/functions/NEDetectionPostProcessLayer.cpp +++ b/src/runtime/NEON/functions/NEDetectionPostProcessLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -26,6 +26,7 @@ #include "arm_compute/core/Error.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/Validate.h" +#include "src/common/utils/Log.h" #include #include @@ -45,6 +46,7 @@ void NEDetectionPostProcessLayer::configure(const ITensor *input_box_encoding, c ARM_COMPUTE_ERROR_THROW_ON(NEDetectionPostProcessLayer::validate(input_box_encoding->info(), input_scores->info(), input_anchors->info(), output_boxes->info(), output_classes->info(), output_scores->info(), num_detection->info(), info)); + ARM_COMPUTE_LOG_PARAMS(input_box_encoding, input_scores, input_anchors, output_boxes, output_classes, output_scores, num_detection, info); const ITensor *input_scores_to_use = input_scores; DetectionPostProcessLayerInfo info_to_use = info; diff --git a/src/runtime/NEON/functions/NEFFT1D.cpp b/src/runtime/NEON/functions/NEFFT1D.cpp index e72488f0f6..343b817eba 100644 --- a/src/runtime/NEON/functions/NEFFT1D.cpp +++ b/src/runtime/NEON/functions/NEFFT1D.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -26,6 +26,7 @@ #include "arm_compute/core/ITensor.h" #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEFFTDigitReverseKernel.h" #include "src/core/NEON/kernels/NEFFTRadixStageKernel.h" #include "src/core/NEON/kernels/NEFFTScaleKernel.h" @@ -44,6 +45,7 @@ void NEFFT1D::configure(const ITensor *input, ITensor *output, const FFT1DInfo & { ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); ARM_COMPUTE_ERROR_THROW_ON(NEFFT1D::validate(input->info(), output->info(), config)); + ARM_COMPUTE_LOG_PARAMS(input, output, config); // Decompose size to radix factors const auto supported_radix = NEFFTRadixStageKernel::supported_radix(); diff --git a/src/runtime/NEON/functions/NEFFT2D.cpp b/src/runtime/NEON/functions/NEFFT2D.cpp index 5aaf587cdf..ab422bd2ae 100644 --- a/src/runtime/NEON/functions/NEFFT2D.cpp +++ b/src/runtime/NEON/functions/NEFFT2D.cpp @@ -26,6 +26,7 @@ #include "arm_compute/core/ITensor.h" #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/Scheduler.h" +#include "src/common/utils/Log.h" namespace arm_compute { @@ -40,6 +41,7 @@ void NEFFT2D::configure(const ITensor *input, ITensor *output, const FFT2DInfo & { ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); ARM_COMPUTE_ERROR_THROW_ON(NEFFT2D::validate(input->info(), output->info(), config)); + ARM_COMPUTE_LOG_PARAMS(input, output, config); // Setup first pass FFT1DInfo first_pass_config; diff --git a/src/runtime/NEON/functions/NEFFTConvolutionLayer.cpp b/src/runtime/NEON/functions/NEFFTConvolutionLayer.cpp index 56fc2e4a2b..0551d756fb 100644 --- a/src/runtime/NEON/functions/NEFFTConvolutionLayer.cpp +++ b/src/runtime/NEON/functions/NEFFTConvolutionLayer.cpp @@ -27,6 +27,7 @@ #include "arm_compute/core/Utils.h" #include "arm_compute/core/Validate.h" #include "arm_compute/core/utils/misc/ShapeCalculator.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEFFTDigitReverseKernel.h" #include "src/core/NEON/kernels/NEFFTRadixStageKernel.h" #include "src/core/NEON/kernels/NEFFTScaleKernel.h" @@ -105,6 +106,7 @@ void NEFFTConvolutionLayer::configure(ITensor *input, const ITensor *weights, co const ActivationLayerInfo &act_info, bool enable_fast_math) { ARM_COMPUTE_UNUSED(enable_fast_math); + ARM_COMPUTE_LOG_PARAMS(input, weights, biases, output, conv_info, act_info, enable_fast_math); _original_weights = weights; _original_bias = biases; diff --git a/src/runtime/NEON/functions/NEFillBorder.cpp b/src/runtime/NEON/functions/NEFillBorder.cpp index 256aad6d3f..d633e340f8 100644 --- a/src/runtime/NEON/functions/NEFillBorder.cpp +++ b/src/runtime/NEON/functions/NEFillBorder.cpp @@ -25,6 +25,7 @@ #include "arm_compute/core/Window.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEFillBorderKernel.h" namespace arm_compute @@ -36,6 +37,7 @@ NEFillBorder::NEFillBorder() void NEFillBorder::configure(ITensor *input, unsigned int border_width, BorderMode border_mode, const PixelValue &constant_border_value) { + ARM_COMPUTE_LOG_PARAMS(input, border_width, border_mode, constant_border_value); _border_handler = std::make_unique(); _border_handler->configure(input, BorderSize(border_width), border_mode, constant_border_value); } @@ -44,4 +46,4 @@ void NEFillBorder::run() { NEScheduler::get().schedule(_border_handler.get(), Window::DimZ); } -} // namespace arm_compute \ No newline at end of file +} // namespace arm_compute diff --git a/src/runtime/NEON/functions/NEFullyConnectedLayer.cpp b/src/runtime/NEON/functions/NEFullyConnectedLayer.cpp index 3f55a1f34e..77028d96a2 100644 --- a/src/runtime/NEON/functions/NEFullyConnectedLayer.cpp +++ b/src/runtime/NEON/functions/NEFullyConnectedLayer.cpp @@ -27,6 +27,7 @@ #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/NEON/functions/NEConvertFullyConnectedWeights.h" +#include "src/common/utils/Log.h" #include "src/core/helpers/MemoryHelpers.h" #include "src/cpu/operators/CpuFullyConnected.h" @@ -69,6 +70,7 @@ void NEFullyConnectedLayer::configure(const ITensor *input, const ITensor *weigh biases != nullptr ? biases->info() : nullptr, output->info(), fc_info)); + ARM_COMPUTE_LOG_PARAMS(input, weights, biases, output, fc_info); _impl->op = std::make_unique(); _impl->original_weights = weights; diff --git a/src/runtime/NEON/functions/NEFuseBatchNormalization.cpp b/src/runtime/NEON/functions/NEFuseBatchNormalization.cpp index a8ce6b2bfc..6612845d86 100644 --- a/src/runtime/NEON/functions/NEFuseBatchNormalization.cpp +++ b/src/runtime/NEON/functions/NEFuseBatchNormalization.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -28,6 +28,7 @@ #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Types.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEFuseBatchNormalizationKernel.h" namespace arm_compute @@ -44,6 +45,9 @@ void NEFuseBatchNormalization::configure(const ITensor *input_weights, const ITe const ITensor *input_bias, const ITensor *bn_beta, const ITensor *bn_gamma, float epsilon, FuseBatchNormalizationType fbn_type) { + ARM_COMPUTE_LOG_PARAMS(input_weights, bn_mean, bn_var, fused_weights, fused_bias, input_bias, + bn_beta, bn_gamma, epsilon, fbn_type); + _fuse_bn_kernel = std::make_unique(); _fuse_bn_kernel->configure(input_weights, bn_mean, bn_var, fused_weights, fused_bias, input_bias, bn_beta, bn_gamma, epsilon, fbn_type); } diff --git a/src/runtime/NEON/functions/NEGather.cpp b/src/runtime/NEON/functions/NEGather.cpp index 86cbfd187a..f5d19c769e 100644 --- a/src/runtime/NEON/functions/NEGather.cpp +++ b/src/runtime/NEON/functions/NEGather.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,12 +25,15 @@ #include "src/core/NEON/kernels/NEGatherKernel.h" +#include "src/common/utils/Log.h" + #include namespace arm_compute { void NEGather::configure(const ITensor *input, const ITensor *indices, ITensor *output, int axis) { + ARM_COMPUTE_LOG_PARAMS(input, indices, output, axis); auto k = std::make_unique(); k->configure(input, indices, output, axis); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NEGenerateProposalsLayer.cpp b/src/runtime/NEON/functions/NEGenerateProposalsLayer.cpp index 931fdb22f7..1c0e736766 100644 --- a/src/runtime/NEON/functions/NEGenerateProposalsLayer.cpp +++ b/src/runtime/NEON/functions/NEGenerateProposalsLayer.cpp @@ -25,6 +25,7 @@ #include "arm_compute/core/Types.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEFillBorderKernel.h" #include "src/core/NEON/kernels/NEGenerateProposalsLayerKernel.h" #include "src/core/NEON/kernels/NEPadLayerKernel.h" @@ -72,6 +73,7 @@ void NEGenerateProposalsLayer::configure(const ITensor *scores, const ITensor *d { ARM_COMPUTE_ERROR_ON_NULLPTR(scores, deltas, anchors, proposals, scores_out, num_valid_proposals); ARM_COMPUTE_ERROR_THROW_ON(NEGenerateProposalsLayer::validate(scores->info(), deltas->info(), anchors->info(), proposals->info(), scores_out->info(), num_valid_proposals->info(), info)); + ARM_COMPUTE_LOG_PARAMS(scores, deltas, anchors, proposals, scores_out, num_valid_proposals, info); _is_nhwc = scores->info()->data_layout() == DataLayout::NHWC; const DataType scores_data_type = scores->info()->data_type(); diff --git a/src/runtime/NEON/functions/NEInstanceNormalizationLayer.cpp b/src/runtime/NEON/functions/NEInstanceNormalizationLayer.cpp index 5965b9722f..822dcf491c 100644 --- a/src/runtime/NEON/functions/NEInstanceNormalizationLayer.cpp +++ b/src/runtime/NEON/functions/NEInstanceNormalizationLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -26,6 +26,7 @@ #include "arm_compute/core/Helpers.h" #include "arm_compute/core/KernelDescriptors.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEInstanceNormalizationLayerKernel.h" namespace arm_compute @@ -39,6 +40,8 @@ NEInstanceNormalizationLayer::NEInstanceNormalizationLayer(std::shared_ptrinfo()->data_layout(); const auto kernel_descriptor = InstanceNormalizationLayerKernelInfo{ gamma, beta, epsilon, true }; diff --git a/src/runtime/NEON/functions/NEL2NormalizeLayer.cpp b/src/runtime/NEON/functions/NEL2NormalizeLayer.cpp index 505ee0a962..c3ecfb430f 100644 --- a/src/runtime/NEON/functions/NEL2NormalizeLayer.cpp +++ b/src/runtime/NEON/functions/NEL2NormalizeLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,6 +25,7 @@ #include "arm_compute/core/Helpers.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEL2NormalizeLayerKernel.h" #include "src/core/NEON/kernels/NEReductionOperationKernel.h" @@ -43,6 +44,8 @@ NEL2NormalizeLayer::NEL2NormalizeLayer(std::shared_ptr memory_ma void NEL2NormalizeLayer::configure(ITensor *input, ITensor *output, int axis, float epsilon) { + ARM_COMPUTE_LOG_PARAMS(input, output, axis, epsilon); + // Manage intermediate buffers _memory_group.manage(&_sumsq); diff --git a/src/runtime/NEON/functions/NELSTMLayer.cpp b/src/runtime/NEON/functions/NELSTMLayer.cpp index 2eb5e9a61e..2d6be06499 100644 --- a/src/runtime/NEON/functions/NELSTMLayer.cpp +++ b/src/runtime/NEON/functions/NELSTMLayer.cpp @@ -29,6 +29,7 @@ #include "arm_compute/core/utils/misc/ShapeCalculator.h" #include "arm_compute/core/utils/quantization/AsymmHelpers.h" #include "arm_compute/runtime/common/LSTMParams.h" +#include "src/common/utils/Log.h" namespace arm_compute { @@ -67,6 +68,13 @@ void NELSTMLayer::configure(const ITensor *input, forget_gate_bias, cell_bias, output_gate_bias, output_state_in, cell_state_in, scratch_buffer, output_state_out, cell_state_out, output); + ARM_COMPUTE_LOG_PARAMS(input, + input_to_forget_weights, input_to_cell_weights, input_to_output_weights, + recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, + forget_gate_bias, cell_bias, output_gate_bias, + output_state_in, cell_state_in, + scratch_buffer, output_state_out, cell_state_out, output, + lstm_params, activation_info, cell_threshold, projection_threshold); _is_layer_norm_lstm = lstm_params.use_layer_norm(); diff --git a/src/runtime/NEON/functions/NELSTMLayerQuantized.cpp b/src/runtime/NEON/functions/NELSTMLayerQuantized.cpp index eb7d584da2..cfdeb000e0 100644 --- a/src/runtime/NEON/functions/NELSTMLayerQuantized.cpp +++ b/src/runtime/NEON/functions/NELSTMLayerQuantized.cpp @@ -26,6 +26,7 @@ #include "arm_compute/core/Utils.h" #include "arm_compute/core/Validate.h" #include "arm_compute/core/utils/quantization/AsymmHelpers.h" +#include "src/common/utils/Log.h" #include "src/core/helpers/AutoConfiguration.h" #include @@ -72,6 +73,10 @@ void NELSTMLayerQuantized::configure(const ITensor *input, recurrent_to_input_weights->info(), recurrent_to_forget_weights->info(), recurrent_to_cell_weights->info(), recurrent_to_output_weights->info(), input_gate_bias->info(), forget_gate_bias->info(), cell_bias->info(), output_gate_bias->info(), cell_state_in->info(), output_state_in->info(), cell_state_out->info(), output_state_out->info())); + ARM_COMPUTE_LOG_PARAMS(input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, + recurrent_to_input_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, + input_gate_bias, forget_gate_bias, cell_bias, output_gate_bias, cell_state_in, output_state_in, cell_state_out, output_state_out); + const int input_size = input->info()->dimension(0); const int batch_size = input->info()->dimension(1); const int output_size = input_to_input_weights->info()->dimension(1); diff --git a/src/runtime/NEON/functions/NELogical.cpp b/src/runtime/NEON/functions/NELogical.cpp index 171d84da19..92dcf15791 100644 --- a/src/runtime/NEON/functions/NELogical.cpp +++ b/src/runtime/NEON/functions/NELogical.cpp @@ -25,6 +25,7 @@ #include "arm_compute/runtime/NEON/NEScheduler.h" #include "arm_compute/runtime/Tensor.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NELogicalKernel.h" namespace arm_compute @@ -47,6 +48,7 @@ NELogicalAnd::~NELogicalAnd() = default; void NELogicalAnd::configure(const ITensor *input1, const ITensor *input2, ITensor *output) { ARM_COMPUTE_ERROR_ON_NULLPTR(input1, input2, output); + ARM_COMPUTE_LOG_PARAMS(input1, input2, output); _impl->kernel = std::make_unique(); _impl->kernel->configure(input1->info(), input2->info(), output->info(), LogicalOperation::And); @@ -79,6 +81,7 @@ NELogicalOr::~NELogicalOr() = default; void NELogicalOr::configure(const ITensor *input1, const ITensor *input2, ITensor *output) { ARM_COMPUTE_ERROR_ON_NULLPTR(input1, input2, output); + ARM_COMPUTE_LOG_PARAMS(input1, input2, output); _impl->kernel = std::make_unique(); _impl->kernel->configure(input1->info(), input2->info(), output->info(), LogicalOperation::Or); @@ -111,6 +114,7 @@ NELogicalNot::~NELogicalNot() = default; void NELogicalNot::configure(const ITensor *input, ITensor *output) { ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); + ARM_COMPUTE_LOG_PARAMS(input, output); _impl->kernel = std::make_unique(); _impl->kernel->configure(input->info(), nullptr, output->info(), LogicalOperation::Not); diff --git a/src/runtime/NEON/functions/NEMaxUnpoolingLayer.cpp b/src/runtime/NEON/functions/NEMaxUnpoolingLayer.cpp index 656777d726..39f717545b 100644 --- a/src/runtime/NEON/functions/NEMaxUnpoolingLayer.cpp +++ b/src/runtime/NEON/functions/NEMaxUnpoolingLayer.cpp @@ -27,6 +27,7 @@ #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/NEON/NEScheduler.h" #include "arm_compute/runtime/NEON/functions/NEFill.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEMaxUnpoolingLayerKernel.h" namespace arm_compute @@ -40,6 +41,8 @@ NEMaxUnpoolingLayer::NEMaxUnpoolingLayer() void NEMaxUnpoolingLayer::configure(ITensor *input, ITensor *indices, ITensor *output, const PoolingLayerInfo &pool_info) { + ARM_COMPUTE_LOG_PARAMS(input, indices, output, pool_info); + const PixelValue zero_value(0.f); _fill_func = std::make_unique(); _unpooling_layer_kernel = std::make_unique(); diff --git a/src/runtime/NEON/functions/NEMeanStdDevNormalizationLayer.cpp b/src/runtime/NEON/functions/NEMeanStdDevNormalizationLayer.cpp index 02de983b77..7626aa0db2 100644 --- a/src/runtime/NEON/functions/NEMeanStdDevNormalizationLayer.cpp +++ b/src/runtime/NEON/functions/NEMeanStdDevNormalizationLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,12 +25,16 @@ #include "src/core/NEON/kernels/NEMeanStdDevNormalizationKernel.h" +#include "src/common/utils/Log.h" + namespace arm_compute { NEMeanStdDevNormalizationLayer::~NEMeanStdDevNormalizationLayer() = default; void NEMeanStdDevNormalizationLayer::configure(ITensor *input, ITensor *output, float epsilon) { + ARM_COMPUTE_LOG_PARAMS(input, output, epsilon); + auto k = std::make_unique(); k->configure(input, output, epsilon); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NENormalizationLayer.cpp b/src/runtime/NEON/functions/NENormalizationLayer.cpp index 9dcb157c03..d3b1696335 100644 --- a/src/runtime/NEON/functions/NENormalizationLayer.cpp +++ b/src/runtime/NEON/functions/NENormalizationLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -29,6 +29,7 @@ #include "arm_compute/core/Types.h" #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NENormalizationLayerKernel.h" namespace arm_compute @@ -43,6 +44,7 @@ NENormalizationLayer::NENormalizationLayer(std::shared_ptr memor void NENormalizationLayer::configure(const ITensor *input, ITensor *output, const NormalizationLayerInfo &norm_info) { ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); + ARM_COMPUTE_LOG_PARAMS(input, output, norm_info); TensorInfo tensor_info(input->info()->tensor_shape(), 1, input->info()->data_type()); _input_squared.allocator()->init(tensor_info); diff --git a/src/runtime/NEON/functions/NEPadLayer.cpp b/src/runtime/NEON/functions/NEPadLayer.cpp index 531b06de64..e776e673c2 100644 --- a/src/runtime/NEON/functions/NEPadLayer.cpp +++ b/src/runtime/NEON/functions/NEPadLayer.cpp @@ -27,6 +27,7 @@ #include "arm_compute/core/Types.h" #include "arm_compute/core/utils/misc/ShapeCalculator.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEPadLayerKernel.h" #include "src/core/helpers/AutoConfiguration.h" @@ -167,6 +168,7 @@ void NEPadLayer::configure_reflect_symmetric_mode(ITensor *input, ITensor *outpu void NEPadLayer::configure(ITensor *input, ITensor *output, const PaddingList &padding, const PixelValue constant_value, const PaddingMode mode) { ARM_COMPUTE_ERROR_THROW_ON(validate(input->info(), output->info(), padding, constant_value, mode)); + ARM_COMPUTE_LOG_PARAMS(input, output, padding, constant_value, mode); _padding = padding; _mode = mode; diff --git a/src/runtime/NEON/functions/NEPriorBoxLayer.cpp b/src/runtime/NEON/functions/NEPriorBoxLayer.cpp index 0c71706586..aba09239cf 100644 --- a/src/runtime/NEON/functions/NEPriorBoxLayer.cpp +++ b/src/runtime/NEON/functions/NEPriorBoxLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -30,12 +30,15 @@ #include "arm_compute/core/Validate.h" #include "arm_compute/core/utils/misc/ShapeCalculator.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEPriorBoxLayerKernel.h" namespace arm_compute { void NEPriorBoxLayer::configure(const ITensor *input1, const ITensor *input2, ITensor *output, const PriorBoxLayerInfo &info) { + ARM_COMPUTE_LOG_PARAMS(input1, input2, output, info); + auto k = std::make_unique(); k->configure(input1, input2, output, info); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NEQLSTMLayer.cpp b/src/runtime/NEON/functions/NEQLSTMLayer.cpp index 565c5531c4..fdfe95fb64 100644 --- a/src/runtime/NEON/functions/NEQLSTMLayer.cpp +++ b/src/runtime/NEON/functions/NEQLSTMLayer.cpp @@ -31,6 +31,7 @@ #include "arm_compute/core/utils/misc/InfoHelpers.h" #include "arm_compute/core/utils/quantization/AsymmHelpers.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEQLSTMLayerNormalizationKernel.h" #include "src/core/helpers/WindowHelpers.h" #include "src/cpu/kernels/CpuGemmLowpMatrixReductionKernel.h" @@ -87,6 +88,8 @@ Status NEQLSTMLayer::TensorCopyKernel::validate(const ITensorInfo &src, const IT void NEQLSTMLayer::TensorCopyKernel::configure(ITensor &src, ITensor &dst) { ARM_COMPUTE_ERROR_THROW_ON(NEQLSTMLayer::TensorCopyKernel::validate(*src.info(), *dst.info())); + ARM_COMPUTE_LOG_PARAMS(src, dst); + _src = &src; _dst = &dst; _row_size = std::min(_src->info()->tensor_shape().x(), _dst->info()->tensor_shape().x()); @@ -156,6 +159,10 @@ void NEQLSTMLayer::configure(const ITensor *input, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, forget_gate_bias, cell_bias, output_gate_bias, cell_state_in, output_state_in, cell_state_out, output_state_out); + ARM_COMPUTE_LOG_PARAMS(input, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, + recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, + forget_gate_bias, cell_bias, output_gate_bias, cell_state_in, output_state_in, cell_state_out, output_state_out); + // Set lstm parameters LSTMParams lstm_params_info{}; build_lstm_params_tensor_info(lstm_params, &lstm_params_info); diff --git a/src/runtime/NEON/functions/NERNNLayer.cpp b/src/runtime/NEON/functions/NERNNLayer.cpp index 6f6d4d942d..a66ef3d27a 100644 --- a/src/runtime/NEON/functions/NERNNLayer.cpp +++ b/src/runtime/NEON/functions/NERNNLayer.cpp @@ -30,6 +30,7 @@ #include "arm_compute/core/Validate.h" #include "arm_compute/core/utils/misc/ShapeCalculator.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" namespace arm_compute { @@ -73,6 +74,7 @@ void NERNNLayer::configure(const ITensor *input, const ITensor *weights, const I { ARM_COMPUTE_ERROR_ON_NULLPTR(input, weights, recurrent_weights, bias, hidden_state, output); ARM_COMPUTE_ERROR_THROW_ON(NERNNLayer::validate(input->info(), weights->info(), recurrent_weights->info(), bias->info(), hidden_state->info(), output->info(), info)); + ARM_COMPUTE_LOG_PARAMS(input, weights, recurrent_weights, bias, hidden_state, output, info); const int idx_height = get_data_layout_dimension_index(input->info()->data_layout(), DataLayoutDimension::HEIGHT); TensorShape shape = misc::shape_calculator::compute_rnn_shape(recurrent_weights->info(), hidden_state->info()->dimension(idx_height)); diff --git a/src/runtime/NEON/functions/NEROIAlignLayer.cpp b/src/runtime/NEON/functions/NEROIAlignLayer.cpp index a946358e18..a9bdb50d95 100644 --- a/src/runtime/NEON/functions/NEROIAlignLayer.cpp +++ b/src/runtime/NEON/functions/NEROIAlignLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -23,6 +23,7 @@ */ #include "arm_compute/runtime/NEON/functions/NEROIAlignLayer.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEFillBorderKernel.h" #include "src/core/NEON/kernels/NEROIAlignLayerKernel.h" @@ -37,6 +38,8 @@ Status NEROIAlignLayer::validate(const ITensorInfo *input, const ITensorInfo *ro void NEROIAlignLayer::configure(const ITensor *input, const ITensor *rois, ITensor *output, const ROIPoolingLayerInfo &pool_info) { + ARM_COMPUTE_LOG_PARAMS(input, rois, output, pool_info); + // Configure ROI pooling kernel auto k = std::make_unique(); k->configure(input, rois, output, pool_info); diff --git a/src/runtime/NEON/functions/NEROIPoolingLayer.cpp b/src/runtime/NEON/functions/NEROIPoolingLayer.cpp index f9434059ea..a24f2aac50 100644 --- a/src/runtime/NEON/functions/NEROIPoolingLayer.cpp +++ b/src/runtime/NEON/functions/NEROIPoolingLayer.cpp @@ -24,6 +24,7 @@ #include "arm_compute/runtime/NEON/functions/NEROIPoolingLayer.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEROIPoolingLayerKernel.h" namespace arm_compute @@ -42,6 +43,8 @@ Status NEROIPoolingLayer::validate(const ITensorInfo *input, const ITensorInfo * void NEROIPoolingLayer::configure(const ITensor *input, const ITensor *rois, const ITensor *output, const ROIPoolingLayerInfo &pool_info) { + ARM_COMPUTE_LOG_PARAMS(input, rois, output, pool_info); + _roi_kernel = std::make_unique(); _roi_kernel->configure(input, rois, output, pool_info); } diff --git a/src/runtime/NEON/functions/NERange.cpp b/src/runtime/NEON/functions/NERange.cpp index 56ef2bf657..a6f7be8be0 100644 --- a/src/runtime/NEON/functions/NERange.cpp +++ b/src/runtime/NEON/functions/NERange.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -24,6 +24,7 @@ #include "arm_compute/runtime/NEON/functions/NERange.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NERangeKernel.h" namespace arm_compute @@ -37,6 +38,7 @@ NERange::NERange() void NERange::configure(ITensor *output, const float start, const float end, const float step) { + ARM_COMPUTE_LOG_PARAMS(output, start, end, step); _kernel = std::make_unique(); _kernel->configure(output, start, end, step); } diff --git a/src/runtime/NEON/functions/NEReduceMean.cpp b/src/runtime/NEON/functions/NEReduceMean.cpp index b50a925f44..a2322c9eda 100644 --- a/src/runtime/NEON/functions/NEReduceMean.cpp +++ b/src/runtime/NEON/functions/NEReduceMean.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -27,6 +27,7 @@ #include "arm_compute/core/Helpers.h" #include "arm_compute/core/utils/misc/ShapeCalculator.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/CPP/Validate.h" #include "src/core/NEON/kernels/NEReductionOperationKernel.h" #include "src/core/helpers/AutoConfiguration.h" @@ -112,6 +113,8 @@ Status NEReduceMean::validate(const ITensorInfo *input, const Coordinates &reduc void NEReduceMean::configure(ITensor *input, const Coordinates &reduction_axis, bool keep_dims, ITensor *output) { + ARM_COMPUTE_LOG_PARAMS(input, reduction_axis, keep_dims, output); + // Perform validate step ARM_COMPUTE_ERROR_THROW_ON(NEReduceMean::validate(input->info(), reduction_axis, keep_dims, output->info())); // Output auto inizialitation if not yet initialized diff --git a/src/runtime/NEON/functions/NEReductionOperation.cpp b/src/runtime/NEON/functions/NEReductionOperation.cpp index 5d6f520a52..9660347a16 100644 --- a/src/runtime/NEON/functions/NEReductionOperation.cpp +++ b/src/runtime/NEON/functions/NEReductionOperation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -26,6 +26,7 @@ #include "arm_compute/core/Helpers.h" #include "arm_compute/core/utils/misc/ShapeCalculator.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEReductionOperationKernel.h" #include "src/core/helpers/AutoConfiguration.h" @@ -104,6 +105,7 @@ Status NEReductionOperation::validate(const ITensorInfo *input, const ITensorInf void NEReductionOperation::configure(ITensor *input, ITensor *output, unsigned int axis, ReductionOperation op, bool keep_dims) { ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); + ARM_COMPUTE_LOG_PARAMS(input, output, axis, op, keep_dims); _is_reshape_required = !keep_dims; diff --git a/src/runtime/NEON/functions/NERemap.cpp b/src/runtime/NEON/functions/NERemap.cpp index dc2c4b4f91..154479aede 100644 --- a/src/runtime/NEON/functions/NERemap.cpp +++ b/src/runtime/NEON/functions/NERemap.cpp @@ -28,6 +28,7 @@ #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/TensorAllocator.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NERemapKernel.h" #include @@ -45,6 +46,7 @@ void NERemap::configure(ITensor *input, const ITensor *map_x, const ITensor *map ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(map_x, 1, DataType::F32); ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(map_y, 1, DataType::F32); ARM_COMPUTE_ERROR_ON_MSG(policy == InterpolationPolicy::AREA, "Area interpolation is not supported"); + ARM_COMPUTE_LOG_PARAMS(input, map_x, map_y, output, policy, border_mode, constant_border_value); auto k = std::make_unique(); k->configure(input, map_x, map_y, output, policy, border_mode, constant_border_value.get()); diff --git a/src/runtime/NEON/functions/NEReorgLayer.cpp b/src/runtime/NEON/functions/NEReorgLayer.cpp index 23ca3a4eea..8ee73d7390 100644 --- a/src/runtime/NEON/functions/NEReorgLayer.cpp +++ b/src/runtime/NEON/functions/NEReorgLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,10 +25,14 @@ #include "src/core/NEON/kernels/NEReorgLayerKernel.h" +#include "src/common/utils/Log.h" + namespace arm_compute { void NEReorgLayer::configure(const ITensor *input, ITensor *output, int32_t stride) { + ARM_COMPUTE_LOG_PARAMS(input, output, stride); + auto k = std::make_unique(); k->configure(input, output, stride); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NEReverse.cpp b/src/runtime/NEON/functions/NEReverse.cpp index 36127ef83c..d4ed2a9018 100644 --- a/src/runtime/NEON/functions/NEReverse.cpp +++ b/src/runtime/NEON/functions/NEReverse.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,10 +25,14 @@ #include "src/core/NEON/kernels/NEReverseKernel.h" +#include "src/common/utils/Log.h" + namespace arm_compute { void NEReverse::configure(const ITensor *input, ITensor *output, const ITensor *axis) { + ARM_COMPUTE_LOG_PARAMS(input, output, axis); + auto k = std::make_unique(); k->configure(input, output, axis); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NEScale.cpp b/src/runtime/NEON/functions/NEScale.cpp index b952858181..9f48e78a5a 100644 --- a/src/runtime/NEON/functions/NEScale.cpp +++ b/src/runtime/NEON/functions/NEScale.cpp @@ -25,6 +25,7 @@ #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/Tensor.h" +#include "src/common/utils/Log.h" #include "src/core/utils/ScaleUtils.h" #include "src/cpu/operators/CpuScale.h" #include "support/Rounding.h" @@ -49,6 +50,8 @@ NEScale::~NEScale() = default; void NEScale::configure(ITensor *input, ITensor *output, const ScaleKernelInfo &info) { + ARM_COMPUTE_LOG_PARAMS(input, output, info); + _impl->src = input; _impl->dst = output; _impl->op = std::make_unique(); diff --git a/src/runtime/NEON/functions/NESelect.cpp b/src/runtime/NEON/functions/NESelect.cpp index f8ba9f03ed..26c2eb8fe9 100644 --- a/src/runtime/NEON/functions/NESelect.cpp +++ b/src/runtime/NEON/functions/NESelect.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -24,12 +24,15 @@ #include "arm_compute/runtime/NEON/functions/NESelect.h" #include "arm_compute/core/Types.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NESelectKernel.h" namespace arm_compute { void NESelect::configure(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output) { + ARM_COMPUTE_LOG_PARAMS(c, x, y, output); + auto k = std::make_unique(); k->configure(c, x, y, output); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NESlice.cpp b/src/runtime/NEON/functions/NESlice.cpp index 9b08bca38a..4a8912bfe9 100644 --- a/src/runtime/NEON/functions/NESlice.cpp +++ b/src/runtime/NEON/functions/NESlice.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -27,6 +27,7 @@ #include "arm_compute/core/Types.h" #include "arm_compute/core/Validate.h" #include "arm_compute/core/utils/helpers/tensor_transform.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEStridedSliceKernel.h" namespace arm_compute @@ -36,6 +37,7 @@ namespace experimental void NESlice::configure(const ITensorInfo *input, ITensorInfo *output, const Coordinates &starts, const Coordinates &ends) { ARM_COMPUTE_ERROR_ON_NULLPTR(input); + ARM_COMPUTE_LOG_PARAMS(input, output, starts, ends); // Get absolute end coordinates const int32_t slice_end_mask = arm_compute::helpers::tensor_transform::construct_slice_end_mask(ends); diff --git a/src/runtime/NEON/functions/NESpaceToBatchLayer.cpp b/src/runtime/NEON/functions/NESpaceToBatchLayer.cpp index e8a84246fe..c4509510dc 100644 --- a/src/runtime/NEON/functions/NESpaceToBatchLayer.cpp +++ b/src/runtime/NEON/functions/NESpaceToBatchLayer.cpp @@ -30,6 +30,7 @@ #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/NEON/NEScheduler.h" #include "arm_compute/runtime/NEON/functions/NEFill.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NESpaceToBatchLayerKernel.h" namespace arm_compute @@ -44,6 +45,7 @@ NESpaceToBatchLayer::NESpaceToBatchLayer() void NESpaceToBatchLayer::configure(const ITensor *input, const ITensor *block_shape, const ITensor *paddings, ITensor *output) { ARM_COMPUTE_ERROR_ON_NULLPTR(input, block_shape, paddings, output); + ARM_COMPUTE_LOG_PARAMS(input, block_shape, paddings, output); if(input->info()->tensor_shape().total_size() != output->info()->tensor_shape().total_size()) { diff --git a/src/runtime/NEON/functions/NESpaceToDepthLayer.cpp b/src/runtime/NEON/functions/NESpaceToDepthLayer.cpp index 1e3776c448..b37bf0d20f 100644 --- a/src/runtime/NEON/functions/NESpaceToDepthLayer.cpp +++ b/src/runtime/NEON/functions/NESpaceToDepthLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -29,6 +29,7 @@ #include "arm_compute/core/Types.h" #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NESpaceToDepthLayerKernel.h" namespace arm_compute @@ -43,6 +44,8 @@ NESpaceToDepthLayer::NESpaceToDepthLayer() void NESpaceToDepthLayer::configure(const ITensor *input, ITensor *output, int32_t block_shape) { ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); + ARM_COMPUTE_LOG_PARAMS(input, output, block_shape); + _space_to_depth_kernel = std::make_unique(); _space_to_depth_kernel->configure(input, output, block_shape); } diff --git a/src/runtime/NEON/functions/NEStackLayer.cpp b/src/runtime/NEON/functions/NEStackLayer.cpp index af5c80d036..68554e0931 100644 --- a/src/runtime/NEON/functions/NEStackLayer.cpp +++ b/src/runtime/NEON/functions/NEStackLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -30,6 +30,7 @@ #include "arm_compute/core/Types.h" #include "arm_compute/core/utils/misc/ShapeCalculator.h" #include "arm_compute/runtime/NEON/NEScheduler.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEStackLayerKernel.h" namespace arm_compute @@ -45,6 +46,8 @@ NEStackLayer::NEStackLayer() // NOLINT void NEStackLayer::configure(const std::vector &input, int axis, ITensor *output) { + ARM_COMPUTE_LOG_PARAMS(input, axis, output); + _num_inputs = input.size(); _stack_kernels.resize(_num_inputs); diff --git a/src/runtime/NEON/functions/NEStridedSlice.cpp b/src/runtime/NEON/functions/NEStridedSlice.cpp index fffb38c3ca..4f50749a4f 100644 --- a/src/runtime/NEON/functions/NEStridedSlice.cpp +++ b/src/runtime/NEON/functions/NEStridedSlice.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,6 +25,7 @@ #include "arm_compute/core/ITensor.h" #include "arm_compute/core/Types.h" +#include "src/common/utils/Log.h" #include "src/core/NEON/kernels/NEStridedSliceKernel.h" namespace arm_compute @@ -35,6 +36,8 @@ void NEStridedSlice::configure(const ITensorInfo *input, ITensorInfo *output, const Coordinates &starts, const Coordinates &ends, const BiStrides &strides, int32_t begin_mask, int32_t end_mask, int32_t shrink_axis_mask) { + ARM_COMPUTE_LOG_PARAMS(input, output, starts, ends, strides, begin_mask, end_mask, shrink_axis_mask); + auto k = std::make_unique(); k->configure(input, output, starts, ends, strides, begin_mask, end_mask, shrink_axis_mask); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NETile.cpp b/src/runtime/NEON/functions/NETile.cpp index 088816eb95..526603f1a3 100644 --- a/src/runtime/NEON/functions/NETile.cpp +++ b/src/runtime/NEON/functions/NETile.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,10 +25,14 @@ #include "src/core/NEON/kernels/NETileKernel.h" +#include "src/common/utils/Log.h" + namespace arm_compute { void NETile::configure(const ITensor *input, ITensor *output, const Multiples &multiples) { + ARM_COMPUTE_LOG_PARAMS(input, output, multiples); + auto k = std::make_unique(); k->configure(input, output, multiples); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NETranspose.cpp b/src/runtime/NEON/functions/NETranspose.cpp index b6bf15e428..78c7ea202a 100644 --- a/src/runtime/NEON/functions/NETranspose.cpp +++ b/src/runtime/NEON/functions/NETranspose.cpp @@ -24,6 +24,7 @@ #include "arm_compute/runtime/NEON/functions/NETranspose.h" #include "arm_compute/core/Validate.h" +#include "src/common/utils/Log.h" #include "src/cpu/operators/CpuTranspose.h" namespace arm_compute @@ -45,6 +46,7 @@ NETranspose::~NETranspose() = default; void NETranspose::configure(const ITensor *input, ITensor *output) { ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); + ARM_COMPUTE_LOG_PARAMS(input, output); _impl->src = input; _impl->dst = output; diff --git a/src/runtime/NEON/functions/NEUnstack.cpp b/src/runtime/NEON/functions/NEUnstack.cpp index 50596dbc0a..176b17f1f5 100644 --- a/src/runtime/NEON/functions/NEUnstack.cpp +++ b/src/runtime/NEON/functions/NEUnstack.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -28,6 +28,7 @@ #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Types.h" #include "arm_compute/core/utils/misc/ShapeCalculator.h" +#include "src/common/utils/Log.h" namespace arm_compute { @@ -70,6 +71,7 @@ void NEUnstack::configure(const ITensor *input, const std::vector &ou ARM_COMPUTE_ERROR_ON_NULLPTR(input); ARM_COMPUTE_ERROR_THROW_ON(NEUnstack::validate(input->info(), outputs_vector_info, axis)); + ARM_COMPUTE_LOG_PARAMS(input, output_vector, outputs_vector_info, axis); // Wrap around negative values const unsigned int axis_u = wrap_axis(axis, input->info()); diff --git a/utils/TypePrinter.h b/utils/TypePrinter.h index 91532bdaac..c3641028a6 100644 --- a/utils/TypePrinter.h +++ b/utils/TypePrinter.h @@ -24,6 +24,10 @@ #ifndef __ARM_COMPUTE_TYPE_PRINTER_H__ #define __ARM_COMPUTE_TYPE_PRINTER_H__ +#ifdef ARM_COMPUTE_OPENCL_ENABLED +#include "arm_compute/core/CL/ICLTensor.h" +#endif /* ARM_COMPUTE_OPENCL_ENABLED */ + #include "arm_compute/core/Dimensions.h" #include "arm_compute/core/Error.h" #include "arm_compute/core/GPUTarget.h" @@ -35,6 +39,7 @@ #include "arm_compute/runtime/CL/CLTunerTypes.h" #include "arm_compute/runtime/CL/CLTypes.h" #include "arm_compute/runtime/FunctionDescriptors.h" +#include "arm_compute/runtime/common/LSTMParams.h" #include "support/StringSupport.h" #include @@ -1094,13 +1099,13 @@ inline std::string to_string(const ITensorInfo &info) return str.str(); } -/** Formatted output of the ITensorInfo* type. +/** Formatted output of the const ITensorInfo* type. * * @param[in] info Type to output. * * @return Formatted string. */ -inline std::string to_string(ITensorInfo *info) +inline std::string to_string(const ITensorInfo *info) { std::string ret_str = "nullptr"; if(info != nullptr) @@ -1112,25 +1117,18 @@ inline std::string to_string(ITensorInfo *info) return ret_str; } -/** Formatted output of the const ITensorInfo* type. +/** Formatted output of the ITensorInfo* type. * * @param[in] info Type to output. * * @return Formatted string. */ -inline std::string to_string(const ITensorInfo *info) +inline std::string to_string(ITensorInfo *info) { - std::string ret_str = "nullptr"; - if(info != nullptr) - { - std::stringstream str; - str << info; - ret_str = str.str(); - } - return ret_str; + return to_string(static_cast(info)); } -/** Formatted output of the const ITensor* type. +/** Formatted output of the ITensorInfo type obtained from const ITensor* type. * * @param[in] tensor Type to output. * @@ -1142,42 +1140,66 @@ inline std::string to_string(const ITensor *tensor) if(tensor != nullptr) { std::stringstream str; - str << tensor->info(); + str << "ITensor->info(): " << tensor->info(); ret_str = str.str(); } return ret_str; } -/** Formatted output of the ITensor* type. +/** Formatted output of the ITensorInfo type obtained from the ITensor* type. * * @param[in] tensor Type to output. * * @return Formatted string. */ inline std::string to_string(ITensor *tensor) +{ + return to_string(static_cast(tensor)); +} + +/** Formatted output of the ITensorInfo type obtained from the ITensor& type. + * + * @param[in] tensor Type to output. + * + * @return Formatted string. + */ +inline std::string to_string(ITensor &tensor) +{ + std::stringstream str; + str << "ITensor.info(): " << tensor.info(); + return str.str(); +} + +#ifdef ARM_COMPUTE_OPENCL_ENABLED +/** Formatted output of the ITensorInfo type obtained from the const ICLTensor& type. + * + * @param[in] cl_tensor Type to output. + * + * @return Formatted string. + */ +inline std::string to_string(const ICLTensor *cl_tensor) { std::string ret_str = "nullptr"; - if(tensor != nullptr) + if(cl_tensor != nullptr) { std::stringstream str; - str << tensor->info(); + str << "ICLTensor->info(): " << cl_tensor->info(); ret_str = str.str(); } return ret_str; } -/** Formatted output of the ITensor& type. +/** Formatted output of the ITensorInfo type obtained from the ICLTensor& type. * - * @param[in] tensor Type to output. + * @param[in] cl_tensor Type to output. * * @return Formatted string. */ -inline std::string to_string(ITensor &tensor) +inline std::string to_string(ICLTensor *cl_tensor) { - std::stringstream str; - str << tensor.info(); - return str.str(); + return to_string(static_cast(cl_tensor)); } +#endif /* ARM_COMPUTE_OPENCL_ENABLED */ /** Formatted output of the Dimensions type. * @@ -1268,7 +1290,7 @@ inline ::std::ostream &operator<<(::std::ostream &os, const GEMMInfo &info) os << "retain_internal_weights=" << info.retain_internal_weights() << ","; os << "fp_mixed_precision=" << info.fp_mixed_precision() << ","; os << "broadcast_bias=" << info.broadcast_bias() << ","; - os << "pretranpose_B=" << info.pretranpose_B() << ","; + os << "pretranspose_B=" << info.pretranspose_B() << ","; return os; } @@ -1360,7 +1382,7 @@ inline std::string to_string(const Window::Dimension &dim) str << dim; return str.str(); } -/** Formatted output of the Window type. +/** Formatted output of the Window& type. * * @param[in] win Type to output. * @@ -1373,6 +1395,24 @@ inline std::string to_string(const Window &win) return str.str(); } +/** Formatted output of the Window* type. + * + * @param[in] win Type to output. + * + * @return Formatted string. + */ +inline std::string to_string(Window *win) +{ + std::string ret_str = "nullptr"; + if(win != nullptr) + { + std::stringstream str; + str << *win; + ret_str = str.str(); + } + return ret_str; +} + /** Formatted output of the Rectangle type. * * @param[out] os Output stream. @@ -2322,10 +2362,10 @@ inline ::std::ostream &operator<<(::std::ostream &os, const CLTunerMode &val) */ inline ::std::ostream &operator<<(::std::ostream &os, const ConvolutionInfo &conv_info) { - os << "PadStrideInfo = " << conv_info.pad_stride_info << ", " + os << "{PadStrideInfo = " << conv_info.pad_stride_info << ", " << "depth_multiplier = " << conv_info.depth_multiplier << ", " << "act_info = " << to_string(conv_info.act_info) << ", " - << "dilation = " << conv_info.dilation; + << "dilation = " << conv_info.dilation << "}"; return os; } @@ -2351,13 +2391,13 @@ inline std::string to_string(const ConvolutionInfo &info) */ inline ::std::ostream &operator<<(::std::ostream &os, const FullyConnectedLayerInfo &layer_info) { - os << "activation_info = " << to_string(layer_info.activation_info) << ", " + os << "{activation_info = " << to_string(layer_info.activation_info) << ", " << "weights_trained_layout = " << layer_info.weights_trained_layout << ", " << "transpose_weights = " << layer_info.transpose_weights << ", " << "are_weights_reshaped = " << layer_info.are_weights_reshaped << ", " << "retain_internal_weights = " << layer_info.retain_internal_weights << ", " << "constant_weights = " << layer_info.transpose_weights << ", " - << "fp_mixed_precision = " << layer_info.fp_mixed_precision; + << "fp_mixed_precision = " << layer_info.fp_mixed_precision << "}"; return os; } @@ -2425,7 +2465,7 @@ inline std::string to_string(const GEMMLowpOutputStageType &gemm_type) */ inline ::std::ostream &operator<<(::std::ostream &os, const GEMMLowpOutputStageInfo &gemm_info) { - os << "type = " << gemm_info.type << ", " + os << "{type = " << gemm_info.type << ", " << "gemlowp_offset = " << gemm_info.gemmlowp_offset << ", " << "gemmlowp_multiplier" << gemm_info.gemmlowp_multiplier << ", " << "gemmlowp_shift = " << gemm_info.gemmlowp_shift << ", " @@ -2435,7 +2475,7 @@ inline ::std::ostream &operator<<(::std::ostream &os, const GEMMLowpOutputStageI << "gemmlowp_shifts = " << gemm_info.gemmlowp_shift << ", " << "gemmlowp_real_multiplier = " << gemm_info.gemmlowp_real_multiplier << ", " << "is_quantized_per_channel = " << gemm_info.is_quantized_per_channel << ", " - << "output_data_type = " << gemm_info.output_data_type; + << "output_data_type = " << gemm_info.output_data_type << "}"; return os; } @@ -2461,11 +2501,11 @@ inline std::string to_string(const GEMMLowpOutputStageInfo &gemm_info) */ inline ::std::ostream &operator<<(::std::ostream &os, const Conv2dInfo &conv_info) { - os << "conv_info = " << conv_info.conv_info << ", " + os << "{conv_info = " << conv_info.conv_info << ", " << "dilation = " << conv_info.dilation << ", " << "act_info = " << to_string(conv_info.act_info) << ", " << "enable_fast_math = " << conv_info.enable_fast_math << ", " - << "num_groups = " << conv_info.num_groups; + << "num_groups = " << conv_info.num_groups << "}"; return os; } @@ -2491,7 +2531,7 @@ inline std::string to_string(const Conv2dInfo &conv_info) */ inline ::std::ostream &operator<<(::std::ostream &os, const PixelValue &pixel_value) { - os << "value.u64= " << pixel_value.get(); + os << "{value.u64= " << pixel_value.get() << "}"; return os; } @@ -2517,13 +2557,13 @@ inline std::string to_string(const PixelValue &pixel_value) */ inline ::std::ostream &operator<<(::std::ostream &os, const ScaleKernelInfo &scale_info) { - os << "interpolation_policy = " << scale_info.interpolation_policy << ", " + os << "{interpolation_policy = " << scale_info.interpolation_policy << ", " << "BorderMode = " << scale_info.border_mode << ", " << "PixelValue = " << scale_info.constant_border_value << ", " << "SamplingPolicy = " << scale_info.sampling_policy << ", " << "use_padding = " << scale_info.use_padding << ", " << "align_corners = " << scale_info.align_corners << ", " - << "data_layout = " << scale_info.data_layout; + << "data_layout = " << scale_info.data_layout << "}"; return os; } @@ -2572,7 +2612,7 @@ inline ::std::ostream &operator<<(::std::ostream &os, const FFTDirection &fft_di inline std::string to_string(const FFTDirection &fft_dir) { std::stringstream str; - str << fft_dir; + str << "{" << fft_dir << "}"; return str.str(); } @@ -2585,8 +2625,8 @@ inline std::string to_string(const FFTDirection &fft_dir) */ inline ::std::ostream &operator<<(::std::ostream &os, const FFT1DInfo &fft1d_info) { - os << "axis = " << fft1d_info.axis << ", " - << "direction = " << fft1d_info.direction; + os << "{axis = " << fft1d_info.axis << ", " + << "direction = " << fft1d_info.direction << "}"; return os; } @@ -2612,9 +2652,9 @@ inline std::string to_string(const FFT1DInfo &fft1d_info) */ inline ::std::ostream &operator<<(::std::ostream &os, const FFT2DInfo &fft2d_info) { - os << "axis = " << fft2d_info.axis0 << ", " + os << "{axis = " << fft2d_info.axis0 << ", " << "axis = " << fft2d_info.axis1 << ", " - << "direction = " << fft2d_info.direction; + << "direction = " << fft2d_info.direction << "}"; return os; } @@ -2640,8 +2680,8 @@ inline std::string to_string(const FFT2DInfo &fft2d_info) */ inline ::std::ostream &operator<<(::std::ostream &os, const Coordinates2D &coord_2d) { - os << "x = " << coord_2d.x << ", " - << "y = " << coord_2d.y; + os << "{x = " << coord_2d.x << ", " + << "y = " << coord_2d.y << "}"; return os; } @@ -2694,6 +2734,97 @@ inline std::string to_string(const FuseBatchNormalizationType &fuse_type) return str.str(); } +/** Formatted output of the SoftmaxKernelInfo type. + * + * @param[out] os Output stream. + * @param[in] info SoftmaxKernelInfo to output. + * + * @return Modified output stream. + */ +inline ::std::ostream &operator<<(::std::ostream &os, const SoftmaxKernelInfo &info) +{ + os << "{beta = " << info.beta << ", " + << "is_log = " << info.is_log << ", " + << "input_data_type = " << info.input_data_type << ", " + << "axis = " << info.axis << "}"; + return os; +} + +/** Converts a @ref SoftmaxKernelInfo to string + * + * @param[in] info SoftmaxKernelInfo value to be converted + * + * @return String representing the corresponding SoftmaxKernelInfo + */ +inline std::string to_string(const SoftmaxKernelInfo &info) +{ + std::stringstream str; + str << info; + return str.str(); +} + +/** Formatted output of the ScaleKernelInfo type. + * + * @param[out] os Output stream. + * @param[in] lstm_params LSTMParams to output. + * + * @return Modified output stream. + */ +template +inline ::std::ostream &operator<<(::std::ostream &os, const LSTMParams &lstm_params) +{ + os << "{input_to_input_weights=" << lstm_params.input_to_input_weights() << ", " + << "recurrent_to_input_weights=" << lstm_params.recurrent_to_input_weights() << ", " + << "cell_to_input_weights=" << lstm_params.cell_to_input_weights() << ", " + << "input_gate_bias=" << lstm_params.input_gate_bias() << ", " + << "cell_to_forget_weights=" << lstm_params.cell_to_forget_weights() << ", " + << "cell_to_output_weights=" << lstm_params.cell_to_output_weights() << ", " + << "projection_weights=" << lstm_params.projection_weights() << ", " + << "projection_bias=" << lstm_params.projection_bias() << ", " + << "input_layer_norm_weights=" << lstm_params.input_layer_norm_weights() << ", " + << "forget_layer_norm_weights=" << lstm_params.forget_layer_norm_weights() << ", " + << "cell_layer_norm_weights=" << lstm_params.cell_layer_norm_weights() << ", " + << "output_layer_norm_weights=" << lstm_params.output_layer_norm_weights() << ", " + << "cell_clip=" << lstm_params.cell_clip() << ", " + << "projection_clip=" << lstm_params.projection_clip() << ", " + << "input_intermediate_scale=" << lstm_params.input_intermediate_scale() << ", " + << "forget_intermediate_scale=" << lstm_params.forget_intermediate_scale() << ", " + << "cell_intermediate_scale=" << lstm_params.cell_intermediate_scale() << ", " + << "hidden_state_zero=" << lstm_params.hidden_state_zero() << ", " + << "hidden_state_scale=" << lstm_params.hidden_state_scale() << ", " + << "has_peephole_opt=" << lstm_params.has_peephole_opt() << ", " + << "has_projection=" << lstm_params.has_projection() << ", " + << "has_cifg_opt=" << lstm_params.has_cifg_opt() << ", " + << "use_layer_norm=" << lstm_params.use_layer_norm() << "}"; + return os; +} + +/** Converts a @ref LSTMParams to string + * + * @param[in] lstm_params LSTMParams value to be converted + * + * @return String representing the corresponding LSTMParams + */ +template +inline std::string to_string(const LSTMParams &lstm_params) +{ + std::stringstream str; + str << lstm_params; + return str.str(); +} + +/** Converts a @ref LSTMParams to string + * + * @param[in] num uint8_t value to be converted + * + * @return String representing the corresponding uint8_t + */ +inline std::string to_string(const uint8_t num) +{ + // Explicity cast the uint8_t to signed integer and call the corresponding overloaded to_string() function. + return ::std::to_string(static_cast(num)); +} + } // namespace arm_compute #endif /* __ARM_COMPUTE_TYPE_PRINTER_H__ */ -- cgit v1.2.1