mxnet
dnnl_ocl.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright 2020-2021 Intel Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *******************************************************************************/
16 
17 #ifndef ONEAPI_DNNL_DNNL_OCL_H
18 #define ONEAPI_DNNL_DNNL_OCL_H
19 
20 #include "oneapi/dnnl/dnnl.h"
21 
22 #include "oneapi/dnnl/dnnl_ocl_types.h"
23 
25 // Set target version for OpenCL explicitly to suppress a compiler warning.
26 #ifndef CL_TARGET_OPENCL_VERSION
27 #define CL_TARGET_OPENCL_VERSION 120
28 #endif
29 
30 #include <CL/cl.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
39 
42 
45 
75  const dnnl_memory_desc_t *memory_desc, dnnl_engine_t engine,
76  dnnl_ocl_interop_memory_kind_t memory_kind, void *handle);
77 
86  const_dnnl_memory_t memory,
87  dnnl_ocl_interop_memory_kind_t *memory_kind);
88 
96  const_dnnl_memory_t memory, cl_mem *mem_object);
97 
107  dnnl_memory_t memory, cl_mem mem_object);
108 
117  dnnl_engine_t *engine, cl_device_id device, cl_context context);
118 
126  dnnl_engine_t engine, cl_context *context);
127 
135  dnnl_engine_t engine, cl_device_id *device);
136 
146  dnnl_stream_t *stream, dnnl_engine_t engine, cl_command_queue queue);
147 
155  dnnl_stream_t stream, cl_command_queue *queue);
156 
158 
160 
162 
163 #ifdef __cplusplus
164 }
165 #endif
166 
167 #endif
dnnl_ocl_interop_memory_set_mem_object
dnnl_status_t DNNL_API dnnl_ocl_interop_memory_set_mem_object(dnnl_memory_t memory, cl_mem mem_object)
dnnl_memory
dnnl_status_t
dnnl_status_t
Status values returned by the library functions.
Definition: dnnl_types.h:39
dnnl_engine
An opaque structure to describe an engine.
dnnl_ocl_interop_engine_create
dnnl_status_t DNNL_API dnnl_ocl_interop_engine_create(dnnl_engine_t *engine, cl_device_id device, cl_context context)
dnnl_ocl_interop_stream_create
dnnl_status_t DNNL_API dnnl_ocl_interop_stream_create(dnnl_stream_t *stream, dnnl_engine_t engine, cl_command_queue queue)
dnnl_ocl_interop_memory_get_mem_object
dnnl_status_t DNNL_API dnnl_ocl_interop_memory_get_mem_object(const_dnnl_memory_t memory, cl_mem *mem_object)
dnnl.h
dnnl_ocl_interop_stream_get_command_queue
dnnl_status_t DNNL_API dnnl_ocl_interop_stream_get_command_queue(dnnl_stream_t stream, cl_command_queue *queue)
dnnl_ocl_interop_memory_create
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)
dnnl_ocl_interop_engine_get_context
dnnl_status_t DNNL_API dnnl_ocl_interop_engine_get_context(dnnl_engine_t engine, cl_context *context)
dnnl_ocl_interop_memory_get_memory_kind
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)
dnnl_memory_desc_t
Definition: dnnl_types.h:1792
dnnl_stream
dnnl_ocl_interop_get_device
dnnl_status_t DNNL_API dnnl_ocl_interop_get_device(dnnl_engine_t engine, cl_device_id *device)