Add new flag to USM memory manager

Related-To: NEO-5498

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2021-03-08 12:27:14 +00:00
committed by Compute-Runtime-Automation
parent bca7b54728
commit 779253c49c
18 changed files with 171 additions and 47 deletions

View File

@@ -102,7 +102,8 @@ void SVMAllocsManager::makeInternalAllocationsResident(CommandStreamReceiver &co
}
}
SVMAllocsManager::SVMAllocsManager(MemoryManager *memoryManager) : memoryManager(memoryManager) {
SVMAllocsManager::SVMAllocsManager(MemoryManager *memoryManager, bool multiOsContextSupport)
: memoryManager(memoryManager), multiOsContextSupport(multiOsContextSupport) {
}
void *SVMAllocsManager::createSVMAlloc(size_t size, const SvmAllocationProperties svmProperties,
@@ -135,7 +136,7 @@ void *SVMAllocsManager::createHostUnifiedMemoryAllocation(size_t size,
alignedSize,
allocationType,
false,
deviceBitfield.count() > 1,
(deviceBitfield.count() > 1) && multiOsContextSupport,
deviceBitfield};
unifiedMemoryProperties.flags.shareable = memoryProperties.allocationFlags.flags.shareable;
unifiedMemoryProperties.flags.isUSMHostAllocation = true;
@@ -178,7 +179,7 @@ void *SVMAllocsManager::createUnifiedMemoryAllocation(size_t size,
alignedSize,
allocationType,
false,
deviceBitfield.count() > 1,
(deviceBitfield.count() > 1) && multiOsContextSupport,
deviceBitfield};
unifiedMemoryProperties.flags.shareable = memoryProperties.allocationFlags.flags.shareable;
unifiedMemoryProperties.flags.isUSMDeviceAllocation = true;
@@ -390,7 +391,7 @@ void *SVMAllocsManager::createUnifiedAllocationWithDeviceStorage(size_t size, co
alignedSize,
GraphicsAllocation::AllocationType::SVM_GPU,
false,
subDevices.count() > 1,
(subDevices.count() > 1) && multiOsContextSupport,
subDevices};
gpuProperties.alignment = 2 * MemoryConstants::megaByte;

View File

@@ -105,7 +105,7 @@ class SVMAllocsManager {
const std::map<uint32_t, DeviceBitfield> &subdeviceBitfields;
};
SVMAllocsManager(MemoryManager *memoryManager);
SVMAllocsManager(MemoryManager *memoryManager, bool multiOsContextSupport);
MOCKABLE_VIRTUAL ~SVMAllocsManager() = default;
void *createSVMAlloc(size_t size,
const SvmAllocationProperties svmProperties,
@@ -153,5 +153,6 @@ class SVMAllocsManager {
MapOperationsTracker svmMapOperations;
MemoryManager *memoryManager;
SpinLock mtx;
bool multiOsContextSupport;
};
} // namespace NEO