Split wait for timestamps to queue and event

On PVC both enabled.
On DG2 only for events.

Related-To: NEO-6948

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Dominik Dabek
2022-05-05 14:26:03 +00:00
committed by Compute-Runtime-Automation
parent 0b4ea8d2eb
commit 6e8cabdce5
17 changed files with 129 additions and 31 deletions

View File

@@ -42,7 +42,7 @@ HWTEST_F(CommandQueueHwTest, WhenConstructingTwoCommandQueuesThenOnlyOneDebugSur
HWTEST_F(CommandQueueHwTest, givenNoTimestampPacketsWhenWaitForTimestampsThenNoWaitAndTagIsNotUpdated) {
DebugManagerStateRestore restorer;
DebugManager.flags.EnableTimestampPacket.set(0);
DebugManager.flags.EnableTimestampWait.set(4);
DebugManager.flags.EnableTimestampWaitForQueues.set(4);
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
auto device = std::make_unique<MockClDevice>(MockDevice::create<MockDeviceWithDebuggerActive>(executionEnvironment, 0u));
device->getUltCommandStreamReceiver<FamilyType>().timestampPacketWriteEnabled = false;

View File

@@ -146,34 +146,34 @@ TEST(CommandQueue, givenEnableTimestampWaitWhenCheckIsTimestampWaitEnabledThenRe
MockCommandQueue cmdQ(nullptr, mockDevice.get(), 0, false);
{
DebugManager.flags.EnableTimestampWait.set(-1);
DebugManager.flags.EnableTimestampWaitForQueues.set(-1);
const auto &hwHelper = HwHelper::get(mockDevice->getHardwareInfo().platform.eRenderCoreFamily);
const auto &hwInfoConfig = *HwInfoConfig::get(mockDevice->getHardwareInfo().platform.eProductFamily);
EXPECT_EQ(cmdQ.isWaitForTimestampsEnabled(), hwHelper.isTimestampWaitSupported() && !hwInfoConfig.isDcFlushAllowed());
EXPECT_EQ(cmdQ.isWaitForTimestampsEnabled(), hwHelper.isTimestampWaitSupportedForQueues() && !hwInfoConfig.isDcFlushAllowed());
}
{
DebugManager.flags.EnableTimestampWait.set(0);
DebugManager.flags.EnableTimestampWaitForQueues.set(0);
EXPECT_FALSE(cmdQ.isWaitForTimestampsEnabled());
}
{
DebugManager.flags.EnableTimestampWait.set(1);
DebugManager.flags.EnableTimestampWaitForQueues.set(1);
EXPECT_EQ(cmdQ.isWaitForTimestampsEnabled(), cmdQ.getGpgpuCommandStreamReceiver().isUpdateTagFromWaitEnabled());
}
{
DebugManager.flags.EnableTimestampWait.set(2);
DebugManager.flags.EnableTimestampWaitForQueues.set(2);
EXPECT_EQ(cmdQ.isWaitForTimestampsEnabled(), cmdQ.getGpgpuCommandStreamReceiver().isDirectSubmissionEnabled());
}
{
DebugManager.flags.EnableTimestampWait.set(3);
DebugManager.flags.EnableTimestampWaitForQueues.set(3);
EXPECT_EQ(cmdQ.isWaitForTimestampsEnabled(), cmdQ.getGpgpuCommandStreamReceiver().isAnyDirectSubmissionEnabled());
}
{
DebugManager.flags.EnableTimestampWait.set(4);
DebugManager.flags.EnableTimestampWaitForQueues.set(4);
EXPECT_TRUE(cmdQ.isWaitForTimestampsEnabled());
}
}

View File

@@ -1708,7 +1708,7 @@ TEST(EventsDebug, givenEventWhenTrackingOfParentsIsOffThenDoNotTrackParents) {
event.setStatus(CL_COMPLETE);
}
TEST(CommandQueue, givenTimestampPacketWritesDisabledAndQueueHasTimestampPacketContainerThenCreateTheContainerForEvent) {
TEST(EventTimestampTest, givenTimestampPacketWritesDisabledAndQueueHasTimestampPacketContainerThenCreateTheContainerForEvent) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.EnableTimestampPacket.set(0);
@@ -1721,3 +1721,45 @@ TEST(CommandQueue, givenTimestampPacketWritesDisabledAndQueueHasTimestampPacketC
MockEvent<Event> event{&queue, CL_COMMAND_MARKER, 0, 0};
EXPECT_NE(nullptr, event.timestampPacketContainer);
}
TEST(EventTimestampTest, givenEnableTimestampWaitWhenCheckIsTimestampWaitEnabledThenReturnProperValue) {
DebugManagerStateRestore restorer;
VariableBackup<UltHwConfig> backup(&ultHwConfig);
ultHwConfig.useWaitForTimestamps = true;
MockContext context{};
auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
MockCommandQueue cmdQ(&context, mockDevice.get(), 0, false);
MockEvent<Event> event{&cmdQ, CL_COMMAND_MARKER, 0, 0};
{
DebugManager.flags.EnableTimestampWaitForEvents.set(-1);
const auto &hwHelper = HwHelper::get(mockDevice->getHardwareInfo().platform.eRenderCoreFamily);
EXPECT_EQ(event.isWaitForTimestampsEnabled(), hwHelper.isTimestampWaitSupportedForEvents());
}
{
DebugManager.flags.EnableTimestampWaitForEvents.set(0);
EXPECT_FALSE(event.isWaitForTimestampsEnabled());
}
{
DebugManager.flags.EnableTimestampWaitForEvents.set(1);
EXPECT_EQ(event.isWaitForTimestampsEnabled(), cmdQ.getGpgpuCommandStreamReceiver().isUpdateTagFromWaitEnabled());
}
{
DebugManager.flags.EnableTimestampWaitForEvents.set(2);
EXPECT_EQ(event.isWaitForTimestampsEnabled(), cmdQ.getGpgpuCommandStreamReceiver().isDirectSubmissionEnabled());
}
{
DebugManager.flags.EnableTimestampWaitForEvents.set(3);
EXPECT_EQ(event.isWaitForTimestampsEnabled(), cmdQ.getGpgpuCommandStreamReceiver().isAnyDirectSubmissionEnabled());
}
{
DebugManager.flags.EnableTimestampWaitForEvents.set(4);
EXPECT_TRUE(event.isWaitForTimestampsEnabled());
}
}

View File

@@ -819,7 +819,8 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledWhenEnqueueingThe
HWTEST_F(TimestampPacketTests, givenTimestampWaitEnabledWhenEnqueueWithEventThenEventHasCorrectTimestampsToCheckForCompletion) {
DebugManagerStateRestore restorer;
DebugManager.flags.UpdateTaskCountFromWait.set(3);
DebugManager.flags.EnableTimestampWait.set(1);
DebugManager.flags.EnableTimestampWaitForEvents.set(1);
DebugManager.flags.EnableTimestampWaitForQueues.set(1);
auto &csr = device->getUltCommandStreamReceiver<FamilyType>();
csr.timestampPacketWriteEnabled = true;
@@ -889,10 +890,10 @@ HWTEST_F(TimestampPacketTests, givenTimestampWaitEnabledWhenEnqueueWithEventThen
*csr.getTagAddress() = csr.peekTaskCount();
}
HWTEST_F(TimestampPacketTests, givenEnableTimestampWaitWhenFinishWithoutEnqueueThenDoNotWaitOnTimestamp) {
HWTEST_F(TimestampPacketTests, givenEnableTimestampWaitForQueuesWhenFinishWithoutEnqueueThenDoNotWaitOnTimestamp) {
DebugManagerStateRestore restorer;
DebugManager.flags.UpdateTaskCountFromWait.set(3);
DebugManager.flags.EnableTimestampWait.set(1);
DebugManager.flags.EnableTimestampWaitForQueues.set(1);
auto &csr = device->getUltCommandStreamReceiver<FamilyType>();
csr.timestampPacketWriteEnabled = true;
@@ -910,10 +911,10 @@ HWTEST_F(TimestampPacketTests, givenEnableTimestampWaitWhenFinishWithoutEnqueueT
EXPECT_EQ(csr.waitForCompletionWithTimeoutTaskCountCalled, 1u);
}
HWTEST_F(TimestampPacketTests, givenEnableTimestampWaitWhenFinishThenWaitOnTimestamp) {
HWTEST_F(TimestampPacketTests, givenEnableTimestampWaitForQueuesWhenFinishThenWaitOnTimestamp) {
DebugManagerStateRestore restorer;
DebugManager.flags.UpdateTaskCountFromWait.set(3);
DebugManager.flags.EnableTimestampWait.set(1);
DebugManager.flags.EnableTimestampWaitForQueues.set(1);
auto &csr = device->getUltCommandStreamReceiver<FamilyType>();
csr.timestampPacketWriteEnabled = true;
@@ -940,10 +941,10 @@ HWTEST_F(TimestampPacketTests, givenEnableTimestampWaitWhenFinishThenWaitOnTimes
EXPECT_EQ(csr.waitForCompletionWithTimeoutTaskCountCalled, 0u);
}
HWTEST_F(TimestampPacketTests, givenOOQAndEnableTimestampWaitWhenFinishThenWaitOnTimestamp) {
HWTEST_F(TimestampPacketTests, givenOOQAndEnableTimestampWaitForQueuesWhenFinishThenWaitOnTimestamp) {
DebugManagerStateRestore restorer;
DebugManager.flags.UpdateTaskCountFromWait.set(3);
DebugManager.flags.EnableTimestampWait.set(1);
DebugManager.flags.EnableTimestampWaitForQueues.set(1);
auto &csr = device->getUltCommandStreamReceiver<FamilyType>();
csr.timestampPacketWriteEnabled = true;
@@ -982,10 +983,10 @@ extern uint32_t pauseOffset;
extern std::function<void()> setupPauseAddress;
} // namespace CpuIntrinsicsTests
HWTEST_F(TimestampPacketTests, givenEnableTimestampWaitWhenFinishThenCallWaitUtils) {
HWTEST_F(TimestampPacketTests, givenEnableTimestampWaitForQueuesWhenFinishThenCallWaitUtils) {
DebugManagerStateRestore restorer;
DebugManager.flags.UpdateTaskCountFromWait.set(3);
DebugManager.flags.EnableTimestampWait.set(1);
DebugManager.flags.EnableTimestampWaitForQueues.set(1);
device->getUltCommandStreamReceiver<FamilyType>().timestampPacketWriteEnabled = true;
cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, 0};

View File

@@ -37,6 +37,7 @@ struct MockEvent : public BaseEventType {
using BaseEventType::timeStampNode;
using Event::calcProfilingData;
using Event::calculateSubmitTimestampData;
using Event::isWaitForTimestampsEnabled;
using Event::magic;
using Event::queueTimeStamp;
using Event::submitTimeStamp;

View File

@@ -234,7 +234,7 @@ PrintIoctlTimes = 0
PrintIoctlEntries = 0
PrintUmdSharedMigration = 0
UpdateTaskCountFromWait = -1
EnableTimestampWait = -1
EnableTimestampWaitForQueues = -1
PreferCopyEngineForCopyBufferToBuffer = -1
EnableStaticPartitioning = -1
DisableDeepBind = 0
@@ -416,3 +416,4 @@ PrintImageBlitBlockCopyCmdDetails = 0
UseContextEndOffsetForEventCompletion = -1
DirectSubmissionInsertExtraMiMemFenceCommands = -1
DirectSubmissionInsertSfenceInstructionPriorToSubmission = -1
EnableTimestampWaitForEvents = -1