Base class for all computational primitives. More...
#include <dnnl.hpp>


Public Types | |
| enum class | kind |
| Kinds of primitives supported by the library. More... | |
Public Member Functions | |
| primitive ()=default | |
| Default constructor. Constructs an empty object. | |
| primitive (const_dnnl_primitive_desc_t c_pd) | |
| Constructs a primitive from a C API primitive descriptor. | |
| primitive (const primitive_desc &pd) | |
| Constructs a primitive from a primitive descriptor. | |
| const_dnnl_primitive_desc_t | get_primitive_desc () const |
| Returns the C API primitive descriptor of the underlying C API primitive. | |
| kind | get_kind () const |
| Returns the kind of the primitive. | |
| void | execute (const stream &stream, const std::unordered_map< int, memory > &args) const |
| Executes computations specified by the primitive in a specified stream. | |
| 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_primitive_t > | |
| handle ()=default | |
| Constructs an empty handle object. | |
| handle< dnnl_primitive_t, handle_traits< dnnl_primitive_t > > & | operator= (const handle< dnnl_primitive_t, handle_traits< dnnl_primitive_t > > &)=default |
| Assignment operator. | |
| void | reset (dnnl_primitive_t t, bool weak=false) |
| Resets the handle wrapper objects to wrap a new C API handle. | |
| dnnl_primitive_t | get (bool allow_empty=false) const |
| Returns the underlying C API handle. | |
| operator dnnl_primitive_t () const | |
| Converts a handle to the underlying C API handle type. | |
| operator bool () const | |
| Checks whether the object is empty. | |
Base class for all computational primitives.
|
strong |
Kinds of primitives supported by the library.
| dnnl::primitive::primitive | ( | const_dnnl_primitive_desc_t | c_pd | ) |
Constructs a primitive from a C API primitive descriptor.
| c_pd | C API primitive descriptor. |
| dnnl::primitive::primitive | ( | const primitive_desc & | pd | ) |
Constructs a primitive from a primitive descriptor.
| pd | Primitive descriptor. |
| void dnnl::primitive::execute | ( | const stream & | stream, |
| const std::unordered_map< int, memory > & | args ) const |
Executes computations specified by the primitive in a specified stream.
Arguments are passed via an arguments map containing <index, memory object> pairs. The index must be one of the DNNL_ARG_* values such as DNNL_ARG_SRC, and the memory must have a memory descriptor matching the one returned by primitive_desc::query_md(query::exec_arg_md, index) unless using dynamic shapes (see DNNL_RUNTIME_DIM_VAL).
| stream | Stream object. The stream must belong to the same engine as the primitive. |
| args | Arguments map. |
|
default |
Constructs an empty handle object.
|
inlineexplicit |
Constructs a handle wrapper object from a C API handle.
| t | The C API handle to wrap. |
| weak | A flag specifying whether to construct a weak wrapper; defaults to false. |