oneAPI Deep Neural Network Library (oneDNN)  1.6.0
Performance library for Deep Learning
Public Member Functions | List of all members
dnnl::stream_attr Struct Reference

A container for stream attributes. More...

#include <dnnl.hpp>

Inheritance diagram for dnnl::stream_attr:
Inheritance graph
[legend]
Collaboration diagram for dnnl::stream_attr:
Collaboration graph
[legend]

Public Member Functions

 stream_attr ()=default
 Constructs default (empty) stream attributes.
 
 stream_attr (engine::kind akind)
 Constructs stream attributes for a stream that runs on an engine of a particular kind. More...
 
void set_threadpool (threadpool_iface *threadpool)
 Sets the threadpool attribute. More...
 
threadpool_ifaceget_threadpool ()
 Returns the threadpool attribute. 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_attr_t >
bool operator== (const handle< dnnl_stream_attr_t, handle_traits< dnnl_stream_attr_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_attr_t, handle_traits< dnnl_stream_attr_t > > &)=default
 Copy constructor.
 
 handle (handle< dnnl_stream_attr_t, handle_traits< dnnl_stream_attr_t > > &&)=default
 Move constructor.
 
 handle (dnnl_stream_attr_t t, bool weak=false)
 Constructs a handle wrapper object from a C API handle. More...
 
handle< dnnl_stream_attr_t, handle_traits< dnnl_stream_attr_t > > & operator= (const handle< dnnl_stream_attr_t, handle_traits< dnnl_stream_attr_t > > &)=default
 Assignment operator.
 
handle< dnnl_stream_attr_t, handle_traits< dnnl_stream_attr_t > > & operator= (handle< dnnl_stream_attr_t, handle_traits< dnnl_stream_attr_t > > &&)=default
 Move assignment operator.
 
void reset (dnnl_stream_attr_t t, bool weak=false)
 Resets the handle wrapper objects to wrap a new C API handle. More...
 
dnnl_stream_attr_t get (bool allow_empty=false) const
 Returns the underlying C API handle. More...
 
 operator dnnl_stream_attr_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

A container for stream attributes.

Constructor & Destructor Documentation

◆ stream_attr()

dnnl::stream_attr::stream_attr ( engine::kind  akind)
inline

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

Parameters
akindTarget engine kind.

Member Function Documentation

◆ set_threadpool()

void dnnl::stream_attr::set_threadpool ( threadpool_iface threadpool)
inline

Sets the threadpool attribute.

Always throws unless oneDNN is built with threadpool runtime.

See also
Using oneDNN with threadpool-based threading
Parameters
threadpoolA pointer to an instance of a class that implements the dnnl::threadpool_iface interface.

◆ get_threadpool()

threadpool_iface* dnnl::stream_attr::get_threadpool ( )
inline

Returns the threadpool attribute.

Always throws unless oneDNN is built with threadpool runtime.

See also
Using oneDNN with threadpool-based threading

◆ 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: