mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
Revert "performance: Reuse GPU timestamps by default"
This reverts commit 7aceed58ca.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b331fa56fc
commit
34f53d5d94
@@ -395,30 +395,26 @@ void Event::calculateProfilingDataInternal(uint64_t contextStartTS, uint64_t con
|
||||
auto &gfxCoreHelper = device.getGfxCoreHelper();
|
||||
auto resolution = device.getDeviceInfo().profilingTimerResolution;
|
||||
|
||||
// Calculate startTimestamp only if it was not already set on CPU
|
||||
if (startTimeStamp.cpuTimeInNs == 0) {
|
||||
startTimeStamp.gpuTimeStamp = globalStartTS;
|
||||
addOverflowToTimestamp(startTimeStamp.gpuTimeStamp, submitTimeStamp.gpuTimeStamp);
|
||||
if (startTimeStamp.gpuTimeStamp < submitTimeStamp.gpuTimeStamp) {
|
||||
auto diff = submitTimeStamp.gpuTimeStamp - startTimeStamp.gpuTimeStamp;
|
||||
auto diffInNS = gfxCoreHelper.getGpuTimeStampInNS(diff, resolution);
|
||||
auto osTime = device.getOSTime();
|
||||
if (diffInNS < osTime->getTimestampRefreshTimeout()) {
|
||||
auto alignedSubmitTimestamp = startTimeStamp.gpuTimeStamp - 1;
|
||||
auto alignedQueueTimestamp = startTimeStamp.gpuTimeStamp - 2;
|
||||
if (startTimeStamp.gpuTimeStamp <= 2) {
|
||||
alignedSubmitTimestamp = 0;
|
||||
alignedQueueTimestamp = 0;
|
||||
}
|
||||
updateTimestamp(submitTimeStamp, alignedSubmitTimestamp);
|
||||
updateTimestamp(queueTimeStamp, alignedQueueTimestamp);
|
||||
osTime->setRefreshTimestampsFlag();
|
||||
} else {
|
||||
startTimeStamp.gpuTimeStamp += static_cast<uint64_t>(1ULL << gfxCoreHelper.getGlobalTimeStampBits());
|
||||
startTimeStamp.gpuTimeStamp = globalStartTS;
|
||||
addOverflowToTimestamp(startTimeStamp.gpuTimeStamp, submitTimeStamp.gpuTimeStamp);
|
||||
if (startTimeStamp.gpuTimeStamp < submitTimeStamp.gpuTimeStamp) {
|
||||
auto diff = submitTimeStamp.gpuTimeStamp - startTimeStamp.gpuTimeStamp;
|
||||
auto diffInNS = gfxCoreHelper.getGpuTimeStampInNS(diff, resolution);
|
||||
auto osTime = device.getOSTime();
|
||||
if (diffInNS < osTime->getTimestampRefreshTimeout()) {
|
||||
auto alignedSubmitTimestamp = startTimeStamp.gpuTimeStamp - 1;
|
||||
auto alignedQueueTimestamp = startTimeStamp.gpuTimeStamp - 2;
|
||||
if (startTimeStamp.gpuTimeStamp <= 2) {
|
||||
alignedSubmitTimestamp = 0;
|
||||
alignedQueueTimestamp = 0;
|
||||
}
|
||||
updateTimestamp(submitTimeStamp, alignedSubmitTimestamp);
|
||||
updateTimestamp(queueTimeStamp, alignedQueueTimestamp);
|
||||
osTime->setRefreshTimestampsFlag();
|
||||
} else {
|
||||
startTimeStamp.gpuTimeStamp += static_cast<uint64_t>(1ULL << gfxCoreHelper.getGlobalTimeStampBits());
|
||||
}
|
||||
}
|
||||
|
||||
UNRECOVERABLE_IF(startTimeStamp.gpuTimeStamp < submitTimeStamp.gpuTimeStamp);
|
||||
auto gpuTicksDiff = startTimeStamp.gpuTimeStamp - submitTimeStamp.gpuTimeStamp;
|
||||
auto timeDiff = static_cast<uint64_t>(gpuTicksDiff * resolution);
|
||||
|
||||
@@ -911,10 +911,16 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledAndGlobalStartTSSmalle
|
||||
}
|
||||
|
||||
TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledAndGlobalStartTSSmallerThanQueueTSWithinRecalculationLimitWhenCalculateStartTimestampThenAdjustTimestmaps) {
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
debugManager.flags.EnableReusingGpuTimestamps.set(true);
|
||||
|
||||
MockContext context{};
|
||||
auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||
|
||||
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
|
||||
MockCommandQueue cmdQ(mockContext, pClDevice, props, false);
|
||||
MockCommandQueue cmdQ(&context, mockDevice.get(), props, false);
|
||||
MockEvent<Event> event(&cmdQ, CL_COMPLETE, 0, 0);
|
||||
auto resolution = pClDevice->getDevice().getDeviceInfo().profilingTimerResolution;
|
||||
auto resolution = mockDevice->getDevice().getDeviceInfo().profilingTimerResolution;
|
||||
|
||||
HwTimeStamps timestamp{};
|
||||
timestamp.globalStartTS = 3;
|
||||
@@ -940,10 +946,16 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledAndGlobalStartTSSmalle
|
||||
}
|
||||
|
||||
TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledAndGlobalStartTSSmallerThanQueueTSWithinRecalculationLimitAndStartTSBelowOneWhenCalculateStartTimestampThenAdjustTimestmaps) {
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
debugManager.flags.EnableReusingGpuTimestamps.set(true);
|
||||
|
||||
MockContext context{};
|
||||
auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||
|
||||
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
|
||||
MockCommandQueue cmdQ(mockContext, pClDevice, props, false);
|
||||
MockCommandQueue cmdQ(&context, mockDevice.get(), props, false);
|
||||
MockEvent<Event> event(&cmdQ, CL_COMPLETE, 0, 0);
|
||||
auto resolution = pClDevice->getDevice().getDeviceInfo().profilingTimerResolution;
|
||||
auto resolution = mockDevice->getDevice().getDeviceInfo().profilingTimerResolution;
|
||||
|
||||
HwTimeStamps timestamp{};
|
||||
timestamp.globalStartTS = 2;
|
||||
|
||||
@@ -347,7 +347,7 @@ DECLARE_DEBUG_VARIABLE(bool, DisableStatelessToStatefulOptimization, false, "Dis
|
||||
DECLARE_DEBUG_VARIABLE(bool, DisableConcurrentBlockExecution, false, "disables concurrent block kernel execution")
|
||||
DECLARE_DEBUG_VARIABLE(bool, UseNoRingFlushesKmdMode, true, "Windows only, passes flag to KMD that informs KMD to not emit any ring buffer flushes.")
|
||||
DECLARE_DEBUG_VARIABLE(bool, DisableZeroCopyForUseHostPtr, false, "When active all buffer allocations created with CL_MEM_USE_HOST_PTR flag will not share memory with CPU.")
|
||||
DECLARE_DEBUG_VARIABLE(bool, EnableReusingGpuTimestamps, true, "When enabled, GPU timestamp will be reused for next device time requests")
|
||||
DECLARE_DEBUG_VARIABLE(bool, EnableReusingGpuTimestamps, false, "When enabled, GPU timestamp will be reused for next device time requests")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, AllowZeroCopyWithoutCoherency, -1, "Use cacheline flush instead of memory copy for map/unmap mem object")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, EnableHostPtrTracking, -1, "Enable host ptr tracking: -1 - default platform setting, 0 - disabled, 1 - enabled")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, MaxHwThreadsPercent, 0, "If not zero then maximum number of used HW threads is capped to max * MaxHwThreadsPercent / 100")
|
||||
|
||||
@@ -601,5 +601,5 @@ ForceSynchronizedDispatchMode = -1
|
||||
DirectSubmissionControllerAdjustOnThrottleAndAcLineStatus = -1
|
||||
ReadOnlyAllocationsTypeMask = 0
|
||||
EnableLogLevel = 6
|
||||
EnableReusingGpuTimestamps = 1
|
||||
EnableReusingGpuTimestamps = 0
|
||||
# Please don't edit below this line
|
||||
|
||||
@@ -126,27 +126,27 @@ TEST_F(DrmTimeTest, given36BitGpuTimeStampWhenGpuTimeStampOverflowThenGpuTimeDoe
|
||||
EXPECT_TRUE(osTime->getGpuCpuTime(&gpuCpuTime));
|
||||
EXPECT_EQ(100ull, gpuCpuTime.gpuTimeStamp);
|
||||
|
||||
actualTime = 200ll;
|
||||
deviceTime->gpuCpuTimeValue.gpuTimeStamp = 200ll;
|
||||
EXPECT_TRUE(osTime->getGpuCpuTime(&gpuCpuTime));
|
||||
EXPECT_EQ(actualTime, gpuCpuTime.gpuTimeStamp);
|
||||
EXPECT_EQ(200ull, gpuCpuTime.gpuTimeStamp);
|
||||
|
||||
osTime->maxGpuTimeStamp = 1ull << 36;
|
||||
|
||||
deviceTime->gpuCpuTimeValue = {10ull, 10ull}; // read from KMD below initial value
|
||||
EXPECT_TRUE(osTime->getGpuCpuTime(&gpuCpuTime, true));
|
||||
deviceTime->gpuCpuTimeValue.gpuTimeStamp = 10ull; // read below initial value
|
||||
EXPECT_TRUE(osTime->getGpuCpuTime(&gpuCpuTime));
|
||||
EXPECT_EQ(osTime->maxGpuTimeStamp + 10ull, gpuCpuTime.gpuTimeStamp);
|
||||
|
||||
actualTime = 30ull; // second read below initial value
|
||||
deviceTime->gpuCpuTimeValue.gpuTimeStamp = 30ull; // second read below initial value
|
||||
EXPECT_TRUE(osTime->getGpuCpuTime(&gpuCpuTime));
|
||||
EXPECT_EQ(osTime->maxGpuTimeStamp + actualTime, gpuCpuTime.gpuTimeStamp);
|
||||
EXPECT_EQ(osTime->maxGpuTimeStamp + 30ull, gpuCpuTime.gpuTimeStamp);
|
||||
|
||||
actualTime = 110ull;
|
||||
deviceTime->gpuCpuTimeValue.gpuTimeStamp = 110ull;
|
||||
EXPECT_TRUE(osTime->getGpuCpuTime(&gpuCpuTime));
|
||||
EXPECT_EQ(osTime->maxGpuTimeStamp + actualTime, gpuCpuTime.gpuTimeStamp);
|
||||
EXPECT_EQ(osTime->maxGpuTimeStamp + 110ull, gpuCpuTime.gpuTimeStamp);
|
||||
|
||||
actualTime = 70ull; // second overflow
|
||||
deviceTime->gpuCpuTimeValue.gpuTimeStamp = 70ull; // second overflow
|
||||
EXPECT_TRUE(osTime->getGpuCpuTime(&gpuCpuTime));
|
||||
EXPECT_EQ(2ull * osTime->maxGpuTimeStamp + actualTime, gpuCpuTime.gpuTimeStamp);
|
||||
EXPECT_EQ(2ull * osTime->maxGpuTimeStamp + 70ull, gpuCpuTime.gpuTimeStamp);
|
||||
}
|
||||
|
||||
TEST_F(DrmTimeTest, given64BitGpuTimeStampWhenGpuTimeStampOverflowThenOverflowsAreNotDetected) {
|
||||
@@ -157,27 +157,27 @@ TEST_F(DrmTimeTest, given64BitGpuTimeStampWhenGpuTimeStampOverflowThenOverflowsA
|
||||
EXPECT_TRUE(osTime->getGpuCpuTime(&gpuCpuTime));
|
||||
EXPECT_EQ(100ull, gpuCpuTime.gpuTimeStamp);
|
||||
|
||||
actualTime = 200ull;
|
||||
deviceTime->gpuCpuTimeValue.gpuTimeStamp = 200ull;
|
||||
EXPECT_TRUE(osTime->getGpuCpuTime(&gpuCpuTime));
|
||||
EXPECT_EQ(actualTime, gpuCpuTime.gpuTimeStamp);
|
||||
EXPECT_EQ(200ull, gpuCpuTime.gpuTimeStamp);
|
||||
|
||||
osTime->maxGpuTimeStamp = 0ull;
|
||||
|
||||
deviceTime->gpuCpuTimeValue = {10ull, 10ull}; // read from KMD below initial value
|
||||
EXPECT_TRUE(osTime->getGpuCpuTime(&gpuCpuTime, true));
|
||||
deviceTime->gpuCpuTimeValue.gpuTimeStamp = 10ull; // read below initial value
|
||||
EXPECT_TRUE(osTime->getGpuCpuTime(&gpuCpuTime));
|
||||
EXPECT_EQ(10ull, gpuCpuTime.gpuTimeStamp);
|
||||
|
||||
actualTime = 30ull;
|
||||
deviceTime->gpuCpuTimeValue.gpuTimeStamp = 30ull;
|
||||
EXPECT_TRUE(osTime->getGpuCpuTime(&gpuCpuTime));
|
||||
EXPECT_EQ(actualTime, gpuCpuTime.gpuTimeStamp);
|
||||
EXPECT_EQ(30ull, gpuCpuTime.gpuTimeStamp);
|
||||
|
||||
actualTime = 110ull;
|
||||
deviceTime->gpuCpuTimeValue.gpuTimeStamp = 110ull;
|
||||
EXPECT_TRUE(osTime->getGpuCpuTime(&gpuCpuTime));
|
||||
EXPECT_EQ(actualTime, gpuCpuTime.gpuTimeStamp);
|
||||
EXPECT_EQ(110ull, gpuCpuTime.gpuTimeStamp);
|
||||
|
||||
actualTime = 70ull;
|
||||
deviceTime->gpuCpuTimeValue.gpuTimeStamp = 70ull;
|
||||
EXPECT_TRUE(osTime->getGpuCpuTime(&gpuCpuTime));
|
||||
EXPECT_EQ(actualTime, gpuCpuTime.gpuTimeStamp);
|
||||
EXPECT_EQ(70ull, gpuCpuTime.gpuTimeStamp);
|
||||
}
|
||||
|
||||
TEST_F(DrmTimeTest, GivenInvalidDrmWhenGettingGpuCpuTimeThenFails) {
|
||||
@@ -287,8 +287,17 @@ TEST_F(DrmTimeTest, whenGettingMaxGpuTimeStampValueThenHwInfoBasedValueIsReturne
|
||||
}
|
||||
|
||||
TEST_F(DrmTimeTest, whenGettingGpuTimeStampValueWithinIntervalThenReuseFromPreviousCall) {
|
||||
DebugManagerStateRestore restore;
|
||||
debugManager.flags.EnableReusingGpuTimestamps.set(true);
|
||||
|
||||
// Recreate mock to apply debug flag
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
osTime = MockOSTimeLinux::create(*rootDeviceEnvironment.osInterface);
|
||||
osTime->setResolutionFunc(resolutionFuncTrue);
|
||||
osTime->setGetTimeFunc(getTimeFuncTrue);
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
auto deviceTime = osTime->getDeviceTime();
|
||||
|
||||
EXPECT_EQ(deviceTime->getGpuCpuTimeImplCalled, 0u);
|
||||
TimeStampData gpuCpuTime;
|
||||
@@ -311,6 +320,17 @@ TEST_F(DrmTimeTest, whenGettingGpuTimeStampValueWithinIntervalThenReuseFromPrevi
|
||||
}
|
||||
|
||||
TEST_F(DrmTimeTest, whenGettingGpuTimeStampValueAfterIntervalThenCallToKmdAndAdaptTimeout) {
|
||||
DebugManagerStateRestore restore;
|
||||
debugManager.flags.EnableReusingGpuTimestamps.set(true);
|
||||
|
||||
// Recreate mock to apply debug flag
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
osTime = MockOSTimeLinux::create(*rootDeviceEnvironment.osInterface);
|
||||
osTime->setResolutionFunc(resolutionFuncTrue);
|
||||
osTime->setGetTimeFunc(getTimeFuncTrue);
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
auto deviceTime = osTime->getDeviceTime();
|
||||
deviceTime->callBaseGetGpuCpuTimeImpl = false;
|
||||
EXPECT_EQ(deviceTime->getGpuCpuTimeImplCalled, 0u);
|
||||
|
||||
@@ -380,20 +400,3 @@ TEST_F(DrmTimeTest, givenReusingTimestampsDisabledWhenGetTimestampRefreshTimeout
|
||||
osTime->setGetTimeFunc(getTimeFuncTrue);
|
||||
EXPECT_EQ(0ul, osTime->getTimestampRefreshTimeout());
|
||||
}
|
||||
|
||||
TEST_F(DrmTimeTest, givenReusingTimestampsDisabledWhenGetGpuCpuTimeThenAlwaysCallKmd) {
|
||||
DebugManagerStateRestore restore;
|
||||
debugManager.flags.EnableReusingGpuTimestamps.set(0);
|
||||
// Recreate mock to apply debug flag
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
osTime = MockOSTimeLinux::create(*rootDeviceEnvironment.osInterface);
|
||||
osTime->setResolutionFunc(resolutionFuncTrue);
|
||||
osTime->setGetTimeFunc(getTimeFuncTrue);
|
||||
auto deviceTime = osTime->getDeviceTime();
|
||||
TimeStampData gpuCpuTime;
|
||||
osTime->getGpuCpuTime(&gpuCpuTime);
|
||||
EXPECT_EQ(deviceTime->getGpuCpuTimeImplCalled, 1u);
|
||||
|
||||
osTime->getGpuCpuTime(&gpuCpuTime);
|
||||
EXPECT_EQ(deviceTime->getGpuCpuTimeImplCalled, 2u);
|
||||
}
|
||||
|
||||
@@ -53,8 +53,6 @@ struct OSTimeWinTest : public ::testing::Test {
|
||||
rootDeviceEnvironment.osInterface = std::make_unique<OSInterface>();
|
||||
rootDeviceEnvironment.osInterface->setDriverModel(std::unique_ptr<DriverModel>(wddm));
|
||||
osTime = std::unique_ptr<MockOSTimeWin>(new MockOSTimeWin(*rootDeviceEnvironment.osInterface));
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
@@ -64,11 +62,8 @@ struct OSTimeWinTest : public ::testing::Test {
|
||||
};
|
||||
|
||||
TEST_F(OSTimeWinTest, given36BitGpuTimeStampWhenGpuTimeStampOverflowThenGpuTimeDoesNotDecrease) {
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
auto deviceTime = new MockDeviceTimeWin();
|
||||
osTime->deviceTime.reset(deviceTime);
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
|
||||
TimeStampData gpuCpuTime = {0ull, 0ull};
|
||||
|
||||
@@ -100,11 +95,8 @@ TEST_F(OSTimeWinTest, given36BitGpuTimeStampWhenGpuTimeStampOverflowThenGpuTimeD
|
||||
}
|
||||
|
||||
TEST_F(OSTimeWinTest, given64BitGpuTimeStampWhenGpuTimeStampOverflowThenOverflowsAreNotDetected) {
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
auto deviceTime = new MockDeviceTimeWin();
|
||||
osTime->deviceTime.reset(deviceTime);
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
|
||||
TimeStampData gpuCpuTime = {0ull, 0ull};
|
||||
|
||||
@@ -191,12 +183,9 @@ TEST(OSTimeWinTests, givenOSInterfaceWhenGetGpuCpuTimeThenReturnsSuccess) {
|
||||
auto wddm = new WddmMock(rootDeviceEnvironment);
|
||||
TimeStampData gpuCpuTime01 = {};
|
||||
TimeStampData gpuCpuTime02 = {};
|
||||
rootDeviceEnvironment.osInterface = std::make_unique<OSInterface>();
|
||||
rootDeviceEnvironment.osInterface->setDriverModel(std::unique_ptr<DriverModel>(wddm));
|
||||
wddm->init();
|
||||
auto osTime = OSTime::create(rootDeviceEnvironment.osInterface.get());
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
std::unique_ptr<OSInterface> osInterface(new OSInterface());
|
||||
osInterface->setDriverModel(std::unique_ptr<DriverModel>(wddm));
|
||||
auto osTime = OSTime::create(osInterface.get());
|
||||
auto success = osTime->getGpuCpuTime(&gpuCpuTime01);
|
||||
EXPECT_TRUE(success);
|
||||
EXPECT_NE(0u, gpuCpuTime01.cpuTimeinNS);
|
||||
@@ -219,6 +208,8 @@ TEST_F(OSTimeWinTest, whenGettingMaxGpuTimeStampValueThenHwInfoBasedValueIsRetur
|
||||
}
|
||||
|
||||
TEST_F(OSTimeWinTest, whenGettingMaxGpuTimeStampValueWithinIntervalThenReuseFromPreviousCall) {
|
||||
DebugManagerStateRestore restore;
|
||||
debugManager.flags.EnableReusingGpuTimestamps.set(true);
|
||||
osTime->overrideQueryPerformanceCounterFunction(queryPerformanceCounterMock);
|
||||
LARGE_INTEGER frequency = {};
|
||||
frequency.QuadPart = NSEC_PER_SEC;
|
||||
@@ -254,6 +245,8 @@ TEST_F(OSTimeWinTest, whenGettingMaxGpuTimeStampValueWithinIntervalThenReuseFrom
|
||||
}
|
||||
|
||||
TEST_F(OSTimeWinTest, whenGettingGpuTimeStampValueAfterIntervalThenCallToKmdAndAdaptTimeout) {
|
||||
DebugManagerStateRestore restore;
|
||||
debugManager.flags.EnableReusingGpuTimestamps.set(true);
|
||||
osTime->overrideQueryPerformanceCounterFunction(queryPerformanceCounterMock);
|
||||
LARGE_INTEGER frequency = {};
|
||||
frequency.QuadPart = NSEC_PER_SEC;
|
||||
@@ -311,6 +304,8 @@ TEST_F(OSTimeWinTest, whenGetGpuCpuTimeFailedThenReturnFalse) {
|
||||
}
|
||||
|
||||
TEST_F(OSTimeWinTest, whenGettingMaxGpuTimeStampValueAfterFlagSetThenCallToKmd) {
|
||||
DebugManagerStateRestore restore;
|
||||
debugManager.flags.EnableReusingGpuTimestamps.set(true);
|
||||
TimeStampData gpuCpuTime;
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
@@ -329,6 +324,8 @@ TEST_F(OSTimeWinTest, whenGettingMaxGpuTimeStampValueAfterFlagSetThenCallToKmd)
|
||||
}
|
||||
|
||||
TEST_F(OSTimeWinTest, whenGettingMaxGpuTimeStampValueWhenForceFlagSetThenCallToKmd) {
|
||||
DebugManagerStateRestore restore;
|
||||
debugManager.flags.EnableReusingGpuTimestamps.set(true);
|
||||
osTime->overrideQueryPerformanceCounterFunction(queryPerformanceCounterMock);
|
||||
LARGE_INTEGER frequency = {};
|
||||
frequency.QuadPart = NSEC_PER_SEC;
|
||||
@@ -362,19 +359,3 @@ TEST_F(OSTimeWinTest, givenReusingTimestampsDisabledWhenGetTimestampRefreshTimeo
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
EXPECT_EQ(0ul, osTime->getTimestampRefreshTimeout());
|
||||
}
|
||||
|
||||
TEST_F(OSTimeWinTest, givenReusingTimestampsDisabledWhenGetGpuCpuTimeThenAlwaysCallKmd) {
|
||||
DebugManagerStateRestore restore;
|
||||
debugManager.flags.EnableReusingGpuTimestamps.set(0);
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
auto deviceTime = new MockDeviceTimeWin();
|
||||
osTime->deviceTime.reset(deviceTime);
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
TimeStampData gpuCpuTime;
|
||||
osTime->getGpuCpuTime(&gpuCpuTime);
|
||||
EXPECT_EQ(deviceTime->getGpuCpuTimeImplCalled, 1u);
|
||||
|
||||
osTime->getGpuCpuTime(&gpuCpuTime);
|
||||
EXPECT_EQ(deviceTime->getGpuCpuTimeImplCalled, 2u);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user