A stream is an encapsulation of execution context tied to a particular engine.

struct dnnl::stream_attr : public handle<dnnl_stream_attr_t>

A container for stream attributes.

Public Functions


Constructs default (empty) stream attributes.

stream_attr(engine::kind kind)

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

  • kind: Target engine kind.

struct dnnl::stream

An execution stream.

Public Types

enum flags

Stream flags. Can be combined using the bitwise OR operator.


enumerator default_order

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

enumerator in_order

In-order execution.

enumerator out_of_order

Out-of-order execution.

enumerator default_flags

Default stream configuration.

Public Functions


Constructs an empty stream. An empty stream cannot be used in any operations.

stream(const engine &engine, flags flags = flags::default_flags, const stream_attr &attr = stream_attr())

Constructs a stream for the specified engine and with behavior controlled by the specified flags.

  • engine: Engine to create the stream on.

  • flags: Flags controlling stream behavior.

  • attr: Stream attributes.

stream(const engine &engine, cl::sycl::queue &queue)

Constructs a stream for the specified engine and the SYCL queue.

  • engine: Engine object to use for the stream.

  • queue: SYCL queue to use for the stream.

cl::sycl::queue get_sycl_queue() const

Returns the underlying SYCL queue object.


SYCL queue object.

stream &wait()

Waits for all primitives executing in the stream to finish.


The stream itself.