Profiling

Overview

// enums

enum dnnl::profiling_data_kind;

// global functions

void dnnl::reset_profiling(stream& stream);

std::vector<uint64_t> dnnl::get_profiling_data(
    stream& stream,
    profiling_data_kind data_kind
    );

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

void dnnl::reset_profiling(stream& stream)

Resets a profiler’s state.

Parameters:

stream

Stream associated with the profiler.

std::vector<uint64_t> dnnl::get_profiling_data(
    stream& stream,
    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 dnnl::reset_profiling call.

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.

Returns:

A vector with the requested profiling data.

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.