.. index:: pair: group; Reduction .. _doxid-group__dnnl__api__reduction: Reduction ========= .. toctree:: :hidden: struct_dnnl_reduction.rst Overview ~~~~~~~~ A primitive to compute reduction operation on data tensor using min, max, mul, sum, mean and norm_lp operations. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block // structs struct :ref:`dnnl::reduction`; // global functions :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_reduction_primitive_desc_create`( :ref:`dnnl_primitive_desc_t`* primitive_desc, :ref:`dnnl_engine_t` engine, :ref:`dnnl_alg_kind_t` alg_kind, :ref:`const_dnnl_memory_desc_t` src_desc, :ref:`const_dnnl_memory_desc_t` dst_desc, float p, float eps, :ref:`const_dnnl_primitive_attr_t` attr ); .. _details-group__dnnl__api__reduction: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ A primitive to compute reduction operation on data tensor using min, max, mul, sum, mean and norm_lp operations. .. rubric:: See also: :ref:`Reduction ` in developer guide Global Functions ---------------- .. index:: pair: function; dnnl_reduction_primitive_desc_create .. _doxid-group__dnnl__api__reduction_1gab26d42a8553d69b5fc3fbdb3b44d3f98: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_reduction_primitive_desc_create( :ref:`dnnl_primitive_desc_t`* primitive_desc, :ref:`dnnl_engine_t` engine, :ref:`dnnl_alg_kind_t` alg_kind, :ref:`const_dnnl_memory_desc_t` src_desc, :ref:`const_dnnl_memory_desc_t` dst_desc, float p, float eps, :ref:`const_dnnl_primitive_attr_t` attr ) Creates a primitive descriptor for a reduction primitive. .. note:: Destination memory descriptor is allowed to be initialized with :ref:`dnnl_format_tag_any ` or with format_kind set to :ref:`dnnl_format_kind_any `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - primitive_desc - Output primitive descriptor. * - engine - Engine to use. * - alg_kind - reduction algorithm kind. Possible values: :ref:`dnnl_reduction_max `, :ref:`dnnl_reduction_min `, :ref:`dnnl_reduction_sum `, :ref:`dnnl_reduction_mul `, :ref:`dnnl_reduction_mean `, :ref:`dnnl_reduction_norm_lp_max `, :ref:`dnnl_reduction_norm_lp_sum `, :ref:`dnnl_reduction_norm_lp_power_p_max `, :ref:`dnnl_reduction_norm_lp_power_p_sum `. * - p - Algorithm specific parameter. * - eps - Algorithm specific parameter. * - src_desc - Source memory descriptor. * - dst_desc - Destination memory descriptor. * - attr - Primitive attributes (can be NULL). .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise.