|
| | handle ()=default |
| | Constructs an empty handle object.
|
|
| handle (const handle< T, traits > &)=default |
| | Copy constructor.
|
|
handle< T, traits > & | operator= (const handle< T, traits > &)=default |
| | Assignment operator.
|
|
| handle (handle< T, traits > &&)=default |
| | Move constructor.
|
|
handle< T, traits > & | operator= (handle< T, traits > &&)=default |
| | Move assignment operator.
|
| | handle (T t, bool weak=false) |
| | Constructs a handle wrapper object from a C API handle.
|
| void | reset (T t, bool weak=false) |
| | Resets the handle wrapper objects to wrap a new C API handle.
|
| T | get (bool allow_empty=false) const |
| | Returns the underlying C API handle.
|
| | operator T () const |
| | Converts a handle to the underlying C API handle type.
|
| | operator bool () const |
| | Checks whether the object is empty.
|
| bool | operator== (const handle< T, traits > &other) const |
| | Equality operator.
|
| bool | operator!= (const handle &other) const |
| | Inequality operator.
|
template<typename T, typename traits = handle_traits<T>>
struct dnnl::handle< T, traits >
oneDNN C API handle wrapper class.
This class is used as the base class for primitive (dnnl::primitive), engine (dnnl::engine), and stream (dnnl::stream) classes, as well as others. An object of the dnnl::handle class can be passed by value.
A handle can be weak, in which case it follows std::weak_ptr semantics. Otherwise, it follows std::shared_ptr semantics.
- Note
- The implementation stores oneDNN C API handles in a std::shared_ptr with deleter set to a dummy function in the weak mode.