.. index:: pair: struct; dnnl::sum::primitive_desc .. _doxid-structdnnl_1_1sum_1_1primitive__desc: struct dnnl::sum::primitive_desc ================================ .. toctree:: :hidden: Overview ~~~~~~~~ Primitive descriptor for a sum 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:`memory::desc`& dst, const std::vector& scales, const std::vector<:ref:`memory::desc`>& srcs, const :ref:`engine`& aengine, const primitive_attr& attr = primitive_attr() ); :ref:`primitive_desc`( const std::vector& scales, const std::vector<:ref:`memory::desc`>& srcs, const :ref:`engine`& aengine, const primitive_attr& attr = primitive_attr() ); :ref:`primitive_desc`(:ref:`dnnl_primitive_desc_t` pd); // methods :ref:`memory::desc` :ref:`src_desc`(int idx = 0) 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::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; primitive_attr :ref:`get_primitive_attr`() const; :ref:`dnnl::primitive::kind` :ref:`get_kind`() const; .. _details-structdnnl_1_1sum_1_1primitive__desc: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Primitive descriptor for a sum primitive. Construction ------------ .. index:: pair: function; primitive_desc .. _doxid-structdnnl_1_1sum_1_1primitive__desc_1a2710757f8e776fb3988c41ec101bd1ea: .. 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_1sum_1_1primitive__desc_1a4f4275779d85cc2003830cb0e8f4f657: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc( const :ref:`memory::desc`& dst, const std::vector& scales, const std::vector<:ref:`memory::desc`>& srcs, const :ref:`engine`& aengine, const primitive_attr& attr = primitive_attr() ) Constructs a primitive descriptor for a sum primitive. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - dst - Destination memory descriptor. * - scales - Vector of scales to multiply data in each source memory by. * - srcs - Vector of source memory descriptors. * - aengine - Engine to perform the operation on. * - attr - Primitive attributes to use (optional). .. index:: pair: function; primitive_desc .. _doxid-structdnnl_1_1sum_1_1primitive__desc_1aa6823168a1dcaf4a47d2ec59063156c6: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc( const std::vector& scales, const std::vector<:ref:`memory::desc`>& srcs, const :ref:`engine`& aengine, const primitive_attr& attr = primitive_attr() ) Constructs a primitive descriptor for a sum primitive. This version derives the destination memory descriptor automatically. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - scales - Vector of scales by which to multiply data in each source memory object. * - srcs - Vector of source memory descriptors. * - aengine - Engine on which to perform the operation. * - attr - Primitive attributes to use (optional). .. index:: pair: function; primitive_desc .. _doxid-structdnnl_1_1sum_1_1primitive__desc_1aeeed702d1ff4a01b98432b3bacffaae2: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc(:ref:`dnnl_primitive_desc_t` pd) Constructs a primitive descriptor for sum 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; src_desc .. _doxid-structdnnl_1_1sum_1_1primitive__desc_1a27db7c274a1c459edc5666e7e8ff8bcc: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` src_desc(int idx = 0) const Returns a source memory descriptor. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - idx - Source index. .. rubric:: Returns: Source memory descriptor. A zero memory descriptor if the primitive does not have a source parameter with index ``idx``. .. index:: pair: function; dst_desc .. _doxid-structdnnl_1_1sum_1_1primitive__desc_1a0d43b4a7a2d2d14633fd90fb3be310b6: .. 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_1sum_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_1sum_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_1sum_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_1sum_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.