.. index:: pair: struct; dnnl::binary::primitive_desc .. _doxid-structdnnl_1_1binary_1_1primitive__desc: struct dnnl::binary::primitive_desc =================================== .. toctree:: :hidden: Overview ~~~~~~~~ Primitive descriptor for an elementwise binary operator primitive. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include struct primitive_desc: public :ref:`dnnl::primitive_desc` { // construction :ref:`primitive_desc`(); :ref:`primitive_desc`( const :ref:`desc`& adesc, const :ref:`engine`& aengine, bool allow_empty = false ); :ref:`primitive_desc`( const :ref:`desc`& adesc, const primitive_attr& attr, const :ref:`engine`& aengine, bool allow_empty = false ); :ref:`primitive_desc`(:ref:`dnnl_primitive_desc_t` pd); // methods :ref:`memory::desc` :ref:`src_desc`(int idx = 0) const; :ref:`memory::desc` :ref:`src0_desc`() const; :ref:`memory::desc` :ref:`src1_desc`() const; :ref:`memory::desc` :ref:`dst_desc`() const; }; 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; bool :ref:`next_impl`(); :ref:`primitive_desc_base`(); :ref:`primitive_desc_base`(); :ref:`primitive_desc_base`(); :ref:`primitive_desc_base`(); .. _details-structdnnl_1_1binary_1_1primitive__desc: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Primitive descriptor for an elementwise binary operator primitive. Construction ------------ .. index:: pair: function; primitive_desc .. _doxid-structdnnl_1_1binary_1_1primitive__desc_1a99e0ed1bc3cf3d6754ea737a487a9ecd: .. 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_1binary_1_1primitive__desc_1aff62ff34e4c4ff6a6003d5b8444b207c: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc( const :ref:`desc`& adesc, const :ref:`engine`& aengine, bool allow_empty = false ) Constructs a primitive descriptor for an elementwise binary operator primitive. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - adesc - Descriptor for an elementwise binary operator primitive. * - aengine - Engine to use. * - 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_1binary_1_1primitive__desc_1a65e6290e4f4aa68eb6ca3c3789b7846a: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc( const :ref:`desc`& adesc, const primitive_attr& attr, const :ref:`engine`& aengine, bool allow_empty = false ) Constructs a primitive descriptor for an elementwise binary operator primitive. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - adesc - Descriptor for an elementwise binary operator primitive. * - aengine - Engine to use. * - attr - Primitive attributes to use. * - 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_1binary_1_1primitive__desc_1abd064a6e1d78d2452611ea45b25c1105: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc(:ref:`dnnl_primitive_desc_t` pd) Constructs a primitive descriptor for a binary primitive from a C API primitive descriptor that must have a matching kind. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - pd - C API primitive descriptor for a binary primitive. Methods ------- .. index:: pair: function; src_desc .. _doxid-structdnnl_1_1binary_1_1primitive__desc_1a69618bf51de3aab412db31dffa8784b3: .. 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; src0_desc .. _doxid-structdnnl_1_1binary_1_1primitive__desc_1a7cc236972b1ad9b3c072e96c221cb3c8: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` src0_desc() const Returns the memory descriptor for source #0. .. index:: pair: function; src1_desc .. _doxid-structdnnl_1_1binary_1_1primitive__desc_1ad3d19867872ecbe0e7738ef1821d6e83: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` src1_desc() const Returns the memory descriptor for source #1. .. index:: pair: function; dst_desc .. _doxid-structdnnl_1_1binary_1_1primitive__desc_1ac552b6afc7e7e422e28d477d6c1218e5: .. 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.