24.02
|
#include <TensorHandle.hpp>
Public Member Functions | |
ScopedTensorHandle (const TensorInfo &tensorInfo) | |
ScopedTensorHandle (const ConstTensor &tensor) | |
ScopedTensorHandle (const ConstTensorHandle &tensorHandle) | |
ScopedTensorHandle (const ScopedTensorHandle &other) | |
ScopedTensorHandle & | operator= (const ScopedTensorHandle &other) |
~ScopedTensorHandle () | |
virtual void | Allocate () override |
Indicate to the memory manager that this resource is no longer active. More... | |
Public Member Functions inherited from TensorHandle | |
template<typename T > | |
T * | GetTensor () const |
template<> | |
void * | GetTensor () const |
template<> | |
void * | GetTensor () const |
Public Member Functions inherited from ConstTensorHandle | |
template<typename T > | |
const T * | GetConstTensor () const |
const TensorInfo & | GetTensorInfo () const |
virtual void | Manage () override |
Indicate to the memory manager that this resource is active. More... | |
virtual ITensorHandle * | GetParent () const override |
Get the parent tensor if this is a subtensor. More... | |
virtual const void * | Map (bool) const override |
Map the tensor data for access. More... | |
virtual void | Unmap () const override |
Unmap the tensor data. More... | |
TensorShape | GetStrides () const override |
Get the strides for each dimension ordered from largest to smallest where the smallest value is the same as the size of a single element in the tensor. More... | |
TensorShape | GetShape () const override |
Get the number of elements for each dimension ordered from slowest iterating dimension to fastest iterating dimension. More... | |
template<> | |
const void * | GetConstTensor () const |
template<> | |
const void * | GetConstTensor () const |
Public Member Functions inherited from ITensorHandle | |
virtual | ~ITensorHandle () |
void * | Map (bool blocking=true) |
Map the tensor data for access. More... | |
void | Unmap () |
Unmap the tensor data that was previously mapped with call to Map(). More... | |
virtual unsigned int | GetImportFlags () const |
Get flags describing supported import sources. More... | |
virtual bool | Import (void *memory, MemorySource source) |
Import externally allocated memory. More... | |
virtual bool | CanBeImported (void *memory, MemorySource source) |
Implementations must determine if this memory block can be imported. More... | |
virtual void | Unimport () |
Unimport externally allocated memory. More... | |
virtual std::shared_ptr< ITensorHandle > | DecorateTensorHandle (const TensorInfo &tensorInfo) |
Returns a decorated version of this TensorHandle allowing us to override the TensorInfo for it. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from TensorHandle | |
TensorHandle (const TensorInfo &tensorInfo) | |
void | SetMemory (void *mem) |
Protected Member Functions inherited from ConstTensorHandle | |
ConstTensorHandle (const TensorInfo &tensorInfo) | |
void | SetConstMemory (const void *mem) |
Definition at line 115 of file TensorHandle.hpp.
|
explicit |
Definition at line 55 of file TensorHandle.cpp.
|
explicit |
Definition at line 60 of file TensorHandle.cpp.
References BaseTensor< MemoryType >::GetMemoryArea(), and BaseTensor< MemoryType >::GetNumBytes().
|
explicit |
Definition at line 66 of file TensorHandle.cpp.
References ConstTensorHandle::GetConstTensor(), TensorInfo::GetNumBytes(), and ConstTensorHandle::GetTensorInfo().
ScopedTensorHandle | ( | const ScopedTensorHandle & | other | ) |
Definition at line 72 of file TensorHandle.cpp.
~ScopedTensorHandle | ( | ) |
Definition at line 86 of file TensorHandle.cpp.
|
overridevirtual |
Indicate to the memory manager that this resource is no longer active.
This is used to compute overlapping lifetimes of resources.
Implements ITensorHandle.
Definition at line 91 of file TensorHandle.cpp.
References ConstTensorHandle::GetTensorInfo(), and TensorHandle::SetMemory().
ScopedTensorHandle & operator= | ( | const ScopedTensorHandle & | other | ) |