class ov::intel_gpu::ocl::VAContext¶
Overview¶
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. More…
#include <va.hpp>
class VAContext: public ov::intel_gpu::ocl::ClContext
{
public:
// construction
VAContext(, , );
// methods
static voidconst RemoteContext& type_check();
operator VADisplay ();
std::pair<VASurfaceTensor, VASurfaceTensor>const size_tconst size_tconst VASurfaceID create_tensor_nv12(
,
,
);
VASurfaceTensorconst element::Typeconst Shape&const VASurfaceIDconst uint32_t create_tensor(
,
,
,
);
ClBufferTensorconst element::Typeconst Shape&const cl_mem create_tensor(, , );
ClBufferTensorconst element::Typeconst Shape&const cl::Buffer& create_tensor(
,
,
);
ClImage2DTensorconst element::Typeconst Shape&const cl::Image2D& create_tensor(
,
,
);
USMTensorconst element::Typeconst Shape&void \* create_tensor(, , );
RemoteTensorconst element::Type&const Shape&const AnyMap& create_tensor(, , );
};
Inherited Members¶
public:
// methods
RemoteContext&const RemoteContext& operator = ();
RemoteContext&RemoteContext&& operator = ();
operator bool () const;
template <>
bool is() const;
template <>
const T as() const;
RemoteTensorconst element::Type&const Shape&const AnyMap& create_tensor(, , );
AnyMap get_params() const;
Tensorconst element::Typeconst Shape& create_host_tensor(, );
static voidconst RemoteContext&const std::map<std::string, std::vector<std::string>>& type_check(
,
);
static voidconst RemoteContext& type_check();
cl_context get();
operator cl_context ();
operator cl::Context ();
std::pair<ClImage2DTensor, ClImage2DTensor>const cl::Image2D&const cl::Image2D& create_tensor_nv12(
,
);
ClBufferTensorconst element::Typeconst Shape&const cl_mem create_tensor(, , );
ClBufferTensorconst element::Typeconst Shape&const cl::Buffer& create_tensor(
,
,
);
ClImage2DTensorconst element::Typeconst Shape&const cl::Image2D& create_tensor(
,
,
);
USMTensorconst element::Typeconst Shape&void \* create_tensor(, , );
USMTensorconst element::Typeconst Shape& create_usm_host_tensor(, );
USMTensorconst element::Typeconst Shape& create_usm_device_tensor(, );
RemoteTensorconst element::Type&const Shape&const AnyMap& create_tensor(, , );
Detailed Documentation¶
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.
User can also obtain OpenCL context handle from this class.
Construction¶
VAContext(, , )
Constructs remote context object from VA display handle.
Parameters:
core |
OpenVINO Runtime Core object |
device |
A |
target_tile_id |
Desired tile id within given context for multi-tile system. Default value (-1) means that root device should be used |
Methods¶
static voidconst RemoteContext& type_check()
Checks that type defined runtime parameters are presented in remote object.
Parameters:
remote_context |
A remote context to check |
operator VADisplay ()
VADisplay
conversion operator for the VAContext object.
Returns:
Underlying VADisplay
object handle
std::pair<VASurfaceTensor, VASurfaceTensor>const size_tconst size_tconst VASurfaceID create_tensor_nv12(
,
,
)
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 |
Returns:
A pair of remote tensors for each plane
VASurfaceTensorconst element::Typeconst Shape&const VASurfaceIDconst uint32_t create_tensor(
,
,
,
)
This function is used to create remote tensor from VA surface handle.
Parameters:
type |
Tensor element type |
shape |
Tensor shape |
surface |
A |
plane |
An index of a plane inside |
Returns:
A remote tensor wrapping VASurfaceID
ClBufferTensorconst element::Typeconst Shape&const cl_mem create_tensor(, , )
This function is used to obtain remote tensor object from user-supplied cl_mem object.
Parameters:
type |
Tensor element type |
shape |
Tensor shape |
buffer |
A cl_mem object that should be wrapped by a remote tensor |
Returns:
A remote tensor instance
ClBufferTensorconst element::Typeconst Shape&const cl::Buffer& create_tensor(
,
,
)
This function is used to obtain remote tensor object from user-supplied cl::Buffer object.
Parameters:
type |
Tensor element type |
shape |
Tensor shape |
buffer |
A cl::Buffer object that should be wrapped by a remote tensor |
Returns:
A remote tensor instance
ClImage2DTensorconst element::Typeconst Shape&const cl::Image2D& create_tensor(
,
,
)
This function is used to obtain remote tensor object from user-supplied cl::Image2D object.
Parameters:
type |
Tensor element type |
shape |
Tensor shape |
image |
A cl::Image2D object that should be wrapped by a remote tensor |
Returns:
A remote tensor instance
USMTensorconst element::Typeconst Shape&void \* create_tensor(, , )
This function is used to obtain remote tensor object from user-supplied USM pointer.
Parameters:
type |
Tensor element type |
shape |
Tensor shape |
usm_ptr |
A USM pointer that should be wrapped by a remote tensor |
Returns:
A remote tensor instance
RemoteTensorconst element::Type&const Shape&const AnyMap& create_tensor(, , )
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.