From 9129549110527fd53655d3e6b61e8e59bed6f97f Mon Sep 17 00:00:00 2001 From: SiCong Li Date: Fri, 21 Jul 2023 18:16:13 +0100 Subject: Retain back-compatibility for arm_compute/core/Types.h * Some symbols have been moved from core/Types.h. This patch retains back compatibility so that the user can still include this header for those symbols * A new header core/CoreTypes.h is created to avoid circular dependency. This header includes essential small types that are used across functions * Move all function info types into function_info folder for easier tracking Resolves COMPMID-6330 Related to https://review.mlplatform.org/c/ml/ComputeLibrary/+/9757 Signed-off-by: SiCong Li Change-Id: I4739175c2d4d184a9bc8e28b881b497fab03ca60 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9979 Reviewed-by: Jakub Sujak Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- arm_compute/BUILD.bazel | 1 + arm_compute/core/ActivationLayerInfo.h | 111 ------ arm_compute/core/ConvolutionInfo.h | 45 --- arm_compute/core/CoreTypes.h | 346 ++++++++++++++++++ arm_compute/core/FullyConnectedLayerInfo.h | 71 ---- arm_compute/core/GEMMInfo.h | 314 ---------------- arm_compute/core/KernelDescriptors.h | 2 +- arm_compute/core/MatMulInfo.h | 79 ---- arm_compute/core/Types.h | 401 ++------------------- arm_compute/core/experimental/PostOps.h | 2 +- arm_compute/core/utils/FormatUtils.h | 4 +- arm_compute/core/utils/misc/ShapeCalculator.h | 12 +- arm_compute/function_info/ActivationLayerInfo.h | 117 ++++++ arm_compute/function_info/ConvolutionInfo.h | 46 +++ .../function_info/FullyConnectedLayerInfo.h | 71 ++++ arm_compute/function_info/GEMMInfo.h | 341 ++++++++++++++++++ arm_compute/function_info/MatMulInfo.h | 62 ++++ arm_compute/graph/Types.h | 8 +- .../runtime/CL/functions/CLActivationLayer.h | 2 +- .../CL/functions/CLBatchNormalizationLayer.h | 2 +- .../runtime/CL/functions/CLConvolutionLayer.h | 2 +- .../CL/functions/CLDepthwiseConvolutionLayer.h | 2 +- .../CL/functions/CLDirectConvolutionLayer.h | 2 +- .../runtime/CL/functions/CLElementwiseOperations.h | 2 +- .../runtime/CL/functions/CLFullyConnectedLayer.h | 2 +- arm_compute/runtime/CL/functions/CLGEMM.h | 2 +- .../runtime/CL/functions/CLGEMMConvolutionLayer.h | 2 +- .../CL/functions/CLGEMMLowpMatrixMultiplyCore.h | 2 +- .../CL/functions/CLIndirectConvolutionLayer.h | 2 +- arm_compute/runtime/CL/functions/CLMatMul.h | 2 +- .../CL/functions/CLPixelWiseMultiplication.h | 2 +- .../CL/functions/CLWinogradConvolutionLayer.h | 2 +- arm_compute/runtime/FunctionDescriptors.h | 2 +- .../runtime/NEON/functions/NEActivationLayer.h | 2 +- .../runtime/NEON/functions/NEArithmeticAddition.h | 2 +- .../NEON/functions/NEArithmeticSubtraction.h | 2 +- .../runtime/NEON/functions/NEConvolutionLayer.h | 2 +- .../NEON/functions/NEDirectConvolutionLayer.h | 2 +- .../NEON/functions/NEElementwiseOperations.h | 2 +- .../runtime/NEON/functions/NEFullyConnectedLayer.h | 2 +- arm_compute/runtime/NEON/functions/NEGEMM.h | 2 +- .../NEON/functions/NEGEMMConvolutionLayer.h | 2 +- .../NEON/functions/NEGEMMLowpMatrixMultiplyCore.h | 2 +- arm_compute/runtime/NEON/functions/NEMatMul.h | 2 +- .../NEON/functions/NEPixelWiseMultiplication.h | 4 +- .../NEON/functions/NEWinogradConvolutionLayer.h | 2 +- docs/contributor_guide/adding_operator.dox | 6 +- src/common/utils/LegacySupport.cpp | 2 +- src/common/utils/LegacySupport.h | 2 +- .../CL/kernels/CLBatchNormalizationLayerKernel.h | 2 +- .../CLDepthwiseConvolutionLayerNativeKernel.h | 2 +- .../NEON/kernels/NEBatchNormalizationLayerKernel.h | 2 +- .../kernels/batchnormalization/impl/SVE/fp16.cpp | 2 +- .../kernels/batchnormalization/impl/SVE/fp32.cpp | 2 +- .../kernels/detail/NEActivationFunctionDetail.h | 2 +- src/core/Utils.cpp | 2 +- src/core/utils/AssemblyUtils.cpp | 2 +- src/core/utils/quantization/AsymmHelpers.cpp | 21 +- src/cpu/kernels/CpuActivationKernel.h | 2 +- src/cpu/kernels/CpuAddMulAddKernel.h | 2 +- src/cpu/kernels/CpuDepthwiseConv2dNativeKernel.h | 2 +- src/cpu/kernels/activation/generic/neon/impl.h | 4 +- src/cpu/kernels/activation/generic/neon/lut.cpp | 2 +- .../kernels/activation/generic/neon/qasymm8.cpp | 2 +- .../activation/generic/neon/qasymm8_signed.cpp | 2 +- .../kernels/activation/generic/neon/qsymm16.cpp | 2 +- src/cpu/kernels/activation/generic/sve/fp16.cpp | 2 +- src/cpu/kernels/activation/generic/sve/fp32.cpp | 2 +- src/cpu/kernels/activation/generic/sve2/lut.cpp | 2 +- .../kernels/activation/generic/sve2/qasymm8.cpp | 21 +- .../activation/generic/sve2/qasymm8_signed.cpp | 2 +- .../kernels/activation/generic/sve2/qsymm16.cpp | 2 +- src/cpu/kernels/addmuladd/generic/neon/fp16.cpp | 2 +- src/cpu/kernels/addmuladd/generic/neon/fp32.cpp | 2 +- src/cpu/kernels/addmuladd/generic/neon/qasymm8.cpp | 2 +- .../addmuladd/generic/neon/qasymm8_signed.cpp | 2 +- .../kernels/depthwiseconv2d/generic/neon/impl.cpp | 2 +- src/cpu/operators/CpuActivation.h | 2 +- src/cpu/operators/CpuAdd.h | 2 +- src/cpu/operators/CpuConv2d.h | 2 +- .../operators/CpuDepthwiseConv2dAssemblyDispatch.h | 2 +- src/cpu/operators/CpuFullyConnected.h | 10 +- src/cpu/operators/CpuGemm.h | 2 +- src/cpu/operators/CpuGemmConv2d.h | 2 +- src/cpu/operators/CpuGemmLowpMatrixMultiplyCore.h | 2 +- src/cpu/operators/CpuMatMul.cpp | 2 +- src/cpu/operators/CpuMul.h | 2 +- src/cpu/operators/CpuSub.h | 2 +- .../operators/internal/CpuGemmAssemblyDispatch.h | 2 +- .../gpu/components/cl/ClComponentActivation.h | 4 +- .../sketch/gpu/operators/GpuSigmoid.cpp | 2 +- .../gpu/template_writer/cl/ClTemplateActivation.h | 4 +- src/gpu/cl/kernels/ClActivationKernel.cpp | 6 +- src/gpu/cl/kernels/ClActivationKernel.h | 2 +- src/gpu/cl/kernels/ClDirectConv2dKernel.h | 2 +- src/gpu/cl/kernels/ClElementwiseKernel.h | 2 +- src/gpu/cl/kernels/ClIndirectConv2dKernel.h | 2 +- src/gpu/cl/kernels/ClMatMulLowpNativeKernel.h | 2 +- src/gpu/cl/kernels/ClMulKernel.h | 2 +- src/gpu/cl/operators/ClActivation.h | 2 +- src/gpu/cl/operators/ClAdd.h | 2 +- src/gpu/cl/operators/ClDirectConv2d.h | 2 +- src/gpu/cl/operators/ClElementwiseOperations.h | 2 +- src/gpu/cl/operators/ClFullyConnected.h | 2 +- src/gpu/cl/operators/ClGemm.h | 2 +- .../cl/operators/ClGemmLowpMatrixMultiplyCore.h | 2 +- src/gpu/cl/operators/ClIndirectConv2d.h | 2 +- src/gpu/cl/operators/ClMatMul.h | 4 +- src/gpu/cl/operators/ClMul.h | 2 +- src/gpu/cl/operators/ClSub.h | 2 +- src/runtime/CL/functions/CLActivationLayer.cpp | 2 +- .../CL/functions/CLGEMMDeconvolutionLayer.cpp | 2 +- .../matmul_native/IClMatMulNativeKernelConfig.h | 2 +- tests/validation/Helpers.h | 2 +- utils/TypePrinter.h | 8 +- 115 files changed, 1169 insertions(+), 1128 deletions(-) delete mode 100644 arm_compute/core/ActivationLayerInfo.h delete mode 100644 arm_compute/core/ConvolutionInfo.h create mode 100644 arm_compute/core/CoreTypes.h delete mode 100644 arm_compute/core/FullyConnectedLayerInfo.h delete mode 100644 arm_compute/core/GEMMInfo.h delete mode 100644 arm_compute/core/MatMulInfo.h create mode 100644 arm_compute/function_info/ActivationLayerInfo.h create mode 100644 arm_compute/function_info/ConvolutionInfo.h create mode 100644 arm_compute/function_info/FullyConnectedLayerInfo.h create mode 100644 arm_compute/function_info/GEMMInfo.h create mode 100644 arm_compute/function_info/MatMulInfo.h diff --git a/arm_compute/BUILD.bazel b/arm_compute/BUILD.bazel index 641a327d51..d1219015b7 100644 --- a/arm_compute/BUILD.bazel +++ b/arm_compute/BUILD.bazel @@ -28,6 +28,7 @@ cc_library( "*.h", "*.hpp", "dynamic_fusion/**/*.h", + "function_info/**/*.h", ]), visibility = ["//visibility:public"], ) diff --git a/arm_compute/core/ActivationLayerInfo.h b/arm_compute/core/ActivationLayerInfo.h deleted file mode 100644 index d9dc0a0702..0000000000 --- a/arm_compute/core/ActivationLayerInfo.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2016-2023 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_ACTIVATIONLAYERINFO_H -#define ARM_COMPUTE_ACTIVATIONLAYERINFO_H - -#include "arm_compute/core/Coordinates.h" -#include "arm_compute/core/QuantizationInfo.h" -#include "arm_compute/core/Size2D.h" -#include "arm_compute/core/Size3D.h" -#include "arm_compute/core/Strides.h" -#include "arm_compute/core/TensorShape.h" -#include "arm_compute/core/Types.h" -#include "arm_compute/core/experimental/IPostOp.h" -#include "arm_compute/core/utils/misc/Macros.h" -#include "support/Bfloat16.h" -#include "support/Half.h" - -#include -#include -#include -#include -#include -#include - -namespace arm_compute -{ -/** Activation Layer Information class */ -class ActivationLayerInfo -{ -public: - typedef arm_compute::ActivationFunction ActivationFunction; - - /** Lookup table */ - using LookupTable256 = std::array; - - ActivationLayerInfo() = default; - /** Default Constructor - * - * @param[in] f The activation function to use. - * @param[in] a (Optional) The alpha parameter used by some activation functions - * (@ref ActivationFunction::BOUNDED_RELU, @ref ActivationFunction::LU_BOUNDED_RELU, @ref ActivationFunction::LINEAR, @ref ActivationFunction::TANH). - * @param[in] b (Optional) The beta parameter used by some activation functions (@ref ActivationFunction::LINEAR, @ref ActivationFunction::LU_BOUNDED_RELU, @ref ActivationFunction::TANH). - */ - ActivationLayerInfo(ActivationFunction f, float a = 0.0f, float b = 0.0f) - : _act(f), _a(a), _b(b), _enabled(true) - { - } - /** Get the type of activation function */ - ActivationFunction activation() const - { - return _act; - } - /** Get the alpha value */ - float a() const - { - return _a; - } - /** Get the beta value */ - float b() const - { - return _b; - } - /** Check if initialised */ - bool enabled() const - { - return _enabled; - } - -#ifdef __aarch64__ - const LookupTable256 &lut() const - { - return _lut; - } - void setLookupTable256(LookupTable256 &lut) - { - _lut = std::move(lut); - } -#endif // __aarch64__ -private: - ActivationFunction _act = { ActivationLayerInfo::ActivationFunction::IDENTITY }; - float _a = {}; - float _b = {}; - bool _enabled = { false }; - -#ifdef __aarch64__ - LookupTable256 _lut = {}; -#endif // __aarch64__ -}; -} // namespace arm_compute -#endif /* ARM_COMPUTE_ACTIVATIONLAYERINFO_H */ diff --git a/arm_compute/core/ConvolutionInfo.h b/arm_compute/core/ConvolutionInfo.h deleted file mode 100644 index 1b5e5d197b..0000000000 --- a/arm_compute/core/ConvolutionInfo.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2016-2023 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_CONVOLUTIONINFO_H -#define ARM_COMPUTE_CONVOLUTIONINFO_H - -#include "arm_compute/core/ActivationLayerInfo.h" -#include "arm_compute/core/Types.h" - -namespace arm_compute -{ -struct ConvolutionInfo -{ - ConvolutionInfo() = default; - ConvolutionInfo(const PadStrideInfo &pad_stride_info, unsigned int depth_multiplier, const ActivationLayerInfo &act_info, const Size2D &dilation) - : pad_stride_info(pad_stride_info), depth_multiplier(depth_multiplier), act_info(act_info), dilation(dilation) - { - } - PadStrideInfo pad_stride_info{}; /**< Convolution info (Pads, strides,...) */ - unsigned int depth_multiplier{ 1 }; /**< Multiplier to apply to input's depth to retrieve the output depth. Defaults to 1 */ - ActivationLayerInfo act_info{}; /**< Fused activation to apply after convolution. */ - Size2D dilation{ Size2D(1, 1) }; /**< Dilation, in elements, across x and y. Defaults to (1, 1). */ -}; -} // namespace arm_compute -#endif /* ARM_COMPUTE_CONVOLUTIONINFO_H */ diff --git a/arm_compute/core/CoreTypes.h b/arm_compute/core/CoreTypes.h new file mode 100644 index 0000000000..4a48a36651 --- /dev/null +++ b/arm_compute/core/CoreTypes.h @@ -0,0 +1,346 @@ +/* + * Copyright (c) 2016-2023 Arm Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ACL_ARM_COMPUTE_CORE_CORETYPES +#define ACL_ARM_COMPUTE_CORE_CORETYPES + +#include "arm_compute/core/Strides.h" +#include "support/Half.h" + +/** CoreTypes.h groups together essential small types that are used across functions */ + +namespace arm_compute +{ +/** 16-bit floating point type */ +using half = half_float::half; +/** Permutation vector */ +using PermutationVector = Strides; + +/** Available channels */ +enum class Channel +{ + UNKNOWN, /** Unknown channel format */ + C0, /**< First channel (used by formats with unknown channel types). */ + C1, /**< Second channel (used by formats with unknown channel types). */ + C2, /**< Third channel (used by formats with unknown channel types). */ + C3, /**< Fourth channel (used by formats with unknown channel types). */ + R, /**< Red channel. */ + G, /**< Green channel. */ + B, /**< Blue channel. */ + A, /**< Alpha channel. */ + Y, /**< Luma channel. */ + U, /**< Cb/U channel. */ + V /**< Cr/V/Value channel. */ +}; + +/** Image colour formats */ +enum class Format +{ + UNKNOWN, /**< Unknown image format */ + U8, /**< 1 channel, 1 U8 per channel */ + S16, /**< 1 channel, 1 S16 per channel */ + U16, /**< 1 channel, 1 U16 per channel */ + S32, /**< 1 channel, 1 S32 per channel */ + U32, /**< 1 channel, 1 U32 per channel */ + S64, /**< 1 channel, 1 S64 per channel */ + U64, /**< 1 channel, 1 U64 per channel */ + BFLOAT16, /**< 16-bit brain floating-point number */ + F16, /**< 1 channel, 1 F16 per channel */ + F32, /**< 1 channel, 1 F32 per channel */ + UV88, /**< 2 channel, 1 U8 per channel */ + RGB888, /**< 3 channels, 1 U8 per channel */ + RGBA8888, /**< 4 channels, 1 U8 per channel */ + YUV444, /**< A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes */ + YUYV422, /**< A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes */ + NV12, /**< A 2 plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling */ + NV21, /**< A 2 plane YUV format of Luma (Y) and interleaved VU data at 4:2:0 sampling */ + IYUV, /**< A 3 plane of 8-bit 4:2:0 sampled Y, U, V planes */ + UYVY422 /**< A single plane of 32-bit macro pixel of U0, Y0, V0, Y1 byte */ +}; + +/** Available data types */ +enum class DataType +{ + UNKNOWN, /**< Unknown data type */ + U8, /**< unsigned 8-bit number */ + S8, /**< signed 8-bit number */ + QSYMM8, /**< quantized, symmetric fixed-point 8-bit number */ + QASYMM8, /**< quantized, asymmetric fixed-point 8-bit number unsigned */ + QASYMM8_SIGNED, /**< quantized, asymmetric fixed-point 8-bit number signed */ + QSYMM8_PER_CHANNEL, /**< quantized, symmetric per channel fixed-point 8-bit number */ + U16, /**< unsigned 16-bit number */ + S16, /**< signed 16-bit number */ + QSYMM16, /**< quantized, symmetric fixed-point 16-bit number */ + QASYMM16, /**< quantized, asymmetric fixed-point 16-bit number */ + U32, /**< unsigned 32-bit number */ + S32, /**< signed 32-bit number */ + U64, /**< unsigned 64-bit number */ + S64, /**< signed 64-bit number */ + BFLOAT16, /**< 16-bit brain floating-point number */ + F16, /**< 16-bit floating-point number */ + F32, /**< 32-bit floating-point number */ + F64, /**< 64-bit floating-point number */ + SIZET /**< size_t */ +}; + +/** [DataLayout enum definition] **/ + +/** Supported tensor data layouts */ +enum class DataLayout +{ + UNKNOWN, /**< Unknown data layout */ + NCHW, /**< Num samples, channels, height, width */ + NHWC, /**< Num samples, height, width, channels */ + NCDHW, /**< Num samples, channels, depth, height, width */ + NDHWC /**< Num samples, depth, height, width, channels */ +}; +/** [DataLayout enum definition] **/ + +/** Supported tensor data layout dimensions */ +enum class DataLayoutDimension +{ + CHANNEL, /**< channel */ + HEIGHT, /**< height */ + WIDTH, /**< width */ + DEPTH, /**< depth */ + BATCHES /**< batches */ +}; + +/** Dimension rounding type when down-scaling on CNNs + * @note Used in pooling and convolution layer + */ +enum class DimensionRoundingType +{ + FLOOR, /**< Floor rounding */ + CEIL /**< Ceil rounding */ +}; + +class PadStrideInfo +{ +public: + /** Constructor + * + * @param[in] stride_x (Optional) Stride, in elements, across x. Defaults to 1. + * @param[in] stride_y (Optional) Stride, in elements, across y. Defaults to 1. + * @param[in] pad_x (Optional) Padding, in elements, across x. Defaults to 0. + * @param[in] pad_y (Optional) Padding, in elements, across y. Defaults to 0. + * @param[in] round (Optional) Dimensions rounding. Defaults to @ref DimensionRoundingType::FLOOR. + */ + PadStrideInfo(unsigned int stride_x = 1, unsigned int stride_y = 1, + unsigned int pad_x = 0, unsigned int pad_y = 0, + DimensionRoundingType round = DimensionRoundingType::FLOOR) + : _stride(std::make_pair(stride_x, stride_y)), + _pad_left(pad_x), + _pad_top(pad_y), + _pad_right(pad_x), + _pad_bottom(pad_y), + _round_type(round) + { + } + /** Constructor + * + * @param[in] stride_x Stride, in elements, across x. + * @param[in] stride_y Stride, in elements, across y. + * @param[in] pad_left Padding across x on the left, in elements. + * @param[in] pad_right Padding across x on the right, in elements. + * @param[in] pad_top Padding across y on the top, in elements. + * @param[in] pad_bottom Padding across y on the bottom, in elements. + * @param[in] round Dimensions rounding. + */ + PadStrideInfo(unsigned int stride_x, unsigned int stride_y, + unsigned int pad_left, unsigned int pad_right, + unsigned int pad_top, unsigned int pad_bottom, + DimensionRoundingType round) + : _stride(std::make_pair(stride_x, stride_y)), + _pad_left(pad_left), + _pad_top(pad_top), + _pad_right(pad_right), + _pad_bottom(pad_bottom), + _round_type(round) + { + } + /** Get the stride. + * + * @return a pair: stride x, stride y. + */ + std::pair stride() const + { + return _stride; + } + /** Check whether the padding is symmetric. + * + * @return True if the padding is symmetric. + */ + bool padding_is_symmetric() const + { + return (_pad_left == _pad_right) && (_pad_top == _pad_bottom); + } + /** Get the padding. + * + * @note This should only be used when the padding is symmetric. + * + * @return a pair: padding left/right, padding top/bottom + */ + std::pair pad() const + { + //this accessor should be used only when padding is symmetric + ARM_COMPUTE_ERROR_ON(!padding_is_symmetric()); + return std::make_pair(_pad_left, _pad_top); + } + + /** Get the left padding */ + unsigned int pad_left() const + { + return _pad_left; + } + /** Get the right padding */ + unsigned int pad_right() const + { + return _pad_right; + } + /** Get the top padding */ + unsigned int pad_top() const + { + return _pad_top; + } + /** Get the bottom padding */ + unsigned int pad_bottom() const + { + return _pad_bottom; + } + + /** Get the rounding type */ + DimensionRoundingType round() const + { + return _round_type; + } + + /** Check whether this has any padding */ + bool has_padding() const + { + return (_pad_left != 0 || _pad_top != 0 || _pad_right != 0 || _pad_bottom != 0); + } + +private: + std::pair _stride; + unsigned int _pad_left; + unsigned int _pad_top; + unsigned int _pad_right; + unsigned int _pad_bottom; + + DimensionRoundingType _round_type; +}; + +/** Memory layouts for the weights tensor. + * + * * UNSPECIFIED is used to select kernels that do not run in + * variable weights mode. + * + * * ANY is used to query the kernel database to retrieve any of the + * kernels that runs in variable weights mode. Once a kernel is + * found, the specific format expected by the kernel can be + * retrieved by the user for reordering the weights tensor + * accordingly. + * + * The other values OHWIo{interleave_by}i{block_by} describe the + * memory layout of a 4D tensor with layout OHWI that has been + * transformed into a 4D tensor with dimensions O'HWI' where: + * + * O' = first multiple of {interleave_by} s.t. O<=O' + * I' = first multiple of {block_by} s.t. I<=I' + * + * The total size of the dst tensor is O' x H x W x I' + * + * The access function of the tensor with layout + * OHWIo{interleave_by}i{block_by} and size O'HWI' is a 6-parameter + * access function, where the 6 parameters are computed as follows: + * + * x5 = floor(o/{interleave_by}) RANGE [0, O'/{interleave_by} -1] SIZE: O'/{interleave_by} + * + * x4 = h RANGE [0, H-1] SIZE: H + * x3 = w RANGE [0, W-1] SIZE: W + * x2 = floor(i/{block_by}) RANGE [0, I'/{block_by} -1] SIZE: I'/{block_by} + * x1 = o%{interleave_by} RANGE [0, {interleave_by} -1] SIZE: {interleave_by} + * x0 = i%{block_by} RANGE [0, {block_by} -1] SIZE: {block_by} + * TOTAL SIZE: O' * H * W * I' + * + * 4D 6D + * ----------------- ----------------------------------- + * value(o, h, w, i) = x5 * H * W * I' * {interleave_by} + * + x4 * W * I' * {interleave_by} + * + x3 * I' * {interleave_by} + * + x2 * {interleave_by} * {block_by} + * + x1 * {block_by} + * + x0 + * + * Notice that in arm_gemm the 4D tensor of dimension O'HWI' created + * for the OHWIo{interleave_by}i{block_by} format is in reality seen + * as a 2D tensor, where the number of rows is O'/{interleave_by} + * and the number of columns is {interleave_by} * H * W * I'. + * + * The postfix *_bf16 is for the memory layout needed for the + * fast-mode kernels, in which the weights are passed in bfloat16 + * format. + */ +enum class WeightFormat +{ + UNSPECIFIED = 0x1, + ANY = 0x2, + OHWI = 0x100100, + OHWIo2 = 0x100200, + OHWIo4 = 0x100400, + OHWIo8 = 0x100800, + OHWIo16 = 0x101000, + OHWIo32 = 0x102000, + OHWIo64 = 0x104000, + OHWIo128 = 0x108000, + OHWIo4i2 = 0x200400, + OHWIo4i2_bf16 = 0x200410, + OHWIo8i2 = 0x200800, + OHWIo8i2_bf16 = 0x200810, + OHWIo16i2 = 0x201000, + OHWIo16i2_bf16 = 0x201010, + OHWIo32i2 = 0x202000, + OHWIo32i2_bf16 = 0x202010, + OHWIo64i2 = 0x204000, + OHWIo64i2_bf16 = 0x204010, + OHWIo4i4 = 0x400400, + OHWIo4i4_bf16 = 0x400410, + OHWIo8i4 = 0x400800, + OHWIo8i4_bf16 = 0x400810, + OHWIo16i4 = 0x401000, + OHWIo16i4_bf16 = 0x401010, + OHWIo32i4 = 0x402000, + OHWIo32i4_bf16 = 0x402010, + OHWIo64i4 = 0x404000, + OHWIo64i4_bf16 = 0x404010, + OHWIo2i8 = 0x800200, + OHWIo4i8 = 0x800400, + OHWIo8i8 = 0x800800, + OHWIo16i8 = 0x801000, + OHWIo32i8 = 0x802000, + OHWIo64i8 = 0x804000 +}; + +} // namespace arm_compute +#endif /* ACL_ARM_COMPUTE_CORE_CORETYPES */ diff --git a/arm_compute/core/FullyConnectedLayerInfo.h b/arm_compute/core/FullyConnectedLayerInfo.h deleted file mode 100644 index f699cb2792..0000000000 --- a/arm_compute/core/FullyConnectedLayerInfo.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2016-2023 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_FULLYCONNECTEDLAYERINFO_H -#define ARM_COMPUTE_FULLYCONNECTEDLAYERINFO_H - -#include "arm_compute/core/ActivationLayerInfo.h" -#include "arm_compute/core/Types.h" - -namespace arm_compute -{ -/** Fully connected layer info */ -struct FullyConnectedLayerInfo -{ - /* Fused-activation parameters */ - ActivationLayerInfo activation_info{}; /**< Fused activation to apply after the matrix multiplication. */ - /* Information about weights */ - DataLayout weights_trained_layout{ DataLayout::NCHW }; /**< Layout that the weights have been trained with. */ - bool transpose_weights{ true }; /**< Transpose weights if true. */ - bool are_weights_reshaped{ false }; /**< @deprecated Reshape the weights tensor if false. */ - bool retain_internal_weights{ false }; /**< Retain internal reshaped weights. */ - bool enable_fast_math{ false }; /**< Enable fast math computation. */ - /* Other parameters */ - bool fp_mixed_precision{ false }; /**< Use wider accumulators (32 bit instead of 16 for FP16) to improve accuracy. */ - - /** Sets the weights trained data layout - * - * @param[in] layout Data layout that the weights were trained with - * - * @return Updated object - */ - FullyConnectedLayerInfo &set_weights_trained_layout(DataLayout layout) - { - weights_trained_layout = layout; - return *this; - } - /** Sets the transpose weights flag - * - * @param[in] should_transpose_weights Boolean flag indicating if weights should be transposed - * - * @return Updated object - */ - FullyConnectedLayerInfo &set_transpose_weights(bool should_transpose_weights) - { - transpose_weights = should_transpose_weights; - return *this; - } -}; - -} // namespace arm_compute -#endif /* ARM_COMPUTE_FULLYCONNECTEDLAYERINFO_H */ diff --git a/arm_compute/core/GEMMInfo.h b/arm_compute/core/GEMMInfo.h deleted file mode 100644 index 4c8e94a315..0000000000 --- a/arm_compute/core/GEMMInfo.h +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Copyright (c) 2016-2023 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GEMMINFO_H -#define ARM_COMPUTE_GEMMINFO_H - -#include "arm_compute/core/ActivationLayerInfo.h" -#include "arm_compute/core/Types.h" - -namespace arm_compute -{ -/** GEMM information class. This class stores the necessary information to compute GEMM functions - * - * This object also contains the information about how matrix A and matrix B have been reshaped - * - */ -class GEMMInfo -{ -public: - /** Default constructor */ - GEMMInfo() noexcept - : _is_a_reshaped(false), - _is_b_reshaped(false), - _reshape_b_only_on_first_run(true), - _depth_output_gemm3d(0), - _reinterpret_input_as_3d(false), - _retain_internal_weights(false), - _gemmlowp_output_stage(), - _fast_math(false), - _fp_mixed_precision(false), - _broadcast_bias(false), - _pretranspose_A(false), - _pretranspose_B(false), - _activation_info(), - _post_ops(), - _fixed_format(false), - _weight_format(arm_compute::WeightFormat::UNSPECIFIED) - { - } - /** Constructor - * - * @param[in] is_a_reshaped True if the matrix A has been reshaped - * @param[in] is_b_reshaped True if the matrix B has been reshaped - * @param[in] reshape_b_only_on_first_run Reshape matrix B only for the first run - * @param[in] depth_output_gemm3d (Optional) Depth (third dimension) of the output tensor to be used with the GEMM3D kernel - * If 0 the output will not be reinterpreted as 3D. Default 0 - * @param[in] reinterpret_input_as_3d (Optional) Reinterpret the input as 3D tensor. (i.e. this flag should be set to true when GEMM is used - * to perform 1x1 convolutions with the NHWC data layout) - * @param[in] retain_internal_weights (Optional) Retain the weights tensor from previous run - * @param[in] gemmlowp_output_stage (Optional) GEMMLowp Output stage info - * @param[in] fp_mixed_precision (Optional) Use wider accumulators (32 bit instead of 16 for FP16) to improve accuracy. - * @param[in] fast_math (Optional) Use a data type of shorter width to improve performance - * @param[in] broadcast_bias (Optional) Broadcast the shape of the bias tensor from a vector to a matrix. - * @param[in] activation_info (Optional) Activation to apply after the matrix multiplication - * @param[in] post_ops (Optional) A sequence of post operations that are performed after the main operation. - * @param[in] fixed_format (Optional) Specify the selection of fixed format kernels for variable weights support in GEMM. These kernels expect the weights tensor to be in amemory format that is fixed by the kernel itself. For more information, see arm_compute::WeightFormat. - * @param[in] weight_format (Optional) arm_gemm:WeightFormat enumeration requested by the user. Default is arm_compute::WeightFormat::UNSPECIFIED. - */ - GEMMInfo(bool is_a_reshaped, bool is_b_reshaped, bool reshape_b_only_on_first_run, int depth_output_gemm3d = 0, bool reinterpret_input_as_3d = false, bool retain_internal_weights = false, - GEMMLowpOutputStageInfo gemmlowp_output_stage = GEMMLowpOutputStageInfo(), bool fp_mixed_precision = false, bool fast_math = false, bool broadcast_bias = false, - const ActivationLayerInfo &activation_info = ActivationLayerInfo(), const experimental::PostOpList &post_ops = experimental::PostOpList(), - bool fixed_format = false, arm_compute::WeightFormat weight_format = arm_compute::WeightFormat::UNSPECIFIED) noexcept - : _is_a_reshaped(is_a_reshaped), - _is_b_reshaped(is_b_reshaped), - _reshape_b_only_on_first_run(reshape_b_only_on_first_run), - _depth_output_gemm3d(depth_output_gemm3d), - _reinterpret_input_as_3d(reinterpret_input_as_3d), - _retain_internal_weights(retain_internal_weights), - _gemmlowp_output_stage(gemmlowp_output_stage), - _fast_math(fast_math), - _fp_mixed_precision(fp_mixed_precision), - _broadcast_bias(broadcast_bias), - _pretranspose_A(false), - _pretranspose_B(false), - _activation_info(activation_info), - _post_ops(post_ops), - _fixed_format(fixed_format), - _weight_format(weight_format) - { - } - /** Flag which specifies if the matrix A has been reshaped - * - * @return True if the matrix A has been reshaped - */ - bool is_a_reshaped() const - { - return _is_a_reshaped; - }; - /** Flag which specifies if the matrix B has been reshaped - * - * @return True if the matrix B has been reshaped - */ - bool is_b_reshaped() const - { - return _is_b_reshaped; - }; - /** Flag which specifies if the reshape of matrix B should executed only for the first - * - * @note This flag could be set to TRUE when GEMM is used to accelerate convolution layer - * - * @return True if the reshaped of matrix B happens only for the first run - */ - bool reshape_b_only_on_first_run() const - { - return _reshape_b_only_on_first_run; - }; - /** Depth of the output when GEMM output is reinterpreted as 3D tensor - * - * @return the depth of the output tensor - */ - int depth_output_gemm3d() const - { - return _depth_output_gemm3d; - }; - /** Flag which specifies if the input tensor has to be reinterpreted as 3D - * - * @return True if the input tensor has to be reinterpreted as 3D tensor - */ - bool reinterpret_input_as_3d() const - { - return _reinterpret_input_as_3d; - }; - /** Flag which specifies if the weights tensor has to be retained from previous run - * - * @return True if the weights tensor has to be retained - */ - bool retain_internal_weights() const - { - return _retain_internal_weights; - }; - /** GEMMLowp output stage - * - * @return the GEMMLowp output stage info - */ - GEMMLowpOutputStageInfo gemmlowp_output_stage() const - { - return _gemmlowp_output_stage; - }; - /** Sets GEMMLowp output stage - * - * @param[in] output_stage Output stage to set - */ - void set_gemmlowp_output_stage(GEMMLowpOutputStageInfo &output_stage) - { - _gemmlowp_output_stage = output_stage; - }; - /** Flag which specifies if a wider accumulator should be used. - * - * @return True if a wider accumulator has to be used - */ - bool fp_mixed_precision() const - { - return _fp_mixed_precision; - }; - /** Flag which specifies if a shorter accumulator to be used. - * - * @return True if a shorter accumulator has to be used - */ - bool fast_math() const - { - return _fast_math; - }; - /** Set fast math flag - * - * @param[in] fast_math Flag to set - */ - void set_fast_math(bool fast_math) - { - _fast_math = fast_math; - } - /** Flag which specifies whether to broadcast the shape of the bias tensor. - * - * @return True if the shape of the bias tensor is to be broadcasted. - */ - bool broadcast_bias() const - { - return _broadcast_bias; - }; - /** Flag which specifies whether A should be pre-transposed if supported. - * - * @return True if A should be pre-transposed else false. - */ - bool pretranspose_A() const - { - return _pretranspose_A; - }; - /** Set pre-transpose A flag - * - * @param[in] flag Flag to set - */ - void set_pretranspose_A(bool flag) - { - _pretranspose_A = flag; - } - /** Flag which specifies whether b should be pre-transposed if supported. - * - * @return True if b should be pre-transposed else false. - */ - bool pretranspose_B() const - { - return _pretranspose_B; - }; - /** Set pre-transpose b flag - * - * @param[in] flag Flag to set - */ - void set_pretranspose_B(bool flag) - { - _pretranspose_B = flag; - } - /** Activation layer to apply after the matrix multiplication - * - * @return ActivationLayerInfo object - */ - ActivationLayerInfo activation_info() const - { - return _activation_info; - } - /** Set activation layer info - * - * @param[in] activation_info ActivationLayerInfo object to set - */ - void set_activation_info(const ActivationLayerInfo &activation_info) - { - _activation_info = activation_info; - } - /** Post operations to apply after the matrix multiplication - * - * @return experimental::PostOpList object - */ - const experimental::PostOpList &post_ops() const - { - return _post_ops; - } - /** Set post ops - * - * @param[in] post_ops experimental::PostOpList object to set - */ - void set_post_ops(const experimental::PostOpList &post_ops) - { - _post_ops = post_ops; - } - /** Flag which specifies if the GEMM operation is running fixed-format kernels. - * - * @return True if the GEMM operation is running fixed-format kernel else false. - */ - bool fixed_format() const - { - return _fixed_format; - } - - /** Set fixed-format flag - * - * @param[in] fixed_format sets whether or not to use fixed-format kernels - */ - void set_fixed_format(bool fixed_format) - { - _fixed_format = fixed_format; - } - - arm_compute::WeightFormat weight_format() const - { - return _weight_format; - } - - /** Set weight format to be used - * - * @param[in] weight_format arm_compute::WeightFormat enumeration - */ - void set_weight_format(arm_compute::WeightFormat weight_format) - { - _weight_format = weight_format; - } - -private: - bool _is_a_reshaped; - bool _is_b_reshaped; - bool _reshape_b_only_on_first_run; - int _depth_output_gemm3d; - bool _reinterpret_input_as_3d; - bool _retain_internal_weights; - GEMMLowpOutputStageInfo _gemmlowp_output_stage; - bool _fast_math; - bool _fp_mixed_precision; - bool _broadcast_bias; - bool _pretranspose_A; - bool _pretranspose_B; - ActivationLayerInfo _activation_info; - experimental::PostOpList _post_ops; - bool _fixed_format; - arm_compute::WeightFormat _weight_format; -}; -} //namespace arm_compute -#endif /* ARM_COMPUTE_GEMMINFO_H */ diff --git a/arm_compute/core/KernelDescriptors.h b/arm_compute/core/KernelDescriptors.h index 1ce37d31c1..305766e825 100644 --- a/arm_compute/core/KernelDescriptors.h +++ b/arm_compute/core/KernelDescriptors.h @@ -26,8 +26,8 @@ #include "arm_compute/core/PixelValue.h" #include "arm_compute/core/Types.h" -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/experimental/IPostOp.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" namespace arm_compute { diff --git a/arm_compute/core/MatMulInfo.h b/arm_compute/core/MatMulInfo.h deleted file mode 100644 index 01b9b47761..0000000000 --- a/arm_compute/core/MatMulInfo.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2016-2023 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_MATMULINFO_H -#define ARM_COMPUTE_MATMULINFO_H - -#include "arm_compute/core/Coordinates.h" -#include "arm_compute/core/Size2D.h" -#include "arm_compute/core/Size3D.h" -#include "arm_compute/core/Strides.h" -#include "arm_compute/core/TensorShape.h" -#include "arm_compute/core/experimental/IPostOp.h" -#include "arm_compute/core/utils/misc/Macros.h" -#include "support/Bfloat16.h" -#include "support/Half.h" - -#include -#include -#include -#include -#include -#include - -namespace arm_compute -{ -/** Class for holding information related to matrix multiplication function - */ -class MatMulInfo -{ -public: - /* Get Adjoint LHS flag value */ - bool adj_lhs() const - { - return _adj_lhs; - } - /* Get Adjoint RHS flag value */ - bool adj_rhs() const - { - return _adj_rhs; - } - /* Set Adjoint LHS flag */ - MatMulInfo &adj_lhs(bool adj_lhs) - { - _adj_lhs = adj_lhs; - return *this; - } - /* Set Adjoint RHS flag */ - MatMulInfo &adj_rhs(bool adj_rhs) - { - _adj_rhs = adj_rhs; - return *this; - } - -private: - bool _adj_lhs{ false }; - bool _adj_rhs{ false }; -}; -} // namespace arm_compute -#endif /* ARM_COMPUTE_MATMULINFO_H */ diff --git a/arm_compute/core/Types.h b/arm_compute/core/Types.h index a69177ed80..12d860205e 100644 --- a/arm_compute/core/Types.h +++ b/arm_compute/core/Types.h @@ -21,18 +21,53 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef ARM_COMPUTE_TYPES_H -#define ARM_COMPUTE_TYPES_H +#ifndef ACL_ARM_COMPUTE_CORE_TYPES +#define ACL_ARM_COMPUTE_CORE_TYPES + +/** The following symbols have been moved to: + * half + * PermutationVector + * Format + * DataType + * DataLayout + * DataLayoutDimension + * PadStrideInfo + * WeightFormat + * Channel + * DimensionRoundingType + */ +#include "arm_compute/core/CoreTypes.h" +/** The following symbols have been moved to: + * ActivationFunction + * ActivationLayerInfo + */ +#include "arm_compute/function_info/ActivationLayerInfo.h" +/** The following symbols have been moved to: + * ConvolutionInfo + */ +#include "arm_compute/function_info/ConvolutionInfo.h" +/** The following symbols have been moved to: + * FullyConnectedLayerInfo + */ +#include "arm_compute/function_info/FullyConnectedLayerInfo.h" +/** The following symbols have been moved to: + * GEMMLowpOutputStageType + * GEMMLowpOutputStageInfo + * GEMMInfo + */ +#include "arm_compute/function_info/GEMMInfo.h" +/** The following symbols have been moved to: + * MatMulInfo + */ +#include "arm_compute/function_info/MatMulInfo.h" #include "arm_compute/core/Coordinates.h" #include "arm_compute/core/Size2D.h" #include "arm_compute/core/Size3D.h" -#include "arm_compute/core/Strides.h" #include "arm_compute/core/TensorShape.h" #include "arm_compute/core/experimental/IPostOp.h" #include "arm_compute/core/utils/misc/Macros.h" #include "support/Bfloat16.h" -#include "support/Half.h" #include #include @@ -43,85 +78,9 @@ namespace arm_compute { -/** 16-bit floating point type */ -using half = half_float::half; - -/** Permutation vector */ -using PermutationVector = Strides; /** Bidirectional strides */ using BiStrides = Coordinates; -/** Available activation functions */ -enum class ActivationFunction -{ - LOGISTIC, /**< Logistic ( \f$ f(x) = \frac{1}{1 + e^{-x}} \f$ ) */ - TANH, /**< Hyperbolic tangent ( \f$ f(x) = a \cdot tanh(b \cdot x) \f$ ) */ - RELU, /**< Rectifier ( \f$ f(x) = max(0,x) \f$ ) */ - BOUNDED_RELU, /**< Upper Bounded Rectifier ( \f$ f(x) = min(a, max(0,x)) \f$ ) */ - LU_BOUNDED_RELU, /**< Lower and Upper Bounded Rectifier ( \f$ f(x) = min(a, max(b,x)) \f$ ) */ - LEAKY_RELU, /**< Leaky Rectifier ( \f$ f(x) = \begin{cases} \alpha x & \quad \text{if } x \text{ < 0}\\ x & \quad \text{if } x \geq \text{ 0 } \end{cases} \f$ ) */ - SOFT_RELU, /**< Soft Rectifier ( \f$ f(x)= log(1+e^x) \f$ ) */ - ELU, /**< Exponential Linear Unit ( \f$ f(x) = \begin{cases} \alpha (exp(x) - 1) & \quad \text{if } x \text{ < 0}\\ x & \quad \text{if } x \geq \text{ 0 } \end{cases} \f$ ) */ - ABS, /**< Absolute ( \f$ f(x)= |x| \f$ ) */ - SQUARE, /**< Square ( \f$ f(x)= x^2 \f$ )*/ - SQRT, /**< Square root ( \f$ f(x) = \sqrt{x} \f$ )*/ - LINEAR, /**< Linear ( \f$ f(x)= ax + b \f$ ) */ - IDENTITY, /**< Identity ( \f$ f(x)= x \f$ ) */ - HARD_SWISH, /**< Hard-swish ( \f$ f(x) = (x \text{ReLU6}(x+3))/6 = x \min(\max(0,x+3),6)/6 \f$ ) */ - SWISH, /**< Swish ( \f$ f(x) = \frac{x}{1 + e^{-ax}} = x \text{logistic}(ax) \f$ ) */ - GELU /**< GELU ( \f$ f(x) = x * 1/2 * 1 + erf(x / \sqrt{2}) \f$ ) */ -}; - -/** Image colour formats */ -enum class Format -{ - UNKNOWN, /**< Unknown image format */ - U8, /**< 1 channel, 1 U8 per channel */ - S16, /**< 1 channel, 1 S16 per channel */ - U16, /**< 1 channel, 1 U16 per channel */ - S32, /**< 1 channel, 1 S32 per channel */ - U32, /**< 1 channel, 1 U32 per channel */ - S64, /**< 1 channel, 1 S64 per channel */ - U64, /**< 1 channel, 1 U64 per channel */ - BFLOAT16, /**< 16-bit brain floating-point number */ - F16, /**< 1 channel, 1 F16 per channel */ - F32, /**< 1 channel, 1 F32 per channel */ - UV88, /**< 2 channel, 1 U8 per channel */ - RGB888, /**< 3 channels, 1 U8 per channel */ - RGBA8888, /**< 4 channels, 1 U8 per channel */ - YUV444, /**< A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes */ - YUYV422, /**< A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes */ - NV12, /**< A 2 plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling */ - NV21, /**< A 2 plane YUV format of Luma (Y) and interleaved VU data at 4:2:0 sampling */ - IYUV, /**< A 3 plane of 8-bit 4:2:0 sampled Y, U, V planes */ - UYVY422 /**< A single plane of 32-bit macro pixel of U0, Y0, V0, Y1 byte */ -}; - -/** Available data types */ -enum class DataType -{ - UNKNOWN, /**< Unknown data type */ - U8, /**< unsigned 8-bit number */ - S8, /**< signed 8-bit number */ - QSYMM8, /**< quantized, symmetric fixed-point 8-bit number */ - QASYMM8, /**< quantized, asymmetric fixed-point 8-bit number unsigned */ - QASYMM8_SIGNED, /**< quantized, asymmetric fixed-point 8-bit number signed */ - QSYMM8_PER_CHANNEL, /**< quantized, symmetric per channel fixed-point 8-bit number */ - U16, /**< unsigned 16-bit number */ - S16, /**< signed 16-bit number */ - QSYMM16, /**< quantized, symmetric fixed-point 16-bit number */ - QASYMM16, /**< quantized, asymmetric fixed-point 16-bit number */ - U32, /**< unsigned 32-bit number */ - S32, /**< signed 32-bit number */ - U64, /**< unsigned 64-bit number */ - S64, /**< signed 64-bit number */ - BFLOAT16, /**< 16-bit brain floating-point number */ - F16, /**< 16-bit floating-point number */ - F32, /**< 32-bit floating-point number */ - F64, /**< 64-bit floating-point number */ - SIZET /**< size_t */ -}; - /** Available Sampling Policies */ enum class SamplingPolicy { @@ -129,29 +88,6 @@ enum class SamplingPolicy TOP_LEFT /**< Samples are taken at pixel top left corner */ }; -/** [DataLayout enum definition] **/ - -/** Supported tensor data layouts */ -enum class DataLayout -{ - UNKNOWN, /**< Unknown data layout */ - NCHW, /**< Num samples, channels, height, width */ - NHWC, /**< Num samples, height, width, channels */ - NCDHW, /**< Num samples, channels, depth, height, width */ - NDHWC /**< Num samples, depth, height, width, channels */ -}; -/** [DataLayout enum definition] **/ - -/** Supported tensor data layout dimensions */ -enum class DataLayoutDimension -{ - CHANNEL, /**< channel */ - HEIGHT, /**< height */ - WIDTH, /**< width */ - DEPTH, /**< depth */ - BATCHES /**< batches */ -}; - /** Available ConvolutionMethod*/ enum class ConvolutionMethod { @@ -479,23 +415,6 @@ using PaddingList = std::vector; /** Information to produce a tiled version of a Tensor */ using Multiples = std::vector; -/** Available channels */ -enum class Channel -{ - UNKNOWN, /** Unknown channel format */ - C0, /**< First channel (used by formats with unknown channel types). */ - C1, /**< Second channel (used by formats with unknown channel types). */ - C2, /**< Third channel (used by formats with unknown channel types). */ - C3, /**< Fourth channel (used by formats with unknown channel types). */ - R, /**< Red channel. */ - G, /**< Green channel. */ - B, /**< Blue channel. */ - A, /**< Alpha channel. */ - Y, /**< Luma channel. */ - U, /**< Cb/U channel. */ - V /**< Cr/V/Value channel. */ -}; - /** Available reduction operations */ enum class ReductionOperation { @@ -568,15 +487,6 @@ struct DetectionWindow float score{ 0.f }; /**< Confidence value for the detection window */ }; -/** Dimension rounding type when down-scaling on CNNs - * @note Used in pooling and convolution layer - */ -enum class DimensionRoundingType -{ - FLOOR, /**< Floor rounding */ - CEIL /**< Ceil rounding */ -}; - /** Available pooling types */ enum class PoolingType { @@ -690,122 +600,6 @@ private: }; /** Padding and stride information class */ -class PadStrideInfo -{ -public: - /** Constructor - * - * @param[in] stride_x (Optional) Stride, in elements, across x. Defaults to 1. - * @param[in] stride_y (Optional) Stride, in elements, across y. Defaults to 1. - * @param[in] pad_x (Optional) Padding, in elements, across x. Defaults to 0. - * @param[in] pad_y (Optional) Padding, in elements, across y. Defaults to 0. - * @param[in] round (Optional) Dimensions rounding. Defaults to @ref DimensionRoundingType::FLOOR. - */ - PadStrideInfo(unsigned int stride_x = 1, unsigned int stride_y = 1, - unsigned int pad_x = 0, unsigned int pad_y = 0, - DimensionRoundingType round = DimensionRoundingType::FLOOR) - : _stride(std::make_pair(stride_x, stride_y)), - _pad_left(pad_x), - _pad_top(pad_y), - _pad_right(pad_x), - _pad_bottom(pad_y), - _round_type(round) - { - } - /** Constructor - * - * @param[in] stride_x Stride, in elements, across x. - * @param[in] stride_y Stride, in elements, across y. - * @param[in] pad_left Padding across x on the left, in elements. - * @param[in] pad_right Padding across x on the right, in elements. - * @param[in] pad_top Padding across y on the top, in elements. - * @param[in] pad_bottom Padding across y on the bottom, in elements. - * @param[in] round Dimensions rounding. - */ - PadStrideInfo(unsigned int stride_x, unsigned int stride_y, - unsigned int pad_left, unsigned int pad_right, - unsigned int pad_top, unsigned int pad_bottom, - DimensionRoundingType round) - : _stride(std::make_pair(stride_x, stride_y)), - _pad_left(pad_left), - _pad_top(pad_top), - _pad_right(pad_right), - _pad_bottom(pad_bottom), - _round_type(round) - { - } - /** Get the stride. - * - * @return a pair: stride x, stride y. - */ - std::pair stride() const - { - return _stride; - } - /** Check whether the padding is symmetric. - * - * @return True if the padding is symmetric. - */ - bool padding_is_symmetric() const - { - return (_pad_left == _pad_right) && (_pad_top == _pad_bottom); - } - /** Get the padding. - * - * @note This should only be used when the padding is symmetric. - * - * @return a pair: padding left/right, padding top/bottom - */ - std::pair pad() const - { - //this accessor should be used only when padding is symmetric - ARM_COMPUTE_ERROR_ON(!padding_is_symmetric()); - return std::make_pair(_pad_left, _pad_top); - } - - /** Get the left padding */ - unsigned int pad_left() const - { - return _pad_left; - } - /** Get the right padding */ - unsigned int pad_right() const - { - return _pad_right; - } - /** Get the top padding */ - unsigned int pad_top() const - { - return _pad_top; - } - /** Get the bottom padding */ - unsigned int pad_bottom() const - { - return _pad_bottom; - } - - /** Get the rounding type */ - DimensionRoundingType round() const - { - return _round_type; - } - - /** Check whether this has any padding */ - bool has_padding() const - { - return (_pad_left != 0 || _pad_top != 0 || _pad_right != 0 || _pad_bottom != 0); - } - -private: - std::pair _stride; - unsigned int _pad_left; - unsigned int _pad_top; - unsigned int _pad_right; - unsigned int _pad_bottom; - - DimensionRoundingType _round_type; -}; - /** Padding information for 2D operations like Conv2d */ struct Padding2D { @@ -1795,96 +1589,6 @@ private: int32_t _shrink_axis_mask; }; -/** Memory layouts for the weights tensor. - * - * * UNSPECIFIED is used to select kernels that do not run in - * variable weights mode. - * - * * ANY is used to query the kernel database to retrieve any of the - * kernels that runs in variable weights mode. Once a kernel is - * found, the specific format expected by the kernel can be - * retrieved by the user for reordering the weights tensor - * accordingly. - * - * The other values OHWIo{interleave_by}i{block_by} describe the - * memory layout of a 4D tensor with layout OHWI that has been - * transformed into a 4D tensor with dimensions O'HWI' where: - * - * O' = first multiple of {interleave_by} s.t. O<=O' - * I' = first multiple of {block_by} s.t. I<=I' - * - * The total size of the dst tensor is O' x H x W x I' - * - * The access function of the tensor with layout - * OHWIo{interleave_by}i{block_by} and size O'HWI' is a 6-parameter - * access function, where the 6 parameters are computed as follows: - * - * x5 = floor(o/{interleave_by}) RANGE [0, O'/{interleave_by} -1] SIZE: O'/{interleave_by} - * - * x4 = h RANGE [0, H-1] SIZE: H - * x3 = w RANGE [0, W-1] SIZE: W - * x2 = floor(i/{block_by}) RANGE [0, I'/{block_by} -1] SIZE: I'/{block_by} - * x1 = o%{interleave_by} RANGE [0, {interleave_by} -1] SIZE: {interleave_by} - * x0 = i%{block_by} RANGE [0, {block_by} -1] SIZE: {block_by} - * TOTAL SIZE: O' * H * W * I' - * - * 4D 6D - * ----------------- ----------------------------------- - * value(o, h, w, i) = x5 * H * W * I' * {interleave_by} - * + x4 * W * I' * {interleave_by} - * + x3 * I' * {interleave_by} - * + x2 * {interleave_by} * {block_by} - * + x1 * {block_by} - * + x0 - * - * Notice that in arm_gemm the 4D tensor of dimension O'HWI' created - * for the OHWIo{interleave_by}i{block_by} format is in reality seen - * as a 2D tensor, where the number of rows is O'/{interleave_by} - * and the number of columns is {interleave_by} * H * W * I'. - * - * The postfix *_bf16 is for the memory layout needed for the - * fast-mode kernels, in which the weights are passed in bfloat16 - * format. - */ -enum class WeightFormat -{ - UNSPECIFIED = 0x1, - ANY = 0x2, - OHWI = 0x100100, - OHWIo2 = 0x100200, - OHWIo4 = 0x100400, - OHWIo8 = 0x100800, - OHWIo16 = 0x101000, - OHWIo32 = 0x102000, - OHWIo64 = 0x104000, - OHWIo128 = 0x108000, - OHWIo4i2 = 0x200400, - OHWIo4i2_bf16 = 0x200410, - OHWIo8i2 = 0x200800, - OHWIo8i2_bf16 = 0x200810, - OHWIo16i2 = 0x201000, - OHWIo16i2_bf16 = 0x201010, - OHWIo32i2 = 0x202000, - OHWIo32i2_bf16 = 0x202010, - OHWIo64i2 = 0x204000, - OHWIo64i2_bf16 = 0x204010, - OHWIo4i4 = 0x400400, - OHWIo4i4_bf16 = 0x400410, - OHWIo8i4 = 0x400800, - OHWIo8i4_bf16 = 0x400810, - OHWIo16i4 = 0x401000, - OHWIo16i4_bf16 = 0x401010, - OHWIo32i4 = 0x402000, - OHWIo32i4_bf16 = 0x402010, - OHWIo64i4 = 0x404000, - OHWIo64i4_bf16 = 0x404010, - OHWIo2i8 = 0x800200, - OHWIo4i8 = 0x800400, - OHWIo8i8 = 0x800800, - OHWIo16i8 = 0x801000, - OHWIo32i8 = 0x802000, - OHWIo64i8 = 0x804000 -}; // OHWIoi inline int interleave_by(const WeightFormat wf) { @@ -2095,31 +1799,6 @@ private: bool _broadcast_bias; }; -/** GEMMLowp output stage type */ -enum class GEMMLowpOutputStageType -{ - NONE, /**< No quantization */ - QUANTIZE_DOWN, /**< Quantize using an integer multiplication */ - QUANTIZE_DOWN_FIXEDPOINT, /**< Quantize using a fixed point multiplication */ - QUANTIZE_DOWN_FLOAT /**< Quantize using a floating point multiplication */ -}; - -/** GEMMLowp output stage info */ -struct GEMMLowpOutputStageInfo -{ - GEMMLowpOutputStageType type{ GEMMLowpOutputStageType::NONE }; /**< GEMMLowp output stage type */ - int32_t gemmlowp_offset{ 0 }; /**< GEMMLowp output stage offset used for quantizing to QASYMM8 */ - int32_t gemmlowp_multiplier{ 0 }; /**< GEMMLowp output stage multiplier used for quantizing to QASYMM8 */ - int32_t gemmlowp_shift{ 0 }; /**< GEMMLowp output stage shift used for quantizing to uint8 */ - int32_t gemmlowp_min_bound{ std::numeric_limits::lowest() }; /**< GEMMLowp min value used to saturate down the output result before converting back to QASYMM8 */ - int32_t gemmlowp_max_bound{ std::numeric_limits::max() }; /**< GEMMLowp max value used to saturate down the output result before converting back to QASYMM8 */ - std::vector gemmlowp_multipliers{}; /**< GEMMLowp output stage multiplier used for quantizing to QASYMM8 */ - std::vector gemmlowp_shifts{}; /**< GEMMLowp output stage multiplier used for quantizing to QASYMM8 */ - float gemmlowp_real_multiplier{ 0 }; /**< GEMMLowp output stage real multiplier used for quantizing to QASYMM8 */ - bool is_quantized_per_channel{ false }; /**< GEMMLowp quantized per-channel flag */ - DataType output_data_type{ DataType::UNKNOWN }; /**< Output tensor data type to use if the output is not initialized */ -}; - /** GEMM LHS (Left Hand Side) matrix information */ struct GEMMLHSMatrixInfo { @@ -2236,4 +1915,4 @@ struct IOFormatInfo /** Class for holding information related to cropping */ using CropInfo = Padding2D; } // namespace arm_compute -#endif /* ARM_COMPUTE_TYPES_H */ +#endif /* ACL_ARM_COMPUTE_CORE_TYPES */ diff --git a/arm_compute/core/experimental/PostOps.h b/arm_compute/core/experimental/PostOps.h index c70df841b8..a5585bab5d 100644 --- a/arm_compute/core/experimental/PostOps.h +++ b/arm_compute/core/experimental/PostOps.h @@ -26,8 +26,8 @@ #include "arm_compute/core/experimental/IPostOp.h" -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include diff --git a/arm_compute/core/utils/FormatUtils.h b/arm_compute/core/utils/FormatUtils.h index 10e6f747f2..afb0f78255 100644 --- a/arm_compute/core/utils/FormatUtils.h +++ b/arm_compute/core/utils/FormatUtils.h @@ -24,7 +24,8 @@ #ifndef ARM_COMPUTE_CORE_UTILS_FORMATUTILS_H #define ARM_COMPUTE_CORE_UTILS_FORMATUTILS_H -#include "arm_compute/core/Types.h" +#include "arm_compute/core/CoreTypes.h" +#include "arm_compute/core/Error.h" namespace arm_compute { @@ -339,6 +340,5 @@ inline size_t num_channels_from_format(Format format) * @return The string describing the format. */ const std::string &string_from_format(Format format); - } #endif /*ARM_COMPUTE_CORE_UTILS_FORMATUTILS_H */ diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index 2a4aa4d7db..77ad33910b 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -24,11 +24,11 @@ #ifndef ACL_ARM_COMPUTE_CORE_UTILS_MISC_SHAPECALCULATOR #define ACL_ARM_COMPUTE_CORE_UTILS_MISC_SHAPECALCULATOR -#include "arm_compute/core/ConvolutionInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensorInfo.h" #include "arm_compute/core/KernelDescriptors.h" #include "arm_compute/core/Utils.h" +#include "arm_compute/function_info/ConvolutionInfo.h" #include "arm_compute/runtime/FunctionDescriptors.h" #include "arm_compute/core/utils/helpers/tensor_transform.h" @@ -433,8 +433,8 @@ inline TensorShape compute_depthwise_convolution_shape(const ITensorInfo &input, const int weights_width_idx = get_data_layout_dimension_index(weights_data_layout, DataLayoutDimension::WIDTH); const int weights_height_idx = get_data_layout_dimension_index(weights_data_layout, DataLayoutDimension::HEIGHT); - unsigned int output_width = 0; - unsigned int output_height = 0; + unsigned int output_width = 0; + unsigned int output_height = 0; std::tie(output_width, output_height) = scaled_dimensions(input_shape[width_idx], input_shape[height_idx], weights_shape[weights_width_idx], weights_shape[weights_height_idx], info.pad_stride_info, info.dilation); @@ -684,8 +684,8 @@ inline TensorShape compute_winograd_output_transform_shape(const ITensorInfo &in const DataLayout data_layout = winograd_info.output_data_layout; // Compute output shape - unsigned int output_width = 0; - unsigned int output_height = 0; + unsigned int output_width = 0; + unsigned int output_height = 0; std::tie(output_width, output_height) = scaled_dimensions(input_dimensions.width, input_dimensions.height, kernel_size.width, kernel_size.height, conv_info); @@ -725,7 +725,7 @@ inline TensorShape compute_deep_convolution_shape(const TensorShape &input_shape const unsigned int weights_out_channel = weights_shape[3]; unsigned int output_width = 0; unsigned int output_height = 0; - std::tie(output_width, output_height) = scaled_dimensions(input_width, input_height, weights_width, weights_height, conv_info); + std::tie(output_width, output_height) = scaled_dimensions(input_width, input_height, weights_width, weights_height, conv_info); TensorShape output_shape{ input_shape }; output_shape.set(idx_width, output_width); diff --git a/arm_compute/function_info/ActivationLayerInfo.h b/arm_compute/function_info/ActivationLayerInfo.h new file mode 100644 index 0000000000..84e962cb3a --- /dev/null +++ b/arm_compute/function_info/ActivationLayerInfo.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2016-2023 Arm Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ACL_ARM_COMPUTE_FUNCTION_INFO_ACTIVATIONLAYERINFO +#define ACL_ARM_COMPUTE_FUNCTION_INFO_ACTIVATIONLAYERINFO + +#include "arm_compute/core/CoreTypes.h" +#include "arm_compute/core/QuantizationInfo.h" + +#include + +namespace arm_compute +{ +/** Available activation functions */ +enum class ActivationFunction +{ + LOGISTIC, /**< Logistic ( \f$ f(x) = \frac{1}{1 + e^{-x}} \f$ ) */ + TANH, /**< Hyperbolic tangent ( \f$ f(x) = a \cdot tanh(b \cdot x) \f$ ) */ + RELU, /**< Rectifier ( \f$ f(x) = max(0,x) \f$ ) */ + BOUNDED_RELU, /**< Upper Bounded Rectifier ( \f$ f(x) = min(a, max(0,x)) \f$ ) */ + LU_BOUNDED_RELU, /**< Lower and Upper Bounded Rectifier ( \f$ f(x) = min(a, max(b,x)) \f$ ) */ + LEAKY_RELU, /**< Leaky Rectifier ( \f$ f(x) = \begin{cases} \alpha x & \quad \text{if } x \text{ < 0}\\ x & \quad \text{if } x \geq \text{ 0 } \end{cases} \f$ ) */ + SOFT_RELU, /**< Soft Rectifier ( \f$ f(x)= log(1+e^x) \f$ ) */ + ELU, /**< Exponential Linear Unit ( \f$ f(x) = \begin{cases} \alpha (exp(x) - 1) & \quad \text{if } x \text{ < 0}\\ x & \quad \text{if } x \geq \text{ 0 } \end{cases} \f$ ) */ + ABS, /**< Absolute ( \f$ f(x)= |x| \f$ ) */ + SQUARE, /**< Square ( \f$ f(x)= x^2 \f$ )*/ + SQRT, /**< Square root ( \f$ f(x) = \sqrt{x} \f$ )*/ + LINEAR, /**< Linear ( \f$ f(x)= ax + b \f$ ) */ + IDENTITY, /**< Identity ( \f$ f(x)= x \f$ ) */ + HARD_SWISH, /**< Hard-swish ( \f$ f(x) = (x \text{ReLU6}(x+3))/6 = x \min(\max(0,x+3),6)/6 \f$ ) */ + SWISH, /**< Swish ( \f$ f(x) = \frac{x}{1 + e^{-ax}} = x \text{logistic}(ax) \f$ ) */ + GELU /**< GELU ( \f$ f(x) = x * 1/2 * 1 + erf(x / \sqrt{2}) \f$ ) */ +}; +/** Activation Layer Information class */ +class ActivationLayerInfo +{ +public: + typedef arm_compute::ActivationFunction ActivationFunction; + + /** Lookup table */ + using LookupTable256 = std::array; + + ActivationLayerInfo() = default; + /** Default Constructor + * + * @param[in] f The activation function to use. + * @param[in] a (Optional) The alpha parameter used by some activation functions + * (@ref ActivationFunction::BOUNDED_RELU, @ref ActivationFunction::LU_BOUNDED_RELU, @ref ActivationFunction::LINEAR, @ref ActivationFunction::TANH). + * @param[in] b (Optional) The beta parameter used by some activation functions (@ref ActivationFunction::LINEAR, @ref ActivationFunction::LU_BOUNDED_RELU, @ref ActivationFunction::TANH). + */ + ActivationLayerInfo(ActivationFunction f, float a = 0.0f, float b = 0.0f) + : _act(f), _a(a), _b(b), _enabled(true) + { + } + /** Get the type of activation function */ + ActivationFunction activation() const + { + return _act; + } + /** Get the alpha value */ + float a() const + { + return _a; + } + /** Get the beta value */ + float b() const + { + return _b; + } + /** Check if initialised */ + bool enabled() const + { + return _enabled; + } + +#ifdef __aarch64__ + const LookupTable256 &lut() const + { + return _lut; + } + void setLookupTable256(LookupTable256 &lut) + { + _lut = std::move(lut); + } +#endif // __aarch64__ +private: + ActivationFunction _act = { ActivationLayerInfo::ActivationFunction::IDENTITY }; + float _a = {}; + float _b = {}; + bool _enabled = { false }; + +#ifdef __aarch64__ + LookupTable256 _lut = {}; +#endif // __aarch64__ +}; +} // namespace arm_compute +#endif /* ACL_ARM_COMPUTE_FUNCTION_INFO_ACTIVATIONLAYERINFO */ diff --git a/arm_compute/function_info/ConvolutionInfo.h b/arm_compute/function_info/ConvolutionInfo.h new file mode 100644 index 0000000000..c27dc523c8 --- /dev/null +++ b/arm_compute/function_info/ConvolutionInfo.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2016-2023 Arm Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ACL_ARM_COMPUTE_FUNCTION_INFO_CONVOLUTIONINFO +#define ACL_ARM_COMPUTE_FUNCTION_INFO_CONVOLUTIONINFO + +#include "arm_compute/core/CoreTypes.h" +#include "arm_compute/core/Size2D.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" + +namespace arm_compute +{ +struct ConvolutionInfo +{ + ConvolutionInfo() = default; + ConvolutionInfo(const PadStrideInfo &pad_stride_info, unsigned int depth_multiplier, const ActivationLayerInfo &act_info, const Size2D &dilation) + : pad_stride_info(pad_stride_info), depth_multiplier(depth_multiplier), act_info(act_info), dilation(dilation) + { + } + PadStrideInfo pad_stride_info{}; /**< Convolution info (Pads, strides,...) */ + unsigned int depth_multiplier{ 1 }; /**< Multiplier to apply to input's depth to retrieve the output depth. Defaults to 1 */ + ActivationLayerInfo act_info{}; /**< Fused activation to apply after convolution. */ + Size2D dilation{ Size2D(1, 1) }; /**< Dilation, in elements, across x and y. Defaults to (1, 1). */ +}; +} // namespace arm_compute +#endif /* ACL_ARM_COMPUTE_FUNCTION_INFO_CONVOLUTIONINFO */ diff --git a/arm_compute/function_info/FullyConnectedLayerInfo.h b/arm_compute/function_info/FullyConnectedLayerInfo.h new file mode 100644 index 0000000000..5f5578eadd --- /dev/null +++ b/arm_compute/function_info/FullyConnectedLayerInfo.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2016-2023 Arm Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ACL_ARM_COMPUTE_FUNCTION_INFO_FULLYCONNECTEDLAYERINFO +#define ACL_ARM_COMPUTE_FUNCTION_INFO_FULLYCONNECTEDLAYERINFO + +#include "arm_compute/core/CoreTypes.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" + +namespace arm_compute +{ +/** Fully connected layer info */ +struct FullyConnectedLayerInfo +{ + /* Fused-activation parameters */ + ActivationLayerInfo activation_info{}; /**< Fused activation to apply after the matrix multiplication. */ + /* Information about weights */ + DataLayout weights_trained_layout{ DataLayout::NCHW }; /**< Layout that the weights have been trained with. */ + bool transpose_weights{ true }; /**< Transpose weights if true. */ + bool are_weights_reshaped{ false }; /**< @deprecated Reshape the weights tensor if false. */ + bool retain_internal_weights{ false }; /**< Retain internal reshaped weights. */ + bool enable_fast_math{ false }; /**< Enable fast math computation. */ + /* Other parameters */ + bool fp_mixed_precision{ false }; /**< Use wider accumulators (32 bit instead of 16 for FP16) to improve accuracy. */ + + /** Sets the weights trained data layout + * + * @param[in] layout Data layout that the weights were trained with + * + * @return Updated object + */ + FullyConnectedLayerInfo &set_weights_trained_layout(DataLayout layout) + { + weights_trained_layout = layout; + return *this; + } + /** Sets the transpose weights flag + * + * @param[in] should_transpose_weights Boolean flag indicating if weights should be transposed + * + * @return Updated object + */ + FullyConnectedLayerInfo &set_transpose_weights(bool should_transpose_weights) + { + transpose_weights = should_transpose_weights; + return *this; + } +}; + +} // namespace arm_compute +#endif /* ACL_ARM_COMPUTE_FUNCTION_INFO_FULLYCONNECTEDLAYERINFO */ diff --git a/arm_compute/function_info/GEMMInfo.h b/arm_compute/function_info/GEMMInfo.h new file mode 100644 index 0000000000..daaf86243a --- /dev/null +++ b/arm_compute/function_info/GEMMInfo.h @@ -0,0 +1,341 @@ +/* + * Copyright (c) 2016-2023 Arm Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ACL_ARM_COMPUTE_FUNCTION_INFO_GEMMINFO +#define ACL_ARM_COMPUTE_FUNCTION_INFO_GEMMINFO + +#include "arm_compute/core/CoreTypes.h" +#include "arm_compute/core/experimental/IPostOp.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" +#include + +namespace arm_compute +{ +class ITensorInfo; +/** GEMMLowp output stage type */ +enum class GEMMLowpOutputStageType +{ + NONE, /**< No quantization */ + QUANTIZE_DOWN, /**< Quantize using an integer multiplication */ + QUANTIZE_DOWN_FIXEDPOINT, /**< Quantize using a fixed point multiplication */ + QUANTIZE_DOWN_FLOAT /**< Quantize using a floating point multiplication */ +}; + +/** GEMMLowp output stage info */ +struct GEMMLowpOutputStageInfo +{ + GEMMLowpOutputStageType type{ GEMMLowpOutputStageType::NONE }; /**< GEMMLowp output stage type */ + int32_t gemmlowp_offset{ 0 }; /**< GEMMLowp output stage offset used for quantizing to QASYMM8 */ + int32_t gemmlowp_multiplier{ 0 }; /**< GEMMLowp output stage multiplier used for quantizing to QASYMM8 */ + int32_t gemmlowp_shift{ 0 }; /**< GEMMLowp output stage shift used for quantizing to uint8 */ + int32_t gemmlowp_min_bound{ std::numeric_limits::lowest() }; /**< GEMMLowp min value used to saturate down the output result before converting back to QASYMM8 */ + int32_t gemmlowp_max_bound{ std::numeric_limits::max() }; /**< GEMMLowp max value used to saturate down the output result before converting back to QASYMM8 */ + std::vector gemmlowp_multipliers{}; /**< GEMMLowp output stage multiplier used for quantizing to QASYMM8 */ + std::vector gemmlowp_shifts{}; /**< GEMMLowp output stage multiplier used for quantizing to QASYMM8 */ + float gemmlowp_real_multiplier{ 0 }; /**< GEMMLowp output stage real multiplier used for quantizing to QASYMM8 */ + bool is_quantized_per_channel{ false }; /**< GEMMLowp quantized per-channel flag */ + DataType output_data_type{ DataType::UNKNOWN }; /**< Output tensor data type to use if the output is not initialized */ +}; +/** GEMM information class. This class stores the necessary information to compute GEMM functions + * + * This object also contains the information about how matrix A and matrix B have been reshaped + * + */ +class GEMMInfo +{ +public: + /** Default constructor */ + GEMMInfo() noexcept + : _is_a_reshaped(false), + _is_b_reshaped(false), + _reshape_b_only_on_first_run(true), + _depth_output_gemm3d(0), + _reinterpret_input_as_3d(false), + _retain_internal_weights(false), + _gemmlowp_output_stage(), + _fast_math(false), + _fp_mixed_precision(false), + _broadcast_bias(false), + _pretranspose_A(false), + _pretranspose_B(false), + _activation_info(), + _post_ops(), + _fixed_format(false), + _weight_format(arm_compute::WeightFormat::UNSPECIFIED) + { + } + /** Constructor + * + * @param[in] is_a_reshaped True if the matrix A has been reshaped + * @param[in] is_b_reshaped True if the matrix B has been reshaped + * @param[in] reshape_b_only_on_first_run Reshape matrix B only for the first run + * @param[in] depth_output_gemm3d (Optional) Depth (third dimension) of the output tensor to be used with the GEMM3D kernel + * If 0 the output will not be reinterpreted as 3D. Default 0 + * @param[in] reinterpret_input_as_3d (Optional) Reinterpret the input as 3D tensor. (i.e. this flag should be set to true when GEMM is used + * to perform 1x1 convolutions with the NHWC data layout) + * @param[in] retain_internal_weights (Optional) Retain the weights tensor from previous run + * @param[in] gemmlowp_output_stage (Optional) GEMMLowp Output stage info + * @param[in] fp_mixed_precision (Optional) Use wider accumulators (32 bit instead of 16 for FP16) to improve accuracy. + * @param[in] fast_math (Optional) Use a data type of shorter width to improve performance + * @param[in] broadcast_bias (Optional) Broadcast the shape of the bias tensor from a vector to a matrix. + * @param[in] activation_info (Optional) Activation to apply after the matrix multiplication + * @param[in] post_ops (Optional) A sequence of post operations that are performed after the main operation. + * @param[in] fixed_format (Optional) Specify the selection of fixed format kernels for variable weights support in GEMM. These kernels expect the weights tensor to be in amemory format that is fixed by the kernel itself. For more information, see arm_compute::WeightFormat. + * @param[in] weight_format (Optional) arm_gemm:WeightFormat enumeration requested by the user. Default is arm_compute::WeightFormat::UNSPECIFIED. + */ + GEMMInfo(bool is_a_reshaped, bool is_b_reshaped, bool reshape_b_only_on_first_run, int depth_output_gemm3d = 0, bool reinterpret_input_as_3d = false, bool retain_internal_weights = false, + GEMMLowpOutputStageInfo gemmlowp_output_stage = GEMMLowpOutputStageInfo(), bool fp_mixed_precision = false, bool fast_math = false, bool broadcast_bias = false, + const ActivationLayerInfo &activation_info = ActivationLayerInfo(), const experimental::PostOpList &post_ops = experimental::PostOpList(), + bool fixed_format = false, arm_compute::WeightFormat weight_format = arm_compute::WeightFormat::UNSPECIFIED) noexcept + : _is_a_reshaped(is_a_reshaped), + _is_b_reshaped(is_b_reshaped), + _reshape_b_only_on_first_run(reshape_b_only_on_first_run), + _depth_output_gemm3d(depth_output_gemm3d), + _reinterpret_input_as_3d(reinterpret_input_as_3d), + _retain_internal_weights(retain_internal_weights), + _gemmlowp_output_stage(gemmlowp_output_stage), + _fast_math(fast_math), + _fp_mixed_precision(fp_mixed_precision), + _broadcast_bias(broadcast_bias), + _pretranspose_A(false), + _pretranspose_B(false), + _activation_info(activation_info), + _post_ops(post_ops), + _fixed_format(fixed_format), + _weight_format(weight_format) + { + } + /** Flag which specifies if the matrix A has been reshaped + * + * @return True if the matrix A has been reshaped + */ + bool is_a_reshaped() const + { + return _is_a_reshaped; + }; + /** Flag which specifies if the matrix B has been reshaped + * + * @return True if the matrix B has been reshaped + */ + bool is_b_reshaped() const + { + return _is_b_reshaped; + }; + /** Flag which specifies if the reshape of matrix B should executed only for the first + * + * @note This flag could be set to TRUE when GEMM is used to accelerate convolution layer + * + * @return True if the reshaped of matrix B happens only for the first run + */ + bool reshape_b_only_on_first_run() const + { + return _reshape_b_only_on_first_run; + }; + /** Depth of the output when GEMM output is reinterpreted as 3D tensor + * + * @return the depth of the output tensor + */ + int depth_output_gemm3d() const + { + return _depth_output_gemm3d; + }; + /** Flag which specifies if the input tensor has to be reinterpreted as 3D + * + * @return True if the input tensor has to be reinterpreted as 3D tensor + */ + bool reinterpret_input_as_3d() const + { + return _reinterpret_input_as_3d; + }; + /** Flag which specifies if the weights tensor has to be retained from previous run + * + * @return True if the weights tensor has to be retained + */ + bool retain_internal_weights() const + { + return _retain_internal_weights; + }; + /** GEMMLowp output stage + * + * @return the GEMMLowp output stage info + */ + GEMMLowpOutputStageInfo gemmlowp_output_stage() const + { + return _gemmlowp_output_stage; + }; + /** Sets GEMMLowp output stage + * + * @param[in] output_stage Output stage to set + */ + void set_gemmlowp_output_stage(GEMMLowpOutputStageInfo &output_stage) + { + _gemmlowp_output_stage = output_stage; + }; + /** Flag which specifies if a wider accumulator should be used. + * + * @return True if a wider accumulator has to be used + */ + bool fp_mixed_precision() const + { + return _fp_mixed_precision; + }; + /** Flag which specifies if a shorter accumulator to be used. + * + * @return True if a shorter accumulator has to be used + */ + bool fast_math() const + { + return _fast_math; + }; + /** Set fast math flag + * + * @param[in] fast_math Flag to set + */ + void set_fast_math(bool fast_math) + { + _fast_math = fast_math; + } + /** Flag which specifies whether to broadcast the shape of the bias tensor. + * + * @return True if the shape of the bias tensor is to be broadcasted. + */ + bool broadcast_bias() const + { + return _broadcast_bias; + }; + /** Flag which specifies whether A should be pre-transposed if supported. + * + * @return True if A should be pre-transposed else false. + */ + bool pretranspose_A() const + { + return _pretranspose_A; + }; + /** Set pre-transpose A flag + * + * @param[in] flag Flag to set + */ + void set_pretranspose_A(bool flag) + { + _pretranspose_A = flag; + } + /** Flag which specifies whether b should be pre-transposed if supported. + * + * @return True if b should be pre-transposed else false. + */ + bool pretranspose_B() const + { + return _pretranspose_B; + }; + /** Set pre-transpose b flag + * + * @param[in] flag Flag to set + */ + void set_pretranspose_B(bool flag) + { + _pretranspose_B = flag; + } + /** Activation layer to apply after the matrix multiplication + * + * @return ActivationLayerInfo object + */ + ActivationLayerInfo activation_info() const + { + return _activation_info; + } + /** Set activation layer info + * + * @param[in] activation_info ActivationLayerInfo object to set + */ + void set_activation_info(const ActivationLayerInfo &activation_info) + { + _activation_info = activation_info; + } + /** Post operations to apply after the matrix multiplication + * + * @return experimental::PostOpList object + */ + const experimental::PostOpList &post_ops() const + { + return _post_ops; + } + /** Set post ops + * + * @param[in] post_ops experimental::PostOpList object to set + */ + void set_post_ops(const experimental::PostOpList &post_ops) + { + _post_ops = post_ops; + } + /** Flag which specifies if the GEMM operation is running fixed-format kernels. + * + * @return True if the GEMM operation is running fixed-format kernel else false. + */ + bool fixed_format() const + { + return _fixed_format; + } + + /** Set fixed-format flag + * + * @param[in] fixed_format sets whether or not to use fixed-format kernels + */ + void set_fixed_format(bool fixed_format) + { + _fixed_format = fixed_format; + } + + arm_compute::WeightFormat weight_format() const + { + return _weight_format; + } + + /** Set weight format to be used + * + * @param[in] weight_format arm_compute::WeightFormat enumeration + */ + void set_weight_format(arm_compute::WeightFormat weight_format) + { + _weight_format = weight_format; + } + +private: + bool _is_a_reshaped; + bool _is_b_reshaped; + bool _reshape_b_only_on_first_run; + int _depth_output_gemm3d; + bool _reinterpret_input_as_3d; + bool _retain_internal_weights; + GEMMLowpOutputStageInfo _gemmlowp_output_stage; + bool _fast_math; + bool _fp_mixed_precision; + bool _broadcast_bias; + bool _pretranspose_A; + bool _pretranspose_B; + ActivationLayerInfo _activation_info; + experimental::PostOpList _post_ops; + bool _fixed_format; + arm_compute::WeightFormat _weight_format; +}; +} //namespace arm_compute +#endif /* ACL_ARM_COMPUTE_FUNCTION_INFO_GEMMINFO */ diff --git a/arm_compute/function_info/MatMulInfo.h b/arm_compute/function_info/MatMulInfo.h new file mode 100644 index 0000000000..cd9ef1f4d9 --- /dev/null +++ b/arm_compute/function_info/MatMulInfo.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2016-2023 Arm Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ACL_ARM_COMPUTE_FUNCTION_INFO_MATMULINFO +#define ACL_ARM_COMPUTE_FUNCTION_INFO_MATMULINFO + +namespace arm_compute +{ +/** Class for holding information related to matrix multiplication function + */ +class MatMulInfo +{ +public: + /* Get Adjoint LHS flag value */ + bool adj_lhs() const + { + return _adj_lhs; + } + /* Get Adjoint RHS flag value */ + bool adj_rhs() const + { + return _adj_rhs; + } + /* Set Adjoint LHS flag */ + MatMulInfo &adj_lhs(bool adj_lhs) + { + _adj_lhs = adj_lhs; + return *this; + } + /* Set Adjoint RHS flag */ + MatMulInfo &adj_rhs(bool adj_rhs) + { + _adj_rhs = adj_rhs; + return *this; + } + +private: + bool _adj_lhs{ false }; + bool _adj_rhs{ false }; +}; +} // namespace arm_compute +#endif /* ACL_ARM_COMPUTE_FUNCTION_INFO_MATMULINFO */ diff --git a/arm_compute/graph/Types.h b/arm_compute/graph/Types.h index 644f12b6a4..167f7388d4 100644 --- a/arm_compute/graph/Types.h +++ b/arm_compute/graph/Types.h @@ -27,10 +27,10 @@ #include "arm_compute/core/Error.h" #include "arm_compute/core/PixelValue.h" #include "arm_compute/core/Types.h" -#include "arm_compute/core/ActivationLayerInfo.h" -#include "arm_compute/core/ConvolutionInfo.h" -#include "arm_compute/core/FullyConnectedLayerInfo.h" -#include "arm_compute/core/GEMMInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" +#include "arm_compute/function_info/ConvolutionInfo.h" +#include "arm_compute/function_info/FullyConnectedLayerInfo.h" +#include "arm_compute/function_info/GEMMInfo.h" #include "arm_compute/runtime/CL/CLTunerTypes.h" #include "arm_compute/runtime/CL/CLTypes.h" diff --git a/arm_compute/runtime/CL/functions/CLActivationLayer.h b/arm_compute/runtime/CL/functions/CLActivationLayer.h index 34e47f56f5..4a718ab4b6 100644 --- a/arm_compute/runtime/CL/functions/CLActivationLayer.h +++ b/arm_compute/runtime/CL/functions/CLActivationLayer.h @@ -26,8 +26,8 @@ #include "arm_compute/runtime/IFunction.h" -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/CL/CLRuntimeContext.h" namespace arm_compute diff --git a/arm_compute/runtime/CL/functions/CLBatchNormalizationLayer.h b/arm_compute/runtime/CL/functions/CLBatchNormalizationLayer.h index 2acdfc37ab..37a0680709 100644 --- a/arm_compute/runtime/CL/functions/CLBatchNormalizationLayer.h +++ b/arm_compute/runtime/CL/functions/CLBatchNormalizationLayer.h @@ -26,8 +26,8 @@ #include "arm_compute/runtime/IFunction.h" -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include diff --git a/arm_compute/runtime/CL/functions/CLConvolutionLayer.h b/arm_compute/runtime/CL/functions/CLConvolutionLayer.h index 4b8c550442..8c9e45d753 100644 --- a/arm_compute/runtime/CL/functions/CLConvolutionLayer.h +++ b/arm_compute/runtime/CL/functions/CLConvolutionLayer.h @@ -24,10 +24,10 @@ #ifndef ARM_COMPUTE_CLCONVOLUTIONLAYER_H #define ARM_COMPUTE_CLCONVOLUTIONLAYER_H -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/CL/CLCompileContext.h" #include "arm_compute/core/Types.h" #include "arm_compute/core/experimental/IPostOp.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/IFunction.h" #include "arm_compute/runtime/IMemoryManager.h" diff --git a/arm_compute/runtime/CL/functions/CLDepthwiseConvolutionLayer.h b/arm_compute/runtime/CL/functions/CLDepthwiseConvolutionLayer.h index 9613caa10a..2798449100 100644 --- a/arm_compute/runtime/CL/functions/CLDepthwiseConvolutionLayer.h +++ b/arm_compute/runtime/CL/functions/CLDepthwiseConvolutionLayer.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_CLDEPTHWISECONVOLUTION_H #define ARM_COMPUTE_CLDEPTHWISECONVOLUTION_H -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/functions/CLPermute.h" #include "arm_compute/runtime/IFunction.h" diff --git a/arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h b/arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h index bc6f34f2a9..462a3ac07e 100644 --- a/arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h +++ b/arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_CLDIRECTCONVOLUTIONLAYER_H #define ARM_COMPUTE_CLDIRECTCONVOLUTIONLAYER_H -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/CL/functions/CLActivationLayer.h" #include "arm_compute/runtime/IFunction.h" diff --git a/arm_compute/runtime/CL/functions/CLElementwiseOperations.h b/arm_compute/runtime/CL/functions/CLElementwiseOperations.h index ecebac435a..9de362d2b2 100644 --- a/arm_compute/runtime/CL/functions/CLElementwiseOperations.h +++ b/arm_compute/runtime/CL/functions/CLElementwiseOperations.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CLELEMENTWISEOPERATIONS_H #define ARM_COMPUTE_CLELEMENTWISEOPERATIONS_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/CL/ICLOperator.h" #include "arm_compute/runtime/IFunction.h" diff --git a/arm_compute/runtime/CL/functions/CLFullyConnectedLayer.h b/arm_compute/runtime/CL/functions/CLFullyConnectedLayer.h index 19243e473a..b784226a2f 100644 --- a/arm_compute/runtime/CL/functions/CLFullyConnectedLayer.h +++ b/arm_compute/runtime/CL/functions/CLFullyConnectedLayer.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CLFULLYCONNECTEDLAYER_H #define ARM_COMPUTE_CLFULLYCONNECTEDLAYER_H -#include "arm_compute/core/FullyConnectedLayerInfo.h" +#include "arm_compute/function_info/FullyConnectedLayerInfo.h" #include "arm_compute/runtime/IFunction.h" #include "arm_compute/runtime/CL/CLTensor.h" diff --git a/arm_compute/runtime/CL/functions/CLGEMM.h b/arm_compute/runtime/CL/functions/CLGEMM.h index b72ffa0357..3a39aca692 100644 --- a/arm_compute/runtime/CL/functions/CLGEMM.h +++ b/arm_compute/runtime/CL/functions/CLGEMM.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CLGEMM_H #define ARM_COMPUTE_CLGEMM_H -#include "arm_compute/core/GEMMInfo.h" +#include "arm_compute/function_info/GEMMInfo.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/CLTypes.h" #include "arm_compute/runtime/IFunction.h" diff --git a/arm_compute/runtime/CL/functions/CLGEMMConvolutionLayer.h b/arm_compute/runtime/CL/functions/CLGEMMConvolutionLayer.h index f07fbb4cc9..9827340382 100644 --- a/arm_compute/runtime/CL/functions/CLGEMMConvolutionLayer.h +++ b/arm_compute/runtime/CL/functions/CLGEMMConvolutionLayer.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_CLGEMMCONVOLUTIONLAYER_H #define ARM_COMPUTE_CLGEMMCONVOLUTIONLAYER_H -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/experimental/IPostOp.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/CLTypes.h" #include "arm_compute/runtime/IFunction.h" diff --git a/arm_compute/runtime/CL/functions/CLGEMMLowpMatrixMultiplyCore.h b/arm_compute/runtime/CL/functions/CLGEMMLowpMatrixMultiplyCore.h index 1532060293..8b8d9f235f 100644 --- a/arm_compute/runtime/CL/functions/CLGEMMLowpMatrixMultiplyCore.h +++ b/arm_compute/runtime/CL/functions/CLGEMMLowpMatrixMultiplyCore.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CLGEMMLOWPMATRIXMULTIPLYCORE_H #define ARM_COMPUTE_CLGEMMLOWPMATRIXMULTIPLYCORE_H -#include "arm_compute/core/GEMMInfo.h" +#include "arm_compute/function_info/GEMMInfo.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/IFunction.h" #include "arm_compute/runtime/MemoryGroup.h" diff --git a/arm_compute/runtime/CL/functions/CLIndirectConvolutionLayer.h b/arm_compute/runtime/CL/functions/CLIndirectConvolutionLayer.h index 11677fb83a..12b83ea25b 100644 --- a/arm_compute/runtime/CL/functions/CLIndirectConvolutionLayer.h +++ b/arm_compute/runtime/CL/functions/CLIndirectConvolutionLayer.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_CLINDIRECTCONVOLUTIONLAYER_H #define ARM_COMPUTE_CLINDIRECTCONVOLUTIONLAYER_H -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/IFunction.h" #include diff --git a/arm_compute/runtime/CL/functions/CLMatMul.h b/arm_compute/runtime/CL/functions/CLMatMul.h index a11c1ed6a2..9d54bab868 100644 --- a/arm_compute/runtime/CL/functions/CLMatMul.h +++ b/arm_compute/runtime/CL/functions/CLMatMul.h @@ -24,8 +24,8 @@ #ifndef ACL_ARM_COMPUTE_RUNTIME_CL_FUNCTIONS_CLMATMUL #define ACL_ARM_COMPUTE_RUNTIME_CL_FUNCTIONS_CLMATMUL -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/IFunction.h" #include diff --git a/arm_compute/runtime/CL/functions/CLPixelWiseMultiplication.h b/arm_compute/runtime/CL/functions/CLPixelWiseMultiplication.h index f9081cfe25..62b6d96ad5 100644 --- a/arm_compute/runtime/CL/functions/CLPixelWiseMultiplication.h +++ b/arm_compute/runtime/CL/functions/CLPixelWiseMultiplication.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_CLPIXELWISEMULTIPLICATION_H #define ARM_COMPUTE_CLPIXELWISEMULTIPLICATION_H -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Rounding.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/CL/ICLOperator.h" #include "arm_compute/runtime/IFunction.h" diff --git a/arm_compute/runtime/CL/functions/CLWinogradConvolutionLayer.h b/arm_compute/runtime/CL/functions/CLWinogradConvolutionLayer.h index 74ffe46690..adf5f18626 100644 --- a/arm_compute/runtime/CL/functions/CLWinogradConvolutionLayer.h +++ b/arm_compute/runtime/CL/functions/CLWinogradConvolutionLayer.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_CLWINOGRADCONVOLUTIONLAYER_H #define ARM_COMPUTE_CLWINOGRADCONVOLUTIONLAYER_H -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/IFunction.h" #include "arm_compute/runtime/IMemoryManager.h" diff --git a/arm_compute/runtime/FunctionDescriptors.h b/arm_compute/runtime/FunctionDescriptors.h index 241359519f..630f533244 100644 --- a/arm_compute/runtime/FunctionDescriptors.h +++ b/arm_compute/runtime/FunctionDescriptors.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_RUNTIME_FUNCTION_DESCRIPTORS_H #define ARM_COMPUTE_RUNTIME_FUNCTION_DESCRIPTORS_H -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include diff --git a/arm_compute/runtime/NEON/functions/NEActivationLayer.h b/arm_compute/runtime/NEON/functions/NEActivationLayer.h index 7a1e532cf7..9992de2af8 100644 --- a/arm_compute/runtime/NEON/functions/NEActivationLayer.h +++ b/arm_compute/runtime/NEON/functions/NEActivationLayer.h @@ -26,8 +26,8 @@ #include "arm_compute/runtime/IFunction.h" -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/IRuntimeContext.h" #include diff --git a/arm_compute/runtime/NEON/functions/NEArithmeticAddition.h b/arm_compute/runtime/NEON/functions/NEArithmeticAddition.h index e55c6d94fc..b0d710d517 100644 --- a/arm_compute/runtime/NEON/functions/NEArithmeticAddition.h +++ b/arm_compute/runtime/NEON/functions/NEArithmeticAddition.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_NEARITHMETICADDITION_H #define ARM_COMPUTE_NEARITHMETICADDITION_H -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/IFunction.h" #include diff --git a/arm_compute/runtime/NEON/functions/NEArithmeticSubtraction.h b/arm_compute/runtime/NEON/functions/NEArithmeticSubtraction.h index 483d81bdf6..6fbe9ad450 100644 --- a/arm_compute/runtime/NEON/functions/NEArithmeticSubtraction.h +++ b/arm_compute/runtime/NEON/functions/NEArithmeticSubtraction.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_NEARITHMETICSUBTRACTION_H #define ARM_COMPUTE_NEARITHMETICSUBTRACTION_H -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/IFunction.h" #include "arm_compute/runtime/NEON/INEOperator.h" diff --git a/arm_compute/runtime/NEON/functions/NEConvolutionLayer.h b/arm_compute/runtime/NEON/functions/NEConvolutionLayer.h index 8b9b157918..4dd76d082b 100644 --- a/arm_compute/runtime/NEON/functions/NEConvolutionLayer.h +++ b/arm_compute/runtime/NEON/functions/NEConvolutionLayer.h @@ -26,9 +26,9 @@ #include "arm_compute/runtime/IFunction.h" -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/ITensorInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/MemoryGroup.h" #include diff --git a/arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h b/arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h index 02eb3ac7d1..8db7e6596b 100644 --- a/arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h +++ b/arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_NEDIRECTCONVOLUTIONLAYER_H #define ARM_COMPUTE_NEDIRECTCONVOLUTIONLAYER_H -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/IFunction.h" #include "arm_compute/runtime/IMemoryManager.h" #include "arm_compute/runtime/MemoryGroup.h" diff --git a/arm_compute/runtime/NEON/functions/NEElementwiseOperations.h b/arm_compute/runtime/NEON/functions/NEElementwiseOperations.h index c91ae203bb..bfcd221e17 100644 --- a/arm_compute/runtime/NEON/functions/NEElementwiseOperations.h +++ b/arm_compute/runtime/NEON/functions/NEElementwiseOperations.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_NEELEMENTWISEOPERATIONS_H #define ARM_COMPUTE_NEELEMENTWISEOPERATIONS_H -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/IFunction.h" #include "arm_compute/runtime/NEON/INEOperator.h" diff --git a/arm_compute/runtime/NEON/functions/NEFullyConnectedLayer.h b/arm_compute/runtime/NEON/functions/NEFullyConnectedLayer.h index d0367b79fd..05b7ce3735 100644 --- a/arm_compute/runtime/NEON/functions/NEFullyConnectedLayer.h +++ b/arm_compute/runtime/NEON/functions/NEFullyConnectedLayer.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_NEFULLYCONNECTEDLAYER_H #define ARM_COMPUTE_NEFULLYCONNECTEDLAYER_H -#include "arm_compute/core/FullyConnectedLayerInfo.h" +#include "arm_compute/function_info/FullyConnectedLayerInfo.h" #include "arm_compute/runtime/IFunction.h" #include "arm_compute/runtime/IMemoryManager.h" #include "arm_compute/runtime/IWeightsManager.h" diff --git a/arm_compute/runtime/NEON/functions/NEGEMM.h b/arm_compute/runtime/NEON/functions/NEGEMM.h index 2ad3746718..c6ff2dfb92 100644 --- a/arm_compute/runtime/NEON/functions/NEGEMM.h +++ b/arm_compute/runtime/NEON/functions/NEGEMM.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_NEGEMM_H #define ARM_COMPUTE_NEGEMM_H -#include "arm_compute/core/GEMMInfo.h" +#include "arm_compute/function_info/GEMMInfo.h" #include "arm_compute/runtime/IFunction.h" #include "arm_compute/runtime/IMemoryManager.h" #include "arm_compute/runtime/IWeightsManager.h" diff --git a/arm_compute/runtime/NEON/functions/NEGEMMConvolutionLayer.h b/arm_compute/runtime/NEON/functions/NEGEMMConvolutionLayer.h index 1aca1df8eb..72309e464e 100644 --- a/arm_compute/runtime/NEON/functions/NEGEMMConvolutionLayer.h +++ b/arm_compute/runtime/NEON/functions/NEGEMMConvolutionLayer.h @@ -26,8 +26,8 @@ #include "arm_compute/runtime/IFunction.h" -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/IFunction.h" #include "arm_compute/runtime/IMemoryManager.h" #include "arm_compute/runtime/IWeightsManager.h" diff --git a/arm_compute/runtime/NEON/functions/NEGEMMLowpMatrixMultiplyCore.h b/arm_compute/runtime/NEON/functions/NEGEMMLowpMatrixMultiplyCore.h index ccd2fb5a49..addb13cdfa 100644 --- a/arm_compute/runtime/NEON/functions/NEGEMMLowpMatrixMultiplyCore.h +++ b/arm_compute/runtime/NEON/functions/NEGEMMLowpMatrixMultiplyCore.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_NEGEMMLOWPMATRIXMULTIPLYCORE_H #define ARM_COMPUTE_NEGEMMLOWPMATRIXMULTIPLYCORE_H -#include "arm_compute/core/GEMMInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/GEMMInfo.h" #include "arm_compute/runtime/IFunction.h" #include "arm_compute/runtime/IMemoryManager.h" #include "arm_compute/runtime/IWeightsManager.h" diff --git a/arm_compute/runtime/NEON/functions/NEMatMul.h b/arm_compute/runtime/NEON/functions/NEMatMul.h index 81fec19f86..e961f860c1 100644 --- a/arm_compute/runtime/NEON/functions/NEMatMul.h +++ b/arm_compute/runtime/NEON/functions/NEMatMul.h @@ -24,8 +24,8 @@ #ifndef ACL_ARM_COMPUTE_RUNTIME_NEON_FUNCTIONS_NEMATMUL #define ACL_ARM_COMPUTE_RUNTIME_NEON_FUNCTIONS_NEMATMUL -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/IFunction.h" #include diff --git a/arm_compute/runtime/NEON/functions/NEPixelWiseMultiplication.h b/arm_compute/runtime/NEON/functions/NEPixelWiseMultiplication.h index d09899c3bb..634e8e0c39 100644 --- a/arm_compute/runtime/NEON/functions/NEPixelWiseMultiplication.h +++ b/arm_compute/runtime/NEON/functions/NEPixelWiseMultiplication.h @@ -24,9 +24,9 @@ #ifndef ARM_COMPUTE_NEPIXELWISEMULTIPLICATION_H #define ARM_COMPUTE_NEPIXELWISEMULTIPLICATION_H -#include "arm_compute/core/ActivationLayerInfo.h" -#include "arm_compute/core/Types.h" #include "arm_compute/core/Rounding.h" +#include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/IFunction.h" #include diff --git a/arm_compute/runtime/NEON/functions/NEWinogradConvolutionLayer.h b/arm_compute/runtime/NEON/functions/NEWinogradConvolutionLayer.h index b3d3f9e30a..f6f0185e7d 100644 --- a/arm_compute/runtime/NEON/functions/NEWinogradConvolutionLayer.h +++ b/arm_compute/runtime/NEON/functions/NEWinogradConvolutionLayer.h @@ -26,8 +26,8 @@ #include "arm_compute/runtime/IFunction.h" -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/Tensor.h" #include diff --git a/docs/contributor_guide/adding_operator.dox b/docs/contributor_guide/adding_operator.dox index b9bc7e09ce..559e8e2e76 100644 --- a/docs/contributor_guide/adding_operator.dox +++ b/docs/contributor_guide/adding_operator.dox @@ -55,13 +55,13 @@ Following are the steps involved in adding support for a new operator in Compute @subsection S4_1_1_add_datatypes Adding new data types Compute Library declares a few new datatypes related to its domain, kernels, and functions in the library process Tensors and Images (Computer Vision functions). Tensors are multi-dimensional arrays with a maximum of Coordinates::num_max_dimensions dimensions; depending on the number of dimensions tensors can be interpreted as various objects. A scalar can be represented as a zero-dimensional tensor and a vector of numbers can be represented as a one-dimensional tensor. Furthermore, an image is just a 2D tensor, a 3D tensor can be seen as an array of images and a 4D tensor as a 2D array of images, etc. -All the datatype classes or structures are grouped in the core library folder arm_compute/core like the @ref ITensor, @ref ITensorInfo (all the information of a tensor), TensorShape and simpler types are in arm_compute/core/Types.h. +All the datatype classes or structures are grouped in the core library folder arm_compute/core like the @ref ITensor, @ref ITensorInfo (all the information of a tensor), TensorShape and simpler types are in arm_compute/core/CoreTypes.h. If an operator handles a new datatype, it must be added to the library. While adding a new data type to the library, it's necessary to implement the function to enable printing, the to_string() method and the output stream insertion (<<) operator. Every datatype implements these two functions in utils/TypePrinter.h -A quick example, in Types.h we add: +A quick example, in CoreTypes.h we add: -@snippet arm_compute/core/Types.h DataLayout enum definition +@snippet arm_compute/core/CoreTypes.h DataLayout enum definition And for printing: diff --git a/src/common/utils/LegacySupport.cpp b/src/common/utils/LegacySupport.cpp index f8e8a6ea3c..06b1693bd1 100644 --- a/src/common/utils/LegacySupport.cpp +++ b/src/common/utils/LegacySupport.cpp @@ -23,7 +23,7 @@ */ #include "src/common/utils/LegacySupport.h" -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" namespace arm_compute { diff --git a/src/common/utils/LegacySupport.h b/src/common/utils/LegacySupport.h index f1955ae3e1..05a70fc2c6 100644 --- a/src/common/utils/LegacySupport.h +++ b/src/common/utils/LegacySupport.h @@ -25,9 +25,9 @@ #define SRC_COMMON_LEGACY_SUPPORT_H #include "arm_compute/Acl.h" -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" namespace arm_compute { diff --git a/src/core/CL/kernels/CLBatchNormalizationLayerKernel.h b/src/core/CL/kernels/CLBatchNormalizationLayerKernel.h index 59ea8278ea..acbe0f2a26 100644 --- a/src/core/CL/kernels/CLBatchNormalizationLayerKernel.h +++ b/src/core/CL/kernels/CLBatchNormalizationLayerKernel.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CLBATCHNORMALIZATIONLAYERKERNEL_H #define ARM_COMPUTE_CLBATCHNORMALIZATIONLAYERKERNEL_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/CL/ICLKernel.h" namespace arm_compute diff --git a/src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.h b/src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.h index 08e9c67f2c..8eee7b2500 100644 --- a/src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.h +++ b/src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.h @@ -26,8 +26,8 @@ #include "src/core/CL/ICLKernel.h" -#include "arm_compute/core/ConvolutionInfo.h" #include "arm_compute/core/KernelDescriptors.h" +#include "arm_compute/function_info/ConvolutionInfo.h" namespace arm_compute { diff --git a/src/core/NEON/kernels/NEBatchNormalizationLayerKernel.h b/src/core/NEON/kernels/NEBatchNormalizationLayerKernel.h index f06884f8c9..0551ace30c 100644 --- a/src/core/NEON/kernels/NEBatchNormalizationLayerKernel.h +++ b/src/core/NEON/kernels/NEBatchNormalizationLayerKernel.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_NEBATCHNORMALIZATIONLAYERKERNEL_H #define ARM_COMPUTE_NEBATCHNORMALIZATIONLAYERKERNEL_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/NEON/INEKernel.h" namespace arm_compute diff --git a/src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp b/src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp index f7b75f07e1..98cd9aa7fe 100644 --- a/src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp +++ b/src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp @@ -21,10 +21,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensorPack.h" #include "arm_compute/core/Window.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/NEON/SVEMath.h" #include diff --git a/src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp b/src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp index 22089b1d07..952ab320bf 100644 --- a/src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp +++ b/src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp @@ -21,10 +21,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensorPack.h" #include "arm_compute/core/Window.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/NEON/SVEMath.h" #include diff --git a/src/core/NEON/kernels/detail/NEActivationFunctionDetail.h b/src/core/NEON/kernels/detail/NEActivationFunctionDetail.h index d03b6e9978..3900ea62cd 100644 --- a/src/core/NEON/kernels/detail/NEActivationFunctionDetail.h +++ b/src/core/NEON/kernels/detail/NEActivationFunctionDetail.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_DETAIL_NEACTIVATION_FUNCTION_DETAIL_H #define ARM_COMPUTE_DETAIL_NEACTIVATION_FUNCTION_DETAIL_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/NEON/wrapper/wrapper.h" namespace arm_compute diff --git a/src/core/Utils.cpp b/src/core/Utils.cpp index 89f373fc87..0701ee7c90 100644 --- a/src/core/Utils.cpp +++ b/src/core/Utils.cpp @@ -24,9 +24,9 @@ #include "arm_compute/core/Utils.h" -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/utils/StringUtils.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include #include diff --git a/src/core/utils/AssemblyUtils.cpp b/src/core/utils/AssemblyUtils.cpp index 0efc6ac552..6d483adc7f 100644 --- a/src/core/utils/AssemblyUtils.cpp +++ b/src/core/utils/AssemblyUtils.cpp @@ -23,7 +23,7 @@ */ #include "src/core/utils/AssemblyUtils.h" -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" namespace arm_compute { diff --git a/src/core/utils/quantization/AsymmHelpers.cpp b/src/core/utils/quantization/AsymmHelpers.cpp index 0dec56c451..086d63b968 100644 --- a/src/core/utils/quantization/AsymmHelpers.cpp +++ b/src/core/utils/quantization/AsymmHelpers.cpp @@ -21,11 +21,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/utils/quantization/AsymmHelpers.h" #include "arm_compute/core/Helpers.h" -#include "support/ToolchainSupport.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/utils/quantization/AsymmHelpers.h" +#include "support/ToolchainSupport.h" #include #include @@ -240,15 +240,14 @@ void compute_quantized_multipliers_and_shifts(const ITensorInfo *input, int32_t saturating_rounding_doubling_highmul(int32_t a, int32_t b) { - bool overflow = a == b && a == std::numeric_limits::min(); - int64_t a_64(a); - int64_t b_64(b); - int64_t ab_64 = a_64 * b_64; - const bool is_positive_or_zero = - a == 0 || b == 0 || - (std::signbit(static_cast(a)) == std::signbit(static_cast(b))); - int32_t nudge = is_positive_or_zero ? (1 << 30) : (1 - (1 << 30)); - int32_t ab_x2_high32 = static_cast((ab_64 + nudge) / (1ll << 31)); + bool overflow = a == b && a == std::numeric_limits::min(); + int64_t a_64(a); + int64_t b_64(b); + int64_t ab_64 = a_64 * b_64; + const bool is_positive_or_zero = + a == 0 || b == 0 || (std::signbit(static_cast(a)) == std::signbit(static_cast(b))); + int32_t nudge = is_positive_or_zero ? (1 << 30) : (1 - (1 << 30)); + int32_t ab_x2_high32 = static_cast((ab_64 + nudge) / (1ll << 31)); return overflow ? std::numeric_limits::max() : ab_x2_high32; } diff --git a/src/cpu/kernels/CpuActivationKernel.h b/src/cpu/kernels/CpuActivationKernel.h index 72ba4421e0..804407653f 100644 --- a/src/cpu/kernels/CpuActivationKernel.h +++ b/src/cpu/kernels/CpuActivationKernel.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CPU_ACTIVATION_KERNEL_H #define ARM_COMPUTE_CPU_ACTIVATION_KERNEL_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/common/Macros.h" #include "src/cpu/ICpuKernel.h" diff --git a/src/cpu/kernels/CpuAddMulAddKernel.h b/src/cpu/kernels/CpuAddMulAddKernel.h index 1a300f19cc..67ce6f029a 100644 --- a/src/cpu/kernels/CpuAddMulAddKernel.h +++ b/src/cpu/kernels/CpuAddMulAddKernel.h @@ -25,7 +25,7 @@ #ifndef SRC_CPU_KERNELS_CPUADDMULADDKERNEL #define SRC_CPU_KERNELS_CPUADDMULADDKERNEL -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/common/Macros.h" #include "src/cpu/ICpuKernel.h" diff --git a/src/cpu/kernels/CpuDepthwiseConv2dNativeKernel.h b/src/cpu/kernels/CpuDepthwiseConv2dNativeKernel.h index 8bb70e847f..9fabd0b01c 100644 --- a/src/cpu/kernels/CpuDepthwiseConv2dNativeKernel.h +++ b/src/cpu/kernels/CpuDepthwiseConv2dNativeKernel.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_CPU_DEPTHWISE_CONV2D_NATIVE_KERNEL_H #define ARM_COMPUTE_CPU_DEPTHWISE_CONV2D_NATIVE_KERNEL_H -#include "arm_compute/core/ConvolutionInfo.h" #include "arm_compute/core/utils/misc/Traits.h" +#include "arm_compute/function_info/ConvolutionInfo.h" #include "src/core/common/Macros.h" #include "src/cpu/ICpuKernel.h" #include "support/AclRequires.h" diff --git a/src/cpu/kernels/activation/generic/neon/impl.h b/src/cpu/kernels/activation/generic/neon/impl.h index cac326da0a..05885d8476 100644 --- a/src/cpu/kernels/activation/generic/neon/impl.h +++ b/src/cpu/kernels/activation/generic/neon/impl.h @@ -21,9 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/Window.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/NEON/wrapper/wrapper.h" namespace arm_compute { @@ -213,7 +213,7 @@ void fp_neon_activation_impl(const ITensor *src, ITensor *dst, const ActivationL tmp = in * ((std::min(std::max((in + 3), 0.0f), 6.0f)) * 0.166666667f); break; case ActivationLayerInfo::ActivationFunction::SWISH: - tmp = in / (static_cast(1) + std::exp(-a*in)); + tmp = in / (static_cast(1) + std::exp(-a * in)); break; case ActivationLayerInfo::ActivationFunction::GELU: tmp = in * static_cast(0.5f * (1.0f + erff(static_cast(in) / 1.41421356237f))); diff --git a/src/cpu/kernels/activation/generic/neon/lut.cpp b/src/cpu/kernels/activation/generic/neon/lut.cpp index 231629241b..c973e964e4 100644 --- a/src/cpu/kernels/activation/generic/neon/lut.cpp +++ b/src/cpu/kernels/activation/generic/neon/lut.cpp @@ -22,8 +22,8 @@ * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/cpu/kernels/lut/list.h" namespace arm_compute diff --git a/src/cpu/kernels/activation/generic/neon/qasymm8.cpp b/src/cpu/kernels/activation/generic/neon/qasymm8.cpp index c61facc9b0..e7c146e46f 100644 --- a/src/cpu/kernels/activation/generic/neon/qasymm8.cpp +++ b/src/cpu/kernels/activation/generic/neon/qasymm8.cpp @@ -22,9 +22,9 @@ * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/Window.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/NEON/NEAsymm.h" #include "src/core/NEON/NEMath.h" #include "src/core/NEON/wrapper/wrapper.h" diff --git a/src/cpu/kernels/activation/generic/neon/qasymm8_signed.cpp b/src/cpu/kernels/activation/generic/neon/qasymm8_signed.cpp index 80df76d32a..52c396459b 100644 --- a/src/cpu/kernels/activation/generic/neon/qasymm8_signed.cpp +++ b/src/cpu/kernels/activation/generic/neon/qasymm8_signed.cpp @@ -21,9 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/Window.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/NEON/NEAsymm.h" #include "src/core/NEON/NEMath.h" #include "src/core/NEON/wrapper/wrapper.h" diff --git a/src/cpu/kernels/activation/generic/neon/qsymm16.cpp b/src/cpu/kernels/activation/generic/neon/qsymm16.cpp index 331c30a496..2aea6cba3c 100644 --- a/src/cpu/kernels/activation/generic/neon/qsymm16.cpp +++ b/src/cpu/kernels/activation/generic/neon/qsymm16.cpp @@ -21,11 +21,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensorPack.h" #include "arm_compute/core/Window.h" #include "arm_compute/core/experimental/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/NEON/NEMath.h" #include "src/core/NEON/NESymm.h" #include "src/core/NEON/wrapper/wrapper.h" diff --git a/src/cpu/kernels/activation/generic/sve/fp16.cpp b/src/cpu/kernels/activation/generic/sve/fp16.cpp index 190cf13dcb..4757c60d8f 100644 --- a/src/cpu/kernels/activation/generic/sve/fp16.cpp +++ b/src/cpu/kernels/activation/generic/sve/fp16.cpp @@ -24,10 +24,10 @@ #if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(ENABLE_FP16_KERNELS) -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensorPack.h" #include "arm_compute/core/Window.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include #include diff --git a/src/cpu/kernels/activation/generic/sve/fp32.cpp b/src/cpu/kernels/activation/generic/sve/fp32.cpp index d38b79170f..87f04c255a 100644 --- a/src/cpu/kernels/activation/generic/sve/fp32.cpp +++ b/src/cpu/kernels/activation/generic/sve/fp32.cpp @@ -22,10 +22,10 @@ * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensorPack.h" #include "arm_compute/core/Window.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/NEON/SVEMath.h" #include diff --git a/src/cpu/kernels/activation/generic/sve2/lut.cpp b/src/cpu/kernels/activation/generic/sve2/lut.cpp index 2876caa020..d65de8d649 100644 --- a/src/cpu/kernels/activation/generic/sve2/lut.cpp +++ b/src/cpu/kernels/activation/generic/sve2/lut.cpp @@ -22,8 +22,8 @@ * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/cpu/kernels/lut/list.h" namespace arm_compute diff --git a/src/cpu/kernels/activation/generic/sve2/qasymm8.cpp b/src/cpu/kernels/activation/generic/sve2/qasymm8.cpp index 1295d799b2..bc9bc7aa3c 100644 --- a/src/cpu/kernels/activation/generic/sve2/qasymm8.cpp +++ b/src/cpu/kernels/activation/generic/sve2/qasymm8.cpp @@ -22,9 +22,9 @@ * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/Window.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include #include @@ -49,16 +49,15 @@ void sve2_qasymm8_activation(const ITensor *src, ITensor *dst, const ActivationL Iterator input(src, win_collapsed); Iterator output(dst, win_collapsed); - const UniformQuantizationInfo qi_in = src->info()->quantization_info().uniform(); - const UniformQuantizationInfo qi_out = dst->info()->quantization_info().uniform(); - const auto va = svdup_n_u8(quantize_qasymm8(act_info.a(), qi_in)); - const auto vb = svdup_n_u8(quantize_qasymm8(act_info.b(), qi_in)); - const auto const_0 = quantize_qasymm8(0.f, qi_in); - const auto vconst_0 = svdup_n_u8(const_0); - const auto vconst_1 = svdup_n_f32(1.f); - const auto va_f32 = svdup_n_f32(act_info.a()); - const auto vb_f32 = svdup_n_f32(act_info.b()); - + const UniformQuantizationInfo qi_in = src->info()->quantization_info().uniform(); + const UniformQuantizationInfo qi_out = dst->info()->quantization_info().uniform(); + const auto va = svdup_n_u8(quantize_qasymm8(act_info.a(), qi_in)); + const auto vb = svdup_n_u8(quantize_qasymm8(act_info.b(), qi_in)); + const auto const_0 = quantize_qasymm8(0.f, qi_in); + const auto vconst_0 = svdup_n_u8(const_0); + const auto vconst_1 = svdup_n_f32(1.f); + const auto va_f32 = svdup_n_f32(act_info.a()); + const auto vb_f32 = svdup_n_f32(act_info.b()); // Initialise scale/offset for re-quantization bool requant = true; diff --git a/src/cpu/kernels/activation/generic/sve2/qasymm8_signed.cpp b/src/cpu/kernels/activation/generic/sve2/qasymm8_signed.cpp index aca4e7ebc0..d20684f54d 100644 --- a/src/cpu/kernels/activation/generic/sve2/qasymm8_signed.cpp +++ b/src/cpu/kernels/activation/generic/sve2/qasymm8_signed.cpp @@ -21,9 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/Window.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/NEON/wrapper/wrapper.h" #include diff --git a/src/cpu/kernels/activation/generic/sve2/qsymm16.cpp b/src/cpu/kernels/activation/generic/sve2/qsymm16.cpp index 3265604e03..5154fac8a7 100644 --- a/src/cpu/kernels/activation/generic/sve2/qsymm16.cpp +++ b/src/cpu/kernels/activation/generic/sve2/qsymm16.cpp @@ -21,11 +21,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensorPack.h" #include "arm_compute/core/Window.h" #include "arm_compute/core/experimental/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include #include diff --git a/src/cpu/kernels/addmuladd/generic/neon/fp16.cpp b/src/cpu/kernels/addmuladd/generic/neon/fp16.cpp index 15f62fe502..d8e5f694a8 100644 --- a/src/cpu/kernels/addmuladd/generic/neon/fp16.cpp +++ b/src/cpu/kernels/addmuladd/generic/neon/fp16.cpp @@ -22,11 +22,11 @@ * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensor.h" #include "arm_compute/core/Types.h" #include "arm_compute/core/Window.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/cpu/CpuTypes.h" #include diff --git a/src/cpu/kernels/addmuladd/generic/neon/fp32.cpp b/src/cpu/kernels/addmuladd/generic/neon/fp32.cpp index 1daa8c33b4..b0c487ec56 100644 --- a/src/cpu/kernels/addmuladd/generic/neon/fp32.cpp +++ b/src/cpu/kernels/addmuladd/generic/neon/fp32.cpp @@ -22,11 +22,11 @@ * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensor.h" #include "arm_compute/core/Types.h" #include "arm_compute/core/Window.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include #include diff --git a/src/cpu/kernels/addmuladd/generic/neon/qasymm8.cpp b/src/cpu/kernels/addmuladd/generic/neon/qasymm8.cpp index dc77d0c450..f7448a6717 100644 --- a/src/cpu/kernels/addmuladd/generic/neon/qasymm8.cpp +++ b/src/cpu/kernels/addmuladd/generic/neon/qasymm8.cpp @@ -22,12 +22,12 @@ * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensor.h" #include "arm_compute/core/QuantizationInfo.h" #include "arm_compute/core/Types.h" #include "arm_compute/core/Window.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include #include diff --git a/src/cpu/kernels/addmuladd/generic/neon/qasymm8_signed.cpp b/src/cpu/kernels/addmuladd/generic/neon/qasymm8_signed.cpp index 1e8c2070be..1ae2cb76a9 100644 --- a/src/cpu/kernels/addmuladd/generic/neon/qasymm8_signed.cpp +++ b/src/cpu/kernels/addmuladd/generic/neon/qasymm8_signed.cpp @@ -22,12 +22,12 @@ * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensor.h" #include "arm_compute/core/QuantizationInfo.h" #include "arm_compute/core/Types.h" #include "arm_compute/core/Window.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include #include diff --git a/src/cpu/kernels/depthwiseconv2d/generic/neon/impl.cpp b/src/cpu/kernels/depthwiseconv2d/generic/neon/impl.cpp index da67371398..f128254771 100644 --- a/src/cpu/kernels/depthwiseconv2d/generic/neon/impl.cpp +++ b/src/cpu/kernels/depthwiseconv2d/generic/neon/impl.cpp @@ -21,9 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include "arm_compute/core/ConvolutionInfo.h" #include "src/cpu/kernels/depthwiseconv2d/generic/neon/impl.h" #include "arm_compute/core/utils/quantization/AsymmHelpers.h" +#include "arm_compute/function_info/ConvolutionInfo.h" #include "src/core/NEON/wrapper/wrapper.h" namespace arm_compute diff --git a/src/cpu/operators/CpuActivation.h b/src/cpu/operators/CpuActivation.h index 16c765e3ad..e21fc7d32c 100644 --- a/src/cpu/operators/CpuActivation.h +++ b/src/cpu/operators/CpuActivation.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CPU_ACTIVATION_H #define ARM_COMPUTE_CPU_ACTIVATION_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/cpu/ICpuOperator.h" namespace arm_compute diff --git a/src/cpu/operators/CpuAdd.h b/src/cpu/operators/CpuAdd.h index 17bac81460..db05c100cc 100644 --- a/src/cpu/operators/CpuAdd.h +++ b/src/cpu/operators/CpuAdd.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CPU_ADD_H #define ARM_COMPUTE_CPU_ADD_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/cpu/ICpuOperator.h" namespace arm_compute diff --git a/src/cpu/operators/CpuConv2d.h b/src/cpu/operators/CpuConv2d.h index 7fefe63403..0908ac0cbb 100644 --- a/src/cpu/operators/CpuConv2d.h +++ b/src/cpu/operators/CpuConv2d.h @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/common/Macros.h" #include "src/cpu/ICpuOperator.h" diff --git a/src/cpu/operators/CpuDepthwiseConv2dAssemblyDispatch.h b/src/cpu/operators/CpuDepthwiseConv2dAssemblyDispatch.h index e5a14ed723..f222ab9cf9 100644 --- a/src/cpu/operators/CpuDepthwiseConv2dAssemblyDispatch.h +++ b/src/cpu/operators/CpuDepthwiseConv2dAssemblyDispatch.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CPU_DEPTHWISE_CONV2D_ASSEMBLY_DISPATCH_H #define ARM_COMPUTE_CPU_DEPTHWISE_CONV2D_ASSEMBLY_DISPATCH_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/common/Macros.h" #include "src/cpu/ICpuOperator.h" diff --git a/src/cpu/operators/CpuFullyConnected.h b/src/cpu/operators/CpuFullyConnected.h index db8d71d89e..1e8c6478d0 100644 --- a/src/cpu/operators/CpuFullyConnected.h +++ b/src/cpu/operators/CpuFullyConnected.h @@ -26,8 +26,8 @@ #include "src/cpu/ICpuOperator.h" -#include "arm_compute/core/FullyConnectedLayerInfo.h" #include "arm_compute/core/TensorInfo.h" +#include "arm_compute/function_info/FullyConnectedLayerInfo.h" #include @@ -108,8 +108,8 @@ public: FullyConnectedLayerInfo fc_info, WeightsInfo weights_info); //Inherited methods override - void run(ITensorPack &tensors) override; - void prepare(ITensorPack &tensors) override; + void run(ITensorPack &tensors) override; + void prepare(ITensorPack &tensors) override; experimental::MemoryRequirements workspace() const override; private: @@ -159,8 +159,8 @@ private: bool _dynamic_weights; #ifdef ARM_COMPUTE_ASSERTS_ENABLED - int _asrt_run_count{}; - int _asrt_prepare_count{}; + int _asrt_run_count{}; + int _asrt_prepare_count{}; #endif // ARM_COMPUTE_ASSERTS_ENABLED }; } // namespace cpu diff --git a/src/cpu/operators/CpuGemm.h b/src/cpu/operators/CpuGemm.h index 20d516cbcb..9b08e5d0f6 100644 --- a/src/cpu/operators/CpuGemm.h +++ b/src/cpu/operators/CpuGemm.h @@ -26,10 +26,10 @@ #include "src/cpu/ICpuOperator.h" -#include "arm_compute/core/GEMMInfo.h" #include "arm_compute/core/ITensorPack.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/GEMMInfo.h" #include "src/cpu/kernels/CpuGemmInterleave4x4Kernel.h" #include "src/cpu/kernels/CpuGemmMatrixAdditionKernel.h" #include "src/cpu/kernels/CpuGemmMatrixMultiplyKernel.h" diff --git a/src/cpu/operators/CpuGemmConv2d.h b/src/cpu/operators/CpuGemmConv2d.h index 1739ea6103..81d34ae93d 100644 --- a/src/cpu/operators/CpuGemmConv2d.h +++ b/src/cpu/operators/CpuGemmConv2d.h @@ -24,9 +24,9 @@ #ifndef ARM_COMPUTE_CPU_GEMM_CONV2D_H #define ARM_COMPUTE_CPU_GEMM_CONV2D_H -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/cpu/ICpuOperator.h" #include diff --git a/src/cpu/operators/CpuGemmLowpMatrixMultiplyCore.h b/src/cpu/operators/CpuGemmLowpMatrixMultiplyCore.h index 5914d11ded..a1b34291d0 100644 --- a/src/cpu/operators/CpuGemmLowpMatrixMultiplyCore.h +++ b/src/cpu/operators/CpuGemmLowpMatrixMultiplyCore.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_CPU_GEMMLOWP_MATRIXMULTIPLY_CORE_H #define ARM_COMPUTE_CPU_GEMMLOWP_MATRIXMULTIPLY_CORE_H -#include "arm_compute/core/GEMMInfo.h" #include "arm_compute/core/TensorInfo.h" +#include "arm_compute/function_info/GEMMInfo.h" #include "src/core/common/Macros.h" #include "src/cpu/ICpuOperator.h" diff --git a/src/cpu/operators/CpuMatMul.cpp b/src/cpu/operators/CpuMatMul.cpp index 94013d7262..8811a7ea6b 100644 --- a/src/cpu/operators/CpuMatMul.cpp +++ b/src/cpu/operators/CpuMatMul.cpp @@ -23,12 +23,12 @@ */ #include "src/cpu/operators/CpuMatMul.h" -#include "arm_compute/core/MatMulInfo.h" #include "arm_compute/core/Types.h" #include "arm_compute/core/Validate.h" #include "arm_compute/core/experimental/Types.h" #include "arm_compute/core/utils/misc/ShapeCalculator.h" #include "arm_compute/core/utils/quantization/AsymmHelpers.h" +#include "arm_compute/function_info/MatMulInfo.h" #include "arm_compute/runtime/NEON/NEScheduler.h" #include "arm_compute/runtime/NEON/functions/NEMatMul.h" #include "src/common/utils/Log.h" diff --git a/src/cpu/operators/CpuMul.h b/src/cpu/operators/CpuMul.h index 01c81bcb7b..3e0edbf050 100644 --- a/src/cpu/operators/CpuMul.h +++ b/src/cpu/operators/CpuMul.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_CPU_MUL_H #define ARM_COMPUTE_CPU_MUL_H -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/ITensorInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/cpu/ICpuOperator.h" namespace arm_compute diff --git a/src/cpu/operators/CpuSub.h b/src/cpu/operators/CpuSub.h index ceae3e9c11..88908637aa 100644 --- a/src/cpu/operators/CpuSub.h +++ b/src/cpu/operators/CpuSub.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CPU_SUB_H #define ARM_COMPUTE_CPU_SUB_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/cpu/ICpuOperator.h" namespace arm_compute diff --git a/src/cpu/operators/internal/CpuGemmAssemblyDispatch.h b/src/cpu/operators/internal/CpuGemmAssemblyDispatch.h index 66c3223a4e..ceb7a3f775 100644 --- a/src/cpu/operators/internal/CpuGemmAssemblyDispatch.h +++ b/src/cpu/operators/internal/CpuGemmAssemblyDispatch.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CPU_INTERNAL_CPU_GEMM_ASSEMBLY_DISPATCH_H #define ARM_COMPUTE_CPU_INTERNAL_CPU_GEMM_ASSEMBLY_DISPATCH_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/common/Macros.h" #include "src/cpu/ICpuOperator.h" diff --git a/src/dynamic_fusion/sketch/gpu/components/cl/ClComponentActivation.h b/src/dynamic_fusion/sketch/gpu/components/cl/ClComponentActivation.h index ebe8719420..9b090af988 100644 --- a/src/dynamic_fusion/sketch/gpu/components/cl/ClComponentActivation.h +++ b/src/dynamic_fusion/sketch/gpu/components/cl/ClComponentActivation.h @@ -24,10 +24,10 @@ #ifndef SRC_DYNAMIC_FUSION_SKETCH_GPU_COMPONENTS_CL_CLCOMPONENTACTIVATION #define SRC_DYNAMIC_FUSION_SKETCH_GPU_COMPONENTS_CL_CLCOMPONENTACTIVATION -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/dynamic_fusion/sketch/gpu/components/IGpuKernelComponent.h" -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" namespace arm_compute { diff --git a/src/dynamic_fusion/sketch/gpu/operators/GpuSigmoid.cpp b/src/dynamic_fusion/sketch/gpu/operators/GpuSigmoid.cpp index 95adfae70c..09debad969 100644 --- a/src/dynamic_fusion/sketch/gpu/operators/GpuSigmoid.cpp +++ b/src/dynamic_fusion/sketch/gpu/operators/GpuSigmoid.cpp @@ -23,8 +23,8 @@ */ #include "arm_compute/dynamic_fusion/sketch/gpu/operators/GpuSigmoid.h" -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/experimental/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/common/utils/Log.h" #include "src/core/helpers/AutoConfiguration.h" diff --git a/src/dynamic_fusion/sketch/gpu/template_writer/cl/ClTemplateActivation.h b/src/dynamic_fusion/sketch/gpu/template_writer/cl/ClTemplateActivation.h index 29f0711cc4..ec78cf6ce5 100644 --- a/src/dynamic_fusion/sketch/gpu/template_writer/cl/ClTemplateActivation.h +++ b/src/dynamic_fusion/sketch/gpu/template_writer/cl/ClTemplateActivation.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Arm Limited. + * Copyright (c) 2022-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,7 +25,7 @@ #define SRC_DYNAMIC_FUSION_SKETCH_GPU_TEMPLATE_WRITER_CL_CLTEMPLATEACTIVATION #include "arm_compute/core/experimental/Types.h" -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/dynamic_fusion/sketch/gpu/components/cl/ClComponentActivation.h" #include "src/dynamic_fusion/sketch/gpu/template_writer/GpuKernelVariableTable.h" #include "src/dynamic_fusion/sketch/gpu/template_writer/IGpuTemplateComponentWriter.h" diff --git a/src/gpu/cl/kernels/ClActivationKernel.cpp b/src/gpu/cl/kernels/ClActivationKernel.cpp index a5bf593d7d..ab1543729f 100644 --- a/src/gpu/cl/kernels/ClActivationKernel.cpp +++ b/src/gpu/cl/kernels/ClActivationKernel.cpp @@ -23,14 +23,14 @@ */ #include "src/gpu/cl/kernels/ClActivationKernel.h" -#include "arm_compute/core/utils/ActivationFunctionUtils.h" -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/CL/CLHelpers.h" #include "arm_compute/core/CL/ICLTensor.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Utils.h" -#include "arm_compute/core/utils/helpers/AdjustVecSize.h" +#include "arm_compute/core/utils/ActivationFunctionUtils.h" #include "arm_compute/core/utils/StringUtils.h" +#include "arm_compute/core/utils/helpers/AdjustVecSize.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/CL/CLValidate.h" #include "src/core/helpers/AutoConfiguration.h" #include "src/core/helpers/WindowHelpers.h" diff --git a/src/gpu/cl/kernels/ClActivationKernel.h b/src/gpu/cl/kernels/ClActivationKernel.h index 5369c95b7c..82e35b6104 100644 --- a/src/gpu/cl/kernels/ClActivationKernel.h +++ b/src/gpu/cl/kernels/ClActivationKernel.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CL_ACTIVATION_KERNEL_H #define ARM_COMPUTE_CL_ACTIVATION_KERNEL_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/common/Macros.h" #include "src/gpu/cl/ClCompileContext.h" #include "src/gpu/cl/IClKernel.h" diff --git a/src/gpu/cl/kernels/ClDirectConv2dKernel.h b/src/gpu/cl/kernels/ClDirectConv2dKernel.h index 9a91aec658..7132762b35 100644 --- a/src/gpu/cl/kernels/ClDirectConv2dKernel.h +++ b/src/gpu/cl/kernels/ClDirectConv2dKernel.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CL_DIRECT_CONV2D_KERNEL_H #define ARM_COMPUTE_CL_DIRECT_CONV2D_KERNEL_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/common/Macros.h" #include "src/gpu/cl/ClCompileContext.h" #include "src/gpu/cl/IClKernel.h" diff --git a/src/gpu/cl/kernels/ClElementwiseKernel.h b/src/gpu/cl/kernels/ClElementwiseKernel.h index 927b9c7f46..ea3ddb2124 100644 --- a/src/gpu/cl/kernels/ClElementwiseKernel.h +++ b/src/gpu/cl/kernels/ClElementwiseKernel.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CL_ELEMENTWISE_KERNEL_H #define ARM_COMPUTE_CL_ELEMENTWISE_KERNEL_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/KernelTypes.h" #include "src/core/common/Macros.h" #include "src/gpu/cl/ClCompileContext.h" diff --git a/src/gpu/cl/kernels/ClIndirectConv2dKernel.h b/src/gpu/cl/kernels/ClIndirectConv2dKernel.h index 94106dadec..b6c7b35fa4 100644 --- a/src/gpu/cl/kernels/ClIndirectConv2dKernel.h +++ b/src/gpu/cl/kernels/ClIndirectConv2dKernel.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CL_DIRECT_CONV2D_KERNEL_H #define ARM_COMPUTE_CL_DIRECT_CONV2D_KERNEL_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/common/Macros.h" #include "src/gpu/cl/ClCompileContext.h" #include "src/gpu/cl/IClKernel.h" diff --git a/src/gpu/cl/kernels/ClMatMulLowpNativeKernel.h b/src/gpu/cl/kernels/ClMatMulLowpNativeKernel.h index c90828008c..64415f42f7 100644 --- a/src/gpu/cl/kernels/ClMatMulLowpNativeKernel.h +++ b/src/gpu/cl/kernels/ClMatMulLowpNativeKernel.h @@ -24,7 +24,7 @@ #ifndef ACL_SRC_GPU_CL_KERNELS_CLMATMULLOWPNATIVEKERNEL #define ACL_SRC_GPU_CL_KERNELS_CLMATMULLOWPNATIVEKERNEL -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/common/Macros.h" #include "src/gpu/cl/ClCompileContext.h" #include "src/gpu/cl/IClKernel.h" diff --git a/src/gpu/cl/kernels/ClMulKernel.h b/src/gpu/cl/kernels/ClMulKernel.h index 4210a9103d..4e62a6d67a 100644 --- a/src/gpu/cl/kernels/ClMulKernel.h +++ b/src/gpu/cl/kernels/ClMulKernel.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CL_MUL_KERNEL_H #define ARM_COMPUTE_CL_MUL_KERNEL_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/common/Macros.h" #include "src/gpu/cl/ClCompileContext.h" #include "src/gpu/cl/IClKernel.h" diff --git a/src/gpu/cl/operators/ClActivation.h b/src/gpu/cl/operators/ClActivation.h index 09422485a1..348dc27929 100644 --- a/src/gpu/cl/operators/ClActivation.h +++ b/src/gpu/cl/operators/ClActivation.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CL_ACTIVATION_H #define ARM_COMPUTE_CL_ACTIVATION_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/gpu/cl/ClCompileContext.h" #include "src/gpu/cl/IClOperator.h" diff --git a/src/gpu/cl/operators/ClAdd.h b/src/gpu/cl/operators/ClAdd.h index 67aa8f08fa..a17ce7b5d6 100644 --- a/src/gpu/cl/operators/ClAdd.h +++ b/src/gpu/cl/operators/ClAdd.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CL_ADD_H #define ARM_COMPUTE_CL_ADD_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/gpu/cl/ClCompileContext.h" #include "src/gpu/cl/IClOperator.h" diff --git a/src/gpu/cl/operators/ClDirectConv2d.h b/src/gpu/cl/operators/ClDirectConv2d.h index fc2568eae2..fedb9e971e 100644 --- a/src/gpu/cl/operators/ClDirectConv2d.h +++ b/src/gpu/cl/operators/ClDirectConv2d.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CL_DIRECT_CONV2D_H #define ARM_COMPUTE_CL_DIRECT_CONV2D_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/gpu/cl/ClCompileContext.h" #include "src/gpu/cl/IClKernel.h" #include "src/gpu/cl/IClOperator.h" diff --git a/src/gpu/cl/operators/ClElementwiseOperations.h b/src/gpu/cl/operators/ClElementwiseOperations.h index 7a8570c94a..120049cb7f 100644 --- a/src/gpu/cl/operators/ClElementwiseOperations.h +++ b/src/gpu/cl/operators/ClElementwiseOperations.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CL_ELEMENTWISE_OPERATIONS_H #define ARM_COMPUTE_CL_ELEMENTWISE_OPERATIONS_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/gpu/cl/ClCompileContext.h" #include "src/gpu/cl/IClOperator.h" diff --git a/src/gpu/cl/operators/ClFullyConnected.h b/src/gpu/cl/operators/ClFullyConnected.h index 5a71bd24c7..d975859d87 100644 --- a/src/gpu/cl/operators/ClFullyConnected.h +++ b/src/gpu/cl/operators/ClFullyConnected.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_CL_FULLY_CONNECTED_H #define ARM_COMPUTE_CL_FULLY_CONNECTED_H -#include "arm_compute/core/FullyConnectedLayerInfo.h" #include "arm_compute/core/TensorInfo.h" +#include "arm_compute/function_info/FullyConnectedLayerInfo.h" #include "src/gpu/cl/ClCompileContext.h" #include "src/gpu/cl/IClOperator.h" diff --git a/src/gpu/cl/operators/ClGemm.h b/src/gpu/cl/operators/ClGemm.h index 3d88a9ca84..11f9f2b3d8 100644 --- a/src/gpu/cl/operators/ClGemm.h +++ b/src/gpu/cl/operators/ClGemm.h @@ -25,7 +25,7 @@ #define ARM_COMPUTE_CL_GEMM_H #include "arm_compute/core/TensorInfo.h" -#include "arm_compute/core/GEMMInfo.h" +#include "arm_compute/function_info/GEMMInfo.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/CLTypes.h" diff --git a/src/gpu/cl/operators/ClGemmLowpMatrixMultiplyCore.h b/src/gpu/cl/operators/ClGemmLowpMatrixMultiplyCore.h index 3051f3079b..6e32a90fc4 100644 --- a/src/gpu/cl/operators/ClGemmLowpMatrixMultiplyCore.h +++ b/src/gpu/cl/operators/ClGemmLowpMatrixMultiplyCore.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_CL_GEMMLOWP_MATRIXMULTIPLY_CORE_H #define ARM_COMPUTE_CL_GEMMLOWP_MATRIXMULTIPLY_CORE_H -#include "arm_compute/core/GEMMInfo.h" #include "arm_compute/core/TensorInfo.h" +#include "arm_compute/function_info/GEMMInfo.h" #include "arm_compute/runtime/CL/CLTypes.h" #include "src/gpu/cl/ClCompileContext.h" diff --git a/src/gpu/cl/operators/ClIndirectConv2d.h b/src/gpu/cl/operators/ClIndirectConv2d.h index 0c121182d4..e50fa25069 100644 --- a/src/gpu/cl/operators/ClIndirectConv2d.h +++ b/src/gpu/cl/operators/ClIndirectConv2d.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_CL_INDIRECT_CONV2D_H #define ARM_COMPUTE_CL_INDIRECT_CONV2D_H -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/TensorInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/CLTypes.h" diff --git a/src/gpu/cl/operators/ClMatMul.h b/src/gpu/cl/operators/ClMatMul.h index 9dce5288e6..abbb75239a 100644 --- a/src/gpu/cl/operators/ClMatMul.h +++ b/src/gpu/cl/operators/ClMatMul.h @@ -24,8 +24,8 @@ #ifndef ACL_SRC_GPU_CL_OPERATORS_CLMATMUL #define ACL_SRC_GPU_CL_OPERATORS_CLMATMUL -#include "arm_compute/core/ActivationLayerInfo.h" -#include "arm_compute/core/MatMulInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" +#include "arm_compute/function_info/MatMulInfo.h" #include "src/gpu/cl/IClOperator.h" #include "src/gpu/cl/kernels/ClMatMulLowpNativeKernel.h" #include "src/gpu/cl/kernels/ClMatMulNativeKernel.h" diff --git a/src/gpu/cl/operators/ClMul.h b/src/gpu/cl/operators/ClMul.h index 24eeeb8909..6086bc9d52 100644 --- a/src/gpu/cl/operators/ClMul.h +++ b/src/gpu/cl/operators/ClMul.h @@ -24,8 +24,8 @@ #ifndef ARM_COMPUTE_CL_MUL_H #define ARM_COMPUTE_CL_MUL_H -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/gpu/cl/ClCompileContext.h" #include "src/gpu/cl/IClOperator.h" diff --git a/src/gpu/cl/operators/ClSub.h b/src/gpu/cl/operators/ClSub.h index a84c61cdb1..7eac437143 100644 --- a/src/gpu/cl/operators/ClSub.h +++ b/src/gpu/cl/operators/ClSub.h @@ -24,7 +24,7 @@ #ifndef ARM_COMPUTE_CL_SUB_H #define ARM_COMPUTE_CL_SUB_H -#include "arm_compute/core/ActivationLayerInfo.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/gpu/cl/ClCompileContext.h" #include "src/gpu/cl/IClOperator.h" diff --git a/src/runtime/CL/functions/CLActivationLayer.cpp b/src/runtime/CL/functions/CLActivationLayer.cpp index 0bfc20d83a..f324b1a68c 100644 --- a/src/runtime/CL/functions/CLActivationLayer.cpp +++ b/src/runtime/CL/functions/CLActivationLayer.cpp @@ -23,10 +23,10 @@ */ #include "arm_compute/runtime/CL/functions/CLActivationLayer.h" -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/CL/ICLTensor.h" #include "arm_compute/core/Types.h" #include "arm_compute/core/Validate.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/CL/CLRuntimeContext.h" #include "src/core/CL/ICLKernel.h" #include "src/gpu/cl/operators/ClActivation.h" diff --git a/src/runtime/CL/functions/CLGEMMDeconvolutionLayer.cpp b/src/runtime/CL/functions/CLGEMMDeconvolutionLayer.cpp index dd1112fb4b..9fc81c11da 100644 --- a/src/runtime/CL/functions/CLGEMMDeconvolutionLayer.cpp +++ b/src/runtime/CL/functions/CLGEMMDeconvolutionLayer.cpp @@ -23,11 +23,11 @@ */ #include "arm_compute/runtime/CL/functions/CLGEMMDeconvolutionLayer.h" -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/Validate.h" #include "arm_compute/core/utils/misc/ShapeCalculator.h" #include "arm_compute/core/utils/quantization/AsymmHelpers.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "arm_compute/runtime/CL/CLScheduler.h" #include "src/core/CL/kernels/CLDeconvolutionReshapeOutputKernel.h" #include "src/core/CL/kernels/CLFillBorderKernel.h" diff --git a/src/runtime/heuristics/matmul_native/IClMatMulNativeKernelConfig.h b/src/runtime/heuristics/matmul_native/IClMatMulNativeKernelConfig.h index 60e838c5cb..4f548bd01d 100644 --- a/src/runtime/heuristics/matmul_native/IClMatMulNativeKernelConfig.h +++ b/src/runtime/heuristics/matmul_native/IClMatMulNativeKernelConfig.h @@ -26,8 +26,8 @@ #include "arm_compute/core/GPUTarget.h" #include "arm_compute/core/KernelDescriptors.h" -#include "arm_compute/core/MatMulInfo.h" #include "arm_compute/core/Types.h" +#include "arm_compute/function_info/MatMulInfo.h" #include "src/core/common/Macros.h" namespace arm_compute diff --git a/tests/validation/Helpers.h b/tests/validation/Helpers.h index 3dd0a6f192..df3b08ba53 100644 --- a/tests/validation/Helpers.h +++ b/tests/validation/Helpers.h @@ -24,9 +24,9 @@ #ifndef ACL_TESTS_VALIDATION_HELPERS #define ACL_TESTS_VALIDATION_HELPERS -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Types.h" #include "arm_compute/core/Utils.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "support/Half.h" #include "tests/Globals.h" #include "tests/SimpleTensor.h" diff --git a/utils/TypePrinter.h b/utils/TypePrinter.h index de8a960e41..4bc326b574 100644 --- a/utils/TypePrinter.h +++ b/utils/TypePrinter.h @@ -28,14 +28,10 @@ #include "arm_compute/core/CL/ICLTensor.h" #endif /* ARM_COMPUTE_OPENCL_ENABLED */ -#include "arm_compute/core/ConvolutionInfo.h" #include "arm_compute/core/Dimensions.h" #include "arm_compute/core/Error.h" -#include "arm_compute/core/FullyConnectedLayerInfo.h" -#include "arm_compute/core/GEMMInfo.h" #include "arm_compute/core/GPUTarget.h" #include "arm_compute/core/KernelDescriptors.h" -#include "arm_compute/core/MatMulInfo.h" #include "arm_compute/core/Size2D.h" #include "arm_compute/core/Strides.h" #include "arm_compute/core/TensorInfo.h" @@ -50,6 +46,10 @@ #include "arm_compute/dynamic_fusion/sketch/attributes/ResizeAttributes.h" #include "arm_compute/dynamic_fusion/sketch/attributes/SoftmaxAttributes.h" #include "arm_compute/dynamic_fusion/sketch/gpu/operators/GpuPool2d.h" +#include "arm_compute/function_info/ConvolutionInfo.h" +#include "arm_compute/function_info/FullyConnectedLayerInfo.h" +#include "arm_compute/function_info/GEMMInfo.h" +#include "arm_compute/function_info/MatMulInfo.h" #include "arm_compute/runtime/CL/CLTunerTypes.h" #include "arm_compute/runtime/CL/CLTypes.h" #include "arm_compute/runtime/FunctionDescriptors.h" -- cgit v1.2.1