Enable Linux performance counters.

Change-Id: I688d3669d1791081074626ef474ab1edbc018034
This commit is contained in:
Piotr Maciejewski 2019-08-07 09:19:51 +02:00 committed by sys_ocldev
parent 9cc493ec3e
commit 9bb625185f
3 changed files with 18 additions and 3 deletions

View File

@ -17,6 +17,8 @@
#include "runtime/os_interface/linux/drm_neo.h"
#include "runtime/os_interface/linux/os_interface.h"
#include "instrumentation.h"
#include <cstring>
namespace NEO {
@ -145,7 +147,7 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou
hwHelper.adjustDefaultEngineType(outHwInfo);
outHwInfo->capabilityTable.defaultEngineType = getChosenEngineType(*outHwInfo);
outHwInfo->capabilityTable.instrumentationEnabled = false;
outHwInfo->capabilityTable.instrumentationEnabled &= haveInstrumentation;
outHwInfo->capabilityTable.ftrRenderCompressedBuffers = false;
outHwInfo->capabilityTable.ftrRenderCompressedImages = false;

View File

@ -13,8 +13,7 @@
namespace NEO {
void DeviceInstrumentationFixture::SetUp(bool instrumentation) {
ExecutionEnvironment *executionEnvironment = getExecutionEnvironmentImpl(hwInfo);
if (instrumentation)
hwInfo->capabilityTable.instrumentationEnabled = true;
hwInfo->capabilityTable.instrumentationEnabled = instrumentation;
device = std::unique_ptr<Device>(Device::create<Device>(executionEnvironment, 0));
}
} // namespace NEO

View File

@ -379,3 +379,17 @@ TEST_F(HwInfoConfigTestLinuxDummy, givenPointerToHwInfoWhenConfigureHwInfoCalled
EXPECT_EQ(0, ret);
EXPECT_EQ(outHwInfo.gtSystemInfo.CsrSizeInMb * MemoryConstants::megaByte, outHwInfo.capabilityTable.requiredPreemptionSurfaceSize);
}
TEST_F(HwInfoConfigTestLinuxDummy, givenInstrumentationForHardwareIsEnabledOrDisabledWhenConfiguringHwInfoThenOverrideItUsingHaveInstrumentation) {
int ret;
pInHwInfo.capabilityTable.instrumentationEnabled = false;
ret = hwConfig.configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
ASSERT_EQ(0, ret);
EXPECT_FALSE(outHwInfo.capabilityTable.instrumentationEnabled);
pInHwInfo.capabilityTable.instrumentationEnabled = true;
ret = hwConfig.configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
ASSERT_EQ(0, ret);
EXPECT_TRUE(outHwInfo.capabilityTable.instrumentationEnabled == haveInstrumentation);
}