mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 05:35:19 +08:00
Add support for ntHandles in OCL
Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
5dda77d628
commit
97ea332a9f
@@ -163,6 +163,20 @@ GraphicsAllocation *MockMemoryManager::createGraphicsAllocationFromSharedHandle(
|
||||
}
|
||||
}
|
||||
|
||||
GraphicsAllocation *MockMemoryManager::createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) {
|
||||
if (toOsHandle(handle) != invalidSharedHandle) {
|
||||
auto graphicsAllocation = createMemoryAllocation(NEO::AllocationType::SHARED_BUFFER, nullptr, reinterpret_cast<void *>(1), 1,
|
||||
4096u, toOsHandle(handle), MemoryPool::SystemCpuInaccessible, rootDeviceIndex,
|
||||
false, false, false);
|
||||
graphicsAllocation->setSharedHandle(toOsHandle(handle));
|
||||
this->capturedSharedHandle = toOsHandle(handle);
|
||||
return graphicsAllocation;
|
||||
} else {
|
||||
this->capturedSharedHandle = toOsHandle(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});
|
||||
|
||||
@@ -81,6 +81,7 @@ class MockMemoryManager : public MemoryManagerCreate<OsAgnosticMemoryManager> {
|
||||
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;
|
||||
GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override;
|
||||
|
||||
void *allocateSystemMemory(size_t size, size_t alignment) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user