Profiling#

Overview#

// global functions

dnnl_status_t DNNL_API dnnl_reset_profiling(dnnl_stream_t stream);

dnnl_status_t DNNL_API dnnl_query_profiling_data(
    dnnl_stream_t stream,
    dnnl_profiling_data_kind_t data_kind,
    int* num_entries,
    uint64_t* data
    );

Detailed Documentation#

Global Functions#

dnnl_status_t DNNL_API dnnl_reset_profiling(dnnl_stream_t stream)

Resets a profiler’s state.

Parameters:

stream

Stream associated with the profiler.

Returns:

dnnl_success on success and a status describing the error otherwise.

dnnl_status_t DNNL_API dnnl_query_profiling_data(
    dnnl_stream_t stream,
    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 dnnl_reset_profiling.

Note

It is required to wait for all submitted primitives to complete using dnnl_stream_wait prior to querying profiling data.

Parameters:

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.

Returns:

dnnl_success on success and a status describing the error otherwise.