24.02.1
|
This is a generic class that packs the arguments of an operator. More...
#include <ArgumentPack.h>
Data Structures | |
struct | PackElement |
A single argument element within the pack It contains either a const pointer or a non-const pointer to the Tensor-related type T, but never at the same time. More... | |
Public Types | |
using | Id = TensorType |
arm_compute::TensorType encodes the position of a tensor argument within the pack More... | |
Public Member Functions | |
ArgumentPack ()=default | |
Default constructor. More... | |
~ArgumentPack ()=default | |
Destructor. More... | |
ArgumentPack (const ArgumentPack< T > &other)=default | |
Allow instances of this class to be copy constructed. More... | |
ArgumentPack< T > & | operator= (const ArgumentPack< T > &other)=default |
Allow instances of this class to be copied. More... | |
ArgumentPack (ArgumentPack< T > &&other)=default | |
Allow instances of this class to be move constructed. More... | |
ArgumentPack< T > & | operator= (ArgumentPack< T > &&other)=default |
Allow instances of this class to be moved. More... | |
ArgumentPack (const std::initializer_list< PackElement > &l) | |
Initializer list Constructor. More... | |
void | add_tensor (Id id, T *tensor) |
Add tensor to the pack. More... | |
void | add_const_tensor (Id id, const T *tensor) |
Add const tensor to the pack. More... | |
T * | get_tensor (Id id) |
Get tensor of a given id from the pack. More... | |
const T * | get_const_tensor (Id id) const |
Get constant tensor of a given id. More... | |
void | remove_tensor (Id id) |
Remove the tensor stored with the given id. More... | |
size_t | size () const |
Pack size accessor. More... | |
bool | empty () const |
Checks if pack is empty. More... | |
std::vector< T * > | get_src_tensors () |
Get the ACL_SRC_* tensors. More... | |
std::vector< const T * > | get_const_src_tensors () const |
Get the const ACL_SRC_* tensors. More... | |
std::vector< T * > | get_dst_tensors () |
Get the ACL_DST_* tensors. More... | |
std::vector< const T * > | get_const_dst_tensors () const |
Get the const ACL_DST_* tensors. More... | |
This is a generic class that packs the arguments of an operator.
Forward declaration.
For now, it is only used for tensor-related types Examples of "tensor-related types": ITensorInfo, ITensor, ICLTensor
The argument id is the position of the argument within the pack, and is represented by TensorType
T | Tensor-related type |
Definition at line 46 of file ArgumentPack.h.
using Id = TensorType |
arm_compute::TensorType encodes the position of a tensor argument within the pack
Definition at line 50 of file ArgumentPack.h.
|
default |
Default constructor.
|
default |
Destructor.
|
default |
Allow instances of this class to be copy constructed.
|
default |
Allow instances of this class to be move constructed.
|
inline |
Initializer list Constructor.
Definition at line 87 of file ArgumentPack.h.
|
inline |
Add const tensor to the pack.
[in] | id | ID of the tensor to add |
[in] | tensor | Tensor to add |
Definition at line 108 of file ArgumentPack.h.
Referenced by GpuOutput::create_op(), GpuSigmoid::create_op(), GpuTanh::create_op(), GpuClamp::create_op(), GpuSoftmax::create_op(), GpuReshape::create_op(), GpuResize::create_op(), GpuDepthwiseConv2d::create_op(), GpuCast::create_op(), GpuConv2d::create_op(), GpuPool2d::create_op(), GpuElementwiseBinaryCommon::create_op(), GpuSoftmax::is_supported_op(), GpuPool2d::is_supported_op(), GpuOutput::validate_op(), GpuTanh::validate_op(), GpuSigmoid::validate_op(), GpuReshape::validate_op(), GpuResize::validate_op(), GpuCast::validate_op(), GpuClamp::validate_op(), GpuSoftmax::validate_op(), GpuConv2d::validate_op(), GpuDepthwiseConv2d::validate_op(), GpuPool2d::validate_op(), and GpuElementwiseBinaryCommon::validate_op().
|
inline |
Add tensor to the pack.
[in] | id | ID of the tensor to add |
[in] | tensor | Tensor to add |
Definition at line 99 of file ArgumentPack.h.
Referenced by GpuReshape::create_op(), GpuPool2d::create_op(), and GpuElementwiseBinaryCommon::create_op().
|
inline |
Checks if pack is empty.
Definition at line 158 of file ArgumentPack.h.
|
inline |
Get the const ACL_DST_* tensors.
Definition at line 217 of file ArgumentPack.h.
Referenced by GpuKernelComponentGraph::add_new_component().
|
inline |
Get the const ACL_SRC_* tensors.
Definition at line 183 of file ArgumentPack.h.
Referenced by GpuKernelComponentGraph::add_new_component().
|
inline |
Get constant tensor of a given id.
[in] | id | ID of tensor to extract |
Definition at line 129 of file ArgumentPack.h.
Referenced by ArgumentPack< arm_compute::ITensorInfo >::get_const_dst_tensors(), and ArgumentPack< arm_compute::ITensorInfo >::get_const_src_tensors().
|
inline |
Get the ACL_DST_* tensors.
Definition at line 200 of file ArgumentPack.h.
|
inline |
Get the ACL_SRC_* tensors.
Definition at line 166 of file ArgumentPack.h.
|
inline |
Get tensor of a given id from the pack.
[in] | id | ID of tensor to extract |
Definition at line 118 of file ArgumentPack.h.
Referenced by ArgumentPack< arm_compute::ITensorInfo >::get_dst_tensors(), and ArgumentPack< arm_compute::ITensorInfo >::get_src_tensors().
|
default |
Allow instances of this class to be moved.
|
default |
Allow instances of this class to be copied.
|
inline |
Remove the tensor stored with the given id.
[in] | id | ID of tensor to remove |
Definition at line 142 of file ArgumentPack.h.
|
inline |
Pack size accessor.
Definition at line 150 of file ArgumentPack.h.