fix: allocation information from standalone profiling CB event

Related-To: NEO-11925

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2024-09-26 15:22:08 +00:00
committed by Compute-Runtime-Automation
parent 79bffdb5ba
commit 17a2b36a87
3 changed files with 17 additions and 1 deletions

View File

@@ -411,6 +411,9 @@ void Event::disableImplicitCounterBasedMode() {
}
uint64_t Event::getGpuAddress(Device *device) const {
if (inOrderTimestampNode) {
return inOrderTimestampNode->getGpuAddress();
}
return getAllocation(device)->getGpuAddress() + this->eventPoolOffset;
}

View File

@@ -300,6 +300,8 @@ struct Event : _ze_event_handle_t {
void resetInOrderTimestampNode(NEO::TagNodeBase *newNode);
bool hasInOrderTimestampNode() const { return inOrderTimestampNode != nullptr; }
protected:
Event(int index, Device *device) : device(device), index(index) {}

View File

@@ -6628,11 +6628,18 @@ struct StandaloneInOrderTimestampAllocationTests : public InOrderCmdListTests {
};
HWTEST2_F(StandaloneInOrderTimestampAllocationTests, givenTimestampEventWhenAskingForAllocationOrGpuAddressThenReturnNodeAllocation, MatchAny) {
auto eventPool = createEvents<FamilyType>(1, true);
auto eventPool = createEvents<FamilyType>(2, true);
auto cmdList = createImmCmdList<gfxCoreFamily>();
EXPECT_FALSE(events[0]->hasInOrderTimestampNode());
EXPECT_FALSE(events[1]->hasInOrderTimestampNode());
cmdList->appendLaunchKernel(kernel->toHandle(), groupCount, events[0]->toHandle(), 0, nullptr, launchParams, false);
cmdList->appendLaunchKernel(kernel->toHandle(), groupCount, events[1]->toHandle(), 0, nullptr, launchParams, false);
EXPECT_TRUE(events[0]->hasInOrderTimestampNode());
EXPECT_TRUE(events[1]->hasInOrderTimestampNode());
EXPECT_NE(events[0]->inOrderTimestampNode->getBaseGraphicsAllocation(), events[0]->eventPoolAllocation);
EXPECT_NE(nullptr, events[0]->inOrderTimestampNode->getBaseGraphicsAllocation());
@@ -6641,6 +6648,10 @@ HWTEST2_F(StandaloneInOrderTimestampAllocationTests, givenTimestampEventWhenAski
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));
EXPECT_EQ(events[0]->getGpuAddress(device), events[0]->inOrderTimestampNode->getGpuAddress());
EXPECT_EQ(events[1]->getGpuAddress(device), events[1]->inOrderTimestampNode->getGpuAddress());
EXPECT_NE(events[0]->getGpuAddress(device), events[1]->getGpuAddress(device));
}
HWTEST2_F(StandaloneInOrderTimestampAllocationTests, givenNonWalkerCounterSignalingWhenPassedNonProfilingEventThenAssignAllocation, IsAtLeastXeHpCore) {