oneAPI Deep Neural Network Library (oneDNN)
Performance library for Deep Learning
1.96.0
dnnl::stream Struct Reference

An execution stream. More...

#include <dnnl.hpp>

Inheritance diagram for dnnl::stream:
Collaboration diagram for dnnl::stream:

Public Types

enum  flags : unsigned
 Stream flags. Can be combined using the bitwise OR operator. More...
 

Public Member Functions

 stream ()=default
 Constructs an empty stream. More...
 
 stream (const engine &aengine, flags aflags=flags::default_flags)
 Constructs a stream for the specified engine and with behavior controlled by the specified flags. More...
 
engine get_engine () const
 Returns the associated engine.
 
streamwait ()
 Waits for all primitives executing in the stream to finish. More...
 
 handle ()=default
 Constructs an empty handle object. More...
 
 handle (const handle< T, traits > &)=default
 Copy constructor.
 
 handle (handle< T, traits > &&)=default
 Move constructor.
 
 handle (T t, bool weak=false)
 Constructs a handle wrapper object from a C API handle. More...
 
- Public Member Functions inherited from dnnl::handle< dnnl_stream_t >
bool operator== (const handle< dnnl_stream_t, handle_traits< dnnl_stream_t > > &other) const
 Equality operator. More...
 
bool operator!= (const handle &other) const
 Inequality operator. More...
 
 handle ()=default
 Constructs an empty handle object. More...
 
 handle (const handle< dnnl_stream_t, handle_traits< dnnl_stream_t > > &)=default
 Copy constructor.
 
 handle (handle< dnnl_stream_t, handle_traits< dnnl_stream_t > > &&)=default
 Move constructor.
 
 handle (dnnl_stream_t t, bool weak=false)
 Constructs a handle wrapper object from a C API handle. More...
 
handle< dnnl_stream_t, handle_traits< dnnl_stream_t > > & operator= (const handle< dnnl_stream_t, handle_traits< dnnl_stream_t > > &)=default
 Assignment operator.
 
handle< dnnl_stream_t, handle_traits< dnnl_stream_t > > & operator= (handle< dnnl_stream_t, handle_traits< dnnl_stream_t > > &&)=default
 Move assignment operator.
 
void reset (dnnl_stream_t t, bool weak=false)
 Resets the handle wrapper objects to wrap a new C API handle. More...
 
dnnl_stream_t get (bool allow_empty=false) const
 Returns the underlying C API handle. More...
 
 operator dnnl_stream_t () const
 Converts a handle to the underlying C API handle type. More...
 
 operator bool () const
 Checks whether the object is not empty. More...
 

Detailed Description

Member Enumeration Documentation

◆ flags

enum dnnl::stream::flags : unsigned
strong

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

Enumerator
in_order 

In-order execution.

out_of_order 

Out-of-order execution.

default_flags 

Default stream configuration.

Constructor & Destructor Documentation

◆ stream() [1/2]

dnnl::stream::stream ( )
default

Constructs an empty stream.

An empty stream cannot be used in any operations.

◆ stream() [2/2]

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

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

Parameters
aengineEngine to create the stream on.
aflagsFlags controlling stream behavior.

Member Function Documentation

◆ wait()

◆ handle() [1/2]

dnnl::handle< T, traits >::handle
default

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() [2/2]

dnnl::handle< T, traits >::handle
inlineexplicit

Constructs a handle wrapper object from a C API handle.

Parameters
tThe C API handle to wrap.
weakA flag specifying whether to construct a weak wrapper; defaults to false.

The documentation for this struct was generated from the following file: