2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2023-01-03 18:39:11 +00:00
|
|
|
* Copyright (C) 2018-2023 Intel Corporation
|
2018-09-18 09:11:08 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2021-10-05 12:54:33 +00:00
|
|
|
#include "shared/test/common/mocks/mock_memory_manager.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/command_stream/command_stream_receiver.h"
|
|
|
|
|
#include "shared/source/gmm_helper/gmm.h"
|
2023-01-13 15:18:40 +00:00
|
|
|
#include "shared/source/helpers/aligned_memory.h"
|
2021-10-06 17:46:49 +00:00
|
|
|
#include "shared/source/helpers/surface_format_info.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/memory_manager/deferred_deleter.h"
|
2023-01-13 15:18:40 +00:00
|
|
|
#include "shared/source/memory_manager/gfx_partition.h"
|
|
|
|
|
#include "shared/test/common/helpers/default_hw_info.h"
|
2021-10-14 16:53:11 +00:00
|
|
|
#include "shared/test/common/mocks/mock_allocation_properties.h"
|
2023-01-13 15:18:40 +00:00
|
|
|
#include "shared/test/common/mocks/mock_host_ptr_manager.h"
|
|
|
|
|
#include "shared/test/common/mocks/mock_os_context.h"
|
2020-02-22 09:28:27 +01:00
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
#include <cstring>
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2023-01-13 15:18:40 +00:00
|
|
|
MockMemoryManager::MockMemoryManager(bool enableLocalMemory, ExecutionEnvironment &executionEnvironment) : MemoryManagerCreate(false, enableLocalMemory, executionEnvironment) {
|
|
|
|
|
hostPtrManager.reset(new MockHostPtrManager);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MockMemoryManager::MockMemoryManager() : MockMemoryManager(*(new MockExecutionEnvironment(defaultHwInfo.get()))) {
|
|
|
|
|
mockExecutionEnvironment.reset(static_cast<MockExecutionEnvironment *>(&executionEnvironment));
|
|
|
|
|
mockExecutionEnvironment->initGmm();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MockMemoryManager::MockMemoryManager(bool enable64pages, bool enableLocalMemory) : MemoryManagerCreate(enable64pages, enableLocalMemory, *(new MockExecutionEnvironment(defaultHwInfo.get()))) {
|
|
|
|
|
mockExecutionEnvironment.reset(static_cast<MockExecutionEnvironment *>(&executionEnvironment));
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
void MockMemoryManager::setDeferredDeleter(DeferredDeleter *deleter) {
|
|
|
|
|
deferredDeleter.reset(deleter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MockMemoryManager::overrideAsyncDeleterFlag(bool newValue) {
|
|
|
|
|
asyncDeleterEnabled = newValue;
|
|
|
|
|
if (asyncDeleterEnabled && deferredDeleter == nullptr) {
|
|
|
|
|
deferredDeleter = createDeferredDeleter();
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-12-14 11:24:45 +01:00
|
|
|
|
|
|
|
|
void *MockMemoryManager::allocateSystemMemory(size_t size, size_t alignment) {
|
2019-03-06 16:35:21 +01:00
|
|
|
if (failAllocateSystemMemory) {
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
2021-08-11 10:36:04 +00:00
|
|
|
|
|
|
|
|
if (fakeBigAllocations && size > bigAllocation) {
|
|
|
|
|
size = MemoryConstants::pageSize64k;
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-14 11:24:45 +01:00
|
|
|
return OsAgnosticMemoryManager::allocateSystemMemory(redundancyRatio * size, alignment);
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-13 15:18:40 +00:00
|
|
|
void MockMemoryManager::waitForEnginesCompletion(GraphicsAllocation &graphicsAllocation) {
|
|
|
|
|
waitForEnginesCompletionCalled++;
|
|
|
|
|
if (waitAllocations.get()) {
|
|
|
|
|
waitAllocations->addAllocation(&graphicsAllocation);
|
|
|
|
|
}
|
|
|
|
|
MemoryManager::waitForEnginesCompletion(graphicsAllocation);
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-14 11:24:45 +01:00
|
|
|
GraphicsAllocation *MockMemoryManager::allocateGraphicsMemoryWithProperties(const AllocationProperties &properties) {
|
2023-03-06 15:12:14 +00:00
|
|
|
validateAllocateProperties(properties);
|
2021-02-25 09:38:48 +01:00
|
|
|
if (isMockHostMemoryManager) {
|
|
|
|
|
allocateGraphicsMemoryWithPropertiesCount++;
|
|
|
|
|
if (forceFailureInPrimaryAllocation) {
|
2023-01-03 18:39:11 +00:00
|
|
|
if (singleFailureInPrimaryAllocation) {
|
|
|
|
|
forceFailureInPrimaryAllocation = false;
|
|
|
|
|
}
|
2021-02-25 09:38:48 +01:00
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
return NEO::MemoryManager::allocateGraphicsMemoryWithProperties(properties);
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-16 17:24:38 +02:00
|
|
|
recentlyPassedDeviceBitfield = properties.subDevicesBitfield;
|
2018-12-20 07:43:57 +00:00
|
|
|
AllocationProperties adjustedProperties(properties);
|
|
|
|
|
adjustedProperties.size = redundancyRatio * properties.size;
|
2022-12-12 10:57:02 +00:00
|
|
|
adjustedProperties.rootDeviceIndex = properties.rootDeviceIndex;
|
2018-12-20 07:43:57 +00:00
|
|
|
return OsAgnosticMemoryManager::allocateGraphicsMemoryWithProperties(adjustedProperties);
|
2018-12-14 11:24:45 +01:00
|
|
|
}
|
|
|
|
|
|
2021-02-25 09:38:48 +01:00
|
|
|
GraphicsAllocation *MockMemoryManager::allocateGraphicsMemoryWithProperties(const AllocationProperties &properties, const void *ptr) {
|
2023-03-06 15:12:14 +00:00
|
|
|
validateAllocateProperties(properties);
|
2022-11-21 11:03:05 +00:00
|
|
|
lastAllocationProperties.reset(new AllocationProperties(properties));
|
2021-06-16 14:41:26 +00:00
|
|
|
if (returnFakeAllocation) {
|
2023-12-12 09:11:27 +00:00
|
|
|
return new GraphicsAllocation(properties.rootDeviceIndex, properties.allocationType, const_cast<void *>(ptr), dummyAddress, properties.size, 0, MemoryPool::system4KBPages, maxOsContextCount);
|
2021-06-16 14:41:26 +00:00
|
|
|
}
|
2021-02-25 09:38:48 +01:00
|
|
|
if (isMockHostMemoryManager) {
|
|
|
|
|
allocateGraphicsMemoryWithPropertiesCount++;
|
|
|
|
|
if (forceFailureInAllocationWithHostPointer) {
|
2023-02-16 11:19:02 +00:00
|
|
|
if (singleFailureInAllocationWithHostPointer) {
|
|
|
|
|
forceFailureInAllocationWithHostPointer = false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-25 09:38:48 +01:00
|
|
|
return nullptr;
|
|
|
|
|
}
|
2023-02-16 11:19:02 +00:00
|
|
|
|
2021-02-25 09:38:48 +01:00
|
|
|
return NEO::MemoryManager::allocateGraphicsMemoryWithProperties(properties, ptr);
|
|
|
|
|
}
|
2023-02-16 11:19:02 +00:00
|
|
|
|
|
|
|
|
recentlyPassedDeviceBitfield = properties.subDevicesBitfield;
|
2021-02-25 09:38:48 +01:00
|
|
|
return OsAgnosticMemoryManager::allocateGraphicsMemoryWithProperties(properties, ptr);
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-22 12:40:17 +01:00
|
|
|
GraphicsAllocation *MockMemoryManager::allocateGraphicsMemoryForImage(const AllocationData &allocationData) {
|
|
|
|
|
allocateForImageCalled = true;
|
|
|
|
|
auto *allocation = MemoryManager::allocateGraphicsMemoryForImage(allocationData);
|
2017-12-21 00:45:38 +01:00
|
|
|
if (redundancyRatio != 1) {
|
2019-01-22 12:40:17 +01:00
|
|
|
memset((unsigned char *)allocation->getUnderlyingBuffer(), 0, allocationData.imgInfo->size * redundancyRatio);
|
2017-12-21 00:45:38 +01:00
|
|
|
}
|
|
|
|
|
return allocation;
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-11 10:36:04 +00:00
|
|
|
GraphicsAllocation *MockMemoryManager::allocateMemoryByKMD(const AllocationData &allocationData) {
|
2019-11-14 04:08:59 -05:00
|
|
|
allocateForShareableCalled = true;
|
2021-08-11 10:36:04 +00:00
|
|
|
return OsAgnosticMemoryManager::allocateMemoryByKMD(allocationData);
|
2019-11-14 04:08:59 -05:00
|
|
|
}
|
|
|
|
|
|
2022-12-06 22:36:12 +00:00
|
|
|
GraphicsAllocation *MockMemoryManager::allocatePhysicalDeviceMemory(const AllocationData &allocationData, AllocationStatus &status) {
|
|
|
|
|
return OsAgnosticMemoryManager::allocatePhysicalDeviceMemory(allocationData, status);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GraphicsAllocation *MockMemoryManager::allocatePhysicalLocalDeviceMemory(const AllocationData &allocationData, AllocationStatus &status) {
|
|
|
|
|
return OsAgnosticMemoryManager::allocatePhysicalLocalDeviceMemory(allocationData, status);
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-28 14:12:13 +01:00
|
|
|
GraphicsAllocation *MockMemoryManager::allocateGraphicsMemory64kb(const AllocationData &allocationData) {
|
2018-07-24 16:42:35 +02:00
|
|
|
allocation64kbPageCreated = true;
|
2021-12-03 13:52:16 +00:00
|
|
|
preferCompressedFlagPassed = forceCompressed ? true : allocationData.flags.preferCompressed;
|
2018-07-24 16:42:35 +02:00
|
|
|
|
2018-12-06 15:03:06 +01:00
|
|
|
auto allocation = OsAgnosticMemoryManager::allocateGraphicsMemory64kb(allocationData);
|
2018-07-24 09:06:33 +02:00
|
|
|
if (allocation) {
|
2021-12-03 13:52:16 +00:00
|
|
|
allocation->getDefaultGmm()->isCompressionEnabled = preferCompressedFlagPassed;
|
2018-07-24 09:06:33 +02:00
|
|
|
}
|
|
|
|
|
return allocation;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-24 16:42:35 +02:00
|
|
|
GraphicsAllocation *MockMemoryManager::allocateGraphicsMemoryInDevicePool(const AllocationData &allocationData, AllocationStatus &status) {
|
|
|
|
|
if (failInDevicePool) {
|
|
|
|
|
status = AllocationStatus::RetryInNonDevicePool;
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
if (failInDevicePoolWithError) {
|
|
|
|
|
status = AllocationStatus::Error;
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
2021-02-25 09:38:48 +01:00
|
|
|
if (successAllocatedGraphicsMemoryIndex >= maxSuccessAllocatedGraphicsMemoryIndex) {
|
|
|
|
|
return nullptr;
|
2018-07-24 16:42:35 +02:00
|
|
|
|
2021-02-25 09:38:48 +01:00
|
|
|
} else {
|
|
|
|
|
auto allocation = OsAgnosticMemoryManager::allocateGraphicsMemoryInDevicePool(allocationData, status);
|
|
|
|
|
if (allocation) {
|
|
|
|
|
allocationInDevicePoolCreated = true;
|
|
|
|
|
if (localMemorySupported[allocation->getRootDeviceIndex()]) {
|
2023-12-12 09:11:27 +00:00
|
|
|
static_cast<MemoryAllocation *>(allocation)->overrideMemoryPool(MemoryPool::localMemory);
|
2021-02-25 09:38:48 +01:00
|
|
|
}
|
2019-04-16 15:42:23 +02:00
|
|
|
}
|
2021-02-25 09:38:48 +01:00
|
|
|
successAllocatedGraphicsMemoryIndex++;
|
|
|
|
|
return allocation;
|
2018-07-24 16:42:35 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-30 11:01:33 +01:00
|
|
|
GraphicsAllocation *MockMemoryManager::allocateGraphicsMemoryWithAlignment(const AllocationData &allocationData) {
|
2018-07-25 09:38:00 +02:00
|
|
|
if (failInAllocateWithSizeAndAlignment) {
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
2018-07-24 16:42:35 +02:00
|
|
|
allocationCreated = true;
|
2021-02-19 11:45:53 +00:00
|
|
|
alignAllocationData = allocationData;
|
2018-11-30 11:01:33 +01:00
|
|
|
return OsAgnosticMemoryManager::allocateGraphicsMemoryWithAlignment(allocationData);
|
2018-07-24 16:42:35 +02:00
|
|
|
}
|
2019-02-21 16:29:05 +01:00
|
|
|
|
2022-02-04 13:59:01 +00:00
|
|
|
GraphicsAllocation *MockMemoryManager::allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, AllocationType allocationType) {
|
2018-12-21 10:16:27 +01:00
|
|
|
bool allocateMemory = ptr == nullptr;
|
2020-03-25 15:15:03 +01:00
|
|
|
AllocationData allocationData{};
|
|
|
|
|
MockAllocationProperties properties(rootDeviceIndex, allocateMemory, size, allocationType);
|
2019-05-10 11:30:07 +02:00
|
|
|
getAllocationData(allocationData, properties, ptr, createStorageInfoFromProperties(properties));
|
2023-09-15 17:20:28 +00:00
|
|
|
return allocate32BitGraphicsMemoryImpl(allocationData);
|
2018-12-21 10:16:27 +01:00
|
|
|
}
|
2018-07-24 16:42:35 +02:00
|
|
|
|
2023-09-15 17:20:28 +00:00
|
|
|
GraphicsAllocation *MockMemoryManager::allocate32BitGraphicsMemoryImpl(const AllocationData &allocationData) {
|
2021-05-06 14:15:19 +00:00
|
|
|
allocate32BitGraphicsMemoryImplCalled = true;
|
2019-07-26 15:28:06 +02:00
|
|
|
if (failAllocate32Bit) {
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
2023-09-15 17:20:28 +00:00
|
|
|
return OsAgnosticMemoryManager::allocate32BitGraphicsMemoryImpl(allocationData);
|
2019-07-26 15:28:06 +02:00
|
|
|
}
|
|
|
|
|
|
2023-01-13 15:18:40 +00:00
|
|
|
void MockMemoryManager::forceLimitedRangeAllocator(uint32_t rootDeviceIndex, uint64_t range) {
|
2023-04-28 13:24:48 +00:00
|
|
|
getGfxPartition(rootDeviceIndex)->init(range, 0, 0, gfxPartitions.size(), false, 0u);
|
2023-01-13 15:18:40 +00:00
|
|
|
}
|
|
|
|
|
|
2023-02-28 00:20:17 +00:00
|
|
|
bool MockMemoryManager::hasPageFaultsEnabled(const Device &neoDevice) {
|
2023-11-30 08:32:25 +00:00
|
|
|
if (debugManager.flags.EnableRecoverablePageFaults.get() != -1) {
|
|
|
|
|
return !!debugManager.flags.EnableRecoverablePageFaults.get();
|
2023-02-28 00:20:17 +00:00
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-13 15:18:40 +00:00
|
|
|
bool MockMemoryManager::isKmdMigrationAvailable(uint32_t rootDeviceIndex) {
|
2023-11-30 08:32:25 +00:00
|
|
|
if (debugManager.flags.UseKmdMigration.get() != -1) {
|
|
|
|
|
return !!debugManager.flags.UseKmdMigration.get();
|
2023-01-13 15:18:40 +00:00
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 17:01:19 +00:00
|
|
|
GraphicsAllocation *MockMemoryManager::createGraphicsAllocationFromExistingStorage(AllocationProperties &properties, void *ptr, MultiGraphicsAllocation &multiGraphicsAllocation) {
|
|
|
|
|
auto allocation = OsAgnosticMemoryManager::createGraphicsAllocationFromExistingStorage(properties, ptr, multiGraphicsAllocation);
|
|
|
|
|
createGraphicsAllocationFromExistingStorageCalled++;
|
|
|
|
|
allocationsFromExistingStorage.push_back(allocation);
|
|
|
|
|
return allocation;
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-04 01:40:52 +00:00
|
|
|
GraphicsAllocation *MockMemoryManager::createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation, bool reuseSharedAllocation, void *mapPointer) {
|
2022-05-31 09:36:11 +00:00
|
|
|
if (handle != invalidSharedHandle) {
|
2023-05-04 01:40:52 +00:00
|
|
|
auto allocation = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(handle, properties, requireSpecificBitness, isHostIpcAllocation, reuseSharedAllocation, mapPointer);
|
2022-05-31 09:36:11 +00:00
|
|
|
this->capturedSharedHandle = handle;
|
|
|
|
|
return allocation;
|
|
|
|
|
} else {
|
|
|
|
|
this->capturedSharedHandle = handle;
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
2022-06-15 11:07:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GraphicsAllocation *MockMemoryManager::createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) {
|
|
|
|
|
if (toOsHandle(handle) != invalidSharedHandle) {
|
2023-12-11 14:24:36 +00:00
|
|
|
auto graphicsAllocation = createMemoryAllocation(NEO::AllocationType::sharedBuffer, nullptr, reinterpret_cast<void *>(1), 1,
|
2023-12-12 09:11:27 +00:00
|
|
|
4096u, toOsHandle(handle), MemoryPool::systemCpuInaccessible, rootDeviceIndex,
|
2022-06-15 11:07:49 +00:00
|
|
|
false, false, false);
|
|
|
|
|
graphicsAllocation->setSharedHandle(toOsHandle(handle));
|
|
|
|
|
this->capturedSharedHandle = toOsHandle(handle);
|
|
|
|
|
return graphicsAllocation;
|
|
|
|
|
} else {
|
|
|
|
|
this->capturedSharedHandle = toOsHandle(handle);
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
2022-05-31 09:36:11 +00:00
|
|
|
}
|
|
|
|
|
|
2021-10-21 11:16:19 +00:00
|
|
|
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});
|
|
|
|
|
return OsAgnosticMemoryManager::copyMemoryToAllocationBanks(graphicsAllocation, destinationOffset, memoryToCopy, sizeToCopy, handleMask);
|
|
|
|
|
};
|
|
|
|
|
|
2023-01-13 15:18:40 +00:00
|
|
|
void *MockAllocSysMemAgnosticMemoryManager::allocateSystemMemory(size_t size, size_t alignment) {
|
|
|
|
|
constexpr size_t minAlignment = 16;
|
|
|
|
|
alignment = std::max(alignment, minAlignment);
|
|
|
|
|
return alignedMalloc(size, alignment);
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-28 15:42:23 +01:00
|
|
|
FailMemoryManager::FailMemoryManager(int32_t failedAllocationsCount, ExecutionEnvironment &executionEnvironment) : MockMemoryManager(executionEnvironment) {
|
2018-12-06 15:03:06 +01:00
|
|
|
this->failedAllocationsCount = failedAllocationsCount;
|
2018-10-19 13:41:42 +02:00
|
|
|
}
|
|
|
|
|
|
2019-03-06 16:35:21 +01:00
|
|
|
FailMemoryManager::FailMemoryManager(int32_t failedAllocationsCount, ExecutionEnvironment &executionEnvironment, bool enableLocalMemory)
|
|
|
|
|
: MockMemoryManager(enableLocalMemory, executionEnvironment) {
|
|
|
|
|
this->failedAllocationsCount = failedAllocationsCount;
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-13 15:18:40 +00:00
|
|
|
GraphicsAllocation *MockMemoryManagerFailFirstAllocation::allocateNonSystemGraphicsMemoryInDevicePool(const AllocationData &allocationData, AllocationStatus &status) {
|
|
|
|
|
auto allocation = baseAllocateGraphicsMemoryInDevicePool(allocationData, status);
|
|
|
|
|
if (!allocation) {
|
|
|
|
|
allocation = allocateGraphicsMemory(allocationData);
|
|
|
|
|
}
|
2023-12-12 09:11:27 +00:00
|
|
|
static_cast<MemoryAllocation *>(allocation)->overrideMemoryPool(MemoryPool::systemCpuInaccessible);
|
2023-01-13 15:18:40 +00:00
|
|
|
return allocation;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OsContext *MockMemoryManagerOsAgnosticContext::createAndRegisterOsContext(CommandStreamReceiver *commandStreamReceiver,
|
|
|
|
|
const EngineDescriptor &engineDescriptor) {
|
|
|
|
|
auto osContext = new OsContext(commandStreamReceiver->getRootDeviceIndex(), 0, engineDescriptor);
|
|
|
|
|
osContext->incRefInternal();
|
2023-04-26 10:36:25 +00:00
|
|
|
allRegisteredEngines[commandStreamReceiver->getRootDeviceIndex()].emplace_back(commandStreamReceiver, osContext);
|
2023-01-13 15:18:40 +00:00
|
|
|
return osContext;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OsContext *MockMemoryManagerWithDebuggableOsContext::createAndRegisterOsContext(CommandStreamReceiver *commandStreamReceiver,
|
|
|
|
|
const EngineDescriptor &engineDescriptor) {
|
|
|
|
|
auto osContext = new MockOsContext(0, engineDescriptor);
|
|
|
|
|
osContext->debuggableContext = true;
|
|
|
|
|
osContext->incRefInternal();
|
2023-04-26 10:36:25 +00:00
|
|
|
allRegisteredEngines[commandStreamReceiver->getRootDeviceIndex()].emplace_back(commandStreamReceiver, osContext);
|
2023-01-13 15:18:40 +00:00
|
|
|
return osContext;
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|