Try to use provided pointer when dual storage shared memory is not supported

If user provided not-null hostptr field, then the driver
should try to use it. This change adds omitted functionality,
which handles the described case also in createUnifiedMemoryAllocation().

Related-To: NEO-7600
Signed-off-by: Wrobel, Patryk <patryk.wrobel@intel.com>
This commit is contained in:
Wrobel, Patryk
2023-02-16 11:19:02 +00:00
committed by Compute-Runtime-Automation
parent b4544f6f78
commit d8a65c6958
6 changed files with 76 additions and 7 deletions

View File

@@ -93,10 +93,17 @@ GraphicsAllocation *MockMemoryManager::allocateGraphicsMemoryWithProperties(cons
if (isMockHostMemoryManager) {
allocateGraphicsMemoryWithPropertiesCount++;
if (forceFailureInAllocationWithHostPointer) {
if (singleFailureInAllocationWithHostPointer) {
forceFailureInAllocationWithHostPointer = false;
}
return nullptr;
}
return NEO::MemoryManager::allocateGraphicsMemoryWithProperties(properties, ptr);
}
recentlyPassedDeviceBitfield = properties.subDevicesBitfield;
return OsAgnosticMemoryManager::allocateGraphicsMemoryWithProperties(properties, ptr);
}

View File

@@ -250,6 +250,7 @@ class MockMemoryManager : public MemoryManagerCreate<OsAgnosticMemoryManager> {
bool forceFailureInPrimaryAllocation = false;
bool singleFailureInPrimaryAllocation = false;
bool forceFailureInAllocationWithHostPointer = false;
bool singleFailureInAllocationWithHostPointer = false;
bool isMockHostMemoryManager = false;
bool deferAllocInUse = false;
bool isMockEventPoolCreateMemoryManager = false;