19 #include "gpu_ocl_wrapper.hpp" 35 using Ptr = std::shared_ptr<ClContext>;
49 operator cl_context() {
57 operator cl::Context() {
58 return cl::Context(
get(),
true);
71 using Ptr = std::shared_ptr<ClBlob>;
91 using Ptr = std::shared_ptr<ClBufferBlob>;
118 operator cl::Buffer() {
119 return cl::Buffer(
get(),
true);
134 using Ptr = std::shared_ptr<ClImage2DBlob>;
161 operator cl::Image2D() {
162 return cl::Image2D(
get(),
true);
175 auto casted = std::dynamic_pointer_cast<
ClContext>(ctx);
176 if (
nullptr == casted) {
180 size_t width = nv12_image_plane_y.getImageInfo<CL_IMAGE_WIDTH>();
181 size_t height = nv12_image_plane_y.getImageInfo<CL_IMAGE_HEIGHT>();
190 Blob::Ptr y_blob = std::dynamic_pointer_cast<
Blob>(casted->CreateBlob(ydesc, blobParams));
194 Blob::Ptr uv_blob = std::dynamic_pointer_cast<
Blob>(casted->CreateBlob(uvdesc, blobParams));
196 Blob::Ptr res = make_shared_blob<NV12Blob>(y_blob, uv_blob);
215 return std::dynamic_pointer_cast<
Blob>(ctx->CreateBlob(desc));
222 auto casted = std::dynamic_pointer_cast<
ClContext>(ctx);
223 if (
nullptr == casted) {
231 return std::dynamic_pointer_cast<
Blob>(casted->CreateBlob(desc, params));
238 auto casted = std::dynamic_pointer_cast<
ClContext>(ctx);
239 if (
nullptr == casted) {
247 return std::dynamic_pointer_cast<
Blob>(casted->CreateBlob(desc, params));
254 auto casted = std::dynamic_pointer_cast<
ClContext>(ctx);
255 if (
nullptr == casted) {
263 return std::dynamic_pointer_cast<
Blob>(casted->CreateBlob(desc, params));
#define THROW_IE_EXCEPTION
A macro used to throw the exception with a notable description.
Definition: ie_exception.hpp:25
RemoteContext::Ptr CreateContext(const std::string &deviceName, const ParamMap ¶ms)
Create a new shared context object on specified accelerator device using specified plugin-specific lo...
This class represents Inference Engine Core entity.
Definition: ie_core.hpp:51
A header file for CompoundBlob.
Definition: cldnn_config.hpp:16
ClImage2DBlob(const TensorDesc &tensorDesc)
Creates a ClImage2DBlob object with the specified dimensions and layout.
Definition: gpu_context_api_ocl.hpp:140
static Blob::Ptr make_shared_blob_nv12(RemoteContext::Ptr ctx, cl::Image2D &nv12_image_plane_y, cl::Image2D &nv12_image_plane_uv)
This function is used to construct a NV12 compound blob object from two cl::Image2D wrapper objects...
Definition: gpu_context_api_ocl.hpp:174
std::shared_ptr< ClBlob > Ptr
A smart pointer to the ClBlob object.
Definition: gpu_context_api_ocl.hpp:71
ClBlob(const TensorDesc &tensorDesc)
Creates a ClBlob object with the specified dimensions and layout.
Definition: gpu_context_api_ocl.hpp:77
a header for properties of shared device contexts and shared device memory blobs for clDNN plugin ...
This class represents an abstraction for GPU plugin remote blob which can be shared with user-supplie...
Definition: gpu_context_api_ocl.hpp:129
The basic class for all GPU plugin remote blob objects. The OpenCL memory object handle (cl_mem) can ...
Definition: gpu_context_api_ocl.hpp:66
This is a header file for the Inference Engine Core class C++ API.
This class defines Tensor description.
Definition: ie_layouts.h:153
#define GPU_PARAM_VALUE(name)
Shortcut for defining configuration values.
Definition: gpu_params.hpp:32
This class represents an abstraction for GPU plugin remote context which is shared with OpenCL contex...
Definition: gpu_context_api_ocl.hpp:30
static RemoteContext::Ptr make_shared_context(Core &core, std::string deviceName, cl_context ctx)
This function is used to obtain remote context object from user-supplied OpenCL context handle...
Definition: gpu_context_api_ocl.hpp:203
std::map< std::string, Parameter > ParamMap
An std::map object containing low-level object parameters of classes that are derived from RemoteBlob...
Definition: ie_remote_context.hpp:26
std::shared_ptr< Blob > Ptr
A smart pointer containing Blob object.
Definition: ie_blob.h:42
static Blob::Ptr make_shared_blob(const TensorDesc &desc, ClContext::Ptr ctx)
This function is used to create remote blob object within default GPU plugin OpenCL context...
Definition: gpu_context_api_ocl.hpp:214
virtual ParamMap getParams() const =0
Returns a map of device-specific parameters required for low-level operations with underlying object...
This wrapper class is used to obtain low-level handles from remote blob or context object parameters...
Definition: gpu_context_helpers.hpp:23
Definition: ie_precision.hpp:33
std::shared_ptr< ClContext > Ptr
A smart pointer to the ClContext object.
Definition: gpu_context_api_ocl.hpp:35
This class represents an Inference Engine abstraction for remote (non-CPU) accelerator device-specifi...
Definition: ie_remote_context.hpp:94
This class represents a universal container in the Inference Engine.
Definition: ie_blob.h:37
ClBufferBlob(const TensorDesc &tensorDesc)
Creates a ClBufferBlob object with the specified dimensions and layout.
Definition: gpu_context_api_ocl.hpp:97
a header that defines helpers for GPU plugin-specific wrappers
#define GPU_PARAM_KEY(name)
Shortcut for defining configuration keys.
Definition: gpu_params.hpp:27
std::map< std::string, std::string > params
Map of pairs: (parameter name, parameter value)
Definition: ie_layers.h:367
std::shared_ptr< RemoteContext > Ptr
A smart pointer to the RemoteContext object.
Definition: ie_remote_context.hpp:99
This class represents an abstraction for GPU plugin remote blob which can be shared with user-supplie...
Definition: gpu_context_api_ocl.hpp:86
This class represents an Inference Engine abstraction to the memory allocated on the remote (non-CPU)...
Definition: ie_remote_context.hpp:31
void * gpu_handle_param
Shortcut for defining a handle parameter.
Definition: gpu_params.hpp:20