21.02
|
GLES Compute kernel to multiply two input matrices "A" and "B" or to multiply a vector "A" by a matrix "B". More...
#include <GCGEMMMatrixMultiplyKernel.h>
Public Member Functions | |
GCGEMMMatrixMultiplyKernel () | |
Default constructor. More... | |
GCGEMMMatrixMultiplyKernel (const GCGEMMMatrixMultiplyKernel &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
GCGEMMMatrixMultiplyKernel & | operator= (const GCGEMMMatrixMultiplyKernel &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
GCGEMMMatrixMultiplyKernel (GCGEMMMatrixMultiplyKernel &&)=default | |
Allow instances of this class to be moved. More... | |
GCGEMMMatrixMultiplyKernel & | operator= (GCGEMMMatrixMultiplyKernel &&)=default |
Allow instances of this class to be moved. More... | |
void | configure (const IGCTensor *input0, const IGCTensor *input1, IGCTensor *output, float alpha, bool is_interleaved_transposed=true, const GEMMReshapeInfo &reshape_info=GEMMReshapeInfo()) |
Initialise the kernel's input, output and alpha. 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... | |
virtual BorderSize | border_size () const |
The size of the border for that kernel. More... | |
const Window & | window () const |
The maximum window the kernel can be executed on. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input0, const ITensorInfo *input1, const ITensorInfo *output, float alpha, bool is_interleaved_transposed, const GEMMReshapeInfo &reshape_info, GPUTarget gpu_target) |
Static function to check if given info will lead to a valid configuration of GCGEMMMatrixMultiplyKernel. More... | |
GLES Compute kernel to multiply two input matrices "A" and "B" or to multiply a vector "A" by a matrix "B".
All elements of the output matrix/vector will be multiplied by alpha
Definition at line 39 of file GCGEMMMatrixMultiplyKernel.h.
Default constructor.
Definition at line 183 of file GCGEMMMatrixMultiplyKernel.cpp.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Allow instances of this class to be moved.
void configure | ( | const IGCTensor * | input0, |
const IGCTensor * | input1, | ||
IGCTensor * | output, | ||
float | alpha, | ||
bool | is_interleaved_transposed = true , |
||
const GEMMReshapeInfo & | reshape_info = GEMMReshapeInfo() |
||
) |
Initialise the kernel's input, output and alpha.
[in] | input0 | Input tensor containing the interleaved Matrix A or the vector A. Data types supported: F16/F32 |
[in] | input1 | Input tensor containing the transposed Matrix B if the first input tensor A is not a vector. If the output tensor is a vector, input1 must contain the matrix B not reshaped. Data type supported: same as input0 |
[out] | output | Output tensor to store the result of matrix multiplication. Data type supported: same as input0 |
[in] | alpha | Weight of the matrix product |
[in] | is_interleaved_transposed | (Optional) True if input0 and input1 have been reshaped respectively using GCGEMMInterleave4x4Kernel and GCGEMMTranspose1xWKernel |
[in] | reshape_info | (Optional) GEMM reshape info. If is_interleaved_transposed = true, this object must contain the information to understand how the matrix A and matrix B have been reshaped |
Definition at line 188 of file GCGEMMMatrixMultiplyKernel.cpp.
References ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::BIFROST, GCKernelLibrary::create_kernel(), ITensorInfo::data_type(), ITensorInfo::dimension(), arm_compute::F16, arm_compute::F32, arm_compute::float_to_string_with_full_precision(), GCKernelLibrary::get(), arm_compute::get_arch_from_target(), IGCKernel::get_target(), ITensor::info(), kernel_name, ITensorInfo::num_dimensions(), arm_compute::support::cpp11::to_string(), and arm_compute::validate_arguments().
Referenced by GCGEMM::configure().
|
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 306 of file GCGEMMMatrixMultiplyKernel.cpp.
References IGCKernel::add_2D_tensor_argument(), ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, Window::DimX, Window::DimY, arm_compute::enqueue(), Window::first_slice_window_2D(), ITensor::info(), ITensorInfo::num_dimensions(), Window::set(), arm_compute::test::validation::reference::slice(), Window::slide_window_slice_2D(), and IKernel::window().
|
static |
Static function to check if given info will lead to a valid configuration of GCGEMMMatrixMultiplyKernel.
[in] | input0 | Input tensor containing the Matrix A. Data types supported: F16/F32 |
[in] | input1 | Input tensor containing the Matrix B. Data type supported: same as input0 |
[in] | output | Output tensor to store the result of matrix multiplication. Data type supported: same as input0 |
[in] | alpha | Weight of the matrix product |
[in] | is_interleaved_transposed | True if input0 and input1 have been reshaped respectively using GCGEMMInterleave4x4Kernel and GCGEMMTranspose1xWKernel |
[in] | reshape_info | GEMM reshape info. If is_interleaved_transposed = true, this object must contain the information to understand how the matrix A and matrix B have been reshaped |
[in] | gpu_target | GPU Target |
Definition at line 289 of file GCGEMMMatrixMultiplyKernel.cpp.
References ARM_COMPUTE_RETURN_ON_ERROR, ARM_COMPUTE_UNUSED, ICloneable< T >::clone(), and arm_compute::validate_arguments().