mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
Move TSP creation to HwHelper
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
1414247ed4
commit
a6c6290c09
@@ -12,6 +12,7 @@
|
||||
#include "shared/source/commands/bxml_generator_glue.h"
|
||||
#include "shared/source/helpers/aux_translation.h"
|
||||
#include "shared/source/helpers/engine_node_helper.h"
|
||||
#include "shared/source/helpers/options.h"
|
||||
#include "shared/source/utilities/stackvec.h"
|
||||
|
||||
#include "aub_mem_dump.h"
|
||||
@@ -26,6 +27,7 @@
|
||||
namespace NEO {
|
||||
class GmmHelper;
|
||||
class GraphicsAllocation;
|
||||
class TagAllocatorBase;
|
||||
struct AllocationData;
|
||||
struct AllocationProperties;
|
||||
struct EngineControl;
|
||||
@@ -147,6 +149,10 @@ class HwHelper {
|
||||
virtual uint32_t getPlanarYuvMaxHeight() const = 0;
|
||||
virtual bool isBlitterForImagesSupported(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual size_t getPreemptionAllocationAlignment() const = 0;
|
||||
virtual std::unique_ptr<TagAllocatorBase> createTimestampPacketAllocator(const std::vector<uint32_t> &rootDeviceIndices, MemoryManager *memoryManager,
|
||||
size_t initialTagCount, CommandStreamReceiverType csrType,
|
||||
DeviceBitfield deviceBitfield) const = 0;
|
||||
virtual size_t getTimestampPacketAllocatorAlignment() const = 0;
|
||||
|
||||
static uint32_t getSubDevicesCount(const HardwareInfo *pHwInfo);
|
||||
static uint32_t getEnginesCount(const HardwareInfo &hwInfo);
|
||||
@@ -370,6 +376,11 @@ class HwHelperHw : public HwHelper {
|
||||
|
||||
size_t getPreemptionAllocationAlignment() const override;
|
||||
|
||||
std::unique_ptr<TagAllocatorBase> createTimestampPacketAllocator(const std::vector<uint32_t> &rootDeviceIndices, MemoryManager *memoryManager,
|
||||
size_t initialTagCount, CommandStreamReceiverType csrType,
|
||||
DeviceBitfield deviceBitfield) const override;
|
||||
size_t getTimestampPacketAllocatorAlignment() const override;
|
||||
|
||||
protected:
|
||||
LocalMemoryAccessMode getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
|
||||
@@ -14,9 +14,11 @@
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/source/helpers/preamble.h"
|
||||
#include "shared/source/helpers/timestamp_packet.h"
|
||||
#include "shared/source/memory_manager/allocation_properties.h"
|
||||
#include "shared/source/memory_manager/graphics_allocation.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/source/utilities/tag_allocator.h"
|
||||
|
||||
#include "aub_mem_dump.h"
|
||||
#include "pipe_control_args.h"
|
||||
@@ -460,6 +462,37 @@ bool HwHelperHw<GfxFamily>::additionalKernelExecInfoSupported(const HardwareInfo
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
std::unique_ptr<TagAllocatorBase> HwHelperHw<GfxFamily>::createTimestampPacketAllocator(const std::vector<uint32_t> &rootDeviceIndices, MemoryManager *memoryManager,
|
||||
size_t initialTagCount, CommandStreamReceiverType csrType, DeviceBitfield deviceBitfield) const {
|
||||
bool doNotReleaseNodes = (csrType > CommandStreamReceiverType::CSR_HW) ||
|
||||
DebugManager.flags.DisableTimestampPacketOptimizations.get();
|
||||
|
||||
auto tagAlignment = getTimestampPacketAllocatorAlignment();
|
||||
|
||||
if (DebugManager.flags.OverrideTimestampPacketSize.get() != -1) {
|
||||
if (DebugManager.flags.OverrideTimestampPacketSize.get() == 4) {
|
||||
using TimestampPackets32T = TimestampPackets<uint32_t>;
|
||||
return std::make_unique<TagAllocator<TimestampPackets32T>>(rootDeviceIndices, memoryManager, initialTagCount, tagAlignment, sizeof(TimestampPackets32T), doNotReleaseNodes, deviceBitfield);
|
||||
} else if (DebugManager.flags.OverrideTimestampPacketSize.get() == 8) {
|
||||
using TimestampPackets64T = TimestampPackets<uint64_t>;
|
||||
return std::make_unique<TagAllocator<TimestampPackets64T>>(rootDeviceIndices, memoryManager, initialTagCount, tagAlignment, sizeof(TimestampPackets64T), doNotReleaseNodes, deviceBitfield);
|
||||
} else {
|
||||
UNRECOVERABLE_IF(true);
|
||||
}
|
||||
}
|
||||
|
||||
using TimestampPacketType = typename GfxFamily::TimestampPacketType;
|
||||
using TimestampPacketsT = TimestampPackets<TimestampPacketType>;
|
||||
|
||||
return std::make_unique<TagAllocator<TimestampPacketsT>>(rootDeviceIndices, memoryManager, initialTagCount, tagAlignment, sizeof(TimestampPacketsT), doNotReleaseNodes, deviceBitfield);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
size_t HwHelperHw<GfxFamily>::getTimestampPacketAllocatorAlignment() const {
|
||||
return MemoryConstants::cacheLineSize * 4;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
LocalMemoryAccessMode HwHelperHw<GfxFamily>::getLocalMemoryAccessMode(const HardwareInfo &hwInfo) const {
|
||||
switch (static_cast<LocalMemoryAccessMode>(DebugManager.flags.ForceLocalMemoryAccessMode.get())) {
|
||||
|
||||
Reference in New Issue
Block a user