Public Types | Public Member Functions
InferenceEngine::gpu::D3DBufferBlob Class Reference

This class represents an abstraction for GPU plugin remote blob which is shared with Direct3D 11 buffer. The plugin object derived from this class can be obtained with CreateBlob() call. More...

#include <gpu_context_api_dx.hpp>

Inheritance diagram for InferenceEngine::gpu::D3DBufferBlob:
Inheritance graph
[legend]
Collaboration diagram for InferenceEngine::gpu::D3DBufferBlob:
Collaboration graph
[legend]

Public Types

using Ptr = std::shared_ptr< D3DBufferBlob >
 A smart pointer to the D3DBufferBlob object.
 
- Public Types inherited from InferenceEngine::gpu::ClBufferBlob
using Ptr = std::shared_ptr< ClBufferBlob >
 A smart pointer to the ClBufferBlob object.
 
- Public Types inherited from InferenceEngine::gpu::ClBlob
using Ptr = std::shared_ptr< ClBlob >
 A smart pointer to the ClBlob object.
 
- Public Types inherited from InferenceEngine::RemoteBlob
using Ptr = std::shared_ptr< RemoteBlob >
 A smart pointer to the RemoteBlob object.
 
using CPtr = std::shared_ptr< const RemoteBlob >
 A smart pointer to the const RemoteBlob object.
 
- Public Types inherited from InferenceEngine::MemoryBlob
using Ptr = std::shared_ptr< MemoryBlob >
 A smart pointer to the MemoryBlob object.
 
using CPtr = std::shared_ptr< const MemoryBlob >
 A smart pointer to the const MemoryBlob object.
 
- Public Types inherited from InferenceEngine::Blob
using Ptr = std::shared_ptr< Blob >
 A smart pointer containing Blob object.
 
using CPtr = std::shared_ptr< const Blob >
 A smart pointer to the const Blob object.
 

Public Member Functions

 D3DBufferBlob (const TensorDesc &tensorDesc)
 Creates a D3DBufferBlob object with the specified dimensions and layout. More...
 
 operator ID3D11Buffer * ()
 ID3D11Buffer conversion operator for the D3DContext object. More...
 
- Public Member Functions inherited from InferenceEngine::gpu::ClBufferBlob
 ClBufferBlob (const TensorDesc &tensorDesc)
 Creates a ClBufferBlob object with the specified dimensions and layout. More...
 
cl_mem get ()
 Returns the underlying OpenCL memory object handle.
 
 operator cl_mem ()
 OpenCL memory handle conversion operator.
 
 operator cl::Buffer ()
 Standard Khronos cl::Buffer wrapper conversion operator. More...
 
- Public Member Functions inherited from InferenceEngine::gpu::ClBlob
 ClBlob (const TensorDesc &tensorDesc)
 Creates a ClBlob object with the specified dimensions and layout. More...
 
- Public Member Functions inherited from InferenceEngine::RemoteBlob
virtual ~RemoteBlob ()=default
 RemoteBlob virtual destructor.
 
 RemoteBlob (const TensorDesc &tensorDesc)
 Constructor. Creates an empty RemoteBlob object with the specified precision. More...
 
size_t element_size () const noexcept override
 Returns the number of bytes per element.
 
virtual ParamMap getParams () const =0
 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. More...
 
virtual std::string getDeviceName () const noexcept=0
 Returns name of the device on which underlying object is allocated. Abstract method. More...
 
virtual std::shared_ptr< RemoteContextgetContext () const noexcept=0
 Returns device context which underlying object belongs to. Abstract method. More...
 
- Public Member Functions inherited from InferenceEngine::MemoryBlob
virtual ~MemoryBlob ()
 MemoryBlob virtual destructor.
 
 MemoryBlob (const TensorDesc &tensorDesc)
 Constructor. Creates an empty MemoryBlob object with the specified precision. More...
 
const TensorDescgetTensorDesc () const noexcept override
 Returns the tensor description.
 
TensorDescgetTensorDesc () 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 calculated as size() * element_size(). More...
 
void allocate () noexcept override=0
 Allocates memory to store the data. More...
 
bool deallocate () noexcept override=0
 Releases previously allocated data. More...
 
LockedMemory< void > buffer () noexcept override=0
 Gets access to the allocated memory. More...
 
LockedMemory< const void > cbuffer () const noexcept override=0
 Gets read-only access to the allocated memory. More...
 
virtual LockedMemory< void > rwmap () noexcept=0
 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...
 
virtual LockedMemory< const void > rmap () const noexcept=0
 Gets read only access to the memory in virtual space of the process. The function returns object which retains mapped memory. More...
 
virtual LockedMemory< void > wmap () noexcept=0
 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...
 
- Public Member Functions inherited from InferenceEngine::Blob
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...
 
virtual Blob::Ptr createROI (const ROI &roi) const
 Creates a blob describing given ROI object based on the current blob with memory sharing. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from InferenceEngine::Blob
static Ptr CreateFromData (const DataPtr &data)
 Creates a TBlob<> object from a Data node. More...
 
- Protected Member Functions inherited from InferenceEngine::MemoryBlob
const std::shared_ptr< IAllocator > & getAllocator () const noexcept override=0
 Gets the allocator for allocator-based blobs. More...
 
void * getHandle () const noexcept override=0
 Gets the handle to allocated memory. More...
 
- Protected Member Functions inherited from InferenceEngine::gpu::details::param_map_obj_getter
template<typename Result , typename Tmp >
Result _ObjFromParams (const ParamMap &params, const std::string &handle_Key, const std::string &type_Key, const std::string &obj_T1, const std::string &obj_T2="__") const
 Template function that returns specified object parameter typecasted to desired user type.
 
template<typename Result >
Result _ObjFromParamSimple (const ParamMap &params, const std::string &handle_Key) const
 Same as _ObjFromParams(), but should be used if check for object type is not required.
 
std::string _StrFromParams (const ParamMap &params, std::string Key) const
 Template function that extracts string value from map entry under specified key.
 
- Static Protected Member Functions inherited from InferenceEngine::Blob
static size_t product (const SizeVector &dims) noexcept
 Multiplies the dimension vector values. More...
 
- Protected Attributes inherited from InferenceEngine::Blob
TensorDesc tensorDesc
 The tensor descriptor of the given blob.
 

Detailed Description

This class represents an abstraction for GPU plugin remote blob which is shared with Direct3D 11 buffer. The plugin object derived from this class can be obtained with CreateBlob() call.

Note
User can also obtain OpenCL buffer handle from this class.

Constructor & Destructor Documentation

◆ D3DBufferBlob()

InferenceEngine::gpu::D3DBufferBlob::D3DBufferBlob ( const TensorDesc tensorDesc)
inlineexplicit

Creates a D3DBufferBlob object with the specified dimensions and layout.

Parameters
tensorDescTensor description

Member Function Documentation

◆ operator ID3D11Buffer *()

InferenceEngine::gpu::D3DBufferBlob::operator ID3D11Buffer * ( )
inline

ID3D11Buffer conversion operator for the D3DContext object.

Returns
Pointer to underlying ID3D11Buffer interface

The documentation for this class was generated from the following file: