Class ov::TensorRemoteBlob

class TensorRemoteBlob : public InferenceEngine::RemoteBlob, public ov::legacy_convert::TensorHolder

Create InferenceEngine::RemoteBlob from the Tensor.

Public Functions

inline virtual AnyMap getParams() const override

Returns a map of device-specific parameters required for low-level operations with underlying object. Parameters include device/context/surface/buffer handles, access flags, etc. Contents of the map returned depend on remote execution context that is currently set on the device (working scenario). Abstract method.

Returns

A map of name/parameter elements.

inline virtual std::string getDeviceName() const noexcept override

Returns name of the device on which underlying object is allocated. Abstract method.

Returns

A device name string in the same format as that in plugin metric.

inline virtual std::shared_ptr<InferenceEngine::RemoteContext> getContext() const noexcept override

Returns device context which underlying object belongs to. Abstract method.

Returns

Pointer to plugin-specific context class object, which is derived from RemoteContext. Dynamic casting should be used if it is necessary to retrieve a pointer to original class.

inline virtual void allocate() noexcept override

Allocates memory to store the data.

Abstract method.

inline virtual bool deallocate() noexcept override

Releases previously allocated data.

Abstract method.

Returns

True if deallocation happens successfully, false otherwise.

inline virtual InferenceEngine::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.

To avoid extra copy of data, you can use rmap() 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

inline virtual InferenceEngine::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.

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, because 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

inline virtual InferenceEngine::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.

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 function 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 sense 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

inline virtual const std::shared_ptr<InferenceEngine::IAllocator> &getAllocator() const noexcept override

Gets the allocator for allocator-based blobs.

Returns

The allocator for allocator-based blobs or if there is none then a nullptr.

inline virtual void *getHandle() const noexcept override

Gets the handle to allocated memory.

Returns

The handle to allocated memory for allocator-based blobs or if there is none then a nullptr.