Change MemoryPool to enum class

Use enum class for MemoryPool in GraphicsAllocation
This change will ensure that GA is constructed in the proper way

- Rename namespace for isSystemMemoryPool method
- Add method getMemoryPoolString for logging actual pool which is in used
- Remove wrong pattern in GraphicsAllocation constructor

Related-To: NEO-6523
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
Krzysztof Gibala
2022-06-01 21:13:52 +00:00
committed by Compute-Runtime-Automation
parent e082b80e0a
commit dc1fe7d59a
47 changed files with 232 additions and 173 deletions

View File

@@ -638,7 +638,7 @@ void EncodeSurfaceState<Family>::encodeExtraBufferParams(EncodeSurfaceStateArgs
}
if (DebugManager.flags.EnableStatelessCompressionWithUnifiedMemory.get()) {
if (args.allocation && !MemoryPool::isSystemMemoryPool(args.allocation->getMemoryPool())) {
if (args.allocation && !MemoryPoolHelper::isSystemMemoryPool(args.allocation->getMemoryPool())) {
setCoherencyType(surfaceState, R_SURFACE_STATE::COHERENCY_TYPE_GPU_COHERENT);
setBufferAuxParamsForCCS(surfaceState);
compressionFormat = DebugManager.flags.FormatForStatelessCompressionWithUnifiedMemory.get();

View File

@@ -63,10 +63,10 @@ void BlitCommandsHelper<GfxFamily>::appendBlitCommandsBlockCopy(const BlitProper
blitCmd.setSourceCompressionFormat(compressionFormat);
}
if (MemoryPool::isSystemMemoryPool(blitProperties.dstAllocation->getMemoryPool())) {
if (MemoryPoolHelper::isSystemMemoryPool(blitProperties.dstAllocation->getMemoryPool())) {
blitCmd.setDestinationTargetMemory(XY_BLOCK_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_SYSTEM_MEM);
}
if (MemoryPool::isSystemMemoryPool(blitProperties.srcAllocation->getMemoryPool())) {
if (MemoryPoolHelper::isSystemMemoryPool(blitProperties.srcAllocation->getMemoryPool())) {
blitCmd.setSourceTargetMemory(XY_BLOCK_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_SYSTEM_MEM);
}
@@ -136,7 +136,7 @@ void BlitCommandsHelper<GfxFamily>::appendBlitCommandsForFillBuffer(NEO::Graphic
blitCmd.setDestinationCompressionFormat(compressionFormat);
}
if (MemoryPool::isSystemMemoryPool(dstAlloc->getMemoryPool())) {
if (MemoryPoolHelper::isSystemMemoryPool(dstAlloc->getMemoryPool())) {
blitCmd.setDestinationTargetMemory(XY_COLOR_BLT::DESTINATION_TARGET_MEMORY::DESTINATION_TARGET_MEMORY_SYSTEM_MEM);
}

View File

@@ -21,7 +21,7 @@ void GraphicsAllocation::setAllocationType(AllocationType allocationType) {
}
GraphicsAllocation::GraphicsAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, void *cpuPtrIn, uint64_t canonizedGpuAddress,
uint64_t baseAddress, size_t sizeIn, MemoryPool::Type pool, size_t maxOsContextCount)
uint64_t baseAddress, size_t sizeIn, MemoryPool pool, size_t maxOsContextCount)
: rootDeviceIndex(rootDeviceIndex),
gpuBaseAddress(baseAddress),
gpuAddress(canonizedGpuAddress),
@@ -35,7 +35,7 @@ GraphicsAllocation::GraphicsAllocation(uint32_t rootDeviceIndex, size_t numGmms,
}
GraphicsAllocation::GraphicsAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, void *cpuPtrIn, size_t sizeIn,
osHandle sharedHandleIn, MemoryPool::Type pool, size_t maxOsContextCount)
osHandle sharedHandleIn, MemoryPool pool, size_t maxOsContextCount)
: rootDeviceIndex(rootDeviceIndex),
gpuAddress(GmmHelper::canonize(castToUint64(cpuPtrIn))),
size(sizeIn),

View File

@@ -67,18 +67,18 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
GraphicsAllocation(const GraphicsAllocation &) = delete;
GraphicsAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, void *cpuPtrIn,
uint64_t gpuAddress, uint64_t baseAddress, size_t sizeIn, MemoryPool::Type pool, size_t maxOsContextCount)
uint64_t gpuAddress, uint64_t baseAddress, size_t sizeIn, MemoryPool pool, size_t maxOsContextCount)
: GraphicsAllocation(rootDeviceIndex, 1, allocationType, cpuPtrIn, gpuAddress, baseAddress, sizeIn, pool, maxOsContextCount) {}
GraphicsAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, void *cpuPtrIn,
size_t sizeIn, osHandle sharedHandleIn, MemoryPool::Type pool, size_t maxOsContextCount)
size_t sizeIn, osHandle sharedHandleIn, MemoryPool pool, size_t maxOsContextCount)
: GraphicsAllocation(rootDeviceIndex, 1, allocationType, cpuPtrIn, sizeIn, sharedHandleIn, pool, maxOsContextCount) {}
GraphicsAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, void *cpuPtrIn,
uint64_t canonizedGpuAddress, uint64_t baseAddress, size_t sizeIn, MemoryPool::Type pool, size_t maxOsContextCount);
uint64_t canonizedGpuAddress, uint64_t baseAddress, size_t sizeIn, MemoryPool pool, size_t maxOsContextCount);
GraphicsAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, void *cpuPtrIn,
size_t sizeIn, osHandle sharedHandleIn, MemoryPool::Type pool, size_t maxOsContextCount);
size_t sizeIn, osHandle sharedHandleIn, MemoryPool pool, size_t maxOsContextCount);
uint32_t getRootDeviceIndex() const { return rootDeviceIndex; }
void *getUnderlyingBuffer() const { return cpuPtr; }
@@ -152,7 +152,7 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
void setAllocationType(AllocationType allocationType);
AllocationType getAllocationType() const { return allocationType; }
MemoryPool::Type getMemoryPool() const { return memoryPool; }
MemoryPool getMemoryPool() const { return memoryPool; }
bool isUsed() const { return registeredContextsNum > 0; }
bool isUsedByManyOsContexts() const { return registeredContextsNum > 1u; }
@@ -326,7 +326,7 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
void *cpuPtr = nullptr;
void *lockedPtr = nullptr;
MemoryPool::Type memoryPool = MemoryPool::MemoryNull;
MemoryPool memoryPool = MemoryPool::MemoryNull;
AllocationType allocationType = AllocationType::UNKNOWN;
StackVec<UsageInfo, 32> usageInfos;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2020 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -7,24 +7,26 @@
#pragma once
#include "shared/source/helpers/extendable_enum.h"
namespace NEO {
namespace MemoryPool {
struct Type : ExtendableEnum {
constexpr Type(uint32_t val) : ExtendableEnum(val) {}
enum class MemoryPool {
MemoryNull,
System4KBPages,
System64KBPages,
System4KBPagesWith32BitGpuAddressing,
System64KBPagesWith32BitGpuAddressing,
SystemCpuInaccessible,
LocalMemory,
};
constexpr Type MemoryNull{0};
constexpr Type System4KBPages{1};
constexpr Type System64KBPages{2};
constexpr Type System4KBPagesWith32BitGpuAddressing{3};
constexpr Type System64KBPagesWith32BitGpuAddressing{4};
constexpr Type SystemCpuInaccessible{5};
constexpr Type LocalMemory{6};
inline bool isSystemMemoryPool(Type pool) {
return pool == System4KBPages ||
pool == System64KBPages ||
pool == System4KBPagesWith32BitGpuAddressing ||
pool == System64KBPagesWith32BitGpuAddressing;
namespace MemoryPoolHelper {
inline bool isSystemMemoryPool(MemoryPool pool) {
return pool == MemoryPool::System4KBPages ||
pool == MemoryPool::System64KBPages ||
pool == MemoryPool::System4KBPagesWith32BitGpuAddressing ||
pool == MemoryPool::System64KBPagesWith32BitGpuAddressing;
}
} // namespace MemoryPool
} // namespace MemoryPoolHelper
} // namespace NEO

View File

@@ -420,7 +420,7 @@ void OsAgnosticMemoryManager::releaseReservedCpuAddressRange(void *reserved, siz
MemoryAllocation *OsAgnosticMemoryManager::createMemoryAllocation(AllocationType allocationType, void *driverAllocatedCpuPointer,
void *pMem, uint64_t gpuAddress, size_t memSize, uint64_t count,
MemoryPool::Type pool, uint32_t rootDeviceIndex, bool uncacheable,
MemoryPool pool, uint32_t rootDeviceIndex, bool uncacheable,
bool flushL3Required, bool requireSpecificBitness) {
auto gmmHelper = getGmmHelper(rootDeviceIndex);
if (!isLimitedRange(rootDeviceIndex)) {
@@ -554,7 +554,7 @@ double OsAgnosticMemoryManager::getPercentOfGlobalMemoryAvailable(uint32_t rootD
return 0.8;
}
void MemoryAllocation::overrideMemoryPool(MemoryPool::Type pool) {
void MemoryAllocation::overrideMemoryPool(MemoryPool pool) {
if (DebugManager.flags.AUBDumpForceAllToLocalMemory.get()) {
this->memoryPool = MemoryPool::LocalMemory;
return;

View File

@@ -19,28 +19,28 @@ class MemoryAllocation : public GraphicsAllocation {
const bool uncacheable;
MemoryAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, void *cpuPtrIn, uint64_t gpuAddress, uint64_t baseAddress, size_t sizeIn,
MemoryPool::Type pool, size_t maxOsContextCount)
MemoryPool pool, size_t maxOsContextCount)
: MemoryAllocation(rootDeviceIndex, 1, allocationType, cpuPtrIn, gpuAddress, baseAddress, sizeIn, pool, maxOsContextCount) {}
MemoryAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, void *cpuPtrIn, uint64_t canonizedGpuAddress, uint64_t baseAddress, size_t sizeIn,
MemoryPool::Type pool, size_t maxOsContextCount)
MemoryPool pool, size_t maxOsContextCount)
: GraphicsAllocation(rootDeviceIndex, numGmms, allocationType, cpuPtrIn, canonizedGpuAddress, baseAddress, sizeIn, pool, maxOsContextCount),
id(0), uncacheable(false) {}
MemoryAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, void *cpuPtrIn, size_t sizeIn, osHandle sharedHandleIn, MemoryPool::Type pool, size_t maxOsContextCount)
MemoryAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, void *cpuPtrIn, size_t sizeIn, osHandle sharedHandleIn, MemoryPool pool, size_t maxOsContextCount)
: MemoryAllocation(rootDeviceIndex, 1, allocationType, cpuPtrIn, sizeIn, sharedHandleIn, pool, maxOsContextCount) {}
MemoryAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, void *cpuPtrIn, size_t sizeIn, osHandle sharedHandleIn, MemoryPool::Type pool, size_t maxOsContextCount)
MemoryAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, void *cpuPtrIn, size_t sizeIn, osHandle sharedHandleIn, MemoryPool pool, size_t maxOsContextCount)
: GraphicsAllocation(rootDeviceIndex, numGmms, allocationType, cpuPtrIn, sizeIn, sharedHandleIn, pool, maxOsContextCount),
id(0), uncacheable(false) {}
MemoryAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, void *driverAllocatedCpuPointer, void *pMem, uint64_t canonizedGpuAddress, size_t memSize,
uint64_t count, MemoryPool::Type pool, bool uncacheable, bool flushL3Required, size_t maxOsContextCount)
uint64_t count, MemoryPool pool, bool uncacheable, bool flushL3Required, size_t maxOsContextCount)
: MemoryAllocation(rootDeviceIndex, 1, allocationType, driverAllocatedCpuPointer, pMem, canonizedGpuAddress, memSize,
count, pool, uncacheable, flushL3Required, maxOsContextCount) {}
MemoryAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, void *driverAllocatedCpuPointer, void *pMem, uint64_t canonizedGpuAddress, size_t memSize,
uint64_t count, MemoryPool::Type pool, bool uncacheable, bool flushL3Required, size_t maxOsContextCount)
uint64_t count, MemoryPool pool, bool uncacheable, bool flushL3Required, size_t maxOsContextCount)
: GraphicsAllocation(rootDeviceIndex, numGmms, allocationType, pMem, canonizedGpuAddress, 0u, memSize, pool, maxOsContextCount),
id(count), uncacheable(uncacheable) {
@@ -49,7 +49,7 @@ class MemoryAllocation : public GraphicsAllocation {
allocationInfo.flags.flushL3Required = flushL3Required;
}
void overrideMemoryPool(MemoryPool::Type pool);
void overrideMemoryPool(MemoryPool pool);
void clearUsageInfo() {
for (auto &info : usageInfos) {
@@ -109,7 +109,7 @@ class OsAgnosticMemoryManager : public MemoryManager {
GraphicsAllocation *allocate32BitGraphicsMemoryImpl(const AllocationData &allocationData, bool useLocalMemory) override;
GraphicsAllocation *allocateGraphicsMemoryInDevicePool(const AllocationData &allocationData, AllocationStatus &status) override;
MemoryAllocation *createMemoryAllocation(AllocationType allocationType, void *driverAllocatedCpuPointer, void *pMem, uint64_t gpuAddress, size_t memSize,
uint64_t count, MemoryPool::Type pool, uint32_t rootDeviceIndex, bool uncacheable, bool flushL3Required, bool requireSpecificBitness);
uint64_t count, MemoryPool pool, uint32_t rootDeviceIndex, bool uncacheable, bool flushL3Required, bool requireSpecificBitness);
bool fakeBigAllocations = false;
private:

View File

@@ -33,26 +33,26 @@ class DrmAllocation : public GraphicsAllocation {
MemoryUnmapFunction unmapFunction;
};
DrmAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, BufferObject *bo, void *ptrIn, size_t sizeIn, osHandle sharedHandle, MemoryPool::Type pool)
DrmAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, BufferObject *bo, void *ptrIn, size_t sizeIn, osHandle sharedHandle, MemoryPool pool)
: DrmAllocation(rootDeviceIndex, 1, allocationType, bo, ptrIn, sizeIn, sharedHandle, pool) {}
DrmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, BufferObject *bo, void *ptrIn, size_t sizeIn, osHandle sharedHandle, MemoryPool::Type pool)
DrmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, BufferObject *bo, void *ptrIn, size_t sizeIn, osHandle sharedHandle, MemoryPool pool)
: GraphicsAllocation(rootDeviceIndex, numGmms, allocationType, ptrIn, sizeIn, sharedHandle, pool, MemoryManager::maxOsContextCount), bufferObjects(EngineLimits::maxHandleCount) {
bufferObjects[0] = bo;
}
DrmAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, BufferObject *bo, void *ptrIn, uint64_t canonizedGpuAddress, size_t sizeIn, MemoryPool::Type pool)
DrmAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, BufferObject *bo, void *ptrIn, uint64_t canonizedGpuAddress, size_t sizeIn, MemoryPool pool)
: DrmAllocation(rootDeviceIndex, 1, allocationType, bo, ptrIn, canonizedGpuAddress, sizeIn, pool) {}
DrmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, BufferObject *bo, void *ptrIn, uint64_t canonizedGpuAddress, size_t sizeIn, MemoryPool::Type pool)
DrmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, BufferObject *bo, void *ptrIn, uint64_t canonizedGpuAddress, size_t sizeIn, MemoryPool pool)
: GraphicsAllocation(rootDeviceIndex, numGmms, allocationType, ptrIn, canonizedGpuAddress, 0, sizeIn, pool, MemoryManager::maxOsContextCount), bufferObjects(EngineLimits::maxHandleCount) {
bufferObjects[0] = bo;
}
DrmAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, BufferObjects &bos, void *ptrIn, uint64_t canonizedGpuAddress, size_t sizeIn, MemoryPool::Type pool)
DrmAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, BufferObjects &bos, void *ptrIn, uint64_t canonizedGpuAddress, size_t sizeIn, MemoryPool pool)
: DrmAllocation(rootDeviceIndex, 1, allocationType, bos, ptrIn, canonizedGpuAddress, sizeIn, pool) {}
DrmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, BufferObjects &bos, void *ptrIn, uint64_t canonizedGpuAddress, size_t sizeIn, MemoryPool::Type pool)
DrmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, BufferObjects &bos, void *ptrIn, uint64_t canonizedGpuAddress, size_t sizeIn, MemoryPool pool)
: GraphicsAllocation(rootDeviceIndex, numGmms, allocationType, ptrIn, canonizedGpuAddress, 0, sizeIn, pool, MemoryManager::maxOsContextCount),
bufferObjects(bos) {
}

View File

@@ -1303,7 +1303,7 @@ bool DrmMemoryManager::copyMemoryToAllocation(GraphicsAllocation *graphicsAlloca
return copyMemoryToAllocationBanks(graphicsAllocation, destinationOffset, memoryToCopy, sizeToCopy, maxNBitValue(graphicsAllocation->storageInfo.getNumBanks()));
}
bool DrmMemoryManager::copyMemoryToAllocationBanks(GraphicsAllocation *graphicsAllocation, size_t destinationOffset, const void *memoryToCopy, size_t sizeToCopy, DeviceBitfield handleMask) {
if (MemoryPool::isSystemMemoryPool(graphicsAllocation->getMemoryPool())) {
if (MemoryPoolHelper::isSystemMemoryPool(graphicsAllocation->getMemoryPool())) {
return false;
}
auto drmAllocation = static_cast<DrmAllocation *>(graphicsAllocation);

View File

@@ -24,11 +24,11 @@ constexpr size_t trimListUnusedPosition = std::numeric_limits<size_t>::max();
class WddmAllocation : public GraphicsAllocation {
public:
WddmAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, void *cpuPtrIn, uint64_t canonizedAddress, size_t sizeIn, void *reservedAddr, MemoryPool::Type pool, uint32_t shareable, size_t maxOsContextCount)
WddmAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, void *cpuPtrIn, uint64_t canonizedAddress, size_t sizeIn, void *reservedAddr, MemoryPool pool, uint32_t shareable, size_t maxOsContextCount)
: WddmAllocation(rootDeviceIndex, 1, allocationType, cpuPtrIn, canonizedAddress, sizeIn, reservedAddr, pool, shareable, maxOsContextCount) {}
WddmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, void *cpuPtrIn, uint64_t canonizedAddress, size_t sizeIn,
void *reservedAddr, MemoryPool::Type pool, uint32_t shareable, size_t maxOsContextCount)
void *reservedAddr, MemoryPool pool, uint32_t shareable, size_t maxOsContextCount)
: GraphicsAllocation(rootDeviceIndex, numGmms, allocationType, cpuPtrIn, canonizedAddress, 0llu, sizeIn, pool, maxOsContextCount),
shareable(shareable), trimCandidateListPositions(maxOsContextCount, trimListUnusedPosition) {
reservedAddressRangeInfo.addressPtr = reservedAddr;
@@ -36,11 +36,11 @@ class WddmAllocation : public GraphicsAllocation {
handles.resize(gmms.size());
}
WddmAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, void *cpuPtrIn, size_t sizeIn, osHandle sharedHandle, MemoryPool::Type pool, size_t maxOsContextCount)
WddmAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, void *cpuPtrIn, size_t sizeIn, osHandle sharedHandle, MemoryPool pool, size_t maxOsContextCount)
: WddmAllocation(rootDeviceIndex, 1, allocationType, cpuPtrIn, sizeIn, sharedHandle, pool, maxOsContextCount) {}
WddmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, void *cpuPtrIn, size_t sizeIn,
osHandle sharedHandle, MemoryPool::Type pool, size_t maxOsContextCount)
osHandle sharedHandle, MemoryPool pool, size_t maxOsContextCount)
: GraphicsAllocation(rootDeviceIndex, numGmms, allocationType, cpuPtrIn, sizeIn, sharedHandle, pool, maxOsContextCount),
trimCandidateListPositions(maxOsContextCount, trimListUnusedPosition) {
handles.resize(gmms.size());

View File

@@ -925,7 +925,7 @@ bool WddmMemoryManager::copyMemoryToAllocation(GraphicsAllocation *graphicsAlloc
}
bool WddmMemoryManager::copyMemoryToAllocationBanks(GraphicsAllocation *graphicsAllocation, size_t destinationOffset, const void *memoryToCopy, size_t sizeToCopy, DeviceBitfield handleMask) {
if (MemoryPool::isSystemMemoryPool(graphicsAllocation->getMemoryPool())) {
if (MemoryPoolHelper::isSystemMemoryPool(graphicsAllocation->getMemoryPool())) {
return false;
}
auto &wddm = getWddm(graphicsAllocation->getRootDeviceIndex());

View File

@@ -95,7 +95,7 @@ void FileLogger<DebugLevel>::logAllocation(GraphicsAllocation const *graphicsAll
ss << " ThreadID: " << thisThread;
ss << " AllocationType: " << getAllocationTypeString(graphicsAllocation);
ss << " MemoryPool: " << graphicsAllocation->getMemoryPool();
ss << " MemoryPool: " << getMemoryPoolString(graphicsAllocation);
ss << " Root device index: " << graphicsAllocation->getRootDeviceIndex();
ss << " GPU address: 0x" << std::hex << graphicsAllocation->getGpuAddress() << " - 0x" << std::hex << graphicsAllocation->getGpuAddress() + graphicsAllocation->getUnderlyingBufferSize() - 1;
@@ -233,6 +233,30 @@ const char *getAllocationTypeString(GraphicsAllocation const *graphicsAllocation
}
}
const char *getMemoryPoolString(GraphicsAllocation const *graphicsAllocation) {
auto pool = graphicsAllocation->getMemoryPool();
switch (pool) {
case MemoryPool::MemoryNull:
return "MemoryNull";
case MemoryPool::System4KBPages:
return "System4KBPages";
case MemoryPool::System64KBPages:
return "System64KBPages";
case MemoryPool::System4KBPagesWith32BitGpuAddressing:
return "System4KBPagesWith32BitGpuAddressing";
case MemoryPool::System64KBPagesWith32BitGpuAddressing:
return "System64KBPagesWith32BitGpuAddressing";
case MemoryPool::SystemCpuInaccessible:
return "SystemCpuInaccessible";
case MemoryPool::LocalMemory:
return "LocalMemory";
}
UNRECOVERABLE_IF(true);
return "ILLEGAL_VALUE";
}
template class FileLogger<DebugFunctionalityLevel::None>;
template class FileLogger<DebugFunctionalityLevel::RegKeys>;
template class FileLogger<DebugFunctionalityLevel::Full>;

View File

@@ -22,6 +22,7 @@ struct MultiDispatchInfo;
class GraphicsAllocation;
const char *getAllocationTypeString(GraphicsAllocation const *graphicsAllocation);
const char *getMemoryPoolString(GraphicsAllocation const *graphicsAllocation);
template <DebugFunctionalityLevel DebugLevel>
class FileLogger {

View File

@@ -96,11 +96,11 @@ void BlitCommandsHelper<Family>::appendBlitCommandsMemCopy(const BlitProperties
}
if (DebugManager.flags.EnableStatelessCompressionWithUnifiedMemory.get()) {
if (!MemoryPool::isSystemMemoryPool(srcAllocation->getMemoryPool())) {
if (!MemoryPoolHelper::isSystemMemoryPool(srcAllocation->getMemoryPool())) {
blitCmd.setSourceCompressible(MEM_COPY::SOURCE_COMPRESSIBLE::SOURCE_COMPRESSIBLE_COMPRESSIBLE);
blitCmd.setCompressionFormat(DebugManager.flags.FormatForStatelessCompressionWithUnifiedMemory.get());
}
if (!MemoryPool::isSystemMemoryPool(dstAllocation->getMemoryPool())) {
if (!MemoryPoolHelper::isSystemMemoryPool(dstAllocation->getMemoryPool())) {
blitCmd.setDestinationCompressible(MEM_COPY::DESTINATION_COMPRESSIBLE::DESTINATION_COMPRESSIBLE_COMPRESSIBLE);
blitCmd.setCompressionFormat(DebugManager.flags.FormatForStatelessCompressionWithUnifiedMemory.get());
}
@@ -136,7 +136,7 @@ void BlitCommandsHelper<Family>::dispatchBlitMemoryFill<1>(NEO::GraphicsAllocati
blitCmd.setCompressionFormat40(compressionFormat);
}
if (DebugManager.flags.EnableStatelessCompressionWithUnifiedMemory.get()) {
if (!MemoryPool::isSystemMemoryPool(dstAlloc->getMemoryPool())) {
if (!MemoryPoolHelper::isSystemMemoryPool(dstAlloc->getMemoryPool())) {
blitCmd.setDestinationCompressible(MEM_SET::DESTINATION_COMPRESSIBLE::DESTINATION_COMPRESSIBLE_COMPRESSIBLE);
blitCmd.setCompressionFormat40(DebugManager.flags.FormatForStatelessCompressionWithUnifiedMemory.get());
}