namespace InferenceEngine::gpu

Overview

namespace gpu {

// classes

class ClBlob;
class ClBufferBlob;
class ClContext;
class ClImage2DBlob;
class D3DBufferBlob;
class D3DContext;
class D3DSurface2DBlob;
class USMBlob;
class VAContext;
class VASurfaceBlob;

// global functions

static Blob::Ptr make_shared_blob_nv12(
    size_t height,
    size_t width,
    RemoteContext::Ptr ctx,
    ID3D11Texture2D \* nv12_surf
    );

static D3DContext::Ptr make_shared_context(
    Core& core,
    std::string deviceName,
    ID3D11Device \* device,
    int target_tile_id = -1
    );

static Blob::Ptr make_shared_blob(
    const TensorDesc& desc,
    RemoteContext::Ptr ctx,
    ID3D11Buffer \* buffer
    );

static Blob::Ptr make_shared_blob(
    const TensorDesc& desc,
    RemoteContext::Ptr ctx,
    ID3D11Texture2D \* surface,
    uint32_t plane = 0
    );

static Blob::Ptr make_shared_blob_nv12(
    RemoteContext::Ptr ctx,
    cl::Image2D& nv12_image_plane_y,
    cl::Image2D& nv12_image_plane_uv
    );

static RemoteContext::Ptr make_shared_context(
    Core& core,
    std::string deviceName,
    cl_context ctx,
    int target_tile_id = -1
    );

static RemoteContext::Ptr make_shared_context(
    Core& core,
    std::string deviceName,
    cl_command_queue queue
    );

static Blob::Ptr make_shared_blob(const TensorDesc& desc, ClContext::Ptr ctx);

static Blob::Ptr make_shared_blob(
    const TensorDesc& desc,
    RemoteContext::Ptr ctx,
    cl::Buffer& buffer
    );

static Blob::Ptr make_shared_blob(
    const TensorDesc& desc,
    RemoteContext::Ptr ctx,
    cl_mem buffer
    );

static Blob::Ptr make_shared_blob(
    const TensorDesc& desc,
    RemoteContext::Ptr ctx,
    cl::Image2D& image
    );

static Blob::Ptr make_shared_blob_nv12(
    size_t height,
    size_t width,
    RemoteContext::Ptr ctx,
    VASurfaceID nv12_surf
    );

static VAContext::Ptr make_shared_context(
    Core& core,
    std::string deviceName,
    VADisplay device,
    int target_tile_id = -1
    );

static VASurfaceBlob::Ptr make_shared_blob(
    const TensorDesc& desc,
    RemoteContext::Ptr ctx,
    VASurfaceID surface,
    uint32_t plane = 0
    );

} // namespace gpu

Detailed Documentation

Global Functions

static Blob::Ptr make_shared_blob_nv12(
    size_t height,
    size_t width,
    RemoteContext::Ptr ctx,
    ID3D11Texture2D \* nv12_surf
    )

This function is used to obtain a NV12 compound blob object from NV12 DXGI video decoder output. The resulting compound contains two remote blobs for Y and UV planes of the surface.

Parameters:

height

Height of Y plane

width

Widht of Y plane

ctx

A pointer to remote context

nv12_surf

A ID3D11Texture2D instance to create NV12 blob from

Returns:

NV12 remote blob

static D3DContext::Ptr make_shared_context(
    Core& core,
    std::string deviceName,
    ID3D11Device \* device,
    int target_tile_id = -1
    )

This function is used to obtain remote context object from ID3D11Device.

Parameters:

core

Inference Engine Core object instance

deviceName

A name of to create a remote context for

device

A pointer to ID3D11Device to be used to create a remote context

target_tile_id

Desired tile id within given context for multi-tile system. Default value (-1) means that root device should be used

Returns:

A shared remote context instance

static Blob::Ptr make_shared_blob(
    const TensorDesc& desc,
    RemoteContext::Ptr ctx,
    ID3D11Buffer \* buffer
    )

This function is used to obtain remote blob object from ID3D11Buffer.

Parameters:

desc

A tensor description which describes blob configuration

ctx

A shared pointer to a remote context

buffer

A pointer to ID3D11Buffer instance to create remote blob based on

Returns:

A remote blob instance

static Blob::Ptr make_shared_blob(
    const TensorDesc& desc,
    RemoteContext::Ptr ctx,
    ID3D11Texture2D \* surface,
    uint32_t plane = 0
    )

This function is used to obtain remote blob object from ID3D11Texture2D.

The underlying ID3D11Texture2D can also be a plane of output surface of DXGI video decoder

Parameters:

desc

Tensor description

ctx

the RemoteContext object whuch owns context for the blob to be created

surface

Pointer to ID3D11Texture2D interface of the objects that owns NV12 texture

plane

ID of the plane to be shared (0 or 1)

Returns:

Smart pointer to created RemoteBlob object cast to base class

static Blob::Ptr make_shared_blob_nv12(
    RemoteContext::Ptr ctx,
    cl::Image2D& nv12_image_plane_y,
    cl::Image2D& nv12_image_plane_uv
    )

This function is used to construct a NV12 compound blob object from two cl::Image2D wrapper objects. The resulting compound contains two remote blobs for Y and UV planes of the surface.

Parameters:

ctx

RemoteContext plugin object derived from ClContext class.

nv12_image_plane_y

cl::Image2D object containing Y plane data.

nv12_image_plane_uv

cl::Image2D object containing UV plane data.

Returns:

A shared remote blob instance

static RemoteContext::Ptr make_shared_context(
    Core& core,
    std::string deviceName,
    cl_context ctx,
    int target_tile_id = -1
    )

This function is used to obtain remote context object from user-supplied OpenCL context handle.

Parameters:

core

A reference to Inference Engine Core object

deviceName

A name of device to create a remote context for

ctx

A OpenCL context to be used to create shared remote context

target_tile_id

Desired tile id within given context for multi-tile system. Default value (-1) means that root device should be used

Returns:

A shared remote context instance

static RemoteContext::Ptr make_shared_context(
    Core& core,
    std::string deviceName,
    cl_command_queue queue
    )

This function is used to obtain remote context object from user-supplied OpenCL context handle.

Only latency mode is supported for such context sharing case.

Parameters:

core

A reference to Inference Engine Core object

deviceName

A name of device to create a remote context for

queue

An OpenCL queue to be used to create shared remote context. Queue will be reused inside the plugin.

Returns:

A shared remote context instance

static Blob::Ptr make_shared_blob(const TensorDesc& desc, ClContext::Ptr ctx)

This function is used to create remote blob object within default GPU plugin OpenCL context.

Parameters:

desc

A tensor descriptor object representing remote blob configuration

ctx

A remote context used to create remote blob

Returns:

A remote blob instance

static Blob::Ptr make_shared_blob(
    const TensorDesc& desc,
    RemoteContext::Ptr ctx,
    cl::Buffer& buffer
    )

This function is used to obtain remote blob object from user-supplied cl::Buffer wrapper object.

Parameters:

desc

A tensor descriptor object representing remote blob configuration

ctx

A remote context used to create remote blob

buffer

A cl::Buffer object wrapped by a remote blob

Returns:

A remote blob instance

static Blob::Ptr make_shared_blob(
    const TensorDesc& desc,
    RemoteContext::Ptr ctx,
    cl_mem buffer
    )

This function is used to obtain remote blob object from user-supplied OpenCL buffer handle.

Parameters:

desc

A tensor descriptor object representing remote blob configuration

ctx

A remote context used to create remote blob

buffer

A cl_mem object wrapped by a remote blob

Returns:

A remote blob instance

static Blob::Ptr make_shared_blob(
    const TensorDesc& desc,
    RemoteContext::Ptr ctx,
    cl::Image2D& image
    )

This function is used to obtain remote blob object from user-supplied cl::Image2D wrapper object.

Parameters:

desc

A tensor descriptor object representing remote blob configuration

ctx

A remote context used to create remote blob

image

A cl::Image2D object wrapped by a remote blob

Returns:

A remote blob instance

static Blob::Ptr make_shared_blob_nv12(
    size_t height,
    size_t width,
    RemoteContext::Ptr ctx,
    VASurfaceID nv12_surf
    )

This function is used to obtain a NV12 compound blob object from NV12 VA decoder output. The resulting compound contains two remote blobs for Y and UV planes of the surface.

Parameters:

height

A height of Y plane

width

A width of Y plane

ctx

A remote context instance

nv12_surf

NV12 VASurfaceID to create NV12 from

Returns:

A remote NV12 blob wrapping VASurfaceID

static VAContext::Ptr make_shared_context(
    Core& core,
    std::string deviceName,
    VADisplay device,
    int target_tile_id = -1
    )

This function is used to obtain remote context object from VA display handle.

Parameters:

core

Inference Engine Core object

deviceName

A device name to create a remote context for

device

A VADisplay to create remote context from

target_tile_id

Desired tile id within given context for multi-tile system. Default value (-1) means that root device should be used

Returns:

A remote context wrapping VADisplay

static VASurfaceBlob::Ptr make_shared_blob(
    const TensorDesc& desc,
    RemoteContext::Ptr ctx,
    VASurfaceID surface,
    uint32_t plane = 0
    )

This function is used to obtain remote blob object from VA surface handle.

Parameters:

desc

Tensor descriptor

ctx

A remote context instance

surface

A VASurfaceID to create remote blob from

plane

An index of a plane inside VASurfaceID to create blob from

Returns:

A remote blob wrapping VASurfaceID