|
14 | 14 | #include "shared/source/helpers/hw_helper.h" |
15 | 15 | #include "shared/source/helpers/hw_info.h" |
16 | 16 | #include "shared/source/helpers/preamble.h" |
| 17 | +#include "shared/source/helpers/timestamp_packet.h" |
17 | 18 | #include "shared/source/memory_manager/allocation_properties.h" |
18 | 19 | #include "shared/source/memory_manager/graphics_allocation.h" |
19 | 20 | #include "shared/source/os_interface/os_interface.h" |
| 21 | +#include "shared/source/utilities/tag_allocator.h" |
20 | 22 |
|
21 | 23 | #include "aub_mem_dump.h" |
22 | 24 | #include "pipe_control_args.h" |
@@ -460,6 +462,37 @@ bool HwHelperHw<GfxFamily>::additionalKernelExecInfoSupported(const HardwareInfo |
460 | 462 | return false; |
461 | 463 | } |
462 | 464 |
|
| 465 | +template <typename GfxFamily> |
| 466 | +std::unique_ptr<TagAllocatorBase> HwHelperHw<GfxFamily>::createTimestampPacketAllocator(const std::vector<uint32_t> &rootDeviceIndices, MemoryManager *memoryManager, |
| 467 | + size_t initialTagCount, CommandStreamReceiverType csrType, DeviceBitfield deviceBitfield) const { |
| 468 | + bool doNotReleaseNodes = (csrType > CommandStreamReceiverType::CSR_HW) || |
| 469 | + DebugManager.flags.DisableTimestampPacketOptimizations.get(); |
| 470 | + |
| 471 | + auto tagAlignment = getTimestampPacketAllocatorAlignment(); |
| 472 | + |
| 473 | + if (DebugManager.flags.OverrideTimestampPacketSize.get() != -1) { |
| 474 | + if (DebugManager.flags.OverrideTimestampPacketSize.get() == 4) { |
| 475 | + using TimestampPackets32T = TimestampPackets<uint32_t>; |
| 476 | + return std::make_unique<TagAllocator<TimestampPackets32T>>(rootDeviceIndices, memoryManager, initialTagCount, tagAlignment, sizeof(TimestampPackets32T), doNotReleaseNodes, deviceBitfield); |
| 477 | + } else if (DebugManager.flags.OverrideTimestampPacketSize.get() == 8) { |
| 478 | + using TimestampPackets64T = TimestampPackets<uint64_t>; |
| 479 | + return std::make_unique<TagAllocator<TimestampPackets64T>>(rootDeviceIndices, memoryManager, initialTagCount, tagAlignment, sizeof(TimestampPackets64T), doNotReleaseNodes, deviceBitfield); |
| 480 | + } else { |
| 481 | + UNRECOVERABLE_IF(true); |
| 482 | + } |
| 483 | + } |
| 484 | + |
| 485 | + using TimestampPacketType = typename GfxFamily::TimestampPacketType; |
| 486 | + using TimestampPacketsT = TimestampPackets<TimestampPacketType>; |
| 487 | + |
| 488 | + return std::make_unique<TagAllocator<TimestampPacketsT>>(rootDeviceIndices, memoryManager, initialTagCount, tagAlignment, sizeof(TimestampPacketsT), doNotReleaseNodes, deviceBitfield); |
| 489 | +} |
| 490 | + |
| 491 | +template <typename GfxFamily> |
| 492 | +size_t HwHelperHw<GfxFamily>::getTimestampPacketAllocatorAlignment() const { |
| 493 | + return MemoryConstants::cacheLineSize * 4; |
| 494 | +} |
| 495 | + |
463 | 496 | template <typename GfxFamily> |
464 | 497 | LocalMemoryAccessMode HwHelperHw<GfxFamily>::getLocalMemoryAccessMode(const HardwareInfo &hwInfo) const { |
465 | 498 | switch (static_cast<LocalMemoryAccessMode>(DebugManager.flags.ForceLocalMemoryAccessMode.get())) { |
|
0 commit comments