Set as default use of device based timestamps

Related-To: NEO-7042
Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:
Katarzyna Cencelewska
2022-11-10 14:18:23 +00:00
committed by Compute-Runtime-Automation
parent 002a90c717
commit e75d62af5d
7 changed files with 51 additions and 35 deletions

View File

@ -69,6 +69,7 @@ TEST(MockOSTime, WhenGettingTimersThenDiffBetweenQueriesWithinAllowedError) {
hostOnlyDiff = hostOnlyTimestamp[1] - hostOnlyTimestamp[0];
EXPECT_LT(deviceTimestamp[0], deviceTimestamp[1]);
EXPECT_LT(hostTimestamp[0], hostOnlyTimestamp[0]);
EXPECT_LT(hostTimestamp[1], hostOnlyTimestamp[1]);
@ -115,27 +116,26 @@ TEST(MockOSTime, GivenNullWhenSettingOsTimeThenResolutionIsZero) {
}
TEST(MockOSTime, givenDeviceTimestampBaseNotEnabledWhenGetDeviceAndHostTimerThenCpuTimestampIsReturned) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.EnableDeviceBasedTimestamps.set(0);
auto mockDevice = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
mockDevice->setOSTime(new MockOSTimeWithConstTimestamp());
uint64_t deviceTS = 0u, hostTS = 0u;
mockDevice->getDeviceAndHostTimer(&deviceTS, &hostTS);
EXPECT_EQ(deviceTS, MockDeviceTimeWithConstTimestamp::CPU_TIME_IN_NS);
EXPECT_EQ(deviceTS, MockDeviceTimeWithConstTimestamp::cpuTimeInNs);
EXPECT_EQ(deviceTS, hostTS);
}
TEST(MockOSTime, givenDeviceTimestampBaseEnabledWhenGetDeviceAndHostTimerThenGpuTimestampIsReturned) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableDeviceBasedTimestamps.set(true);
auto mockDevice = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
mockDevice->setOSTime(new MockOSTimeWithConstTimestamp());
uint64_t deviceTS = 0u, hostTS = 0u;
mockDevice->getDeviceAndHostTimer(&deviceTS, &hostTS);
EXPECT_EQ(deviceTS, MockDeviceTimeWithConstTimestamp::GPU_TIMESTAMP);
EXPECT_EQ(deviceTS, MockDeviceTimeWithConstTimestamp::gpuTimestamp);
EXPECT_NE(deviceTS, hostTS);
}