oneAPI Deep Neural Network Library (oneDNN)  1.4.0
Performance library for Deep Learning
Loading...
Searching...
No Matches
dnnl::stream Struct Reference

An execution stream. More...

#include <dnnl.hpp>

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

Public Types

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

Public Member Functions

 stream ()=default
 Constructs an empty stream.
 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.
 stream (const engine &engine, cl_command_queue queue)
 Constructs a stream for the specified engine and the OpenCL queue.
cl_command_queue get_ocl_command_queue () const
 Returns the underlying OpenCL queue object.
streamwait ()
 Waits for all primitives executing in the stream to finish.
 handle ()=default
 Constructs an empty handle object.
 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.
Public Member Functions inherited from dnnl::handle< dnnl_stream_t >
 handle ()=default
 Constructs an empty handle object.
handle< dnnl_stream_t, handle_traits< dnnl_stream_t > > & operator= (const handle< dnnl_stream_t, handle_traits< dnnl_stream_t > > &)=default
 Assignment operator.
void reset (dnnl_stream_t t, bool weak=false)
 Resets the handle wrapper objects to wrap a new C API handle.
dnnl_stream_t get (bool allow_empty=false) const
 Returns the underlying C API handle.
 operator dnnl_stream_t () const
 Converts a handle to the underlying C API handle type.
 operator bool () const
 Checks whether the object is empty.

Detailed Description

Member Enumeration Documentation

◆ flags

enum class dnnl::stream::flags : unsigned
strong

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.

in_order 

In-order execution.

out_of_order 

Out-of-order execution.

default_flags 

Default stream configuration.

Constructor & Destructor Documentation

◆ stream() [1/3]

dnnl::stream::stream ( )
default

Constructs an empty stream.

An empty stream cannot be used in any operations.

◆ stream() [2/3]

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

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

Parameters
engineEngine to create the stream on.
flagsFlags controlling stream behavior.
attrStream attributes.

◆ stream() [3/3]

dnnl::stream::stream ( const engine & engine,
cl_command_queue queue )
inline

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

Parameters
engineEngine to create the stream on.
queueOpenCL queue to use for the stream.

Member Function Documentation

◆ get_ocl_command_queue()

cl_command_queue dnnl::stream::get_ocl_command_queue ( ) const
inline

Returns the underlying OpenCL queue object.

Returns
OpenCL queue.

◆ 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 ( T t,
bool weak = false )
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: