Utility Types and Definitions

struct error : public exception

The exception class.

struct dnnl::primitive_desc_base

Base class for all primitive descriptors.

Subclassed by dnnl::concat::primitive_desc, dnnl::primitive_desc, dnnl::reorder::primitive_desc, dnnl::sum::primitive_desc

Public Functions

primitive_desc_base()

Default constructor. Produces an empty object.

engine get_engine() const

Returns the engine of the primitive descriptor.

Return

The engine of the primitive descriptor.

const char *impl_info_str() const

Returns implementation name.

Return

The implementation name.

memory::dim query_s64(query what) const

Returns a memory::dim value (same as int64_t).

Return

The result of the query.

Parameters
  • what: The value to query.

memory::desc query_md(query what, int idx = 0) const

Returns a memory descriptor.

Note

There are also convenience methods dnnl::primitive_desc_base::src_desc(), dnnl::primitive_desc_base::dst_desc(), and others.

Return

The requested memory descriptor.

Return

A zero memory descriptor if the primitive does not have a parameter of the specified kind or index.

Parameters
  • what: The kind of parameter to query; can be dnnl::query::src_md, dnnl::query::dst_md, etc.

  • idx: Index of the parameter. For example, convolution bias can be queried with what = dnnl::query::weights_md and idx = 1.

memory::desc src_desc(int idx) const

Returns a source memory descriptor.

Return

Source memory descriptor.

Return

A zero memory descriptor if the primitive does not have a source parameter with index pdx.

Parameters
  • idx: Source index.

memory::desc dst_desc(int idx) const

Returns a destination memory descriptor.

Return

Destination memory descriptor.

Return

A zero memory descriptor if the primitive does not have a destination parameter with index pdx.

Parameters
  • idx: Destination index.

memory::desc weights_desc(int idx) const

Returns a weights memory descriptor.

Return

Weights memory descriptor.

Return

A zero memory descriptor if the primitive does not have a weights parameter with index pdx.

Parameters
  • idx: Weights index.

memory::desc diff_src_desc(int idx) const

Returns a diff source memory descriptor.

Return

Diff source memory descriptor.

Return

A zero memory descriptor if the primitive does not have a diff source parameter with index pdx.

Parameters
  • idx: Diff source index.

memory::desc diff_dst_desc(int idx) const

Returns a diff destination memory descriptor.

Return

Diff destination memory descriptor.

Return

A zero memory descriptor if the primitive does not have a diff destination parameter with index pdx.

Parameters
  • idx: Diff destination index.

memory::desc diff_weights_desc(int idx) const

Returns a diff weights memory descriptor.

Return

Diff weights memory descriptor.

Return

A zero memory descriptor if the primitive does not have a diff weights parameter with index pdx.

Parameters
  • idx: Diff weights index.

memory::desc src_desc() const

Returns a source memory descriptor.

Return

Source memory descriptor.

Return

A zero memory descriptor if the primitive does not have a source parameter.

memory::desc dst_desc() const

Returns a destination memory descriptor.

Return

Destination memory descriptor.

Return

A zero memory descriptor if the primitive does not have a destination parameter.

memory::desc weights_desc() const

Returns a weights memory descriptor.

Return

Weights memory descriptor.

Return

A zero memory descriptor if the primitive does not have a weights parameter.

memory::desc diff_src_desc() const

Returns a diff source memory descriptor.

Return

Diff source memory descriptor.

Return

A zero memory descriptor if the primitive does not have a diff source memory with.

memory::desc diff_dst_desc() const

Returns a diff destination memory descriptor.

Return

Diff destination memory descriptor.

Return

A zero memory descriptor if the primitive does not have a diff destination parameter.

memory::desc diff_weights_desc() const

Returns a diff weights memory descriptor.

Return

Diff weights memory descriptor.

Return

A zero memory descriptor if the primitive does not have a diff weights parameter.

memory::desc workspace_desc() const

Returns the workspace memory descriptor.

Return

Workspace memory descriptor.

Return

A zero memory descriptor if the primitive does not require workspace parameter.

memory::desc scratchpad_desc() const

Returns the scratchpad memory descriptor.

Return

scratchpad memory descriptor.

Return

A zero memory descriptor if the primitive does not require scratchpad parameter.

engine scratchpad_engine() const

Returns the engine on which the scratchpad memory is located.

Return

The engine on which the scratchpad memory is located.

primitive_attr get_primitive_attr() const

Returns the primitive attributes.

Return

The primitive attributes.

dnnl::primitive::kind get_kind() const

Returns the kind of the primitive descriptor.

Return

The kind of the primitive descriptor.

struct dnnl::rnn_primitive_desc_base : public dnnl::primitive_desc

Base class for primitive descriptors for RNN primitives.

Subclassed by dnnl::gru_backward::primitive_desc, dnnl::gru_forward::primitive_desc, dnnl::lbr_gru_backward::primitive_desc, dnnl::lbr_gru_forward::primitive_desc, dnnl::lstm_backward::primitive_desc, dnnl::lstm_forward::primitive_desc, dnnl::vanilla_rnn_backward::primitive_desc, dnnl::vanilla_rnn_forward::primitive_desc

Public Functions

rnn_primitive_desc_base()

Default constructor. Produces an empty object.

memory::desc src_layer_desc() const

Returns source layer memory descriptor.

Return

Source layer memory descriptor.

memory::desc src_iter_desc() const

Returns source iteration memory descriptor.

Return

Source iteration memory descriptor.

Return

A zero memory descriptor if the primitive does not have a source iteration parameter.

memory::desc src_iter_c_desc() const

Returns source recurrent cell state memory descriptor.

Return

Source recurrent cell state memory descriptor.

memory::desc weights_layer_desc() const

Returns weights layer memory descriptor.

Return

Weights layer memory descriptor.

memory::desc weights_iter_desc() const

Returns weights iteration memory descriptor.

Return

Weights iteration memory descriptor.

memory::desc bias_desc() const

Returns bias memory descriptor.

Return

Bias memory descriptor.

Return

A zero memory descriptor if the primitive does not have a bias parameter.

memory::desc dst_layer_desc() const

Returns destination layer memory descriptor.

Return

Destination layer memory descriptor.

memory::desc dst_iter_desc() const

Returns destination iteration memory descriptor.

Return

Destination iteration memory descriptor.

Return

A zero memory descriptor if the primitive does not have a destination iteration parameter.

memory::desc dst_iter_c_desc() const

Returns destination recurrent cell state memory descriptor.

Return

Destination recurrent cell state memory descriptor.

memory::desc diff_src_layer_desc() const

Returns diff source layer memory descriptor.

Return

Diff source layer memory descriptor.

memory::desc diff_src_iter_desc() const

Returns diff source iteration memory descriptor.

Return

Diff source iteration memory descriptor.

Return

A zero memory descriptor if the primitive does not have a diff source iteration parameter.

memory::desc diff_src_iter_c_desc() const

Returns diff source recurrent cell state memory descriptor.

Return

Diff source recurrent cell state memory descriptor.

memory::desc diff_weights_layer_desc() const

Returns diff weights layer memory descriptor.

Return

Diff weights layer memory descriptor.

memory::desc diff_weights_iter_desc() const

Returns diff weights iteration memory descriptor.

Return

Diff weights iteration memory descriptor.

memory::desc diff_bias_desc() const

Returns diff bias memory descriptor.

Return

Diff bias memory descriptor.

Return

A zero memory descriptor if the primitive does not have a diff bias parameter.

memory::desc diff_dst_layer_desc() const

Returns diff destination layer memory descriptor.

Return

Diff destination layer memory descriptor.

memory::desc diff_dst_iter_desc() const

Returns diff destination iteration memory descriptor.

Return

Diff destination iteration memory descriptor.

Return

A zero memory descriptor if the primitive does not have a diff destination iteration parameter.

memory::desc diff_dst_iter_c_desc() const

Returns diff destination recurrent cell state memory descriptor.

Return

Diff destination recurrent cell state memory descriptor.