21.02
|
Interface for the direct convolution kernel. More...
#include <GCDirectConvolutionLayerKernel.h>
Public Member Functions | |
GCDirectConvolutionLayerKernel () | |
Default constructor. More... | |
GCDirectConvolutionLayerKernel (const GCDirectConvolutionLayerKernel &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
GCDirectConvolutionLayerKernel & | operator= (const GCDirectConvolutionLayerKernel &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
GCDirectConvolutionLayerKernel (GCDirectConvolutionLayerKernel &&)=default | |
Allow instances of this class to be moved. More... | |
GCDirectConvolutionLayerKernel & | operator= (GCDirectConvolutionLayerKernel &&)=default |
Allow instances of this class to be moved. More... | |
~GCDirectConvolutionLayerKernel ()=default | |
Default destructor. More... | |
void | configure (const IGCTensor *input, const IGCTensor *weights, const IGCTensor *bias, IGCTensor *output, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo()) |
Set the input and output of the kernel. More... | |
BorderSize | border_size () const override |
The size of the border for that kernel. More... | |
void | run (const Window &window) override |
Enqueue the OpenGL ES shader to process the given window. More... | |
Public Member Functions inherited from IGCKernel | |
IGCKernel () | |
Constructor. More... | |
GCKernel & | kernel () |
Returns a reference to the GLES kernel of this object. More... | |
void | add_1D_tensor_argument (unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window) |
Add the passed 1D tensor's parameters to the object's kernel's arguments starting from the index idx. More... | |
void | add_2D_tensor_argument (unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window) |
Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx. More... | |
void | add_3D_tensor_argument (unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window) |
Add the passed 3D tensor's parameters to the object's kernel's arguments starting from the index idx. More... | |
unsigned int | num_arguments_per_1D_tensor () const |
Returns the number of arguments enqueued per 1D tensor object. More... | |
unsigned int | num_arguments_per_2D_tensor () const |
Returns the number of arguments enqueued per 2D tensor object. More... | |
unsigned int | num_arguments_per_3D_tensor () const |
Returns the number of arguments enqueued per 3D tensor object. More... | |
void | set_lws_hint (gles::NDRange &lws_hint) |
Set the Local-Workgroup-Size hint. More... | |
void | set_target (GPUTarget target) |
Set the targeted GPU architecture. More... | |
GPUTarget | get_target () const |
Get the targeted GPU architecture. More... | |
Public Member Functions inherited from IKernel | |
IKernel () | |
Constructor. More... | |
virtual | ~IKernel ()=default |
Destructor. More... | |
virtual bool | is_parallelisable () const |
Indicates whether or not the kernel is parallelisable. More... | |
const Window & | window () const |
The maximum window the kernel can be executed on. More... | |
Interface for the direct convolution kernel.
Definition at line 37 of file GCDirectConvolutionLayerKernel.h.
Default constructor.
Definition at line 43 of file GCDirectConvolutionLayerKernel.cpp.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Allow instances of this class to be moved.
|
default |
Default destructor.
|
overridevirtual |
The size of the border for that kernel.
Reimplemented from IKernel.
Definition at line 49 of file GCDirectConvolutionLayerKernel.cpp.
void configure | ( | const IGCTensor * | input, |
const IGCTensor * | weights, | ||
const IGCTensor * | bias, | ||
IGCTensor * | output, | ||
const PadStrideInfo & | conv_info, | ||
const ActivationLayerInfo & | act_info = ActivationLayerInfo() |
||
) |
Set the input and output of the kernel.
[in] | input | The input tensor to convert. 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: F16/F32 |
[in] | weights | Weights tensor. Weights are 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM]. Data type supported:Same as input . |
[in] | bias | Biases tensor. Shared bias supported. Biases are 1D tensor with dimensions [OFM]. Data type supported:Same as input . |
[out] | output | The output tensor. First 2 lower dimensions represent a transform of each 3D input, while every dimension above represents a batch. Data types supported: Same as input |
[in] | conv_info | Contains padding and stride information described in PadStrideInfo. |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. |
Definition at line 55 of file GCDirectConvolutionLayerKernel.cpp.
References ActivationLayerInfo::a(), ActivationLayerInfo::activation(), ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES, ARM_COMPUTE_ERROR_ON_MISMATCHING_DIMENSIONS, ARM_COMPUTE_ERROR_ON_MSG, arm_compute::auto_init_if_empty(), ActivationLayerInfo::b(), BorderSize::bottom, arm_compute::calculate_max_enlarged_window(), arm_compute::ceil_to_multiple(), arm_compute::test::validation::conv_info, GCKernelLibrary::create_kernel(), ITensorInfo::data_type(), ITensorInfo::dimension(), ActivationLayerInfo::enabled(), arm_compute::F16, arm_compute::F32, arm_compute::float_to_string_with_full_precision(), GCKernelLibrary::get(), ITensor::info(), arm_compute::test::validation::input, input_height, input_width, kernel_name, BorderSize::left, ActivationLayerInfo::LOGISTIC, arm_compute::lower_string(), IGCKernel::num_arguments_per_1D_tensor(), IGCKernel::num_arguments_per_3D_tensor(), ITensorInfo::num_dimensions(), arm_compute::test::validation::output_shape, PadStrideInfo::pad(), ITensorInfo::padding(), PadStrideInfo::padding_is_symmetric(), ActivationLayerInfo::RELU, BorderSize::right, arm_compute::scaled_dimensions(), TensorShape::set(), PadStrideInfo::stride(), ITensorInfo::strides_in_bytes(), arm_compute::string_from_activation_func(), ITensorInfo::tensor_shape(), arm_compute::support::cpp11::to_string(), BorderSize::top, and arm_compute::update_window_and_padding().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Allow instances of this class to be moved.
|
overridevirtual |
Enqueue the OpenGL ES shader to process the given window.
[in] | window | Region on which to execute the kernel. (Must be a valid region of the window returned by window()). |
Implements IGCKernel.
Definition at line 403 of file GCDirectConvolutionLayerKernel.cpp.
References IGCKernel::add_1D_tensor_argument(), IGCKernel::add_3D_tensor_argument(), Window::adjust(), ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, Window::DimX, Window::DimY, arm_compute::enqueue(), Window::first_slice_window_3D(), ITensor::info(), IGCKernel::num_arguments_per_3D_tensor(), ITensorInfo::padding(), Window::set_dimension_step(), IGCTensor::set_needs_shifting(), Window::shift(), arm_compute::test::validation::reference::slice(), Window::slide_window_slice_3D(), Window::Dimension::step(), ITensorInfo::tensor_shape(), Window::use_tensor_dimensions(), IKernel::window(), Window::x(), and Window::y().