Class ov::intel_gpu::ocl::VAContext#

class VAContext : public ov::intel_gpu::ocl::ClContext#

This class represents an abstraction for GPU plugin remote context which is shared with VA display object. The plugin object derived from this class can be obtained either with CompiledModel::get_context() or Core::create_context() calls.

Note

User can also obtain OpenCL context handle from this class.

Public Functions

inline operator VADisplay()#

VADisplay conversion operator for the VAContext object.

Returns:

Underlying VADisplay object handle

inline VAContext(Core &core, VADisplay device, int target_tile_id = -1)#

Constructs remote context object from VA display handle.

Parameters:
  • core – OpenVINO Runtime Core object

  • 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

inline std::pair<VASurfaceTensor, VASurfaceTensor> create_tensor_nv12(const size_t height, const size_t width, const VASurfaceID nv12_surf)#

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

Parameters:
  • height – A height of Y plane

  • width – A width of Y plane

  • nv12_surf – NV12 VASurfaceID to create NV12 from

Returns:

A pair of remote tensors for each plane

inline VASurfaceTensor create_tensor(const element::Type type, const Shape &shape, const VASurfaceID surface, const uint32_t plane = 0)#

This function is used to create remote tensor from VA surface handle.

Parameters:
  • typeTensor element type

  • shapeTensor shape

  • surface – A VASurfaceID to create remote tensor from

  • plane – An index of a plane inside VASurfaceID to create tensor from

Returns:

A remote tensor wrapping VASurfaceID

inline ClBufferTensor create_tensor(const element::Type type, const Shape &shape, const cl_mem buffer)#

This function is used to obtain remote tensor object from user-supplied cl_mem object.

Parameters:
  • typeTensor element type

  • shapeTensor shape

  • buffer – A cl_mem object that should be wrapped by a remote tensor

Returns:

A remote tensor instance

inline ClBufferTensor create_tensor(const element::Type type, const Shape &shape, const cl::Buffer &buffer)#

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

Parameters:
  • typeTensor element type

  • shapeTensor shape

  • buffer – A cl::Buffer object that should be wrapped by a remote tensor

Returns:

A remote tensor instance

inline ClImage2DTensor create_tensor(const element::Type type, const Shape &shape, const cl::Image2D &image)#

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

Parameters:
  • typeTensor element type

  • shapeTensor shape

  • image – A cl::Image2D object that should be wrapped by a remote tensor

Returns:

A remote tensor instance

inline USMTensor create_tensor(const element::Type type, const Shape &shape, void *usm_ptr)#

This function is used to obtain remote tensor object from user-supplied USM pointer.

Parameters:
  • typeTensor element type

  • shapeTensor shape

  • usm_ptr – A USM pointer that should be wrapped by a remote tensor

Returns:

A remote tensor instance

RemoteTensor create_tensor(const element::Type &type, const Shape &shape, const AnyMap &params = {})#

Allocates memory tensor in device memory or wraps user-supplied memory handle using the specified tensor description and low-level device-specific parameters. Returns a pointer to the object that implements the RemoteTensor interface.

Parameters:
  • type – Defines the element type of the tensor.

  • shape – Defines the shape of the tensor.

  • params – Map of the low-level tensor object parameters.

Returns:

Pointer to a plugin object that implements the RemoteTensor interface.

Public Static Functions

static inline void type_check(const RemoteContext &remote_context)#

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

Parameters:

remote_context – A remote context to check