oneAPI Deep Neural Network Library (oneDNN)  1.4.0
Performance library for Deep Learning
Classes | Typedefs | Enumerations | Functions

An encapsulation of execution context tied to a particular engine. More...

Classes

struct  dnnl::stream_attr
 A container for stream attributes. More...
 
struct  dnnl::stream
 An execution stream. More...
 
struct  dnnl_stream
 An opaque structure to describe an execution stream. More...
 

Typedefs

typedef struct dnnl_streamdnnl_stream_t
 An execution stream handle.
 
typedef const struct dnnl_streamconst_dnnl_stream_t
 A constant execution stream handle.
 
typedef struct dnnl_stream_attr * dnnl_stream_attr_t
 An execution stream attributes handle.
 
typedef const struct dnnl_stream_attr * const_dnnl_stream_attr_t
 A constant execution stream attributes handle.
 

Enumerations

enum  dnnl_stream_flags_t
 Stream flags. More...
 

Functions

dnnl_status_t DNNL_API dnnl_stream_attr_create (dnnl_stream_attr_t *attr, dnnl_engine_kind_t kind)
 Creates execution stream attributes for a stream that runs on an engine of a particular kind. More...
 
dnnl_status_t DNNL_API dnnl_stream_attr_destroy (dnnl_stream_attr_t attr)
 Destroys execution stream attributes. More...
 
dnnl_status_t DNNL_API dnnl_stream_create (dnnl_stream_t *stream, dnnl_engine_t engine, unsigned flags)
 Creates an execution stream. More...
 
dnnl_status_t DNNL_API dnnl_stream_create_v2 (dnnl_stream_t *stream, dnnl_engine_t engine, unsigned flags, const_dnnl_stream_attr_t attr)
 Creates an execution stream. More...
 
dnnl_status_t DNNL_API dnnl_stream_create_ocl (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. More...
 
dnnl_status_t DNNL_API dnnl_stream_get_ocl_command_queue (dnnl_stream_t stream, cl_command_queue *queue)
 Returns the OpenCL command queue associated with an execution stream. More...
 
dnnl_status_t DNNL_API dnnl_stream_wait (dnnl_stream_t stream)
 Waits for all primitives in the execution stream to finish computations. More...
 
dnnl_status_t DNNL_API dnnl_stream_destroy (dnnl_stream_t stream)
 Destroys an execution stream. More...
 

Detailed Description

An encapsulation of execution context tied to a particular engine.

See also
Basic Concepts

Enumeration Type Documentation

◆ dnnl_stream_flags_t

Stream flags.

Enumerator
dnnl_stream_default_order 

Default order execution.

Either in-order or out-of-order depending on the runtime.

dnnl_stream_in_order 

In-order execution.

dnnl_stream_out_of_order 

Out-of-order execution.

dnnl_stream_default_flags 

Default stream configuration.

Function Documentation

◆ dnnl_stream_attr_create()

dnnl_status_t DNNL_API dnnl_stream_attr_create ( dnnl_stream_attr_t attr,
dnnl_engine_kind_t  kind 
)

Creates execution stream attributes for a stream that runs on an engine of a particular kind.

Parameters
attrOutput execution stream attributes.
kindTarget engine kind.
Returns
dnnl_success on success and a status describing the error otherwise.

◆ dnnl_stream_attr_destroy()

dnnl_status_t DNNL_API dnnl_stream_attr_destroy ( dnnl_stream_attr_t  attr)

Destroys execution stream attributes.

Parameters
attrExecution stream attributes to destroy.
Returns
dnnl_success on success and a status describing the error otherwise.

◆ dnnl_stream_create()

dnnl_status_t DNNL_API dnnl_stream_create ( dnnl_stream_t stream,
dnnl_engine_t  engine,
unsigned  flags 
)

Creates an execution stream.

Parameters
streamOutput execution stream.
engineEngine to create the execution stream on.
flagsStream behavior flags (
See also
dnnl_stream_flags_t).
Returns
dnnl_success on success and a status describing the error otherwise.
Examples:
cnn_inference_f32.c, cpu_cnn_training_f32.c, and cross_engine_reorder.c.

◆ dnnl_stream_create_v2()

dnnl_status_t DNNL_API dnnl_stream_create_v2 ( dnnl_stream_t stream,
dnnl_engine_t  engine,
unsigned  flags,
const_dnnl_stream_attr_t  attr 
)

Creates an execution stream.

Parameters
streamOutput execution stream.
engineEngine to create the execution stream on.
flagsStream behavior flags (
See also
dnnl_stream_flags_t).
Parameters
attrStream attributes.
Returns
dnnl_success on success and a status describing the error otherwise.

◆ dnnl_stream_create_ocl()

dnnl_status_t DNNL_API dnnl_stream_create_ocl ( 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.

Parameters
streamOutput execution stream.
engineEngine to create the execution stream on.
queueOpenCL command queue to use.
Returns
dnnl_success on success and a status describing the error otherwise.

◆ dnnl_stream_get_ocl_command_queue()

dnnl_status_t DNNL_API dnnl_stream_get_ocl_command_queue ( dnnl_stream_t  stream,
cl_command_queue *  queue 
)

Returns the OpenCL command queue associated with an execution stream.

Parameters
streamExecution stream to query.
queueOutput OpenCL command queue.
Returns
dnnl_success on success and a status describing the error otherwise.

◆ dnnl_stream_wait()

dnnl_status_t DNNL_API dnnl_stream_wait ( dnnl_stream_t  stream)

Waits for all primitives in the execution stream to finish computations.

Parameters
streamExecution stream.
Returns
dnnl_success on success and a status describing the error otherwise.
Examples:
cnn_inference_f32.c, cpu_cnn_training_f32.c, and cross_engine_reorder.c.

◆ dnnl_stream_destroy()

dnnl_status_t DNNL_API dnnl_stream_destroy ( dnnl_stream_t  stream)

Destroys an execution stream.

Parameters
streamExecution stream to destroy.
Returns
dnnl_success on success and a status describing the error otherwise.
Examples:
cnn_inference_f32.c, cpu_cnn_training_f32.c, and cross_engine_reorder.c.