class ov::intel_gpu::ocl::ClImage2DTensor

Overview

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

#include <ocl.hpp>

class ClImage2DTensor: public ov::RemoteTensor
{
public:
    // methods

    static void type_check(const Tensor& tensor);
    cl_mem get();
    operator cl_mem ();
    operator cl::Image2D ();
};

// direct descendants

class D3DSurface2DTensor;
class VASurfaceTensor;

Inherited Members

public:
    // methods

    Tensor& operator = (const Tensor& other);
    Tensor& operator = (Tensor&& other);
    void set_shape(const ov::Shape& shape);
    element::Type get_element_type() const;
    Shape get_shape() const;
    size_t get_size() const;
    size_t get_byte_size() const;
    Strides get_strides() const;
    void \* data(const element::Type type = {}) const;

    template <typename T, typename datatype = typename std::decay<T>::type>
    T \* data() const;

    bool operator ! () const;
    operator bool () const;

    template <typename T>
    std::enable_if<std::is_base_of<Tensor, T>::value, bool>::type is() const;

    template <typename T>
    const std::enable_if<std::is_base_of<Tensor, T>::value, T>::type as() const;

    static void type_check(const Tensor& tensor);

    static void type_check(
        const Tensor& tensor,
        const std::map<std::string, std::vector<std::string>>& type_info = {}
        );

    void \* data(const element::Type);

    template <typename T>
    T \* data();

    ov::AnyMap get_params() const;

Detailed Documentation

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

User can obtain OpenCL image handle from this class.

Methods

static void type_check(const Tensor& tensor)

Checks that type defined runtime parameters are presented in remote object.

Parameters:

tensor

a tensor to check

cl_mem get()

Returns the underlying OpenCL memory object handle.

Returns:

underlying OpenCL memory object handle

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