mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
fix: reduce types for tagSize and tagCount within TagAllocator
Related-To: NEO-16444 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
133421a5e9
commit
7660b29bbb
@@ -79,7 +79,7 @@ NEO::TagAllocatorBase *Device::getFillPatternAllocator() {
|
||||
|
||||
if (!this->fillPatternAllocator.get()) {
|
||||
RootDeviceIndicesContainer rootDeviceIndices = {getNEODevice()->getRootDeviceIndex()};
|
||||
fillPatternAllocator = std::make_unique<NEO::TagAllocator<NEO::FillPaternNodeType>>(rootDeviceIndices, getNEODevice()->getMemoryManager(), MemoryConstants::pageSize2M / MemoryConstants::cacheLineSize,
|
||||
fillPatternAllocator = std::make_unique<NEO::TagAllocator<NEO::FillPaternNodeType>>(rootDeviceIndices, getNEODevice()->getMemoryManager(), static_cast<uint32_t>(MemoryConstants::pageSize2M / MemoryConstants::cacheLineSize),
|
||||
MemoryConstants::cacheLineSize, MemoryConstants::cacheLineSize, 0, false, false, getNEODevice()->getDeviceBitfield());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ class L0GfxCoreHelper : public NEO::ApiGfxCoreHelper {
|
||||
virtual uint64_t getIpSamplingIpMask() const = 0;
|
||||
virtual bool synchronizedDispatchSupported() const = 0;
|
||||
virtual bool implicitSynchronizedDispatchForCooperativeKernelsAllowed() const = 0;
|
||||
virtual std::unique_ptr<NEO::TagAllocatorBase> getInOrderTimestampAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, NEO::MemoryManager *memoryManager, size_t initialTagCount, size_t packetsCountPerElement, size_t tagAlignment,
|
||||
virtual std::unique_ptr<NEO::TagAllocatorBase> getInOrderTimestampAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, NEO::MemoryManager *memoryManager, uint32_t initialTagCount, size_t packetsCountPerElement, size_t tagAlignment,
|
||||
NEO::DeviceBitfield deviceBitfield) const = 0;
|
||||
virtual uint64_t getOaTimestampValidBits() const = 0;
|
||||
virtual CopyOffloadMode getDefaultCopyOffloadMode(bool additionalBlitPropertiesSupported) const = 0;
|
||||
@@ -174,7 +174,7 @@ class L0GfxCoreHelperHw : public L0GfxCoreHelper {
|
||||
uint64_t getIpSamplingIpMask() const override;
|
||||
bool synchronizedDispatchSupported() const override;
|
||||
bool implicitSynchronizedDispatchForCooperativeKernelsAllowed() const override;
|
||||
std::unique_ptr<NEO::TagAllocatorBase> getInOrderTimestampAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, NEO::MemoryManager *memoryManager, size_t initialTagCount, size_t packetsCountPerElement, size_t tagAlignment,
|
||||
std::unique_ptr<NEO::TagAllocatorBase> getInOrderTimestampAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, NEO::MemoryManager *memoryManager, uint32_t initialTagCount, size_t packetsCountPerElement, size_t tagAlignment,
|
||||
NEO::DeviceBitfield deviceBitfield) const override;
|
||||
uint64_t getOaTimestampValidBits() const override;
|
||||
CopyOffloadMode getDefaultCopyOffloadMode(bool additionalBlitPropertiesSupported) const override;
|
||||
|
||||
@@ -75,7 +75,7 @@ bool L0GfxCoreHelperHw<Family>::implicitSynchronizedDispatchForCooperativeKernel
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
std::unique_ptr<NEO::TagAllocatorBase> L0GfxCoreHelperHw<Family>::getInOrderTimestampAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, NEO::MemoryManager *memoryManager, size_t initialTagCount, size_t packetsCountPerElement,
|
||||
std::unique_ptr<NEO::TagAllocatorBase> L0GfxCoreHelperHw<Family>::getInOrderTimestampAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, NEO::MemoryManager *memoryManager, uint32_t initialTagCount, size_t packetsCountPerElement,
|
||||
size_t tagAlignment, NEO::DeviceBitfield deviceBitfield) const {
|
||||
|
||||
using TimestampPacketType = typename Family::TimestampPacketType;
|
||||
|
||||
@@ -1076,7 +1076,7 @@ TagAllocatorBase *CommandStreamReceiver::getEventPerfCountAllocator(const uint32
|
||||
return perfCounterAllocator.get();
|
||||
}
|
||||
|
||||
size_t CommandStreamReceiver::getPreferredTagPoolSize() const {
|
||||
uint32_t CommandStreamReceiver::getPreferredTagPoolSize() const {
|
||||
if (debugManager.flags.DisableTimestampPacketOptimizations.get()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ class CommandStreamReceiver : NEO::NonCopyableAndNonMovableClass {
|
||||
AllocationsList &getDeferredAllocations();
|
||||
InternalAllocationStorage *getInternalAllocationStorage() const { return internalAllocationStorage.get(); }
|
||||
MOCKABLE_VIRTUAL bool createAllocationForHostSurface(HostPtrSurface &surface, bool requiresL3Flush);
|
||||
virtual size_t getPreferredTagPoolSize() const;
|
||||
virtual uint32_t getPreferredTagPoolSize() const;
|
||||
virtual void fillReusableAllocationsList();
|
||||
virtual void setupContext(OsContext &osContext) { this->osContext = &osContext; }
|
||||
OsContext &getOsContext() const { return *osContext; }
|
||||
|
||||
@@ -61,7 +61,7 @@ class CommandStreamReceiverSimulatedCommonHw : public CommandStreamReceiverHw<Gf
|
||||
|
||||
void makeNonResident(GraphicsAllocation &gfxAllocation) override;
|
||||
|
||||
size_t getPreferredTagPoolSize() const override { return 1; }
|
||||
uint32_t getPreferredTagPoolSize() const override { return 1; }
|
||||
|
||||
aub_stream::AubManager *aubManager = nullptr;
|
||||
std::unique_ptr<HardwareContextController> hardwareContextController;
|
||||
|
||||
@@ -43,7 +43,7 @@ class CommandStreamReceiverWithAUBDump : public BaseCSR {
|
||||
WaitStatus waitForTaskCountWithKmdNotifyFallback(TaskCountType taskCountToWait, FlushStamp flushStampToWait,
|
||||
bool useQuickKmdSleep, QueueThrottle throttle) override;
|
||||
|
||||
size_t getPreferredTagPoolSize() const override { return 1; }
|
||||
uint32_t getPreferredTagPoolSize() const override { return 1; }
|
||||
|
||||
void addAubComment(const char *comment) override;
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ class GfxCoreHelper {
|
||||
virtual uint32_t getPlanarYuvMaxHeight() const = 0;
|
||||
virtual size_t getPreemptionAllocationAlignment() const = 0;
|
||||
virtual std::unique_ptr<TagAllocatorBase> createTimestampPacketAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memoryManager,
|
||||
size_t initialTagCount, CommandStreamReceiverType csrType,
|
||||
uint32_t initialTagCount, CommandStreamReceiverType csrType,
|
||||
DeviceBitfield deviceBitfield) const = 0;
|
||||
virtual size_t getTimestampPacketAllocatorAlignment() const = 0;
|
||||
virtual size_t getSingleTimestampPacketSize() const = 0;
|
||||
@@ -404,7 +404,7 @@ class GfxCoreHelperHw : public GfxCoreHelper {
|
||||
size_t getPreemptionAllocationAlignment() const override;
|
||||
|
||||
std::unique_ptr<TagAllocatorBase> createTimestampPacketAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memoryManager,
|
||||
size_t initialTagCount, CommandStreamReceiverType csrType,
|
||||
uint32_t initialTagCount, CommandStreamReceiverType csrType,
|
||||
DeviceBitfield deviceBitfield) const override;
|
||||
size_t getTimestampPacketAllocatorAlignment() const override;
|
||||
|
||||
|
||||
@@ -505,7 +505,7 @@ uint32_t GfxCoreHelperHw<GfxFamily>::getNativeVectorWidthHalf(uint32_t vectorWid
|
||||
|
||||
template <typename GfxFamily>
|
||||
std::unique_ptr<TagAllocatorBase> GfxCoreHelperHw<GfxFamily>::createTimestampPacketAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memoryManager,
|
||||
size_t initialTagCount, CommandStreamReceiverType csrType, DeviceBitfield deviceBitfield) const {
|
||||
uint32_t initialTagCount, CommandStreamReceiverType csrType, DeviceBitfield deviceBitfield) const {
|
||||
bool doNotReleaseNodes = (csrType > CommandStreamReceiverType::hardware) ||
|
||||
debugManager.flags.DisableTimestampPacketOptimizations.get();
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class DeviceAllocNodeType {
|
||||
public:
|
||||
using ValueT = uint64_t;
|
||||
|
||||
static constexpr size_t defaultAllocatorTagCount = 128;
|
||||
static constexpr uint32_t defaultAllocatorTagCount = 128;
|
||||
|
||||
static constexpr AllocationType getAllocationType() { return deviceAlloc ? NEO::AllocationType::gpuTimestampDeviceBuffer : NEO::AllocationType::timestampPacketTagBuffer; }
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -12,10 +12,9 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
TagAllocatorBase::TagAllocatorBase(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memMngr, size_t tagCount, size_t tagAlignment, size_t tagSize, bool doNotReleaseNodes, DeviceBitfield deviceBitfield)
|
||||
: deviceBitfield(deviceBitfield), rootDeviceIndices(rootDeviceIndices), memoryManager(memMngr), tagCount(tagCount), tagSize(tagSize), doNotReleaseNodes(doNotReleaseNodes) {
|
||||
TagAllocatorBase::TagAllocatorBase(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memMngr, uint32_t tagCount, size_t tagAlignment, size_t tagSize, bool doNotReleaseNodes, DeviceBitfield deviceBitfield)
|
||||
: deviceBitfield(deviceBitfield), rootDeviceIndices(rootDeviceIndices), memoryManager(memMngr), tagCount(tagCount), tagSize(static_cast<uint32_t>(alignUp(tagSize, tagAlignment))), doNotReleaseNodes(doNotReleaseNodes) {
|
||||
|
||||
this->tagSize = alignUp(tagSize, tagAlignment);
|
||||
maxRootDeviceIndex = *std::max_element(std::begin(rootDeviceIndices), std::end(rootDeviceIndices));
|
||||
}
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ class TagAllocatorBase {
|
||||
protected:
|
||||
TagAllocatorBase() = delete;
|
||||
|
||||
TagAllocatorBase(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memMngr, size_t tagCount,
|
||||
TagAllocatorBase(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memMngr, uint32_t tagCount,
|
||||
size_t tagAlignment, size_t tagSize, bool doNotReleaseNodes,
|
||||
DeviceBitfield deviceBitfield);
|
||||
|
||||
@@ -173,8 +173,8 @@ class TagAllocatorBase {
|
||||
RootDeviceIndicesContainer rootDeviceIndices;
|
||||
uint32_t maxRootDeviceIndex = 0;
|
||||
MemoryManager *memoryManager;
|
||||
size_t tagCount;
|
||||
size_t tagSize;
|
||||
const uint32_t tagCount;
|
||||
const uint32_t tagSize;
|
||||
bool doNotReleaseNodes = false;
|
||||
|
||||
std::mutex allocatorMutex;
|
||||
@@ -186,7 +186,7 @@ class TagAllocator : public TagAllocatorBase {
|
||||
using NodeType = TagNode<TagType>;
|
||||
using ValueT = typename TagType::ValueT;
|
||||
|
||||
TagAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memMngr, size_t tagCount,
|
||||
TagAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memMngr, uint32_t tagCount,
|
||||
size_t tagAlignment, size_t tagSize, ValueT initialValue, bool doNotReleaseNodes, bool initializeTags, DeviceBitfield deviceBitfield);
|
||||
|
||||
TagNodeBase *getTag() override;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
namespace NEO {
|
||||
template <typename TagType>
|
||||
TagAllocator<TagType>::TagAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memMngr, size_t tagCount, size_t tagAlignment,
|
||||
TagAllocator<TagType>::TagAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memMngr, uint32_t tagCount, size_t tagAlignment,
|
||||
size_t tagSize, ValueT initialValue, bool doNotReleaseNodes, bool initializeTags, DeviceBitfield deviceBitfield)
|
||||
: TagAllocatorBase(rootDeviceIndices, memMngr, tagCount, tagAlignment, tagSize, doNotReleaseNodes, deviceBitfield), initialValue(initialValue), initializeTags(initializeTags) {
|
||||
|
||||
|
||||
@@ -296,7 +296,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily> {
|
||||
return BaseClass::writeMemory(gfxAllocation, isChunkCopy, gpuVaChunkOffset, chunkSize);
|
||||
}
|
||||
|
||||
size_t getPreferredTagPoolSize() const override {
|
||||
uint32_t getPreferredTagPoolSize() const override {
|
||||
return BaseClass::getPreferredTagPoolSize() + 1;
|
||||
}
|
||||
void setPreemptionAllocation(GraphicsAllocation *allocation) { this->preemptionAllocation = allocation; }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2024 Intel Corporation
|
||||
* Copyright (C) 2019-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -19,16 +19,16 @@ class MockTagAllocator : public TagAllocator<TagType> {
|
||||
using BaseClass::usedTags;
|
||||
using NodeType = typename BaseClass::NodeType;
|
||||
|
||||
MockTagAllocator(uint32_t rootDeviceIndex, MemoryManager *memoryManager, size_t tagCount,
|
||||
MockTagAllocator(uint32_t rootDeviceIndex, MemoryManager *memoryManager, uint32_t tagCount,
|
||||
size_t tagAlignment, size_t tagSize, bool doNotReleaseNodes, DeviceBitfield deviceBitfield)
|
||||
: BaseClass(RootDeviceIndicesContainer({rootDeviceIndex}), memoryManager, tagCount, tagAlignment, tagSize, NEO::TimestampPacketConstants::initValue, doNotReleaseNodes, true, deviceBitfield) {
|
||||
}
|
||||
|
||||
MockTagAllocator(uint32_t rootDeviceIndex, MemoryManager *memoryManager, size_t tagCount = 10)
|
||||
MockTagAllocator(uint32_t rootDeviceIndex, MemoryManager *memoryManager, uint32_t tagCount = 10)
|
||||
: MockTagAllocator(rootDeviceIndex, memoryManager, tagCount, MemoryConstants::cacheLineSize, sizeof(TagType), false, mockDeviceBitfield) {
|
||||
}
|
||||
|
||||
MockTagAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memoryManager, size_t tagCount = 10)
|
||||
MockTagAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memoryManager, uint32_t tagCount = 10)
|
||||
: BaseClass(rootDeviceIndices, memoryManager, tagCount, MemoryConstants::cacheLineSize, sizeof(TagType), NEO::TimestampPacketConstants::initValue, false, true, mockDeviceBitfield) {}
|
||||
|
||||
void returnTag(TagNodeBase *node) override {
|
||||
|
||||
@@ -93,16 +93,16 @@ class MockTagAllocator : public TagAllocator<TagType> {
|
||||
using BaseClass::usedTags;
|
||||
using BaseClass::TagAllocatorBase::cleanUpResources;
|
||||
|
||||
MockTagAllocator(uint32_t rootDeviceIndex, MemoryManager *memoryManager, size_t tagCount,
|
||||
MockTagAllocator(uint32_t rootDeviceIndex, MemoryManager *memoryManager, uint32_t tagCount,
|
||||
size_t tagAlignment, size_t tagSize, bool doNotReleaseNodes, DeviceBitfield deviceBitfield)
|
||||
: BaseClass(RootDeviceIndicesContainer{rootDeviceIndex}, memoryManager, tagCount, tagAlignment, tagSize, 0, doNotReleaseNodes, true, deviceBitfield) {
|
||||
}
|
||||
|
||||
MockTagAllocator(MemoryManager *memMngr, size_t tagCount, size_t tagAlignment, bool disableCompletionCheck, DeviceBitfield deviceBitfield)
|
||||
MockTagAllocator(MemoryManager *memMngr, uint32_t tagCount, size_t tagAlignment, bool disableCompletionCheck, DeviceBitfield deviceBitfield)
|
||||
: MockTagAllocator(0, memMngr, tagCount, tagAlignment, sizeof(TagType), disableCompletionCheck, deviceBitfield) {
|
||||
}
|
||||
|
||||
MockTagAllocator(MemoryManager *memMngr, size_t tagCount, size_t tagAlignment, DeviceBitfield deviceBitfield)
|
||||
MockTagAllocator(MemoryManager *memMngr, uint32_t tagCount, size_t tagAlignment, DeviceBitfield deviceBitfield)
|
||||
: MockTagAllocator(memMngr, tagCount, tagAlignment, false, deviceBitfield) {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user