|
| TBlob (const TensorDesc &tensorDesc) |
| Creates a TBlob object with the specified dimensions and layout but does not allocate the memory. More...
|
|
| TBlob (const TensorDesc &tensorDesc, T *ptr, size_t data_size=0) |
| The constructor creates a TBlob object with the specified dimensions and layout on the pre-allocated memory. More...
|
|
| TBlob (const TensorDesc &tensorDesc, const std::shared_ptr< IAllocator > &alloc) |
| Creates a TBlob object with the specified dimensions, layout and custom memory allocator but does not allocate the memory. More...
|
|
| TBlob (const TBlob< T > &blob) |
| The copy constructor data is reallocated and copied from the source to the target blob. More...
|
|
| TBlob (TBlob< T > &&blob) |
| A move constructor. More...
|
|
TBlob & | operator= (const TBlob &blob) |
| Copy operator for the TBlob object. More...
|
|
virtual | ~TBlob () |
| Virtual destructor.
|
|
size_t | element_size () const noexcept override |
| Gets the size of the given type. More...
|
|
virtual LockedMemory< T > | data () noexcept |
| Creates an new empty rvalue LockedMemory object. More...
|
|
virtual LockedMemory< const T > | readOnly () const noexcept |
| Creates a new empty rvalue read-only LockedMemory object. More...
|
|
void | allocate () noexcept override |
| Allocates or reallocates memory.
|
|
bool | deallocate () noexcept override |
| Frees all allocated data.
|
|
LockedMemory< void > | buffer () noexcept override |
| Creates a new LockedMemory instance holding void pointer. More...
|
|
LockedMemory< const void > | cbuffer () const noexcept override |
| Creates a new LockedMemory instance holding constant void pointer. More...
|
|
LockedMemory< void > | rwmap () noexcept override |
| Gets read/write access to the memory in virtual space of the process. The function returns object which retains mapped memory. The memory been addressed in the MemoryBlob in general case can be allocated on remote device. This function maps remote memory to the memory in the virtual process space and after destruction of the LockedMemory will upload changed content to the accelerator. More...
|
|
LockedMemory< const void > | rmap () const noexcept override |
| Gets read only access to the memory in virtual space of the process. The function returns object which retains mapped memory. More...
|
|
LockedMemory< void > | wmap () noexcept override |
| Gets "write only direction" access to the memory in virtual space of the process. The function returns object which retains memory to be uploaded on device. More...
|
|
details::BlobIterator< T > | begin () |
| Gets BlobIterator for the data. More...
|
|
details::BlobIterator< T > | end () |
| Gets BlobIterator for the end of data. More...
|
|
details::BlobIterator< const T > | begin () const |
| Gets a const BlobIterator for the read-only data. More...
|
|
details::BlobIterator< const T > | end () const |
| Gets a const BlobIterator for the end of read-only data. More...
|
|
virtual | ~MemoryBlob () |
| MemoryBlob virtual destructor.
|
|
| MemoryBlob (const TensorDesc &tensorDesc) |
| Constructor. Creates an empty MemoryBlob object with the specified precision. More...
|
|
const TensorDesc & | getTensorDesc () const noexcept override |
| Returns the tensor description.
|
|
TensorDesc & | getTensorDesc () noexcept override |
| Returns the tensor description.
|
|
size_t | size () const noexcept override |
| Returns the total number of elements, which is a product of all the dimensions.
|
|
size_t | byteSize () const noexcept override |
| Returns the size of the current Blob in bytes.
|
|
virtual | ~Blob () |
| Blob virtual destructor.
|
|
template<typename T , typename std::enable_if<!std::is_pointer< T >::value &&!std::is_reference< T >::value, int >::type = 0, typename std::enable_if< std::is_base_of< Blob, T >::value, int >::type = 0> |
bool | is () noexcept |
| Checks if the Blob object can be cast to the type T*. More...
|
|
template<typename T , typename std::enable_if<!std::is_pointer< T >::value &&!std::is_reference< T >::value, int >::type = 0, typename std::enable_if< std::is_base_of< Blob, T >::value, int >::type = 0> |
bool | is () const noexcept |
| Checks if the Blob object can be cast to the type const T*. More...
|
|
template<typename T , typename std::enable_if<!std::is_pointer< T >::value &&!std::is_reference< T >::value, int >::type = 0, typename std::enable_if< std::is_base_of< Blob, T >::value, int >::type = 0> |
T * | as () noexcept |
| Casts this Blob object to the type T*. More...
|
|
template<typename T , typename std::enable_if<!std::is_pointer< T >::value &&!std::is_reference< T >::value, int >::type = 0, typename std::enable_if< std::is_base_of< Blob, T >::value, int >::type = 0> |
const T * | as () const noexcept |
| Casts this Blob object to the type const T*. More...
|
|
| Blob (const TensorDesc &tensorDesc) |
| Constructor. Creates an empty Blob object with the specified precision. More...
|
|
template<typename T, typename = std::enable_if<std::is_pod<T>::value>>
class InferenceEngine::TBlob< T, typename >
Represents real host memory allocated for a Tensor/Blob per C type.
template<typename T, typename = std::enable_if<std::is_pod<T>::value>>
|
inlineoverridevirtualnoexcept |
Gets read only access to the memory in virtual space of the process. The function returns object which retains mapped memory.
The memory been addressed in the MemoryBlob in general case can be allocated on remote device. This function copies remote memory to the memory in the virtual process space and after destruction of the LockedMemory it will not upload host memory back, bacause it is expected that content is not changed.
To have an ability change content, you can use rwmap() and wmap() functions.
In case of memory originally allocated on the host, this function returns LockedMemory which will transparently refer to original memory address. No extra copy will happen
In general case, pointer received from that LockedMemory becomes invalid just after destruction of LockedMemory instance. Keep Locked memory alive while you need to address memory in the process on the host.
Abstract method.
- Returns
- A LockedMemory object
Implements InferenceEngine::MemoryBlob.
template<typename T, typename = std::enable_if<std::is_pod<T>::value>>
|
inlineoverridevirtualnoexcept |
Gets "write only direction" access to the memory in virtual space of the process. The function returns object which retains memory to be uploaded on device.
The memory been addressed in the MemoryBlob in general case can be allocated on remote device. This function does not copy of the content from the device to the memory in the virtual process space, the content of the memory just after calling of this functin is not specified. After destruction of the LockedMemory, content will be upload host memory. In the same time there is no abilities to restrict reading from the memory, you need to care of reading from memory got by wmap(), it might have sence in some cases like filling of content and before uploading to device
To access data stored in the blob, you can use rwmap() and rmap() functions.
In case of memory originally allocated on the host, this function returns LockedMemory which will transparently refer to original memory address. No extra copy will happen
In general case, pointer received from that LockedMemory becomes invalid just after destruction of LockedMemory instance. Keep Locked memory alive while you need to address memory in the process on the host.
Abstract method.
- Returns
- A LockedMemory object
Implements InferenceEngine::MemoryBlob.