24.02.1
|
Basic function to compute the convolution layer. More...
#include <NEGEMMConv2d.h>
Public Member Functions | |
NEGEMMConv2d (const std::shared_ptr< IMemoryManager > &memory_manager=nullptr) | |
Constructor. More... | |
NEGEMMConv2d (const NEGEMMConv2d &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEGEMMConv2d (NEGEMMConv2d &&)=default | |
Default move constructor. More... | |
NEGEMMConv2d & | operator= (const NEGEMMConv2d &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEGEMMConv2d & | operator= (NEGEMMConv2d &&)=default |
Default move assignment operator. More... | |
~NEGEMMConv2d () | |
Destructor. More... | |
void | configure (ITensor *input, const ITensor *weights, const ITensor *biases, ITensor *output, const Conv2dInfo &info) |
Set the input and output tensors. More... | |
void | run () override |
Run the kernels contained in the function. More... | |
void | prepare () override |
Prepare the function for executing. More... | |
Public Member Functions inherited from IFunction | |
virtual | ~IFunction ()=default |
Destructor. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, const Conv2dInfo &info) |
Static function to check if given info will lead to a valid configuration of NEGEMMConv2d. More... | |
Basic function to compute the convolution layer.
This function calls the following kernels/functions:
Supports only NHWC data layout
Weights are transformed from OHWI to HWIO format using the following kernels:
Definition at line 49 of file NEGEMMConv2d.h.
NEGEMMConv2d | ( | const std::shared_ptr< IMemoryManager > & | memory_manager = nullptr | ) |
Constructor.
Definition at line 49 of file NEGEMMConv2d.cpp.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move constructor.
|
default |
Destructor.
void configure | ( | ITensor * | input, |
const ITensor * | weights, | ||
const ITensor * | biases, | ||
ITensor * | output, | ||
const Conv2dInfo & | info | ||
) |
Set the input and output tensors.
Valid data layouts:
Valid data type configurations:
src0 | src1 | src2 | dst |
---|---|---|---|
QASYMM8 | QASYMM8 | S32 | QASYMM8 |
QASYMM8_SIGNED | QASYMM8_SIGNED | S32 | QASYMM8_SIGNED |
F16 | F16 | F16 | F16 |
F32 | F32 | F32 | F32 |
BFLOAT16 | BFLOAT16 | BFLOAT16 | BFLOAT16 |
[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/QASYMM8_SIGNED/BFLOAT16/F16/F32. |
[in] | weights | Weights tensor. Weights are 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM]. Data type supported: QASYMM8/QASYMM8_SIGNED/QSYMM8_PER_CHANNEL/BFLOAT16/F16/F32. |
[in] | biases | Biases tensor. Shared biases supported. Biases are 1D tensor with dimensions [OFM]. Data type supported: Should match input data type, except for input of QASYMM8/QASYMM8_SIGNED type where biases should be of S32 type. |
[out] | output | Destination tensor. 3 lower dimensions represent a single output [width, height, OFM], while the rest represent batch of outputs. Data types supported: Same as input . |
[in] | info | Convolution layer descriptor |
Definition at line 56 of file NEGEMMConv2d.cpp.
References arm_compute::ACL_DST, arm_compute::ACL_SRC_0, arm_compute::ACL_SRC_1, arm_compute::ACL_SRC_2, ARM_COMPUTE_ERROR_ON_NULLPTR, ITensor::info(), arm_compute::test::validation::info, and arm_compute::test::validation::input.
Referenced by arm_compute::test::validation::detail::configure_conv_function< NEGEMMConv2d, Tensor >().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move assignment operator.
|
overridevirtual |
Prepare the function for executing.
Any one off pre-processing step required by the function is handled here
Reimplemented from IFunction.
Definition at line 92 of file NEGEMMConv2d.cpp.
References arm_compute::ACL_SRC_1, and arm_compute::mlgo::parser::end().
Referenced by NEGEMMConv2d::run().
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 84 of file NEGEMMConv2d.cpp.
References NEGEMMConv2d::prepare().
|
static |
Static function to check if given info will lead to a valid configuration of NEGEMMConv2d.
[in] | input | Source tensor info. 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/QASYMM8_SIGNED/BFLOAT16/F16/F32. |
[in] | weights | Weights tensor info. Weights are 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM]. Data type supported: QASYMM8/QASYMM8_SIGNED/QSYMM8_PER_CHANNEL/BFLOAT16/F16/F32. |
[in] | biases | Biases tensor info. Shared biases supported. Biases are 1D tensor with dimensions [OFM]. Data type supported: Should match input data type, except for input of QASYMM8/QASYMM8_SIGNED type where biases should be of S32 type. |
[in] | output | Destination tensor info. 3 lower dimensions represent a single output [width, height, OFM], while the rest represent batch of outputs. Data types supported: Same as input . |
[in] | info | Contains padding and stride information described in PadStrideInfo. |
Definition at line 75 of file NEGEMMConv2d.cpp.
References arm_compute::test::validation::info, arm_compute::test::validation::input, and ClGemm::validate().