mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
New method to return TimestampPacket alignment
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
e93dc9c61a
commit
da9d039dd6
@ -358,6 +358,30 @@ HWTEST_F(TimestampPacketTests, givenCommandStreamReceiverHwWhenObtainingPreferre
|
||||
EXPECT_EQ(2048u, csr.getPreferredTagPoolSize());
|
||||
}
|
||||
|
||||
HWTEST_F(TimestampPacketTests, givenTagAlignmentWhenCreatingAllocatorThenGpuAddressIsAligned) {
|
||||
class MyCsr : public CommandStreamReceiverHw<FamilyType> {
|
||||
public:
|
||||
using CommandStreamReceiverHw<FamilyType>::CommandStreamReceiverHw;
|
||||
size_t getTimestampPacketAllocatorAlignment() const override {
|
||||
return alignment;
|
||||
}
|
||||
|
||||
size_t alignment = 4096;
|
||||
};
|
||||
OsContext &osContext = *executionEnvironment->memoryManager->getRegisteredEngines()[0].osContext;
|
||||
|
||||
MyCsr csr(*executionEnvironment, 0, osContext.getDeviceBitfield());
|
||||
csr.setupContext(osContext);
|
||||
|
||||
auto allocator = csr.getTimestampPacketAllocator();
|
||||
|
||||
auto tag1 = allocator->getTag();
|
||||
auto tag2 = allocator->getTag();
|
||||
|
||||
EXPECT_TRUE(isAligned(tag1->getGpuAddress(), csr.alignment));
|
||||
EXPECT_TRUE(isAligned(tag2->getGpuAddress(), csr.alignment));
|
||||
}
|
||||
|
||||
HWTEST_F(TimestampPacketTests, givenDebugFlagSetWhenCreatingTimestampPacketAllocatorThenDisableReusingAndLimitPoolSize) {
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.DisableTimestampPacketOptimizations.set(true);
|
||||
|
Reference in New Issue
Block a user