class InferenceEngine::gpu::ClImage2DBlob

Overview

This class represents an abstraction for GPU plugin remote blob which can be shared with user-supplied OpenCL 2D Image. The plugin object derived from this class can be obtained with CreateBlob() call. More…

#include <gpu_context_api_ocl.hpp>

class ClImage2DBlob:
    public InferenceEngine::gpu::ClBlob,
    public InferenceEngine::gpu::details::param_map_obj_getter
{
public:
    // typedefs

    typedef std::shared_ptr<ClImage2DBlob> Ptr;

    // construction

    ClImage2DBlob(const TensorDesc& tensorDesc);

    // methods

    cl_mem get();
    operator cl_mem ();
    operator cl::Image2D ();
};

// direct descendants

class D3DSurface2DBlob;
class VASurfaceBlob;

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;

    // 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;
    void setShape(const SizeVector& dims);
    virtual Blob::Ptr createROI(const ROI& roi) const;

    virtual Blob::Ptr createROI(
        const std::vector<std::size_t>& begin,
        const std::vector<std::size_t>& end
        ) 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;
    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 ParamMap getParams() const = 0;
    virtual std::string getDeviceName() const = 0;
    virtual std::shared_ptr<RemoteContext> getContext() const = 0;

Detailed Documentation

This class represents an abstraction for GPU plugin remote blob which can be shared with user-supplied OpenCL 2D Image. The plugin object derived from this class can be obtained with CreateBlob() call.

User can obtain OpenCL image handle from this class.

Typedefs

typedef std::shared_ptr<ClImage2DBlob> Ptr

A smart pointer to the ClImage2DBlob object.

Construction

ClImage2DBlob(const TensorDesc& tensorDesc)

Creates a ClImage2DBlob object with the specified dimensions and layout.

Parameters:

tensorDesc

Tensor description

Methods

cl_mem get()

Returns the underlying OpenCL memory object handle.

Returns:

cl_mem

operator cl_mem ()

OpenCL memory handle conversion operator.

Returns:

cl_mem

operator cl::Image2D ()

Standard Khronos cl::Image2D wrapper conversion operator for the ClContext object.

Returns:

cl::Image2D object