mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
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:

committed by
Compute-Runtime-Automation

parent
002a90c717
commit
e75d62af5d
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user