A class for wrapping an Intel(R) MKL-DNN handle. It is used as the base class for primitive (mkldnn_primitive_t), engine (mkldnn_engine_t), and stream (mkldnn_stream_t) handles. An object of the mkldnn::handle class can be passed by value. This class enables wrapping:
More...
#include <mkldnn.hpp>
template<typename T, typename traits = handle_traits<T>>
class mkldnn::handle< T, traits >
A class for wrapping an Intel(R) MKL-DNN handle. It is used as the base class for primitive (mkldnn_primitive_t), engine (mkldnn_engine_t), and stream (mkldnn_stream_t) handles. An object of the mkldnn::handle class can be passed by value. This class enables wrapping:
- Newly constructed handles.
In this case, the constructed handle uses reference counting provided by std::shared_ptr
with a proper deleter function specified through the handle_traits
class.
- Pre-existing handles returned by the Intel(R) MKL-DNN C API (for example, through mkldnn_primitive_get_output()).
In this case, an Intel(R) MKL-DNN C API handle is wrapped without a deleter because it is assumed that the handle wrapper for the original object deletes the handle (this model is similar to std::weak_ptr
).
◆ handle() [1/2]
template<typename T, typename traits = handle_traits<T>>
Constructs a C handle wrapper.
- Parameters
-
t | The C handle to wrap. |
weak | A flag to specify whether to construct a weak wrapper. |
◆ handle() [2/2]
template<typename T, typename traits = handle_traits<T>>
◆ operator==() [1/2]
template<typename T, typename traits = handle_traits<T>>
◆ operator!=() [1/2]
template<typename T, typename traits = handle_traits<T>>
◆ operator=()
template<typename T, typename traits = handle_traits<T>>
◆ reset()
template<typename T, typename traits = handle_traits<T>>
Resets the value of a C handle.
- Parameters
-
t | The new value of the C handle. |
weak | A flag to specify whether the wrapper should be weak. |
◆ get()
template<typename T, typename traits = handle_traits<T>>
Returns the value of the underlying C handle.
◆ operator==() [2/2]
template<typename T, typename traits = handle_traits<T>>
◆ operator!=() [2/2]
template<typename T, typename traits = handle_traits<T>>
The documentation for this class was generated from the following file: