ARM Compute Library
17.04
|
Basic implementation of a CPU memory tensor allocator. More...
#include <TensorAllocator.h>
Public Member Functions | |
TensorAllocator () | |
Default constructor. More... | |
void | init (const TensorAllocator &allocator, const Coordinates &coords, TensorInfo sub_info) |
Shares the same backing memory with another tensor allocator, while the tensor info might be different. More... | |
uint8_t * | data () const |
Returns the pointer to the allocated data. More... | |
void | allocate () override |
Allocate size specified by TensorInfo of CPU memory. More... | |
Public Member Functions inherited from ITensorAllocator | |
ITensorAllocator () | |
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) |
Initialize a tensor based on the passed 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... | |
Basic implementation of a CPU memory tensor allocator.
Definition at line 39 of file TensorAllocator.h.
TensorAllocator | ( | ) |
Default constructor.
|
overridevirtual |
Allocate size specified by TensorInfo of CPU memory.
Implements ITensorAllocator.
Referenced by main_neon_copy_objects().
uint8_t* data | ( | ) | const |
Returns the pointer to the allocated data.
void init | ( | const TensorAllocator & | allocator, |
const Coordinates & | coords, | ||
TensorInfo | sub_info | ||
) |
Shares the same backing memory with another tensor allocator, while the tensor info might be different.
In other words this can be used to create a sub-tensor from another tensor while sharing the same memory.
[in] | allocator | The allocator that owns the backing memory to be shared. Ownership becomes shared afterwards. |
[in] | coords | The starting coordinates of the new tensor inside the parent tensor. |
[in] | sub_info | The new tensor information (e.g. shape etc) |
Referenced by main_neon_copy_objects().