.. index:: pair: group; Floating-point Math Mode .. _doxid-group__dnnl__api__fpmath__mode: Floating-point Math Mode ======================== .. toctree:: :hidden: enum_dnnl_fpmath_mode_t.rst enum_dnnl_fpmath_mode.rst Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block // enums enum :ref:`dnnl_fpmath_mode_t`; enum :ref:`dnnl::fpmath_mode`; // global functions :ref:`dnnl_fpmath_mode_t` :ref:`dnnl::convert_to_c`(:ref:`fpmath_mode` mode); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_get_default_fpmath_mode`(:ref:`dnnl_fpmath_mode_t`* mode); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_set_default_fpmath_mode`(:ref:`dnnl_fpmath_mode_t` mode); .. _details-group__dnnl__api__fpmath__mode: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Global Functions ---------------- .. index:: pair: function; convert_to_c .. _doxid-group__dnnl__api__fpmath__mode_1gad095d0686c7020ce49be483cb44e8535: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_fpmath_mode_t` dnnl::convert_to_c(:ref:`fpmath_mode` mode) Converts an fpmath mode enum value from C++ API to C API type. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - mode - C++ API fpmath mode enum value. .. rubric:: Returns: Corresponding C API fpmath mode enum value. .. index:: pair: function; dnnl_get_default_fpmath_mode .. _doxid-group__dnnl__api__fpmath__mode_1gada52f7858332a7cda0e0c5e7907056d7: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_get_default_fpmath_mode(:ref:`dnnl_fpmath_mode_t`* mode) Returns the floating-point math mode that will be used by default for all subsequently created primitives. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - mode - Output FP math mode. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. index:: pair: function; dnnl_set_default_fpmath_mode .. _doxid-group__dnnl__api__fpmath__mode_1ga97dd535e43073cee2ebc4b709e42c3ca: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_set_default_fpmath_mode(:ref:`dnnl_fpmath_mode_t` mode) Sets the floating-point math mode that will be used by default for all subsequently created primitives. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - mode - FP math mode. The possible values are: :ref:`dnnl_fpmath_mode_strict `, :ref:`dnnl_fpmath_mode_bf16 `, :ref:`dnnl_fpmath_mode_f16 `, :ref:`dnnl_fpmath_mode_tf32 `, :ref:`dnnl_fpmath_mode_any `. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise.