Add new flag to USM memory manager

Related-To: NEO-5498

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2021-03-08 12:27:14 +00:00
committed by Compute-Runtime-Automation
parent bca7b54728
commit 779253c49c
18 changed files with 171 additions and 47 deletions

View File

@@ -1590,7 +1590,7 @@ TEST(LinkerTests, GivenAllocationInLocalMemoryWhichRequiresBlitterWhenPatchingDa
for (auto isLocalMemorySupported : ::testing::Bool()) {
DebugManager.flags.EnableLocalMemory.set(isLocalMemorySupported);
auto pDevice = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
MockSVMAllocsManager svmAllocsManager(pDevice->getMemoryManager());
MockSVMAllocsManager svmAllocsManager(pDevice->getMemoryManager(), false);
WhiteBox<NEO::LinkerInput> linkerInput;
NEO::Linker linker(linkerInput);

View File

@@ -407,7 +407,7 @@ TEST_F(PageFaultManagerTest, givenUnifiedMemoryAllocWhenSetAubWritableIsCalledTh
void *cmdQ = reinterpret_cast<void *>(0xFFFF);
auto memoryManager = std::make_unique<MockMemoryManager>(executionEnvironment);
auto unifiedMemoryManager = std::make_unique<SVMAllocsManager>(memoryManager.get());
auto unifiedMemoryManager = std::make_unique<SVMAllocsManager>(memoryManager.get(), false);
auto properties = SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::SHARED_UNIFIED_MEMORY, rootDeviceIndices, deviceBitfields);
void *alloc1 = unifiedMemoryManager->createSharedUnifiedMemoryAllocation(10, properties, cmdQ);

View File

@@ -26,7 +26,7 @@ TEST(AllocateGlobalSurfaceTest, GivenSvmAllocsManagerWhenGlobalsAreNotExportedTh
auto &device = *(new MockDevice);
REQUIRE_SVM_OR_SKIP(&device);
MockClDevice clDevice{&device};
MockSVMAllocsManager svmAllocsManager(device.getMemoryManager());
MockSVMAllocsManager svmAllocsManager(device.getMemoryManager(), false);
WhiteBox<LinkerInput> emptyLinkerInput;
std::vector<uint8_t> initData;
initData.resize(64, 7U);
@@ -70,7 +70,7 @@ TEST(AllocateGlobalSurfaceTest, GivenSvmAllocsManagerWhenGlobalsAreExportedThenM
REQUIRE_SVM_OR_SKIP(&device);
MockClDevice clDevice{&device};
MockMemoryManager memoryManager;
MockSVMAllocsManager svmAllocsManager(&memoryManager);
MockSVMAllocsManager svmAllocsManager(&memoryManager, false);
WhiteBox<LinkerInput> linkerInputExportGlobalVariables;
WhiteBox<LinkerInput> linkerInputExportGlobalConstants;
linkerInputExportGlobalVariables.traits.exportsGlobalVariables = true;
@@ -156,7 +156,7 @@ TEST(AllocateGlobalSurfaceTest, WhenGlobalsAreNotExportedAndAllocationFailsThenG
auto memoryManager = std::make_unique<MockMemoryManager>(*clDevice.getExecutionEnvironment());
memoryManager->failInAllocateWithSizeAndAlignment = true;
clDevice.injectMemoryManager(memoryManager.release());
MockSVMAllocsManager mockSvmAllocsManager(clDevice.getMemoryManager());
MockSVMAllocsManager mockSvmAllocsManager(clDevice.getMemoryManager(), false);
WhiteBox<LinkerInput> emptyLinkerInput;
std::vector<uint8_t> initData;
initData.resize(64, 7U);
@@ -191,7 +191,7 @@ TEST(AllocateGlobalSurfaceTest, WhenGlobalsAreExportedAndAllocationFailsThenGrac
auto pDevice = new MockDevice{};
MockClDevice clDevice{pDevice};
MockMemoryManager memoryManager{*clDevice.getExecutionEnvironment()};
MockSVMAllocsManager svmAllocsManager(&memoryManager);
MockSVMAllocsManager svmAllocsManager(&memoryManager, false);
memoryManager.failInAllocateWithSizeAndAlignment = true;
WhiteBox<LinkerInput> linkerInputExportGlobalVariables;
WhiteBox<LinkerInput> linkerInputExportGlobalConstants;
@@ -236,7 +236,7 @@ TEST(AllocateGlobalSurfaceTest, GivenAllocationInLocalMemoryWhichRequiresBlitter
DebugManager.flags.EnableLocalMemory.set(isLocalMemorySupported);
MockDevice device;
device.getExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
MockSVMAllocsManager svmAllocsManager(device.getMemoryManager());
MockSVMAllocsManager svmAllocsManager(device.getMemoryManager(), false);
auto pAllocation = allocateGlobalsSurface(&svmAllocsManager, device, initData.size(), true /* constant */,
nullptr /* linker input */, initData.data());