Skip to content

Commit 6ee7c6d

Browse files
Use correct allocation type for timestamp events
Change-Id: I82dc122fd78045d548f95262c2155eab1b1eae39 Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@intel.com>
1 parent b6ccfed commit 6ee7c6d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

level_zero/core/source/event/event.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ struct EventPoolImp : public EventPool {
9999

100100
NEO::AllocationProperties properties(
101101
device->getRootDeviceIndex(), count * eventSize,
102-
NEO::GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
102+
isEventPoolUsedForTimestamp ? NEO::GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER
103+
: NEO::GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
103104
properties.alignment = MemoryConstants::cacheLineSize;
104105
eventPoolAllocation = driver->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);
105106

level_zero/core/test/unit_tests/sources/event/test_event.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,5 +170,12 @@ TEST_F(TimestampEventCreate, givenSingleTimestampEventThenAllocationSizeCreatedF
170170
EXPECT_GE(minTimestampEventAllocation, allocation->getUnderlyingBufferSize());
171171
}
172172

173+
TEST_F(TimestampEventCreate, givenTimestampEventThenAllocationsIsOfPacketTagBufferType) {
174+
auto allocation = &eventPool->getAllocation();
175+
ASSERT_NE(nullptr, allocation);
176+
177+
EXPECT_EQ(NEO::GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, allocation->getAllocationType());
178+
}
179+
173180
} // namespace ult
174181
} // namespace L0

0 commit comments

Comments
 (0)