• Intel® Graphics Performance Analyzers 2020 R1
  • 12/20/2019
  • Public Content
Contents

Counter API

计数器是用户定义的硬件或软件行为的特征或指标,可用来收集关于执行故障的信息,如任务、事件和标记。也可以将其与执行故障关联起来。例如,不同的计数器可能代表系统级芯片 (SoC) 的不同部分并计算硬件和软件特征。
要定义并创建计数器对象,请使用以下基元:
__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)
基元参数:
[in]
domain
计数器域
[in]
name
计数器名称
[in]
type
计数器类型
要直接设置计数器的值,请使用以下基元:
void ITTAPI __itt_counter_set_value(__itt_counter id, void *value_ptr)
基元的参数:
[in]
id
计数器 ID
[in]
value_ptr
计数器值
示例
下例创建一个测量温度和内存使用指标的计数器。
#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

1

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