• Intel® Graphics Performance Analyzers 2020 R1
  • 03/31/2020
  • Public Content

Counter API

Counter is a user-defined characteristic or metric of hardware or software behavior that can be used to collect information about and correlate with execution breakdown, such as tasks, events, and markers. For example, different counters may represent different parts of the system on a chip (SoC) and count hardware and software characteristics.
To define and create a counter object, use the following primitives:
__itt_counter ITTAPI __itt_counter_create_typedA __itt_counter_create_typedA(const char *name, const char *domain, __itt_metadata_type type)
__itt_counter ITTAPI __itt_counter_create_typedW __itt_counter_create_typedW(const wchar_t *name, const wchar_t *domain, __itt_metadata_type type)
Parameters of the primitives:
Counter domain
Counter name
Counter type
To directly set the counter value, use the following primitive:
void ITTAPI __itt_counter_set_value(__itt_counter id, void *value_ptr)
Parameters of the primitive:
Counter ID
Counter value
The following example creates a counter that measures temperature and memory usage metrics.
#include "ittnotify.h" __itt_counter temperatureCounter = __itt_counter_create_typed(__TEXT("Temperature"), __TEXT("Domain"), __itt_metadata_u64); unsigned __int64 temperature; while (...) { ... temperature = getTemperature(); __itt_counter_set_value(temperatureCounter, &temperature); ... }

Product and Performance Information


Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804