Stream

Overview

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

// typedefs

typedef struct dnnl_stream* dnnl_stream_t;
typedef const struct dnnl_stream* const_dnnl_stream_t;

// enums

enum dnnl_stream_flags_t;

// structs

struct dnnl_stream;
struct dnnl::stream;

// global functions

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

dnnl_status_t DNNL_API dnnl_stream_get_engine(
    const_dnnl_stream_t stream,
    dnnl_engine_t* engine
    );

dnnl_status_t DNNL_API dnnl_stream_wait(dnnl_stream_t stream);
dnnl_status_t DNNL_API dnnl_stream_destroy(dnnl_stream_t stream);

Detailed Documentation

An encapsulation of execution context tied to a particular engine.

See also:

Basic Concepts

Typedefs

typedef struct dnnl_stream* dnnl_stream_t

An execution stream handle.

typedef const struct dnnl_stream* const_dnnl_stream_t

A constant execution stream handle.

Global Functions

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

Creates an execution stream.

Parameters:

stream

Output execution stream.

engine

Engine to create the execution stream on.

flags

Stream behavior flags (

Returns:

dnnl_success on success and a status describing the error otherwise.

See also:

dnnl_stream_flags_t).

dnnl_status_t DNNL_API dnnl_stream_get_engine(
    const_dnnl_stream_t stream,
    dnnl_engine_t* engine
    )

Returns the engine of a stream object.

Parameters:

stream

Stream object.

engine

Output engine on which the stream is created.

Returns:

dnnl_success on success and a status describing the error otherwise.

dnnl_status_t DNNL_API dnnl_stream_wait(dnnl_stream_t stream)

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

Parameters:

stream

Execution stream.

Returns:

dnnl_success on success and a status describing the error otherwise.

dnnl_status_t DNNL_API dnnl_stream_destroy(dnnl_stream_t stream)

Destroys an execution stream.

Parameters:

stream

Execution stream to destroy.

Returns:

dnnl_success on success and a status describing the error otherwise.