mxnet
|
dnnl_status_t DNNL_API dnnl_ocl_interop_engine_create | ( | dnnl_engine_t * | engine, |
cl_device_id | device, | ||
cl_context | context | ||
) |
Creates an engine associated with an OpenCL device and an OpenCL context.
engine | Output engine. |
device | Underlying OpenCL device to use for the engine. |
context | Underlying OpenCL context to use for the engine. |
dnnl_status_t DNNL_API dnnl_ocl_interop_engine_get_context | ( | dnnl_engine_t | engine, |
cl_context * | context | ||
) |
Returns the OpenCL context associated with an engine.
engine | Engine to query. |
context | Output underlying OpenCL context of the engine. |
dnnl_status_t DNNL_API dnnl_ocl_interop_get_device | ( | dnnl_engine_t | engine, |
cl_device_id * | device | ||
) |
Returns the OpenCL device associated with an engine.
engine | Engine to query. |
device | Output underlying OpenCL device of the engine. |
dnnl_status_t DNNL_API dnnl_ocl_interop_memory_create | ( | dnnl_memory_t * | memory, |
const dnnl_memory_desc_t * | memory_desc, | ||
dnnl_engine_t | engine, | ||
dnnl_ocl_interop_memory_kind_t | memory_kind, | ||
void * | handle | ||
) |
Creates a memory object.
Unless handle
is equal to DNNL_MEMORY_NONE or DNNL_MEMORY_ALLOCATE, the constructed memory object will have the underlying buffer set. In this case, the buffer will be initialized as if:
memory_kind
is equal to dnnl_ocl_interop_usm, ormemory_kind
is equal to dnnl_ocl_interop_buffer.memory | Output memory object. |
memory_desc | Memory descriptor. |
engine | Engine to use. |
memory_kind | Memory allocation kind to specify the type of handle. |
handle | Handle of the memory buffer to use as an underlying storage.
|
dnnl_status_t DNNL_API dnnl_ocl_interop_memory_get_mem_object | ( | const_dnnl_memory_t | memory, |
cl_mem * | mem_object | ||
) |
Returns an OpenCL memory object associated with a memory object.
memory | Memory object. |
mem_object | Output OpenCL memory object. |
dnnl_status_t DNNL_API dnnl_ocl_interop_memory_get_memory_kind | ( | const_dnnl_memory_t | memory, |
dnnl_ocl_interop_memory_kind_t * | memory_kind | ||
) |
Returns the memory allocation kind associated with a memory object.
memory | Memory to query. |
memory_kind | Output underlying memory allocation kind of the memory object. |
dnnl_status_t DNNL_API dnnl_ocl_interop_memory_set_mem_object | ( | dnnl_memory_t | memory, |
cl_mem | mem_object | ||
) |
Sets OpenCL memory object associated with a memory object.
For behavioral details, see dnnl_memory_set_data_handle().
memory | Memory object. |
mem_object | OpenCL memory object. |
dnnl_status_t DNNL_API dnnl_ocl_interop_stream_create | ( | dnnl_stream_t * | stream, |
dnnl_engine_t | engine, | ||
cl_command_queue | queue | ||
) |
Creates an execution stream for a given engine associated with an OpenCL command queue.
stream | Output execution stream. |
engine | Engine to create the execution stream on. |
queue | OpenCL command queue to use. |
dnnl_status_t DNNL_API dnnl_ocl_interop_stream_get_command_queue | ( | dnnl_stream_t | stream, |
cl_command_queue * | queue | ||
) |
Returns the OpenCL command queue associated with an execution stream.
stream | Execution stream to query. |
queue | Output OpenCL command queue. |