23.05
|
Interface to allocate tensors. More...
#include <ITensorAllocator.h>
Public Member Functions | |
ITensorAllocator ()=default | |
Default constructor. More... | |
ITensorAllocator (const ITensorAllocator &)=default | |
Allow instances of this class to be copy constructed. More... | |
ITensorAllocator & | operator= (const ITensorAllocator &)=default |
Allow instances of this class to be copied. More... | |
ITensorAllocator (ITensorAllocator &&)=default | |
Allow instances of this class to be move constructed. More... | |
ITensorAllocator & | operator= (ITensorAllocator &&)=default |
Allow instances of this class to be moved. More... | |
virtual | ~ITensorAllocator ()=default |
Default virtual destructor. More... | |
void | init (const TensorInfo &input, size_t alignment=0) |
Initialize a tensor based on the passed TensorInfo. More... | |
void | soft_init (TensorInfo &input, size_t alignment=0) |
Initialize a tensor based with a reference TensorInfo. More... | |
TensorInfo & | info () |
Return a reference to the tensor's metadata. More... | |
const TensorInfo & | info () const |
Return a constant reference to the tensor's metadata. More... | |
size_t | alignment () const |
Return underlying's tensor buffer alignment. More... | |
virtual void | allocate ()=0 |
Interface to be implemented by the child class to allocate the tensor. More... | |
virtual void | free ()=0 |
Interface to be implemented by the child class to free the allocated tensor. More... | |
Interface to allocate tensors.
Definition at line 35 of file ITensorAllocator.h.
|
default |
Default constructor.
|
default |
Allow instances of this class to be copy constructed.
|
default |
Allow instances of this class to be move constructed.
|
virtualdefault |
Default virtual destructor.
size_t alignment | ( | ) | const |
Return underlying's tensor buffer alignment.
Definition at line 56 of file ITensorAllocator.cpp.
Referenced by TensorAllocator::allocate(), CLTensorAllocator::allocate(), TensorAllocator::import_memory(), ITensorAllocator::init(), ITensorAllocator::soft_init(), and arm_compute::test::validation::TEST_CASE().
|
pure virtual |
Interface to be implemented by the child class to allocate the tensor.
Implemented in CLTensorAllocator, and TensorAllocator.
|
pure virtual |
Interface to be implemented by the child class to free the allocated tensor.
Implemented in CLTensorAllocator, and TensorAllocator.
TensorInfo & info | ( | ) |
Return a reference to the tensor's metadata.
Definition at line 46 of file ITensorAllocator.cpp.
Referenced by TensorAllocator::allocate(), CLTensorAllocator::allocate(), TensorAllocator::free(), CLTensorAllocator::free(), TensorAllocator::import_memory(), CLTensorAllocator::import_memory(), Tensor::info(), CLTensor::info(), TensorAllocator::init(), and TensorAllocator::~TensorAllocator().
const TensorInfo & info | ( | ) | const |
Return a constant reference to the tensor's metadata.
Definition at line 51 of file ITensorAllocator.cpp.
void init | ( | const TensorInfo & | input, |
size_t | alignment = 0 |
||
) |
Initialize a tensor based on the passed TensorInfo.
[in] | input | TensorInfo object containing the description of the tensor to initialize. |
[in] | alignment | Alignment in bytes that the underlying base pointer should comply with. |
Definition at line 33 of file ITensorAllocator.cpp.
References ITensorAllocator::alignment(), and arm_compute::test::validation::input.
Referenced by CLQLSTMLayer::CLQLSTMLayer(), CLTensorHandle::CLTensorHandle(), CLRNNLayer::configure(), CLFFT1D::configure(), CLDepthwiseConvolutionLayer::configure(), CLL2NormalizeLayer::configure(), CLFFTConvolutionLayer::configure(), CLGenerateProposalsLayer::configure(), CLGEMMDeconvolutionLayer::configure(), CLDirectDeconvolutionLayer::configure(), CLLSTMLayerQuantized::configure(), CLLSTMLayer::configure(), CLQLSTMLayer::configure(), arm_compute::test::validation::DATA_TEST_CASE(), arm_compute::test::validation::TEST_CASE(), and CLReductionOperation::validate().
|
default |
Allow instances of this class to be copied.
Referenced by TensorAllocator::operator=().
|
default |
Allow instances of this class to be moved.
void soft_init | ( | TensorInfo & | input, |
size_t | alignment = 0 |
||
) |
Initialize a tensor based with a reference TensorInfo.
[in] | input | TensorInfo object containing the description of the tensor to initialize. |
[in] | alignment | Alignment in bytes that the underlying base pointer should comply with. |
Definition at line 40 of file ITensorAllocator.cpp.
References ITensorAllocator::alignment(), and arm_compute::test::validation::input.
Referenced by CLAuxTensorHandler::CLAuxTensorHandler(), CpuAuxTensorHandler::CpuAuxTensorHandler(), and CpuGemmConv2d::run().