21 #include "gpu/gpu_ocl_wrapper.hpp"
38 using Ptr = std::shared_ptr<ClContext>;
52 operator cl_context() {
60 operator cl::Context() {
61 return cl::Context(
get(),
true);
74 using Ptr = std::shared_ptr<ClBlob>;
94 using Ptr = std::shared_ptr<ClBufferBlob>;
121 operator cl::Buffer() {
122 return cl::Buffer(
get(),
true);
137 using Ptr = std::shared_ptr<ClImage2DBlob>;
164 operator cl::Image2D() {
165 return cl::Image2D(
get(),
true);
178 auto casted = std::dynamic_pointer_cast<ClContext>(ctx);
179 if (
nullptr == casted) {
183 size_t width = nv12_image_plane_y.getImageInfo<CL_IMAGE_WIDTH>();
184 size_t height = nv12_image_plane_y.getImageInfo<CL_IMAGE_HEIGHT>();
193 Blob::Ptr y_blob = std::dynamic_pointer_cast<Blob>(casted->CreateBlob(ydesc, blobParams));
197 Blob::Ptr uv_blob = std::dynamic_pointer_cast<Blob>(casted->CreateBlob(uvdesc, blobParams));
199 Blob::Ptr res = make_shared_blob<NV12Blob>(y_blob, uv_blob);
215 return core.CreateContext(deviceName, contextParams);
225 return std::dynamic_pointer_cast<Blob>(ctx->CreateBlob(
desc));
236 auto casted = std::dynamic_pointer_cast<ClContext>(ctx);
237 if (
nullptr == casted) {
245 return std::dynamic_pointer_cast<Blob>(casted->CreateBlob(
desc, params));
256 auto casted = std::dynamic_pointer_cast<ClContext>(ctx);
257 if (
nullptr == casted) {
265 return std::dynamic_pointer_cast<Blob>(casted->CreateBlob(
desc, params));
276 auto casted = std::dynamic_pointer_cast<ClContext>(ctx);
277 if (
nullptr == casted) {
285 return std::dynamic_pointer_cast<Blob>(casted->CreateBlob(
desc, params));
TensorDesc tensorDesc
The tensor descriptor of the given blob.
Definition: ie_blob.h:227
std::shared_ptr< Blob > Ptr
A smart pointer containing Blob object.
Definition: ie_blob.h:43
This class represents Inference Engine Core entity.
Definition: ie_core.hpp:29
@ U8
Definition: ie_precision.hpp:35
This class represents an Inference Engine abstraction to the memory allocated on the remote (non-CPU)...
Definition: ie_remote_context.hpp:31
virtual ParamMap getParams() const =0
Returns a map of device-specific parameters required for low-level operations with underlying object....
This class represents an Inference Engine abstraction for remote (non-CPU) accelerator device-specifi...
Definition: ie_remote_context.hpp:94
virtual ParamMap getParams() const =0
Returns a map of device-specific parameters required for low-level operations with underlying object....
std::shared_ptr< RemoteContext > Ptr
A smart pointer to the RemoteContext object.
Definition: ie_remote_context.hpp:99
This class defines Tensor description.
Definition: ie_layouts.h:158
The basic class for all GPU plugin remote blob objects. The OpenCL memory object handle (cl_mem) can ...
Definition: gpu_context_api_ocl.hpp:69
std::shared_ptr< ClBlob > Ptr
A smart pointer to the ClBlob object.
Definition: gpu_context_api_ocl.hpp:74
ClBlob(const TensorDesc &tensorDesc)
Creates a ClBlob object with the specified dimensions and layout.
Definition: gpu_context_api_ocl.hpp:80
This class represents an abstraction for GPU plugin remote blob which can be shared with user-supplie...
Definition: gpu_context_api_ocl.hpp:89
ClBufferBlob(const TensorDesc &tensorDesc)
Creates a ClBufferBlob object with the specified dimensions and layout.
Definition: gpu_context_api_ocl.hpp:100
cl_mem get()
Returns the underlying OpenCL memory object handle.
Definition: gpu_context_api_ocl.hpp:105
This class represents an abstraction for GPU plugin remote context which is shared with OpenCL contex...
Definition: gpu_context_api_ocl.hpp:33
std::shared_ptr< ClContext > Ptr
A smart pointer to the ClContext object.
Definition: gpu_context_api_ocl.hpp:38
cl_context get()
Returns the underlying OpenCL context handle.
Definition: gpu_context_api_ocl.hpp:43
This class represents an abstraction for GPU plugin remote blob which can be shared with user-supplie...
Definition: gpu_context_api_ocl.hpp:132
ClImage2DBlob(const TensorDesc &tensorDesc)
Creates a ClImage2DBlob object with the specified dimensions and layout.
Definition: gpu_context_api_ocl.hpp:143
cl_mem get()
Returns the underlying OpenCL memory object handle.
Definition: gpu_context_api_ocl.hpp:148
This wrapper class is used to obtain low-level handles from remote blob or context object parameters.
Definition: gpu_context_helpers.hpp:23
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:210
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:177
a header that defines helpers for GPU plugin-specific wrappers
a header for properties of shared device contexts and shared device memory blobs for clDNN plugin
#define GPU_PARAM_KEY(name)
Shortcut for defining configuration keys.
Definition: gpu_params.hpp:27
#define GPU_PARAM_VALUE(name)
Shortcut for defining configuration values.
Definition: gpu_params.hpp:32
A header file for CompoundBlob.
This is a header file for the Inference Engine Core class C++ API.
#define THROW_IE_EXCEPTION
A macro used to throw general exception with a description.
Definition: ie_exception.hpp:25
This is a header file for the IE RemoteContext and RemoteBlob classes.
Inference Engine C++ API.
Definition: cldnn_config.hpp:15
InferenceEngine::TBlob< Type >::Ptr make_shared_blob(const TensorDesc &tensorDesc)
Creates a blob with the given tensor descriptor.
Definition: ie_blob.h:833
void * gpu_handle_param
Shortcut for defining a handle parameter.
Definition: gpu_params.hpp:20
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