create infrastructure for gen specific performance counters

Change-Id: I6ef471ade14ce27b6e5949726b57453a6fe69abc
This commit is contained in:
Artur Harasimiuk
2018-02-15 20:49:25 +01:00
committed by sys_ocldev
parent d7687e32c4
commit c9180fec65
3 changed files with 92 additions and 0 deletions

View File

@@ -27,6 +27,10 @@
#include "runtime/os_interface/os_time.h"
namespace OCLRT {
decltype(&instrGetPerfCountersQueryData) getPerfCountersQueryDataFactory[IGFX_MAX_CORE] = {
nullptr,
};
PerformanceCounters::PerformanceCounters(OSTime *osTime) {
this->osTime = osTime;
DEBUG_BREAK_IF(osTime == nullptr);
@@ -66,6 +70,10 @@ void PerformanceCounters::shutdown() {
void PerformanceCounters::initialize(const HardwareInfo *hwInfo) {
useMIRPC = !(hwInfo->pWaTable->waDoNotUseMIReportPerfCount);
gfxFamily = hwInfo->pPlatform->eRenderCoreFamily;
if (getPerfCountersQueryDataFactory[gfxFamily] != nullptr) {
getPerfCountersQueryDataFunc = getPerfCountersQueryDataFactory[gfxFamily];
}
}
void PerformanceCounters::enableImpl() {
hwMetricsEnabled = hwMetricsEnableFunc(cbData, true);