.. index:: pair: struct; dnnl::reorder .. _doxid-structdnnl_1_1reorder: struct dnnl::reorder ==================== .. toctree:: :hidden: struct_dnnl_reorder_primitive_desc.rst Overview ~~~~~~~~ Reorder primitive. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include struct reorder: public :ref:`dnnl::primitive` { // structs struct :ref:`primitive_desc`; // construction :ref:`reorder`(); :ref:`reorder`(const :ref:`primitive_desc`& pd); :ref:`reorder`(const :ref:`primitive_desc`& pd, const std::vector& cache_blob); :ref:`reorder`( const :ref:`memory`& src, const :ref:`memory`& dst, const :ref:`primitive_attr`& attr = :ref:`primitive_attr`() ); // methods void :ref:`execute`(const :ref:`stream`& astream, :ref:`memory`& src, :ref:`memory`& dst) const; void :ref:`execute`(); }; Inherited Members ----------------- .. ref-code-block:: cpp :class: doxyrest-overview-inherited-code-block public: // enums enum :ref:`kind`; // 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:`const_dnnl_primitive_desc_t` :ref:`get_primitive_desc`() const; :ref:`kind` :ref:`get_kind`() const; std::vector :ref:`get_cache_blob`() const; void :ref:`execute`(const :ref:`stream`& astream, const std::unordered_map`>& args) const; :ref:`handle`(); :ref:`handle`(); :ref:`handle`(); :ref:`handle`(); .. _details-structdnnl_1_1reorder: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Reorder primitive. Construction ------------ .. index:: pair: function; reorder .. _doxid-structdnnl_1_1reorder_1ae964e269b4b2fc48b3f810ba5998d6a2: .. ref-code-block:: cpp :class: doxyrest-title-code-block reorder() Default constructor. Produces an empty object. .. index:: pair: function; reorder .. _doxid-structdnnl_1_1reorder_1a8052aeb588fa278d3e56ef85490b6690: .. ref-code-block:: cpp :class: doxyrest-title-code-block reorder(const :ref:`primitive_desc`& pd) Constructs a reorder primitive. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - pd - Primitive descriptor for reorder primitive. .. index:: pair: function; reorder .. _doxid-structdnnl_1_1reorder_1a6a1fdb6e178bfd3453c2478be306047f: .. ref-code-block:: cpp :class: doxyrest-title-code-block reorder(const :ref:`primitive_desc`& pd, const std::vector& cache_blob) Constructs a reorder primitive from a cache blob. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - pd - Primitive descriptor for reorder primitive. * - cache_blob - Cache blob. .. index:: pair: function; reorder .. _doxid-structdnnl_1_1reorder_1af04b380a824816defecb488a724bfb37: .. ref-code-block:: cpp :class: doxyrest-title-code-block reorder( const :ref:`memory`& src, const :ref:`memory`& dst, const :ref:`primitive_attr`& attr = :ref:`primitive_attr`() ) Constructs a reorder primitive that would reorder data between memory objects having the same memory descriptors as memory objects ``src`` and ``dst``. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - src - Source memory object. * - dst - Destination memory object. * - attr - Primitive attributes to use (optional). Methods ------- .. index:: pair: function; execute .. _doxid-structdnnl_1_1reorder_1ab9d5265274a13d4afa1fe33d784a1027: .. ref-code-block:: cpp :class: doxyrest-title-code-block void execute(const :ref:`stream`& astream, :ref:`memory`& src, :ref:`memory`& dst) const Executes the reorder primitive. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - astream - Stream object. The stream must belong to the same engine as the primitive. * - src - Source memory object. * - dst - Destination memory object. .. index:: pair: function; execute .. _doxid-structdnnl_1_1reorder_1a2c112f2449a18a87310dee2ecd8c64eb: .. ref-code-block:: cpp :class: doxyrest-title-code-block void execute() Executes computations specified by the primitive in a specified stream. Arguments are passed via an arguments map containing 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 :ref:`primitive_desc::query_md ` (:ref:`query::exec_arg_md `, index) unless using dynamic shapes (see :ref:`DNNL_RUNTIME_DIM_VAL `). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - astream - Stream object. The stream must belong to the same engine as the primitive. * - args - Arguments map.