diff options
Diffstat (limited to 'arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h')
-rw-r--r-- | arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h b/arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h index ff0c3054d8..3ae3b2a15c 100644 --- a/arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h +++ b/arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2021 Arm Limited. + * Copyright (c) 2017-2021, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,27 +25,22 @@ #define ARM_COMPUTE_NEDIRECTCONVOLUTIONLAYER_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" -#include "arm_compute/runtime/NEON/functions/NEActivationLayer.h" -#include "arm_compute/runtime/Tensor.h" #include <memory> namespace arm_compute { -class NEDirectConvolutionLayerOutputStageKernel; -class NEDirectConvolutionLayerKernel; -class NEFillBorderKernel; - +class ITensor; +class ITensorInfo; /** Function to run the direct convolution. * - * This function calls the following Neon kernels: + * This function calls the following: * - * -# @ref NEFillBorderKernel for the input - * -# @ref NEDirectConvolutionLayerOutputStageKernel - * -# @ref NEDirectConvolutionLayerKernel + * -# @ref cpu::CpuDirectConv2d */ class NEDirectConvolutionLayer : public IFunction { @@ -64,6 +59,16 @@ public: ~NEDirectConvolutionLayer(); /** Set the input, weights, biases and output tensors. * + * Valid data layouts: + * - NHWC + * - NCHW + * + * Valid data type configurations: + * |src0 |src1 |src2 |dst | + * |:------|:------|:------|:------| + * |F16 |F16 |F16 |F16 | + * |F32 |F32 |F32 |F32 | + * * @note: DirectConvolution only works in the following configurations: * 1x1 convolution with stride_x = 1/2/3, stride_y = 1/2/3 data type = F16/F32 * 3x3 convolution with stride_x = 1/2/3, stride_y = 1/2/3 data type = F16/F32 @@ -80,7 +85,12 @@ public: * @param[in] conv_info Contains padding and stride information described in @ref PadStrideInfo. * @param[in] act_info (Optional) Activation layer information in case of a fused activation. */ - void configure(ITensor *input, const ITensor *weights, const ITensor *bias, ITensor *output, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info = ActivationLayerInfo()); + void configure(ITensor *input, + const ITensor *weights, + const ITensor *bias, + ITensor *output, + const PadStrideInfo &conv_info, + const ActivationLayerInfo &act_info = ActivationLayerInfo()); /** Static function to check if given info will lead to a valid configuration of @ref NEDirectConvolutionLayer * * @note: DirectConvolution only works in the following configurations: @@ -101,23 +111,20 @@ public: * * @return a status */ - static Status validate(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *bias, const ITensorInfo *output, const PadStrideInfo &conv_info, + static Status validate(const ITensorInfo *input, + const ITensorInfo *weights, + const ITensorInfo *bias, + const ITensorInfo *output, + const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info = ActivationLayerInfo()); // Inherited methods overridden: void run() override; private: - MemoryGroup _memory_group; - std::unique_ptr<NEDirectConvolutionLayerOutputStageKernel> _output_stage_kernel; - std::unique_ptr<NEDirectConvolutionLayerKernel> _conv_kernel; - std::unique_ptr<NEFillBorderKernel> _input_border_handler; - NEActivationLayer _activationlayer_function; - Tensor _accumulator; - bool _has_bias; - bool _is_activationlayer_enabled; - unsigned int _dim_split; - bool _is_padding_required; + struct Impl; + std::shared_ptr<IMemoryManager> _memory_manager; + std::unique_ptr<Impl> _impl; }; -} +} // namespace arm_compute #endif /* ARM_COMPUTE_NEDIRECTCONVOLUTIONLAYER_H */ |