struct dnnl::stream

Overview

An execution stream. More…

#include <dnnl.hpp>

struct stream: public dnnl::handle
{
    // enums

    enum flags;

    // construction

    stream();
    stream(const engine& aengine, flags aflags = flags::default_flags);

    // methods

    engine get_engine() const;
    stream& wait();
    handle();
    handle(const handle<T, traits>&);
    handle(handle<T, traits>&&);
    handle(T t, bool weak = false);
};

Inherited Members

public:
    // methods

    handle<T, traits>& operator = (const handle<T, traits>&);
    handle<T, traits>& operator = (handle<T, traits>&&);
    void reset(T t, bool weak = false);
    T get(bool allow_empty = false) const;
    operator T () const;
    operator bool () const;
    bool operator == (const handle<T, traits>& other) const;
    bool operator != (const handle& other) const;

Detailed Documentation

An execution stream.

Construction

stream()

Constructs an empty stream.

An empty stream cannot be used in any operations.

stream(const engine& aengine, flags aflags = flags::default_flags)

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

Parameters:

aengine

Engine to create the stream on.

aflags

Flags controlling stream behavior.

Methods

engine get_engine() const

Returns the associated engine.

stream& wait()

Waits for all primitives executing in the stream to finish.

Returns:

The stream itself.

handle()

Constructs an empty handle object.

Warning

Uninitialized object cannot be used in most library calls and is equivalent to a null pointer. Any attempt to use its methods, or passing it to the other library function, will cause an exception to be thrown.

handle(const handle<T, traits>&)

Copy constructor.

handle(handle<T, traits>&&)

Move constructor.

handle(T t, bool weak = false)

Constructs a handle wrapper object from a C API handle.

Parameters:

t

The C API handle to wrap.

weak

A flag specifying whether to construct a weak wrapper; defaults to false.