.. index:: pair: struct; dnnl::reorder::primitive_desc .. _doxid-structdnnl_1_1reorder_1_1primitive__desc: struct dnnl::reorder::primitive_desc ==================================== .. toctree:: :hidden: Overview ~~~~~~~~ Primitive descriptor for a reorder primitive. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include struct primitive_desc: public :ref:`dnnl::primitive_desc_base` { // construction :ref:`primitive_desc`(); :ref:`primitive_desc`( const :ref:`engine`& src_engine, const :ref:`memory::desc`& src_md, const :ref:`engine`& dst_engine, const :ref:`memory::desc`& dst_md, const :ref:`primitive_attr`& attr = :ref:`default_attr`(), bool allow_empty = false ); :ref:`primitive_desc`( const :ref:`memory`& src, const :ref:`memory`& dst, const :ref:`primitive_attr`& attr = :ref:`default_attr`(), bool allow_empty = false ); :ref:`primitive_desc`(:ref:`dnnl_primitive_desc_t` pd); // methods :ref:`engine` :ref:`get_src_engine`() const; :ref:`engine` :ref:`get_dst_engine`() const; :ref:`memory::desc` :ref:`src_desc`() const; :ref:`memory::desc` :ref:`dst_desc`() const; :ref:`primitive_desc_base`(); :ref:`primitive_desc_base`(); :ref:`primitive_desc_base`(); :ref:`primitive_desc_base`(); }; Inherited Members ----------------- .. ref-code-block:: cpp :class: doxyrest-overview-inherited-code-block public: // methods :ref:`handle`& :ref:`operator =` (const :ref:`handle`&); :ref:`handle`& :ref:`operator =` (:ref:`handle`&&); void :ref:`reset`(T t, bool weak = false); T :ref:`get`(bool allow_empty = false) const; :ref:`operator T` () const; :ref:`operator bool` () const; bool :ref:`operator ==` (const :ref:`handle`& other) const; bool :ref:`operator !=` (const :ref:`handle`& other) const; :ref:`engine` :ref:`get_engine`() const; const char* :ref:`impl_info_str`() const; :ref:`memory::dim` :ref:`query_s64`(:ref:`query` what) const; :ref:`memory::dims` :ref:`get_strides`() const; :ref:`memory::dims` :ref:`get_dilations`() const; :ref:`memory::dims` :ref:`get_padding_l`() const; :ref:`memory::dims` :ref:`get_padding_r`() const; float :ref:`get_epsilon`() const; template T :ref:`get_flags`() const; :ref:`dnnl::algorithm` :ref:`get_algorithm`() const; float :ref:`get_alpha`() const; float :ref:`get_beta`() const; int :ref:`get_axis`() const; :ref:`memory::dim` :ref:`get_local_size`() const; float :ref:`get_k`() const; float :ref:`get_p`() const; std::vector :ref:`get_factors`() const; :ref:`dnnl::algorithm` :ref:`get_cell_kind`() const; :ref:`dnnl::rnn_direction` :ref:`get_direction`() const; :ref:`dnnl::algorithm` :ref:`get_activation_kind`() const; :ref:`memory::dims` :ref:`get_kernel`() const; :ref:`memory::dim` :ref:`get_group_size`() const; :ref:`dnnl::prop_kind` :ref:`get_prop_kind`() const; :ref:`memory::desc` :ref:`query_md`(:ref:`query` what, int idx = 0) const; :ref:`memory::desc` :ref:`src_desc`(int idx) const; :ref:`memory::desc` :ref:`dst_desc`(int idx) const; :ref:`memory::desc` :ref:`weights_desc`(int idx) const; :ref:`memory::desc` :ref:`diff_src_desc`(int idx) const; :ref:`memory::desc` :ref:`diff_dst_desc`(int idx) const; :ref:`memory::desc` :ref:`diff_weights_desc`(int idx) const; :ref:`memory::desc` :ref:`src_desc`() const; :ref:`memory::desc` :ref:`dst_desc`() const; :ref:`memory::desc` :ref:`weights_desc`() const; :ref:`memory::desc` :ref:`diff_src_desc`() const; :ref:`memory::desc` :ref:`diff_dst_desc`() const; :ref:`memory::desc` :ref:`diff_weights_desc`() const; :ref:`memory::desc` :ref:`workspace_desc`() const; :ref:`memory::desc` :ref:`scratchpad_desc`() const; :ref:`engine` :ref:`scratchpad_engine`() const; :ref:`primitive_attr` :ref:`get_primitive_attr`() const; :ref:`dnnl::primitive::kind` :ref:`get_kind`() const; std::vector :ref:`get_cache_blob_id`() const; .. _details-structdnnl_1_1reorder_1_1primitive__desc: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Primitive descriptor for a reorder primitive. Construction ------------ .. index:: pair: function; primitive_desc .. _doxid-structdnnl_1_1reorder_1_1primitive__desc_1aa2e7684d9dacd42d7d4a4bdc30df8786: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc() Default constructor. Produces an empty object. .. index:: pair: function; primitive_desc .. _doxid-structdnnl_1_1reorder_1_1primitive__desc_1ad4599b5c274ded3b421ae9e0c78bdaf7: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc( const :ref:`engine`& src_engine, const :ref:`memory::desc`& src_md, const :ref:`engine`& dst_engine, const :ref:`memory::desc`& dst_md, const :ref:`primitive_attr`& attr = :ref:`default_attr`(), bool allow_empty = false ) Constructs a primitive descriptor for reorder primitive. .. note:: If ``allow_empty`` is true, the constructor does not throw if a primitive descriptor cannot be created. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - src_engine - Engine on which the source memory object will be located. * - src_md - Source memory descriptor. * - dst_engine - Engine on which the destination memory object will be located. * - dst_md - Destination memory descriptor. * - attr - Primitive attributes to use. Attributes are optional and default to empty attributes. * - allow_empty - A flag signifying whether construction is allowed to fail without throwing an exception. In this case an empty object will be produced. This flag is optional and defaults to false. .. index:: pair: function; primitive_desc .. _doxid-structdnnl_1_1reorder_1_1primitive__desc_1a5214b626787ce7ca3b78360b22495d83: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc( const :ref:`memory`& src, const :ref:`memory`& dst, const :ref:`primitive_attr`& attr = :ref:`default_attr`(), bool allow_empty = false ) Constructs a primitive descriptor for reorder primitive. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - src - Source memory object. It is used to obtain the source memory descriptor and engine. * - dst - Destination memory object. It is used to obtain the destination memory descriptor and engine. * - attr - Primitive attributes to use. Attributes are optional and default to empty attributes. * - allow_empty - A flag signifying whether construction is allowed to fail without throwing an exception. In this case an empty object will be produced. This flag is optional and defaults to false. .. index:: pair: function; primitive_desc .. _doxid-structdnnl_1_1reorder_1_1primitive__desc_1a546b5b12a7524f0651ff58e6d5f1c831: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc(:ref:`dnnl_primitive_desc_t` pd) Constructs a primitive descriptor for reorder primitive from a C API primitive descriptor which must have a matching kind. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - pd - C API primitive descriptor for reorder primitive. Methods ------- .. index:: pair: function; get_src_engine .. _doxid-structdnnl_1_1reorder_1_1primitive__desc_1a3793240346a9e432cfa8364eacbc3fac: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`engine` get_src_engine() const Returns the engine on which the source memory is allocated. .. rubric:: Returns: The engine on which the source memory is allocated. .. index:: pair: function; get_dst_engine .. _doxid-structdnnl_1_1reorder_1_1primitive__desc_1a6667395ce77d7c4651d8d9d11dae4a4b: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`engine` get_dst_engine() const Returns the engine on which the destination memory is allocated. .. rubric:: Returns: The engine on which the destination memory is allocated. .. index:: pair: function; src_desc .. _doxid-structdnnl_1_1reorder_1_1primitive__desc_1a07491b1aa7302a3d43ecb0671d9a6cd5: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` src_desc() const Returns a source memory descriptor. .. rubric:: Returns: Source memory descriptor. A zero memory descriptor if the primitive does not have a source parameter. .. index:: pair: function; dst_desc .. _doxid-structdnnl_1_1reorder_1_1primitive__desc_1ab167220e0773c3e8a66782ad62aef373: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` dst_desc() const Returns a destination memory descriptor. .. rubric:: Returns: Destination memory descriptor. A zero memory descriptor if the primitive does not have a destination parameter. .. index:: pair: function; primitive_desc_base .. _doxid-structdnnl_1_1reorder_1_1primitive__desc_1a27780142d0880bb0ca678f7c5a1845b9: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc_base() Default constructor. Produces an empty object. .. index:: pair: function; primitive_desc_base .. _doxid-structdnnl_1_1reorder_1_1primitive__desc_1aae07f2f06d74537546c3056bd305dfbe: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc_base() Constructs a primitive descriptor base object from a clone of a C API primitive descriptor after verifying that it is what the caller expects. .. note:: The ``prim_kind`` should map to a primitive that does not have different values of propagation kind (e.g. :ref:`dnnl::binary `). .. note:: Primitive descriptor base constructed this way does not support next_impl() (will throw). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - pd - C API primitive descriptor to clone. * - prim_kind - Expected primitive kind. .. index:: pair: function; primitive_desc_base .. _doxid-structdnnl_1_1reorder_1_1primitive__desc_1af4eac2eea0fd4eb37c0c90ead14ad52b: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc_base() Constructs a primitive descriptor base object from a clone of a C API primitive descriptor after verifying that it is what the caller expects. .. note:: Primitive descriptor base constructed this way does not support next_impl() (will throw). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - pd - C API primitive descriptor to clone. * - prim_kind - Expected primitive kind. * - aprop_kind - Expected propagation kind. .. index:: pair: function; primitive_desc_base .. _doxid-structdnnl_1_1reorder_1_1primitive__desc_1aa4853f3190cac45b653e510b6eeed97a: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc_base() Constructs a primitive descriptor base object from a clone of a C API primitive descriptor after verifying that it is what the caller expects. .. note:: Primitive descriptor base constructed this way does not support next_impl() (will throw). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - pd - C API primitive descriptor to clone. * - prim_kind - Expected primitive kind. * - prop_kind1 - Expected propagation kind (option 1). * - prop_kind2 - Expected propagation kind (option 2). This value is checked if the check with ``prop_kind1`` fails.