Revert "Set as default use of device based timestamps"

This reverts commit 2d229f3fea.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2022-11-10 05:53:45 +01:00
committed by Compute-Runtime-Automation
parent 192f02785d
commit c0ce5f4684
7 changed files with 35 additions and 51 deletions

View File

@ -167,6 +167,8 @@ HWTEST_F(EnqueueHandlerTimestampEnabledTest, givenProflingAndTimeStampPacketsEna
EXPECT_NE(ev->submitTimeStamp.CPUTimeinNS, 0u);
EXPECT_EQ(ev->submitTimeStamp.GPUTimeStamp, 0u);
DebugManagerStateRestore dbgState;
DebugManager.flags.EnableDeviceBasedTimestamps.set(true);
ev->queueTimeStamp.GPUTimeStamp = 1000;
ev->calculateSubmitTimestampData();
@ -205,6 +207,8 @@ HWTEST_F(EnqueueHandlerTimestampDisabledTest, givenProflingEnabledTimeStampPacke
EXPECT_NE(ev->submitTimeStamp.CPUTimeinNS, 0u);
EXPECT_EQ(ev->submitTimeStamp.GPUTimeStamp, 0u);
DebugManagerStateRestore dbgState;
DebugManager.flags.EnableDeviceBasedTimestamps.set(true);
ev->queueTimeStamp.GPUTimeStamp = 1000;
ev->calculateSubmitTimestampData();

View File

@ -69,7 +69,6 @@ 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]);
@ -116,26 +115,27 @@ 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::cpuTimeInNs);
EXPECT_EQ(deviceTS, MockDeviceTimeWithConstTimestamp::CPU_TIME_IN_NS);
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::gpuTimestamp);
EXPECT_EQ(deviceTS, MockDeviceTimeWithConstTimestamp::GPU_TIMESTAMP);
EXPECT_NE(deviceTS, hostTS);
}

View File

@ -794,8 +794,6 @@ TEST_F(InternalsEventTest, GivenProfilingWhenUserEventCreatedThenProfilingNotSet
}
TEST_F(InternalsEventTest, givenDeviceTimestampBaseNotEnabledWhenGetEventProfilingInfoThenCpuTimestampIsReturned) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.EnableDeviceBasedTimestamps.set(0);
pClDevice->setOSTime(new MockOSTimeWithConstTimestamp());
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
MockCommandQueue cmdQ(mockContext, pClDevice, props, false);
@ -807,41 +805,18 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseNotEnabledWhenGetEventProfili
uint64_t submitTime = 0ULL;
event.getEventProfilingInfo(CL_PROFILING_COMMAND_SUBMIT, sizeof(uint64_t), &submitTime, 0);
EXPECT_EQ(submitTime, MockDeviceTimeWithConstTimestamp::cpuTimeInNs);
}
TEST_F(InternalsEventTest, givenDeviceTimestampBaseNotEnabledWhenCalculateStartTimestampThenCorrectTimeIsReturned) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.EnableDeviceBasedTimestamps.set(0);
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
MockCommandQueue cmdQ(mockContext, pClDevice, props, false);
MockEvent<Event> event(&cmdQ, CL_COMPLETE, 0, 0);
HwTimeStamps timestamp{};
timestamp.GlobalStartTS = 2;
event.queueTimeStamp.GPUTimeStamp = 1;
event.queueTimeStamp.CPUTimeinNS = 100;
TagNode<HwTimeStamps> timestampNode{};
timestampNode.tagForCpuAccess = &timestamp;
event.timeStampNode = &timestampNode;
uint64_t start;
event.getEventProfilingInfo(CL_PROFILING_COMMAND_START, sizeof(cl_ulong), &start, nullptr);
auto resolution = pClDevice->getDevice().getDeviceInfo().profilingTimerResolution;
auto &hwHelper = HwHelper::get(pClDevice->getHardwareInfo().platform.eRenderCoreFamily);
auto c0 = event.queueTimeStamp.CPUTimeinNS - hwHelper.getGpuTimeStampInNS(event.queueTimeStamp.GPUTimeStamp, resolution);
EXPECT_EQ(start, static_cast<uint64_t>(timestamp.GlobalStartTS * resolution) + c0);
event.timeStampNode = nullptr;
EXPECT_EQ(submitTime, MockDeviceTimeWithConstTimestamp::CPU_TIME_IN_NS);
}
TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledWhenGetEventProfilingInfoThenGpuTimestampIsReturned) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableDeviceBasedTimestamps.set(true);
pClDevice->setOSTime(new MockOSTimeWithConstTimestamp());
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
MockCommandQueue cmdQ(mockContext, pClDevice, props, false);
MockEvent<Event> event(&cmdQ, CL_COMMAND_MARKER, 0, 0);
event.queueTimeStamp.GPUTimeStamp = MockDeviceTimeWithConstTimestamp::gpuTimestamp;
event.queueTimeStamp.GPUTimeStamp = MockDeviceTimeWithConstTimestamp::GPU_TIMESTAMP;
event.setCommand(std::unique_ptr<Command>(new CommandWithoutKernel(cmdQ)));
event.submitCommand(false);
@ -849,10 +824,13 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledWhenGetEventProfilingI
event.getEventProfilingInfo(CL_PROFILING_COMMAND_SUBMIT, sizeof(uint64_t), &submitTime, 0);
auto resolution = pClDevice->getDevice().getDeviceInfo().profilingTimerResolution;
EXPECT_EQ(submitTime, static_cast<uint64_t>(MockDeviceTimeWithConstTimestamp::gpuTimestamp * resolution));
EXPECT_EQ(submitTime, static_cast<uint64_t>(MockDeviceTimeWithConstTimestamp::GPU_TIMESTAMP * resolution));
}
TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledWhenCalculateStartTimestampThenCorrectTimeIsReturned) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableDeviceBasedTimestamps.set(true);
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
MockCommandQueue cmdQ(mockContext, pClDevice, props, false);
MockEvent<Event> event(&cmdQ, CL_COMPLETE, 0, 0);
@ -874,6 +852,9 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledWhenCalculateStartTime
}
TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledAndGlobalStartTSSmallerThanQueueTSWhenCalculateStartTimestampThenCorrectTimeIsReturned) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableDeviceBasedTimestamps.set(true);
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
MockCommandQueue cmdQ(mockContext, pClDevice, props, false);
MockEvent<Event> event(&cmdQ, CL_COMPLETE, 0, 0);