.. index:: pair: struct; dnnl::primitive_desc_base .. _doxid-structdnnl_1_1primitive__desc__base: struct dnnl::primitive_desc_base ================================ .. toctree:: :hidden: Overview ~~~~~~~~ Base class for all primitive descriptors. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include struct primitive_desc_base: public :ref:`dnnl::handle` { // methods :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; }; // direct descendants struct :ref:`primitive_desc`; struct :ref:`primitive_desc`; struct :ref:`primitive_desc`; struct :ref:`primitive_desc`; 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; .. _details-structdnnl_1_1primitive__desc__base: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Base class for all primitive descriptors. Methods ------- .. index:: pair: function; get_engine .. _doxid-structdnnl_1_1primitive__desc__base_1a32f7477c79e715a341bb9127df521fbc: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`engine` get_engine() const Returns the engine of the primitive descriptor. .. rubric:: Returns: The engine of the primitive descriptor. .. index:: pair: function; impl_info_str .. _doxid-structdnnl_1_1primitive__desc__base_1ae680492d4e4b16a938cfc051e5c906be: .. ref-code-block:: cpp :class: doxyrest-title-code-block const char* impl_info_str() const Returns implementation name. .. rubric:: Returns: The implementation name. .. index:: pair: function; query_s64 .. _doxid-structdnnl_1_1primitive__desc__base_1acbedc4257eaa26f868356f9f594a856a: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::dim` query_s64(:ref:`query` what) const Returns a :ref:`memory::dim ` value (same as int64_t). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - what - The value to query. .. rubric:: Returns: The result of the query. .. index:: pair: function; query_md .. _doxid-structdnnl_1_1primitive__desc__base_1a35d24b553ba6aa807516e9470fdd7d16: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` query_md(:ref:`query` what, int idx = 0) const Returns a memory descriptor. .. note:: There are also convenience methods :ref:`dnnl::primitive_desc_base::src_desc() `, :ref:`dnnl::primitive_desc_base::dst_desc() `, and others. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - what - The kind of parameter to query; can be :ref:`dnnl::query::src_md `, :ref:`dnnl::query::dst_md `, etc. * - idx - Index of the parameter. For example, convolution bias can be queried with what = :ref:`dnnl::query::weights_md ` and idx = 1. .. rubric:: Returns: The requested memory descriptor. A zero memory descriptor if the primitive does not have a parameter of the specified kind or index. .. index:: pair: function; src_desc .. _doxid-structdnnl_1_1primitive__desc__base_1af42e791f493e636c086e13c6d4c06b43: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` src_desc(int idx) 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_1primitive__desc__base_1a495ee7c8e1ec3eab35f6329fdcd352bb: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` dst_desc(int idx) const Returns a destination memory descriptor. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - idx - Destination index. .. rubric:: Returns: Destination memory descriptor. A zero memory descriptor if the primitive does not have a destination parameter with index ``idx``. .. index:: pair: function; weights_desc .. _doxid-structdnnl_1_1primitive__desc__base_1acb13d08987cca8d8f05ec4858fa61fb4: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` weights_desc(int idx) const Returns a weights memory descriptor. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - idx - Weights index. .. rubric:: Returns: Weights memory descriptor. A zero memory descriptor if the primitive does not have a weights parameter with index ``idx``. .. index:: pair: function; diff_src_desc .. _doxid-structdnnl_1_1primitive__desc__base_1a733e6ff4e78a758e69ae6232e8955871: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` diff_src_desc(int idx) const Returns a diff source memory descriptor. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - idx - Diff source index. .. rubric:: Returns: Diff source memory descriptor. A zero memory descriptor if the primitive does not have a diff source parameter with index ``idx``. .. index:: pair: function; diff_dst_desc .. _doxid-structdnnl_1_1primitive__desc__base_1a60f17d04c493c42e4a50ad5feff5c8ca: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` diff_dst_desc(int idx) const Returns a diff destination memory descriptor. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - idx - Diff destination index. .. rubric:: Returns: Diff destination memory descriptor. A zero memory descriptor if the primitive does not have a diff destination parameter with index ``idx``. .. index:: pair: function; diff_weights_desc .. _doxid-structdnnl_1_1primitive__desc__base_1a192f7b334efac9a5ac20344a76d4d552: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` diff_weights_desc(int idx) const Returns a diff weights memory descriptor. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - idx - Diff weights index. .. rubric:: Returns: Diff weights memory descriptor. A zero memory descriptor if the primitive does not have a diff weights parameter with index ``idx``. .. index:: pair: function; src_desc .. _doxid-structdnnl_1_1primitive__desc__base_1af48dcff294cadb2916fd784b8474d221: .. 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_1primitive__desc__base_1addbec977643a7900f4156f7aab3fb4db: .. 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; weights_desc .. _doxid-structdnnl_1_1primitive__desc__base_1a93f0904566b399874c47b3b1ad3d1495: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` weights_desc() const Returns a weights memory descriptor. .. rubric:: Returns: Weights memory descriptor. A zero memory descriptor if the primitive does not have a weights parameter. .. index:: pair: function; diff_src_desc .. _doxid-structdnnl_1_1primitive__desc__base_1ab4268c6bb70dd6c22de43141cc301b77: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` diff_src_desc() const Returns a diff source memory descriptor. .. rubric:: Returns: Diff source memory descriptor. A zero memory descriptor if the primitive does not have a diff source memory with. .. index:: pair: function; diff_dst_desc .. _doxid-structdnnl_1_1primitive__desc__base_1a6b9fb7da987329256c04db6ecbb9dc36: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` diff_dst_desc() const Returns a diff destination memory descriptor. .. rubric:: Returns: Diff destination memory descriptor. A zero memory descriptor if the primitive does not have a diff destination parameter. .. index:: pair: function; diff_weights_desc .. _doxid-structdnnl_1_1primitive__desc__base_1af51378982968e2b4f7abb6a32acfb0af: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` diff_weights_desc() const Returns a diff weights memory descriptor. .. rubric:: Returns: Diff weights memory descriptor. A zero memory descriptor if the primitive does not have a diff weights parameter. .. index:: pair: function; workspace_desc .. _doxid-structdnnl_1_1primitive__desc__base_1ad26f416a149cb44cc5cfc130012c614e: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` workspace_desc() const Returns the workspace memory descriptor. .. rubric:: Returns: Workspace memory descriptor. A zero memory descriptor if the primitive does not require workspace parameter. .. index:: pair: function; scratchpad_desc .. _doxid-structdnnl_1_1primitive__desc__base_1a6238358ec03afd57fb20dffa65b48d2f: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` scratchpad_desc() const Returns the scratchpad memory descriptor. .. rubric:: Returns: scratchpad memory descriptor. A zero memory descriptor if the primitive does not require scratchpad parameter. .. rubric:: See also: :ref:`Primitive Attributes: Scratchpad ` .. index:: pair: function; scratchpad_engine .. _doxid-structdnnl_1_1primitive__desc__base_1ad4079e0891373bd2dc841f3f94cf47ed: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`engine` scratchpad_engine() const Returns the engine on which the scratchpad memory is located. .. rubric:: Returns: The engine on which the scratchpad memory is located. .. index:: pair: function; get_primitive_attr .. _doxid-structdnnl_1_1primitive__desc__base_1a0ef600ea3666f0fd93c9c5d112aaf05c: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_attr get_primitive_attr() const Returns the primitive attributes. .. rubric:: Returns: The primitive attributes. .. index:: pair: function; get_kind .. _doxid-structdnnl_1_1primitive__desc__base_1a663f3511855bfc2625476019321c909d: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl::primitive::kind` get_kind() const Returns the kind of the primitive descriptor. .. rubric:: Returns: The kind of the primitive descriptor.