refactor: get correct profiling allocation from event

Related-To: NEO-11925

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2024-09-20 12:30:17 +00:00
committed by Compute-Runtime-Automation
parent 1ccc208bc3
commit 08f57c0fd4
12 changed files with 53 additions and 28 deletions

View File

@@ -25,6 +25,7 @@ struct InOrderCmdListFixture : public ::Test<ModuleFixture> {
struct FixtureMockEvent : public EventImp<uint32_t> {
using EventImp<uint32_t>::Event::counterBasedMode;
using EventImp<uint32_t>::Event::counterBasedFlags;
using EventImp<uint32_t>::eventPoolAllocation;
using EventImp<uint32_t>::maxPacketCount;
using EventImp<uint32_t>::inOrderExecInfo;
using EventImp<uint32_t>::inOrderExecSignalValue;

View File

@@ -134,7 +134,7 @@ class MockEvent : public ::L0::Event {
this->maxKernelCount = EventPacketsCount::maxKernelSplit;
this->maxPacketCount = EventPacketsCount::eventPackets;
}
NEO::GraphicsAllocation *getPoolAllocation(L0::Device *device) const override {
NEO::GraphicsAllocation *getAllocation(L0::Device *device) const override {
return mockAllocation.get();
}

View File

@@ -1001,7 +1001,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenTimestampEventsWhenAppendingKernel
{
auto itorEvent = std::find(std::begin(commandList->getCmdContainer().getResidencyContainer()),
std::end(commandList->getCmdContainer().getResidencyContainer()),
event->getPoolAllocation(device));
event->getAllocation(device));
EXPECT_NE(itorEvent, std::end(commandList->getCmdContainer().getResidencyContainer()));
}
}
@@ -1663,7 +1663,7 @@ HWTEST2_F(CommandListAppendLaunchKernelMockModule,
ASSERT_EQ(ZE_RESULT_SUCCESS, eventPool->createEvent(&eventDesc, &event));
std::unique_ptr<L0::Event> eventObject(L0::Event::fromHandle(event));
auto eventAllocation = eventObject->getPoolAllocation(device);
auto eventAllocation = eventObject->getAllocation(device);
ASSERT_NE(nullptr, eventAllocation);
ze_group_count_t groupCount{1, 1, 1};

View File

@@ -132,7 +132,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandListAppendLaunchKernel, givenEventsWhenApp
{
auto itorEvent = std::find(std::begin(commandList->getCmdContainer().getResidencyContainer()),
std::end(commandList->getCmdContainer().getResidencyContainer()),
event->getPoolAllocation(device));
event->getAllocation(device));
EXPECT_NE(itorEvent, std::end(commandList->getCmdContainer().getResidencyContainer()));
}
}

View File

@@ -2564,7 +2564,7 @@ HWTEST2_F(CommandListCreate, givenAppendSignalEventWhenSkipAddToResidencyTrueThe
ASSERT_NE(nullptr, event.get());
auto &residencyContainer = commandContainer.getResidencyContainer();
auto eventAllocation = event->getPoolAllocation(device);
auto eventAllocation = event->getAllocation(device);
void *pipeControlBuffer = nullptr;
@@ -2645,7 +2645,7 @@ HWTEST2_F(CommandListCreate,
ASSERT_NE(nullptr, event.get());
auto &residencyContainer = commandContainer.getResidencyContainer();
auto eventAllocation = event->getPoolAllocation(device);
auto eventAllocation = event->getAllocation(device);
auto eventBaseAddress = event->getGpuAddress(device);
CommandToPatchContainer outStoreRegMemCmdList;
@@ -3115,7 +3115,7 @@ HWTEST2_F(CommandListAppendLaunchKernel,
ASSERT_NE(nullptr, event.get());
auto eventBaseAddress = event->getGpuAddress(device);
auto eventAlloaction = event->getPoolAllocation(device);
auto eventAlloaction = event->getAllocation(device);
uint8_t computeWalkerHostBuffer[512];
uint8_t payloadHostBuffer[256];

View File

@@ -6545,6 +6545,22 @@ struct StandaloneInOrderTimestampAllocationTests : public InOrderCmdListTests {
}
};
HWTEST2_F(StandaloneInOrderTimestampAllocationTests, givenTimestampEventWhenAskingForAllocationOrGpuAddressThenReturnNodeAllocation, MatchAny) {
auto eventPool = createEvents<FamilyType>(1, true);
auto cmdList = createImmCmdList<gfxCoreFamily>();
cmdList->appendLaunchKernel(kernel->toHandle(), groupCount, events[0]->toHandle(), 0, nullptr, launchParams, false);
EXPECT_NE(events[0]->inOrderTimestampNode->getBaseGraphicsAllocation(), events[0]->eventPoolAllocation);
EXPECT_NE(nullptr, events[0]->inOrderTimestampNode->getBaseGraphicsAllocation());
EXPECT_NE(nullptr, events[0]->eventPoolAllocation);
EXPECT_EQ(events[0]->inOrderTimestampNode->getBaseGraphicsAllocation()->getGraphicsAllocation(0), events[0]->getAllocation(device));
EXPECT_EQ(events[0]->inOrderTimestampNode->getBaseGraphicsAllocation()->getGraphicsAllocation(0)->getGpuAddress(), events[0]->getGpuAddress(device));
EXPECT_EQ(events[0]->getGpuAddress(device) + events[0]->getCompletionFieldOffset(), events[0]->getCompletionFieldGpuAddress(device));
}
HWTEST2_F(StandaloneInOrderTimestampAllocationTests, givenTimestampEventWhenDispatchingThenAssignNewNode, MatchAny) {
auto eventPool = createEvents<FamilyType>(1, true);
auto eventHandle = events[0]->toHandle();

View File

@@ -3273,7 +3273,7 @@ HWTEST_F(EventTests, GivenEventWhenHostSynchronizeCalledThenExpectDownloadEventA
downloadAllocationTrack[&gfxAllocation]++;
};
auto eventAllocation = event->getPoolAllocation(device);
auto eventAllocation = event->getAllocation(device);
constexpr uint64_t timeout = std::numeric_limits<std::uint64_t>::max();
auto result = event->hostSynchronize(timeout);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
@@ -3357,7 +3357,7 @@ HWTEST_F(EventContextGroupTests, givenSecondaryCsrWhenDownloadingAllocationThenU
downloadCounter++;
};
auto eventAllocation = event->getPoolAllocation(device);
auto eventAllocation = event->getAllocation(device);
ultCsr->makeResident(*eventAllocation);
event->hostSynchronize(1);
@@ -3397,7 +3397,7 @@ HWTEST_F(EventTests, GivenEventUsedOnNonDefaultCsrWhenHostSynchronizeCalledThenA
downloadAllocationTrack[&gfxAllocation]++;
};
auto eventAllocation = event->getPoolAllocation(device);
auto eventAllocation = event->getAllocation(device);
constexpr uint64_t timeout = 0;
auto result = event->hostSynchronize(timeout);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
@@ -3653,7 +3653,7 @@ HWTEST_F(EventTests, GivenCsrTbxModeWhenEventCreatedAndSignaledThenEventAllocati
EXPECT_EQ(0u, ultCsr.writeMemoryParams.chunkWriteCallCount);
auto event = whiteboxCast(getHelper<L0GfxCoreHelper>().createEvent(eventPool.get(), &eventDesc, device));
auto eventAllocation = event->getPoolAllocation(device);
auto eventAllocation = event->getAllocation(device);
EXPECT_TRUE(eventAllocation->getAubInfo().writeMemoryOnly);
@@ -4340,7 +4340,7 @@ HWTEST2_F(EventMultiTileDynamicPacketUseTest, givenEventUsedCreatedOnSubDeviceBu
downloadCounter1++;
};
auto eventAllocation = event->getPoolAllocation(device);
auto eventAllocation = event->getAllocation(device);
ultCsr0->makeResident(*eventAllocation);
rootCsr->makeResident(*eventAllocation);