mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 09:58:55 +08:00
feature: add NEO_LOCAL_MEMORY_ALLOCATION_MODE
Allow the application to force storageInfo.localOnly and get the out-of-memory returned if not possible. This is a windows-only feature supported on discrete platforms. Related-To: NEO-13428 Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0f19182214
commit
0f8ee57f98
@@ -42,6 +42,7 @@
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
#include "shared/source/page_fault_manager/cpu_page_fault_manager.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
#include "shared/source/utilities/logger_neo_only.h"
|
||||
|
||||
namespace NEO {
|
||||
@@ -653,11 +654,12 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo
|
||||
case AllocationType::svmGpu:
|
||||
case AllocationType::image:
|
||||
if (false == allocationData.flags.uncacheable && useLocalPreferredForCacheableBuffers) {
|
||||
if (!allocationData.flags.preferCompressed) {
|
||||
if ((usmDeviceAllocationMode == LocalMemAllocationMode::hwDefault) && !allocationData.flags.preferCompressed) {
|
||||
allocationData.storageInfo.localOnlyRequired = false;
|
||||
}
|
||||
allocationData.storageInfo.systemMemoryPlacement = false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1250,4 +1252,12 @@ void MemoryManager::removeCustomHeapAllocatorConfig(AllocationType allocationTyp
|
||||
customHeapAllocators.erase({allocationType, isFrontWindowPool});
|
||||
}
|
||||
|
||||
bool MemoryManager::getLocalOnlyRequired(AllocationType allocationType, const ProductHelper &productHelper, const ReleaseHelper *releaseHelper, bool preferCompressed) const {
|
||||
const bool enabledForRelease{!releaseHelper || releaseHelper->isLocalOnlyAllowed()};
|
||||
|
||||
if (allocationType == AllocationType::buffer || allocationType == AllocationType::svmGpu) {
|
||||
return productHelper.getStorageInfoLocalOnlyFlag(usmDeviceAllocationMode, enabledForRelease);
|
||||
}
|
||||
return (preferCompressed ? enabledForRelease : false);
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user