oneAPI Deep Neural Network Library (oneDNN)
Performance library for Deep Learning
2.1.3
dnnl_sycl.h
1/*******************************************************************************
2* Copyright 2020 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_SYCL_H
18#define ONEAPI_DNNL_DNNL_SYCL_H
19
20#include "oneapi/dnnl/dnnl.h"
21
22#include "oneapi/dnnl/dnnl_sycl_types.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
30
33
36
45 dnnl_engine_t *engine, const void *device, const void *context);
46
54 dnnl_engine_t engine, void **context);
55
63 dnnl_engine_t engine, void **device);
64
95 const dnnl_memory_desc_t *memory_desc, dnnl_engine_t engine,
96 dnnl_sycl_interop_memory_kind_t memory_kind, void *handle);
97
106 const_dnnl_memory_t memory,
108
117 dnnl_memory_t memory, void *buffer, dnnl_stream_t stream);
118
128 dnnl_stream_t *stream, dnnl_engine_t engine, void *queue);
129
137 dnnl_stream_t stream, void **queue);
138
157 const_dnnl_primitive_t primitive, dnnl_stream_t stream, int nargs,
158 const dnnl_exec_arg_t *args, const void *deps, void *return_event);
159
161
163
165
166#ifdef __cplusplus
167}
168#endif
169
170#endif
dnnl_status_t DNNL_API dnnl_sycl_interop_engine_get_context(dnnl_engine_t engine, void **context)
Returns the SYCL context associated with an engine.
dnnl_status_t DNNL_API dnnl_sycl_interop_memory_get_memory_kind(const_dnnl_memory_t memory, dnnl_sycl_interop_memory_kind_t *memory_kind)
Returns the memory allocation kind associated with a memory object.
dnnl_status_t DNNL_API dnnl_sycl_interop_primitive_execute(const_dnnl_primitive_t primitive, dnnl_stream_t stream, int nargs, const dnnl_exec_arg_t *args, const void *deps, void *return_event)
Executes computations specified by the primitive in a specified stream and returns a SYCL event.
dnnl_status_t DNNL_API dnnl_sycl_interop_stream_create(dnnl_stream_t *stream, dnnl_engine_t engine, void *queue)
Creates an execution stream for a given engine associated with a SYCL queue.
dnnl_status_t DNNL_API dnnl_sycl_interop_engine_create(dnnl_engine_t *engine, const void *device, const void *context)
Creates an engine associated with a SYCL device and a SYCL context.
dnnl_sycl_interop_memory_kind_t
Memory allocation kind.
Definition: dnnl_sycl_types.h:34
dnnl_status_t DNNL_API dnnl_sycl_interop_stream_get_queue(dnnl_stream_t stream, void **queue)
Returns the SYCL queue associated with an execution stream.
dnnl_status_t DNNL_API dnnl_sycl_interop_memory_create(dnnl_memory_t *memory, const dnnl_memory_desc_t *memory_desc, dnnl_engine_t engine, dnnl_sycl_interop_memory_kind_t memory_kind, void *handle)
Creates a memory object.
dnnl_status_t DNNL_API dnnl_sycl_interop_engine_get_device(dnnl_engine_t engine, void **device)
Returns the SYCL device associated with an engine.
dnnl_status_t DNNL_API dnnl_sycl_interop_memory_set_buffer(dnnl_memory_t memory, void *buffer, dnnl_stream_t stream)
Sets a SYCL buffer for a memory object.
dnnl_status_t
Status values returned by the library functions.
Definition: dnnl_types.h:39
C API.
An opaque structure to describe an engine.
A structure that contains an index and a memory object, and is used to pass arguments to dnnl_primiti...
Definition: dnnl_types.h:2475
Memory descriptor.
Definition: dnnl_types.h:1445
An opaque structure to describe a memory.
An opaque structure to describe a primitive.
An opaque structure to describe an execution stream.