.. index:: pair: group; Profiling .. _doxid-group__dnnl__api__profiling: Profiling ========= .. toctree:: :hidden: enum_dnnl_profiling_data_kind.rst Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block // enums enum :ref:`dnnl::profiling_data_kind`; // global functions void :ref:`dnnl::reset_profiling`(:ref:`stream`& stream); std::vector :ref:`dnnl::get_profiling_data`( :ref:`stream`& stream, :ref:`profiling_data_kind` data_kind ); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_reset_profiling`(:ref:`dnnl_stream_t` stream); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_query_profiling_data`( :ref:`dnnl_stream_t` stream, :ref:`dnnl_profiling_data_kind_t` data_kind, int* num_entries, uint64_t* data ); .. _details-group__dnnl__api__profiling: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Global Functions ---------------- .. index:: pair: function; reset_profiling .. _doxid-group__dnnl__api__profiling_1ga1d9547121faf3f10c23989c3ef05bc1e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void dnnl::reset_profiling(:ref:`stream`& stream) Resets a profiler's state. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - stream - Stream associated with the profiler. .. index:: pair: function; get_profiling_data .. _doxid-group__dnnl__api__profiling_1ga0dc451b94cbeacb7a5e0c73c3071ee4e: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector dnnl::get_profiling_data( :ref:`stream`& stream, :ref:`profiling_data_kind` data_kind ) Returns requested profiling data. The profiling data accumulates for each primitive execution. The size of the vector will be equal to the number of executions since the last ``:ref:`dnnl::reset_profiling ``` call. The profiling data can be reset by calling :ref:`dnnl::reset_profiling `. .. note:: It is required to wait for all submitted primitives to complete using :ref:`dnnl::stream::wait ` prior to querying profiling data. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - stream - Stream that was used for executing a primitive that is being profiled. * - data_kind - Profiling data kind to query. .. rubric:: Returns: A vector with the requested profiling data. .. index:: pair: function; dnnl_reset_profiling .. _doxid-group__dnnl__api__profiling_1gaaf7e8e00d675e7362ccf75b30a9c47bd: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_reset_profiling(:ref:`dnnl_stream_t` stream) Resets a profiler's state. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - stream - Stream associated with the profiler. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. index:: pair: function; dnnl_query_profiling_data .. _doxid-group__dnnl__api__profiling_1gae92506d856399892636be1c86a3a94a7: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_query_profiling_data( :ref:`dnnl_stream_t` stream, :ref:`dnnl_profiling_data_kind_t` data_kind, int* num_entries, uint64_t* data ) Queries profiling data. The profiling data accumulates for each primitive execution. The ``num_entries`` will be equal to the number of executions since the last ``dnnl_reset_profiling`` call. In order to query the ``num_entries`` the ``data`` parameter should be NULL. When ``data`` is NULL then the ``data_kind`` parameter is ignored. The profiling data can be reset by calling :ref:`dnnl_reset_profiling `. .. note:: It is required to wait for all submitted primitives to complete using :ref:`dnnl_stream_wait ` prior to querying profiling data. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - stream - Stream that was used for executing a primitive that is being profiled. * - data_kind - Profiling data kind to query. * - num_entries - Number of profiling data entries. * - data - Profiling data. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise.