class InferenceEngine::gpu::D3DSurface2DBlob

Overview

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

#include <gpu_context_api_dx.hpp>

class D3DSurface2DBlob: public InferenceEngine::gpu::ClImage2DBlob
{
public:
    // typedefs

    typedef std::shared_ptr<D3DSurface2DBlob> Ptr;

    // construction

    D3DSurface2DBlob(const TensorDesc& tensorDesc);

    // methods

    operator ID3D11Texture2D * ();
    uint32_t plane();
};

Inherited Members

public:
    // typedefs

    typedef std::shared_ptr<Blob> Ptr;
    typedef std::shared_ptr<const Blob> CPtr;
    typedef std::shared_ptr<MemoryBlob> Ptr;
    typedef std::shared_ptr<const MemoryBlob> CPtr;
    typedef std::shared_ptr<RemoteBlob> Ptr;
    typedef std::shared_ptr<const RemoteBlob> CPtr;
    typedef std::shared_ptr<ClBlob> Ptr;
    typedef std::shared_ptr<ClImage2DBlob> Ptr;

    // methods

    static Ptr CreateFromData(const DataPtr& data);

    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();

    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;

    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();

    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;

    virtual const TensorDesc& getTensorDesc() const;
    virtual TensorDesc& getTensorDesc();
    virtual size_t size() const;
    virtual size_t byteSize() const;
    virtual size_t element_size() const = 0;
    virtual void allocate() = 0;
    virtual bool deallocate() = 0;
    virtual Blob::Ptr createROI(const ROI& roi) const;
    virtual const TensorDesc& getTensorDesc() const;
    virtual TensorDesc& getTensorDesc();
    virtual size_t size() const;
    virtual size_t byteSize() const;
    virtual size_t element_size() const = 0;
    virtual void allocate() = 0;
    virtual bool deallocate() = 0;
    virtual LockedMemory<void> rwmap() = 0;
    virtual LockedMemory<const void> rmap() const = 0;
    virtual LockedMemory<void> wmap() = 0;
    virtual size_t element_size() const;
    virtual ParamMap getParams() const = 0;
    virtual std::string getDeviceName() const = 0;
    virtual std::shared_ptr<RemoteContext> getContext() const = 0;
    cl_mem get();
    operator cl_mem ();
    operator cl::Image2D ();

Detailed Documentation

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

User can also obtain OpenCL 2D image handle from this class.

Typedefs

typedef std::shared_ptr<D3DSurface2DBlob> Ptr

A smart pointer to the D3DSurface2DBlob object.

Construction

D3DSurface2DBlob(const TensorDesc& tensorDesc)

Creates a D3DSurface2DBlob object with the specified dimensions and layout.

Parameters:

tensorDesc

Tensor description

Methods

operator ID3D11Texture2D * ()

ID3D11Texture2D conversion operator for the D3DContext object.

Returns:

Pointer to underlying ID3D11Texture2D interface

uint32_t plane()

Returns plane ID of underlying video decoder surface, or 0 if no video surface was shared.