Fix missing handle in external memory

Related-To: NEO-6757

Signed-off-by: Baj, Tomasz <tomasz.baj@intel.com>
This commit is contained in:
Baj, Tomasz
2022-05-31 09:36:11 +00:00
committed by Compute-Runtime-Automation
parent 0a4adc7c72
commit 9529f21182
4 changed files with 36 additions and 15 deletions

View File

@@ -152,6 +152,17 @@ GraphicsAllocation *MockMemoryManager::createGraphicsAllocationFromExistingStora
return allocation;
}
GraphicsAllocation *MockMemoryManager::createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation) {
if (handle != invalidSharedHandle) {
auto allocation = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(handle, properties, requireSpecificBitness, isHostIpcAllocation);
this->capturedSharedHandle = handle;
return allocation;
} else {
this->capturedSharedHandle = handle;
return nullptr;
}
}
bool MockMemoryManager::copyMemoryToAllocationBanks(GraphicsAllocation *graphicsAllocation, size_t destinationOffset, const void *memoryToCopy, size_t sizeToCopy, DeviceBitfield handleMask) {
copyMemoryToAllocationBanksCalled++;
copyMemoryToAllocationBanksParamsPassed.push_back({graphicsAllocation, destinationOffset, memoryToCopy, sizeToCopy, handleMask});

View File

@@ -82,6 +82,7 @@ class MockMemoryManager : public MemoryManagerCreate<OsAgnosticMemoryManager> {
GraphicsAllocation *allocateGraphicsMemoryWithProperties(const AllocationProperties &properties) override;
GraphicsAllocation *allocateGraphicsMemoryWithProperties(const AllocationProperties &properties, const void *ptr) override;
GraphicsAllocation *createGraphicsAllocationFromExistingStorage(AllocationProperties &properties, void *ptr, MultiGraphicsAllocation &multiGraphicsAllocation) override;
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation) override;
void *allocateSystemMemory(size_t size, size_t alignment) override;
@@ -220,6 +221,8 @@ class MockMemoryManager : public MemoryManagerCreate<OsAgnosticMemoryManager> {
uint32_t handleFenceCompletionCalled = 0u;
uint32_t waitForEnginesCompletionCalled = 0u;
uint32_t allocateGraphicsMemoryWithPropertiesCount = 0;
osHandle capturedSharedHandle = 0u;
osHandle invalidSharedHandle = -1;
bool allocationCreated = false;
bool allocation64kbPageCreated = false;
bool allocationInDevicePoolCreated = false;