.. 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::dims` :ref:`get_strides`() const; :ref:`memory::dims` :ref:`get_dilations`() const; :ref:`memory::dims` :ref:`get_padding_l`() const; :ref:`memory::dims` :ref:`get_padding_r`() const; float :ref:`get_epsilon`() const; template T :ref:`get_flags`() const; :ref:`dnnl::algorithm` :ref:`get_algorithm`() const; float :ref:`get_alpha`() const; float :ref:`get_beta`() const; int :ref:`get_axis`() const; :ref:`memory::dim` :ref:`get_local_size`() const; float :ref:`get_k`() const; float :ref:`get_p`() const; std::vector :ref:`get_factors`() const; :ref:`dnnl::algorithm` :ref:`get_cell_kind`() const; :ref:`dnnl::rnn_direction` :ref:`get_direction`() const; :ref:`dnnl::algorithm` :ref:`get_activation_kind`() const; :ref:`memory::dims` :ref:`get_kernel`() const; :ref:`memory::dim` :ref:`get_group_size`() const; :ref:`dnnl::prop_kind` :ref:`get_prop_kind`() 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:`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; get_strides .. _doxid-structdnnl_1_1primitive__desc__base_1ab15fa4e08b75652e106ec7b7d6b13e8f: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::dims` get_strides() const Returns strides. .. rubric:: Returns: Strides. An empty :ref:`dnnl::memory::dims ` if the primitive does not have a strides parameter. .. index:: pair: function; get_dilations .. _doxid-structdnnl_1_1primitive__desc__base_1a0f2ef952e57da908a074422822e6dbaf: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::dims` get_dilations() const Returns dilations. .. rubric:: Returns: Dilations. An empty :ref:`dnnl::memory::dims ` if the primitive does not have a dilations parameter. .. index:: pair: function; get_padding_l .. _doxid-structdnnl_1_1primitive__desc__base_1aa21112a5d3d0d38a47b9bb74024c5904: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::dims` get_padding_l() const Returns a left padding. .. rubric:: Returns: A left padding. An empty :ref:`dnnl::memory::dims ` if the primitive does not have a left padding parameter. .. index:: pair: function; get_padding_r .. _doxid-structdnnl_1_1primitive__desc__base_1a004d4371015dc3ba06d57752b4ec1bb6: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::dims` get_padding_r() const Returns a right padding. .. rubric:: Returns: A right padding. An empty :ref:`dnnl::memory::dims ` if the primitive does not have a right padding parameter. .. index:: pair: function; get_epsilon .. _doxid-structdnnl_1_1primitive__desc__base_1ab8c5aaea19030d62c667d4b79eb0d680: .. ref-code-block:: cpp :class: doxyrest-title-code-block float get_epsilon() const Returns an epsilon. .. rubric:: Returns: An epsilon. Zero if the primitive does not have an epsilon parameter. .. index:: pair: function; get_flags .. _doxid-structdnnl_1_1primitive__desc__base_1a8081d18d2289f5b58634a2b902bea264: .. ref-code-block:: cpp :class: doxyrest-title-code-block template T get_flags() const Returns flags. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - T - Flags enumeration type. .. rubric:: Returns: Flags. Zero if the primitive does not have a flags parameter. .. index:: pair: function; get_algorithm .. _doxid-structdnnl_1_1primitive__desc__base_1ae220e7adee4466f48e9a4781f0754461: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl::algorithm` get_algorithm() const Returns an algorithm kind. .. rubric:: Returns: An algorithm kind. :ref:`dnnl::algorithm::undef ` if the primitive does not have an algorithm parameter. .. index:: pair: function; get_alpha .. _doxid-structdnnl_1_1primitive__desc__base_1a73f6fcc68fd45166146a3c3d5eb49821: .. ref-code-block:: cpp :class: doxyrest-title-code-block float get_alpha() const Returns an alpha. .. rubric:: Returns: An alpha. Zero if the primitive does not have an alpha parameter. .. index:: pair: function; get_beta .. _doxid-structdnnl_1_1primitive__desc__base_1a29619c9f1308414bfdc8eb89fae7bd9d: .. ref-code-block:: cpp :class: doxyrest-title-code-block float get_beta() const Returns a beta. .. rubric:: Returns: A beta. Zero if the primitive does not have a beta parameter. .. index:: pair: function; get_axis .. _doxid-structdnnl_1_1primitive__desc__base_1af3b18a5a286f3b46e98b6fe8f45d60ac: .. ref-code-block:: cpp :class: doxyrest-title-code-block int get_axis() const Returns an axis. .. rubric:: Returns: An axis. A negative number if the primitive does not have an axis parameter. .. index:: pair: function; get_local_size .. _doxid-structdnnl_1_1primitive__desc__base_1a00e6f182172077df46fc6f614e309592: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::dim` get_local_size() const Returns an LRN local size parameter. .. rubric:: Returns: An LRN local size parameter. Zero if the primitive does not have an LRN local size parameter. .. index:: pair: function; get_k .. _doxid-structdnnl_1_1primitive__desc__base_1ad28f7f1c59d2fde215d71483daaaa632: .. ref-code-block:: cpp :class: doxyrest-title-code-block float get_k() const Returns an LRN K parameter. .. rubric:: Returns: An LRN K parameter. Zero if the primitive does not have an LRN K parameter. .. index:: pair: function; get_p .. _doxid-structdnnl_1_1primitive__desc__base_1acfde33696840f499f6e790e415bd65ba: .. ref-code-block:: cpp :class: doxyrest-title-code-block float get_p() const Returns a reduction P parameter. .. rubric:: Returns: A reduction P parameter. Zero if the primitive does not have a reduction P parameter. .. index:: pair: function; get_factors .. _doxid-structdnnl_1_1primitive__desc__base_1a18ce555604ee8680353bb95aeca08665: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector get_factors() const Returns a resampling factors parameters. .. rubric:: Returns: A vector of factors. An empty vector if the primitive does not have a resampling factors parameter. .. index:: pair: function; get_cell_kind .. _doxid-structdnnl_1_1primitive__desc__base_1a940546a82d1381597863ecc7036b9c22: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl::algorithm` get_cell_kind() const Returns an RNN cell kind parameter. .. rubric:: Returns: An RNN cell kind parameter. :ref:`dnnl::algorithm::undef ` if the primitive does not have an RNN cell kind parameter. .. index:: pair: function; get_direction .. _doxid-structdnnl_1_1primitive__desc__base_1a7b9b95f2e16e3d2a9644df7ad5436f63: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl::rnn_direction` get_direction() const Returns an RNN direction parameter. .. rubric:: Returns: An RNN direction parameter. :ref:`dnnl::rnn_direction::undef ` if the primitive does not have an RNN direction parameter. .. index:: pair: function; get_activation_kind .. _doxid-structdnnl_1_1primitive__desc__base_1acc309d5adeb8dbe8a88a18105082d566: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl::algorithm` get_activation_kind() const Returns an RNN activation kind parameter. .. rubric:: Returns: An RNN activation kind parameter. :ref:`dnnl::algorithm::undef ` if the primitive does not have an RNN activation kind parameter. .. index:: pair: function; get_kernel .. _doxid-structdnnl_1_1primitive__desc__base_1a3c9a39d1d0375518b18cf762fdd04b7e: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::dims` get_kernel() const Returns a pooling kernel parameter. .. rubric:: Returns: A pooling kernel parameter. An empty :ref:`dnnl::memory::dims ` if the primitive does not have a pooling kernel parameter. .. index:: pair: function; get_group_size .. _doxid-structdnnl_1_1primitive__desc__base_1a03ad4fc755ae405a8a13d2c238266a15: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::dim` get_group_size() const Returns a group size parameter. .. rubric:: Returns: A group size parameter. Zero if the primitive does not have a group size parameter. .. index:: pair: function; get_prop_kind .. _doxid-structdnnl_1_1primitive__desc__base_1a9adba18a967c92b205e939ba34de3542: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl::prop_kind` get_prop_kind() const Returns a propagation kind. .. rubric:: Returns: A propagation kind. :ref:`dnnl::prop_kind::undef ` if the primitive does not have a propagation parameter. .. 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 :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_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. .. index:: pair: function; get_cache_blob_id .. _doxid-structdnnl_1_1primitive__desc__base_1a435862df4d543eb8296424880212b22d: .. 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.