.. 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:`primitive_desc_base`(); :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; :ref:`primitive_attr` :ref:`get_primitive_attr`() const; :ref:`dnnl::primitive::kind` :ref:`get_kind`() const; std::vector :ref:`get_cache_blob_id`() 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:`handle`(const :ref:`handle`&); :ref:`handle`& :ref:`operator =` (const :ref:`handle`&); :ref:`handle`(:ref:`handle`&&); :ref:`handle`& :ref:`operator =` (:ref:`handle`&&); :ref:`handle`(T t, bool weak = false); 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; primitive_desc_base .. _doxid-structdnnl_1_1primitive__desc__base_1a27780142d0880bb0ca678f7c5a1845b9: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc_base() Default constructor. Produces an empty object. .. index:: pair: function; get_engine .. _doxid-structdnnl_1_1primitive__desc__base_1a3f3ea17a8e5767653732ebec37eff68f: .. 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_1a28661bd29607c71ecb8602d6c98adbc5: .. 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_1aa3936cde6aa188f79cc379200de718b3: .. 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_1ac2ec36092718ed89bece0fec7f5f3171: .. 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_1a31ee74fc65986558ac11db590945811a: .. 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_1a0b724a92606a86a7ac9b6b9b07935529: .. 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_1a35b7fb7725959ab336db58dd05e14d20: .. 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_1aeb499ab1390d20eb071d97ec4628029f: .. 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_1aa95dd1711a45923204ffddc3f02ea546: .. 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_1ab6dc65154169608dfb9c2e9842012826: .. 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_1aa49d0307308faad5df4e5606583528f5: .. 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_1ab4ce5fa06a8caa2237a6bf6e42d937d9: .. 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_1af378f246b843e31bfdada2f386662667: .. 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_1a9bdf1c2edfe6afdde73f9acde10b2da9: .. 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_1a88db48bf81f033a479ef2b1031504b4c: .. 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_1ad7cf56d773bf8daefdeabff31093ae2b: .. 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_1aaf33632e215a1f2b066a6111836ecbb3: .. 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_1af8bb36148b4bb356ae61cf48353910fb: .. 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_1aa1e474433668f235b8fb3888d399f200: .. 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_1a9d26b8c1068f0849da74a6ba358e5de6: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`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_1a622be560a40df3c657b18904f81f2a0a: .. 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. .. index:: pair: function; get_cache_blob_id .. _doxid-structdnnl_1_1primitive__desc__base_1ae9e850a065baa1b7dffe389a71013a1f: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector get_cache_blob_id() const Returns the cache blob ID of the primitive descriptor. .. rubric:: Returns: The cache blob ID of the primitive descriptor.