diff options
Diffstat (limited to 'arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h')
-rw-r--r-- | arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h | 60 |
1 files changed, 43 insertions, 17 deletions
diff --git a/arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h b/arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h index 0afc9d3f38..84900b03a3 100644 --- a/arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h +++ b/arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,6 +25,7 @@ #define ARM_COMPUTE_CLDIRECTCONVOLUTIONLAYER_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" @@ -33,8 +34,6 @@ namespace arm_compute { class CLCompileContext; -class CLDirectConvolutionLayerKernel; -class CLFillBorderKernel; class ICLTensor; class ITensorInfo; @@ -43,16 +42,32 @@ class ITensorInfo; class CLDirectConvolutionLayer : public IFunction { public: - /** Default constructor */ + /** Constructor */ CLDirectConvolutionLayer(); - /** Prevent instances of this class from being copied */ + /** Destructor */ + ~CLDirectConvolutionLayer(); + /** Prevent instances of this class from being copied (As this class contains pointers) */ CLDirectConvolutionLayer(const CLDirectConvolutionLayer &) = delete; - /** Prevent instances of this class from being copied */ + /** Default move constructor */ + CLDirectConvolutionLayer(CLDirectConvolutionLayer &&); + /** Prevent instances of this class from being copied (As this class contains pointers) */ CLDirectConvolutionLayer &operator=(const CLDirectConvolutionLayer &) = delete; - /** Default destructor */ - ~CLDirectConvolutionLayer(); + /** Default move assignment operator */ + CLDirectConvolutionLayer &operator=(CLDirectConvolutionLayer &&); /** Set the input and output tensors. * + * Valid data layouts: + * - NHWC + * - NCHW + * + * Valid data type configurations: + * |src0 |src1 |src2 |dst | + * |:--------------|:--------------|:------|:--------------| + * |F16 |F16 |F16 |F16 | + * |F32 |F32 |F32 |F32 | + * |QASYMM8 |QASYMM8 |S32 |QASYMM8 | + * |QASYMM8_SIGNED |QASYMM8_SIGNED |S32 |QASYMM8_SIGNED | + * * @param[in] input Source tensor. 3 lower dimensions represent a single input [width, height, IFM], * while every optional dimension from 4 and above represent a batch of inputs. * Data types supported: QASYMM8_SIGNED/QASYMM8/F16/F32. @@ -64,7 +79,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(ICLTensor *input, const ICLTensor *weights, const ICLTensor *biases, ICLTensor *output, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info = ActivationLayerInfo()); + void configure(ICLTensor *input, + const ICLTensor *weights, + const ICLTensor *biases, + ICLTensor *output, + const PadStrideInfo &conv_info, + const ActivationLayerInfo &act_info = ActivationLayerInfo()); /** Set the input and output tensors. * * @param[in] compile_context The compile context to be used. @@ -79,7 +99,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(const CLCompileContext &compile_context, ICLTensor *input, const ICLTensor *weights, const ICLTensor *biases, ICLTensor *output, const PadStrideInfo &conv_info, + void configure(const CLCompileContext &compile_context, + ICLTensor *input, + const ICLTensor *weights, + const ICLTensor *biases, + ICLTensor *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 CLDirectConvolutionLayer * @@ -96,18 +121,19 @@ public: * * @return a status */ - static Status validate(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, const PadStrideInfo &conv_info, + static Status validate(const ITensorInfo *input, + const ITensorInfo *weights, + const ITensorInfo *biases, + const ITensorInfo *output, + const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info = ActivationLayerInfo()); // Inherited methods overridden: void run() override; private: - std::unique_ptr<CLDirectConvolutionLayerKernel> _direct_conv_kernel; - std::unique_ptr<CLFillBorderKernel> _input_border_handler; - CLActivationLayer _activationlayer_function; - - bool _is_activationlayer_enabled; + struct Impl; + std::unique_ptr<Impl> _impl; }; -} +} // namespace arm_compute #endif /* ARM_COMPUTE_CLDIRECTCONVOLUTIONLAYER_H */ |