diff --git a/level_zero/core/source/driver/driver_handle_imp.cpp b/level_zero/core/source/driver/driver_handle_imp.cpp index 16ace49340..fb378397b3 100644 --- a/level_zero/core/source/driver/driver_handle_imp.cpp +++ b/level_zero/core/source/driver/driver_handle_imp.cpp @@ -265,7 +265,6 @@ void DriverHandleImp::updateRootDeviceBitFields(std::unique_ptr &ne } ze_result_t DriverHandleImp::initialize(std::vector> neoDevices) { - bool multiOsContextDriver = false; this->pid = NEO::SysCalls::getCurrentProcessId(); for (auto &neoDevice : neoDevices) { @@ -289,7 +288,6 @@ ze_result_t DriverHandleImp::initialize(std::vector auto device = Device::create(this, pNeoDevice, false, &returnValue); this->devices.push_back(device); - multiOsContextDriver |= device->isImplicitScalingCapable(); if (returnValue != ZE_RESULT_SUCCESS) { return returnValue; } @@ -299,7 +297,7 @@ ze_result_t DriverHandleImp::initialize(std::vector return ZE_RESULT_ERROR_UNINITIALIZED; } - this->svmAllocsManager = new NEO::SVMAllocsManager(memoryManager, multiOsContextDriver); + this->svmAllocsManager = new NEO::SVMAllocsManager(memoryManager); if (this->svmAllocsManager == nullptr) { return ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; } diff --git a/level_zero/core/test/unit_tests/fixtures/memory_ipc_fixture.cpp b/level_zero/core/test/unit_tests/fixtures/memory_ipc_fixture.cpp index 8a68ba9672..332a5f9484 100644 --- a/level_zero/core/test/unit_tests/fixtures/memory_ipc_fixture.cpp +++ b/level_zero/core/test/unit_tests/fixtures/memory_ipc_fixture.cpp @@ -522,7 +522,7 @@ void MemoryExportImportImplicitScalingTest::SetUp() { driverHandle->setMemoryManager(currMemoryManager); prevSvmAllocsManager = driverHandle->svmAllocsManager; - currSvmAllocsManager = new NEO::SVMAllocsManager(currMemoryManager, false); + currSvmAllocsManager = new NEO::SVMAllocsManager(currMemoryManager); driverHandle->svmAllocsManager = currSvmAllocsManager; device = driverHandle->devices[0]; diff --git a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp index 1b6de74b55..eff5576019 100644 --- a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp @@ -2048,7 +2048,7 @@ TEST_F(CommandQueueCreate, givenCreatedCommandQueueWhenGettingTrackingFlagsThenD struct SVMAllocsManagerMock : public NEO::SVMAllocsManager { using SVMAllocsManager::mtxForIndirectAccess; - SVMAllocsManagerMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager, false) {} + SVMAllocsManagerMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager) {} void makeIndirectAllocationsResident(CommandStreamReceiver &commandStreamReceiver, TaskCountType taskCount) override { makeIndirectAllocationsResidentCalledTimes++; } diff --git a/level_zero/core/test/unit_tests/sources/context/test_context.cpp b/level_zero/core/test/unit_tests/sources/context/test_context.cpp index 928de0bfcd..601c102f83 100644 --- a/level_zero/core/test/unit_tests/sources/context/test_context.cpp +++ b/level_zero/core/test/unit_tests/sources/context/test_context.cpp @@ -365,7 +365,7 @@ TEST_F(MultiDeviceContextTests, } struct SVMAllocsManagerContextMock : public NEO::SVMAllocsManager { - SVMAllocsManagerContextMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager, false) {} + SVMAllocsManagerContextMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager) {} void *createHostUnifiedMemoryAllocation(size_t size, const UnifiedMemoryProperties &memoryProperties) override { EXPECT_EQ(expectedRootDeviceIndexes.size(), memoryProperties.rootDeviceIndices.size()); EXPECT_NE(std::find(memoryProperties.rootDeviceIndices.begin(), memoryProperties.rootDeviceIndices.end(), expectedRootDeviceIndexes[0]), @@ -718,7 +718,7 @@ struct ContextMakeMemoryResidentAndMigrationTests : public ContextMakeMemoryResi ContextMakeMemoryResidentTests::SetUp(); mockMemoryManager = std::make_unique(); mockPageFaultManager = new MockResidentTestsPageFaultManager; - svmManager = std::make_unique(mockMemoryManager.get(), false); + svmManager = std::make_unique(mockMemoryManager.get()); mockMemoryManager->pageFaultManager.reset(mockPageFaultManager); memoryManager = device->getDriverHandle()->getMemoryManager(); diff --git a/level_zero/core/test/unit_tests/sources/device/test_l0_device.cpp b/level_zero/core/test/unit_tests/sources/device/test_l0_device.cpp index 76c82a269c..2e037b45dd 100644 --- a/level_zero/core/test/unit_tests/sources/device/test_l0_device.cpp +++ b/level_zero/core/test/unit_tests/sources/device/test_l0_device.cpp @@ -1806,7 +1806,7 @@ TEST_F(DeviceTest, givenAppendWriteGlobalTimestampFailsWhenGetGlobalTimestampsUs TEST_F(DeviceTest, givenCreateHostUnifiedMemoryAllocationFailsWhenGetGlobalTimestampsUsingSubmissionThenErrorIsReturned) { struct MockSvmAllocsManager : public NEO::SVMAllocsManager { - MockSvmAllocsManager(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager, false) {} + MockSvmAllocsManager(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager) {} void *createHostUnifiedMemoryAllocation(size_t size, const NEO::SVMAllocsManager::UnifiedMemoryProperties &unifiedMemoryProperties) override { return nullptr; diff --git a/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp b/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp index 02ee518a50..858d49e355 100644 --- a/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp +++ b/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp @@ -336,7 +336,7 @@ using ImportNTHandleWithMockMemoryManager = TestsvmAllocsManager; driverHandle->setMemoryManager(execEnv->memoryManager.get()); - driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false); + driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get()); uint64_t imageHandle = 0x1; NEO::AllocationType allocationType = NEO::AllocationType::bufferHostMemory; @@ -354,7 +354,7 @@ HWTEST_F(ImportNTHandleWithMockMemoryManager, givenCallToImportNTHandleWithHostB HWTEST_F(ImportNTHandleWithMockMemoryManager, givenCallToImportNTHandleWithBufferMemoryAllocationTypeThenDeviceUnifiedMemoryIsSet) { delete driverHandle->svmAllocsManager; driverHandle->setMemoryManager(execEnv->memoryManager.get()); - driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false); + driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get()); uint64_t imageHandle = 0x1; NEO::AllocationType allocationType = NEO::AllocationType::buffer; @@ -382,7 +382,7 @@ HWTEST_F(ImportNTHandleWithMockMemoryManager, givenNTHandleWhenCreatingDeviceMem delete driverHandle->svmAllocsManager; driverHandle->setMemoryManager(execEnv->memoryManager.get()); - driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false); + driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get()); void *ptr; auto result = context->allocDeviceMem(device, &devDesc, 100, 1, &ptr); @@ -406,7 +406,7 @@ HWTEST_F(ImportNTHandleWithMockMemoryManager, givenNTHandleWhenCreatingHostMemor delete driverHandle->svmAllocsManager; driverHandle->setMemoryManager(execEnv->memoryManager.get()); - driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false); + driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get()); void *ptr = nullptr; auto result = context->allocHostMem(&hostDesc, 100, 1, &ptr); @@ -420,7 +420,7 @@ HWTEST_F(ImportNTHandleWithMockMemoryManager, givenNTHandleWhenCreatingHostMemor HWTEST_F(ImportNTHandleWithMockMemoryManager, whenCallingCreateGraphicsAllocationFromMultipleSharedHandlesFromOsAgnosticMemoryManagerThenNullptrIsReturned) { delete driverHandle->svmAllocsManager; driverHandle->setMemoryManager(execEnv->memoryManager.get()); - driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false); + driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get()); std::vector handles{6, 7}; AllocationProperties properties = {device->getRootDeviceIndex(), diff --git a/level_zero/core/test/unit_tests/sources/image/test_image.cpp b/level_zero/core/test/unit_tests/sources/image/test_image.cpp index 017fe34a90..a046015ff8 100644 --- a/level_zero/core/test/unit_tests/sources/image/test_image.cpp +++ b/level_zero/core/test/unit_tests/sources/image/test_image.cpp @@ -685,7 +685,7 @@ HWTEST2_F(ImageCreateExternalMemoryTest, givenNTHandleWhenCreatingImageThenSucce delete driverHandle->svmAllocsManager; driverHandle->setMemoryManager(execEnv->memoryManager.get()); - driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false); + driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get()); auto imageHW = std::make_unique>>(); auto ret = imageHW->initialize(device, &desc); @@ -704,7 +704,7 @@ HWTEST2_F(ImageCreateExternalMemoryTest, givenD3D12HeapHandleWhenCreatingImageTh delete driverHandle->svmAllocsManager; driverHandle->setMemoryManager(execEnv->memoryManager.get()); - driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false); + driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get()); auto imageHW = std::make_unique>>(); auto ret = imageHW->initialize(device, &desc); @@ -723,7 +723,7 @@ HWTEST2_F(ImageCreateExternalMemoryTest, givenD3D12ResourceHandleWhenCreatingIma delete driverHandle->svmAllocsManager; driverHandle->setMemoryManager(execEnv->memoryManager.get()); - driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false); + driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get()); auto imageHW = std::make_unique>>(); auto ret = imageHW->initialize(device, &desc); @@ -742,7 +742,7 @@ HWTEST2_F(ImageCreateExternalMemoryTest, givenD3D11TextureHandleWhenCreatingImag delete driverHandle->svmAllocsManager; driverHandle->setMemoryManager(execEnv->memoryManager.get()); - driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false); + driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get()); auto imageHW = std::make_unique>>(); auto ret = imageHW->initialize(device, &desc); @@ -781,7 +781,7 @@ HWTEST2_F(ImageCreateWithMemoryManagerNTHandleMock, givenNTHandleWhenCreatingNV1 delete driverHandle->svmAllocsManager; driverHandle->setMemoryManager(execEnv->memoryManager.get()); - driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false); + driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get()); auto imageHW = std::make_unique>>(); auto ret = imageHW->initialize(device, &desc); @@ -831,7 +831,7 @@ HWTEST2_F(ImageCreateWithFailMemoryManagerMock, givenImageDescWhenFailImageAlloc delete driverHandle->svmAllocsManager; driverHandle->setMemoryManager(execEnv->memoryManager.get()); - driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false); + driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get()); L0::Image *imageHandle = nullptr; static_cast(execEnv->memoryManager.get())->fail = true; @@ -2614,7 +2614,7 @@ HWTEST2_F(ImageCreateExternalMemoryTest, givenNTHandleWhenCreatingInteropImageTh delete driverHandle->svmAllocsManager; driverHandle->setMemoryManager(execEnv->memoryManager.get()); - driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false); + driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get()); Image *imagePtr; auto result = Image::create(productFamily, device, &desc, &imagePtr); diff --git a/level_zero/core/test/unit_tests/sources/memory/linux/test_memory_linux.cpp b/level_zero/core/test/unit_tests/sources/memory/linux/test_memory_linux.cpp index c13aa5873f..8031e5393c 100644 --- a/level_zero/core/test/unit_tests/sources/memory/linux/test_memory_linux.cpp +++ b/level_zero/core/test/unit_tests/sources/memory/linux/test_memory_linux.cpp @@ -204,7 +204,7 @@ struct MemoryExportImportObtainFdTest : public ::testing::Test { driverHandle->setMemoryManager(currMemoryManager); prevSvmAllocsManager = driverHandle->svmAllocsManager; - currSvmAllocsManager = new NEO::SVMAllocsManager(currMemoryManager, false); + currSvmAllocsManager = new NEO::SVMAllocsManager(currMemoryManager); driverHandle->svmAllocsManager = currSvmAllocsManager; context = std::make_unique(driverHandle.get()); @@ -637,7 +637,7 @@ struct MemoryObtainFdTest : public ::testing::Test { driverHandle->setMemoryManager(currMemoryManager); prevSvmAllocsManager = driverHandle->svmAllocsManager; - currSvmAllocsManager = new NEO::SVMAllocsManager(currMemoryManager, false); + currSvmAllocsManager = new NEO::SVMAllocsManager(currMemoryManager); driverHandle->svmAllocsManager = currSvmAllocsManager; context = std::make_unique(driverHandle.get()); diff --git a/level_zero/core/test/unit_tests/sources/memory/test_memory.cpp b/level_zero/core/test/unit_tests/sources/memory/test_memory.cpp index d19518d58d..945d699d5c 100644 --- a/level_zero/core/test/unit_tests/sources/memory/test_memory.cpp +++ b/level_zero/core/test/unit_tests/sources/memory/test_memory.cpp @@ -141,7 +141,7 @@ struct IpcMemoryImplicitScalingTest : public ::testing::Test { driverHandle->setMemoryManager(currMemoryManager); prevSvmAllocsManager = driverHandle->svmAllocsManager; - currSvmAllocsManager = new NEO::SVMAllocsManager(currMemoryManager, false); + currSvmAllocsManager = new NEO::SVMAllocsManager(currMemoryManager); driverHandle->svmAllocsManager = currSvmAllocsManager; context->rootDeviceIndices.pushUnique(neoDevice->getRootDeviceIndex()); @@ -1486,7 +1486,7 @@ TEST_F(MemoryTest, givenContextWhenGettingPitchFor2dImageThenCorrectRowPitchIsRe } struct SVMAllocsManagerSharedAllocZexPointerMock : public NEO::SVMAllocsManager { - SVMAllocsManagerSharedAllocZexPointerMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager, false) {} + SVMAllocsManagerSharedAllocZexPointerMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager) {} void *createHostUnifiedMemoryAllocation(size_t size, const UnifiedMemoryProperties &memoryProperties) override { hostUnifiedMemoryAllocationTimes++; @@ -1717,7 +1717,7 @@ TEST_F(MemoryTest, whenAllocatingSharedMemoryWithHostInitialPlacementBiasFlagThe } struct SVMAllocsManagerFreeExtMock : public NEO::SVMAllocsManager { - SVMAllocsManagerFreeExtMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager, false) {} + SVMAllocsManagerFreeExtMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager) {} bool freeSVMAlloc(void *ptr, bool blocking) override { if (blocking) { blockingCallsMade++; @@ -2234,7 +2234,7 @@ TEST_F(FreeExtTests, } struct SVMAllocsManagerOutOFMemoryMock : public NEO::SVMAllocsManager { - SVMAllocsManagerOutOFMemoryMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager, false) {} + SVMAllocsManagerOutOFMemoryMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager) {} void *createUnifiedMemoryAllocation(size_t size, const UnifiedMemoryProperties &svmProperties) override { return nullptr; @@ -2291,7 +2291,7 @@ TEST_F(OutOfMemoryTests, } struct SVMAllocsManagerRelaxedSizeMock : public NEO::SVMAllocsManager { - SVMAllocsManagerRelaxedSizeMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager, false) {} + SVMAllocsManagerRelaxedSizeMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager) {} void *createUnifiedMemoryAllocation(size_t size, const UnifiedMemoryProperties &svmProperties) override { validateMemoryProperties(svmProperties); @@ -3797,7 +3797,7 @@ struct MultipleDevicePeerAllocationTest : public ::testing::Test { context->deviceBitfields.insert({neoDevice->getRootDeviceIndex(), neoDevice->getDeviceBitfield()}); } - currSvmAllocsManager = new NEO::SVMAllocsManager(currMemoryManager, driverHandle->devices[0]->isImplicitScalingCapable()); + currSvmAllocsManager = new NEO::SVMAllocsManager(currMemoryManager); prevSvmAllocsManager = driverHandle->svmAllocsManager; driverHandle->svmAllocsManager = currSvmAllocsManager; } @@ -5485,7 +5485,7 @@ TEST_F(ImportFdUncachedTests, } struct SVMAllocsManagerSharedAllocFailMock : public NEO::SVMAllocsManager { - SVMAllocsManagerSharedAllocFailMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager, false) {} + SVMAllocsManagerSharedAllocFailMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager) {} void *createSharedUnifiedMemoryAllocation(size_t size, const UnifiedMemoryProperties &svmProperties, void *cmdQ) override { @@ -5539,7 +5539,7 @@ TEST_F(SharedAllocFailTests, whenAllocatinSharedMemoryAndAllocationFailsThenOutO } struct SVMAllocsManagerSharedAllocMultiDeviceMock : public NEO::SVMAllocsManager { - SVMAllocsManagerSharedAllocMultiDeviceMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager, false) {} + SVMAllocsManagerSharedAllocMultiDeviceMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager) {} void *createHostUnifiedMemoryAllocation(size_t size, const UnifiedMemoryProperties &memoryProperties) override { createHostUnifiedMemoryAllocationTimes++; diff --git a/opencl/source/context/context.cpp b/opencl/source/context/context.cpp index dd28b3eb8c..38278bb7ce 100644 --- a/opencl/source/context/context.cpp +++ b/opencl/source/context/context.cpp @@ -301,8 +301,7 @@ bool Context::createImpl(const cl_context_properties *properties, } setupContextType(); - this->svmAllocsManager = new SVMAllocsManager(this->memoryManager, - this->areMultiStorageAllocationsPreferred()); + this->svmAllocsManager = new SVMAllocsManager(this->memoryManager); this->svmAllocsManager->initUsmAllocationsCaches(device->getDevice()); auto requiresWritableStaging = device->getDefaultEngine().commandStreamReceiver->getType() != CommandStreamReceiverType::hardware; this->stagingBufferManager = std::make_unique(svmAllocsManager, rootDeviceIndices, deviceBitfields, requiresWritableStaging); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp index 30a2862b12..f930538099 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp @@ -1400,7 +1400,7 @@ HWTEST_F(BcsTests, givenMapAllocationInBuiltinOpParamsWhenConstructingThenUseItA HWTEST_F(BcsTests, givenNonZeroCopySvmAllocationWhenConstructingBlitPropertiesForReadWriteBufferCallThenSetValidAllocations) { auto &csr = pDevice->getUltCommandStreamReceiver(); MockMemoryManager mockMemoryManager(true, true); - SVMAllocsManager svmAllocsManager(&mockMemoryManager, false); + SVMAllocsManager svmAllocsManager(&mockMemoryManager); auto svmAllocationProperties = MemObjHelper::getSvmAllocationProperties(CL_MEM_READ_WRITE); auto svmAlloc = svmAllocsManager.createSVMAlloc(1, svmAllocationProperties, context->getRootDeviceIndices(), context->getDeviceBitfields()); @@ -1445,7 +1445,7 @@ HWTEST_F(BcsTests, givenNonZeroCopySvmAllocationWhenConstructingBlitPropertiesFo HWTEST_F(BcsTests, givenSvmAllocationWhenBlitCalledThenUsePassedPointers) { auto &csr = pDevice->getUltCommandStreamReceiver(); MockMemoryManager mockMemoryManager(true, true); - SVMAllocsManager svmAllocsManager(&mockMemoryManager, false); + SVMAllocsManager svmAllocsManager(&mockMemoryManager); auto svmAllocationProperties = MemObjHelper::getSvmAllocationProperties(CL_MEM_READ_WRITE); auto svmAlloc = svmAllocsManager.createSVMAlloc(1, svmAllocationProperties, context->getRootDeviceIndices(), context->getDeviceBitfields()); diff --git a/opencl/test/unit_test/context/context_tests.cpp b/opencl/test/unit_test/context/context_tests.cpp index 29aa7c8ac7..949f7b8c30 100644 --- a/opencl/test/unit_test/context/context_tests.cpp +++ b/opencl/test/unit_test/context/context_tests.cpp @@ -781,7 +781,7 @@ struct MockGTPinTestContext : Context { }; struct MockSVMAllocManager : SVMAllocsManager { - MockSVMAllocManager() : SVMAllocsManager(nullptr, false) {} + MockSVMAllocManager() : SVMAllocsManager(nullptr) {} ~MockSVMAllocManager() override { svmAllocManagerDeleted = true; } diff --git a/opencl/test/unit_test/memory_manager/cpu_page_fault_manager_memory_sync_tests.cpp b/opencl/test/unit_test/memory_manager/cpu_page_fault_manager_memory_sync_tests.cpp index ce532f1959..fedda73c39 100644 --- a/opencl/test/unit_test/memory_manager/cpu_page_fault_manager_memory_sync_tests.cpp +++ b/opencl/test/unit_test/memory_manager/cpu_page_fault_manager_memory_sync_tests.cpp @@ -50,7 +50,7 @@ TEST_F(PageFaultManagerTest, givenUnifiedMemoryAllocWhenSynchronizeMemoryThenEnq REQUIRE_SVM_OR_SKIP(executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo()); auto memoryManager = std::make_unique(executionEnvironment); - auto svmAllocsManager = std::make_unique(memoryManager.get(), false); + auto svmAllocsManager = std::make_unique(memoryManager.get()); auto device = std::unique_ptr(new MockClDevice{MockDevice::createWithNewExecutionEnvironment(nullptr)}); auto rootDeviceIndex = device->getRootDeviceIndex(); RootDeviceIndicesContainer rootDeviceIndices = {rootDeviceIndex}; @@ -88,7 +88,7 @@ TEST_F(PageFaultManagerTest, givenUnifiedMemoryAllocWhenGpuTransferIsInvokedThen int insertSvmMapOperationCalled = 0; }; auto memoryManager = std::make_unique(executionEnvironment); - auto svmAllocsManager = std::make_unique(memoryManager.get(), false); + auto svmAllocsManager = std::make_unique(memoryManager.get()); auto device = std::unique_ptr(new MockClDevice{MockDevice::createWithNewExecutionEnvironment(nullptr)}); auto rootDeviceIndex = device->getRootDeviceIndex(); RootDeviceIndicesContainer rootDeviceIndices = {rootDeviceIndex}; @@ -111,7 +111,7 @@ TEST_F(PageFaultManagerTest, givenUnifiedMemoryAllocWhenAllowCPUMemoryEvictionIs REQUIRE_SVM_OR_SKIP(executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo()); auto memoryManager = std::make_unique(executionEnvironment); - auto svmAllocsManager = std::make_unique(memoryManager.get(), false); + auto svmAllocsManager = std::make_unique(memoryManager.get()); auto device = std::unique_ptr(new MockClDevice{MockDevice::createWithNewExecutionEnvironment(nullptr)}); auto rootDeviceIndex = device->getRootDeviceIndex(); RootDeviceIndicesContainer rootDeviceIndices = {rootDeviceIndex}; diff --git a/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp b/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp index 716ec67cfd..26f06ee2af 100644 --- a/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp @@ -50,7 +50,7 @@ using MultiDeviceSVMMemoryAllocatorTest = MultiRootDeviceWithSubDevicesFixture; TEST_F(MultiDeviceSVMMemoryAllocatorTest, givenMultipleDevicesWhenCreatingSVMAllocThenCreateOneGraphicsAllocationPerRootDeviceIndex) { REQUIRE_SVM_OR_SKIP(device1); - auto svmManager = std::make_unique(device1->getMemoryManager(), false); + auto svmManager = std::make_unique(device1->getMemoryManager()); auto ptr = svmManager->createSVMAlloc(MemoryConstants::pageSize, {}, context->getRootDeviceIndices(), context->getDeviceBitfields()); EXPECT_NE(nullptr, ptr); @@ -531,7 +531,7 @@ struct MemoryManagerPropertiesCheck : public MockMemoryManager { struct UnifiedMemoryManagerPropertiesTest : public ::testing::Test { void SetUp() override { memoryManager = std::make_unique(false, true, executionEnvironment); - svmManager = std::make_unique(memoryManager.get(), false); + svmManager = std::make_unique(memoryManager.get()); memoryManager->pageFaultManager.reset(new MockPageFaultManager); } @@ -546,13 +546,12 @@ TEST(UnifiedMemoryTest, givenDeviceBitfieldWithMultipleBitsSetWhenSharedUnifiedM debugManager.flags.CreateMultipleSubDevices.set(4); MockExecutionEnvironment executionEnvironment; auto memoryManager = std::make_unique(false, true, executionEnvironment); - auto svmManager = std::make_unique(memoryManager.get(), false); + auto svmManager = std::make_unique(memoryManager.get()); memoryManager->pageFaultManager.reset(new MockPageFaultManager); RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex}; std::map deviceBitfields{{mockRootDeviceIndex, DeviceBitfield(0xf)}}; SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); - svmManager->multiOsContextSupport = true; auto ptr = svmManager->createSharedUnifiedMemoryAllocation(4096u, unifiedMemoryProperties, &cmdQ); EXPECT_FALSE(memoryManager->multiOsContextCapablePassed); @@ -583,13 +582,12 @@ TEST(UnifiedMemoryTest, givenDeviceBitfieldWithMultipleBitsSetWhenMultiOsContext debugManager.flags.CreateMultipleSubDevices.set(4); MockExecutionEnvironment executionEnvironment; auto memoryManager = std::make_unique(false, true, executionEnvironment); - auto svmManager = std::make_unique(memoryManager.get(), false); + auto svmManager = std::make_unique(memoryManager.get()); memoryManager->pageFaultManager = std::make_unique(); RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex}; std::map deviceBitfields{{mockRootDeviceIndex, DeviceBitfield(0xf)}}; SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); - svmManager->multiOsContextSupport = true; auto ptr = svmManager->createSharedUnifiedMemoryAllocation(4096u, unifiedMemoryProperties, &cmdQ); EXPECT_FALSE(memoryManager->multiOsContextCapablePassed); @@ -599,46 +597,17 @@ TEST(UnifiedMemoryTest, givenDeviceBitfieldWithMultipleBitsSetWhenMultiOsContext svmManager->freeSVMAlloc(ptr); } -TEST(UnifiedMemoryTest, givenDeviceBitfieldWithMultipleBitsSetWhenMultiOsContextFlagFalseThenLowestSubDevicePassedToMemoryManager) { - MockCommandQueue cmdQ; - DebugManagerStateRestore restorer; - debugManager.flags.CreateMultipleSubDevices.set(4); - debugManager.flags.OverrideLeastOccupiedBank.set(1); - - MockExecutionEnvironment executionEnvironment; - auto memoryManager = std::make_unique(false, true, executionEnvironment); - auto svmManager = std::make_unique(memoryManager.get(), false); - memoryManager->pageFaultManager = std::make_unique(); - - RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex}; - std::map deviceBitfields{{mockRootDeviceIndex, DeviceBitfield(0xE)}}; - SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); - svmManager->multiOsContextSupport = false; - auto ptr = svmManager->createSharedUnifiedMemoryAllocation(4096u, unifiedMemoryProperties, &cmdQ); - - auto expectedSubDevices = unifiedMemoryProperties.subdeviceBitfields.at(mockRootDeviceIndex); - expectedSubDevices.reset(); - expectedSubDevices.set(1); - - EXPECT_FALSE(memoryManager->multiOsContextCapablePassed); - EXPECT_FALSE(memoryManager->multiStorageResourcePassed); - EXPECT_EQ(expectedSubDevices, memoryManager->subDevicesBitfieldPassed); - - svmManager->freeSVMAlloc(ptr); -} - TEST(UnifiedMemoryTest, givenDeviceBitfieldWithMultipleBitsSetWhenMultiOsContextFlagTrueAndDeviceMemoryThenProperPropertiesArePassedToMemoryManager) { MockContext mockContext; auto device = mockContext.getDevice(0u); MockExecutionEnvironment executionEnvironment; auto memoryManager = std::make_unique(false, true, executionEnvironment); - auto svmManager = std::make_unique(memoryManager.get(), false); + auto svmManager = std::make_unique(memoryManager.get()); RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex}; std::map deviceBitfields{{mockRootDeviceIndex, DeviceBitfield(0xf)}}; SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::deviceUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); unifiedMemoryProperties.device = &device->getDevice(); - svmManager->multiOsContextSupport = true; auto ptr = svmManager->createUnifiedMemoryAllocation(4096u, unifiedMemoryProperties); EXPECT_FALSE(memoryManager->multiOsContextCapablePassed); @@ -648,42 +617,18 @@ TEST(UnifiedMemoryTest, givenDeviceBitfieldWithMultipleBitsSetWhenMultiOsContext svmManager->freeSVMAlloc(ptr); } -TEST(UnifiedMemoryTest, givenDeviceBitfieldWithTwoBitsSetWhenMultiOsContextFlagTrueAndDeviceMemoryThenProperPropertiesArePassedToMemoryManager) { - MockContext mockContext; - RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex}; - MockExecutionEnvironment executionEnvironment; - auto memoryManager = std::make_unique(false, true, executionEnvironment); - auto svmManager = std::make_unique(memoryManager.get(), false); - std::map deviceBitfields{{mockRootDeviceIndex, DeviceBitfield(0x6)}}; - SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::deviceUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); - auto device = mockContext.getDevice(0u); - unifiedMemoryProperties.device = &device->getDevice(); - - auto ptr = svmManager->createUnifiedMemoryAllocation(4096u, unifiedMemoryProperties); - - EXPECT_FALSE(memoryManager->multiOsContextCapablePassed); - EXPECT_FALSE(memoryManager->multiStorageResourcePassed); - auto expectedSubDevices = unifiedMemoryProperties.subdeviceBitfields.at(mockRootDeviceIndex); - expectedSubDevices.reset(); - expectedSubDevices.set(1); - EXPECT_EQ(expectedSubDevices, memoryManager->subDevicesBitfieldPassed); - - svmManager->freeSVMAlloc(ptr); -} - TEST(UnifiedMemoryTest, givenDeviceBitfieldWithSingleBitsSetWhenMultiOsContextFlagTrueThenProperPropertiesArePassedToMemoryManager) { MockCommandQueue cmdQ; DebugManagerStateRestore restorer; debugManager.flags.CreateMultipleSubDevices.set(1); MockExecutionEnvironment executionEnvironment; auto memoryManager = std::make_unique(false, true, executionEnvironment); - auto svmManager = std::make_unique(memoryManager.get(), false); + auto svmManager = std::make_unique(memoryManager.get()); memoryManager->pageFaultManager = std::make_unique(); RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex}; std::map deviceBitfields{{mockRootDeviceIndex, DeviceBitfield(0x1)}}; SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); - svmManager->multiOsContextSupport = true; auto ptr = svmManager->createSharedUnifiedMemoryAllocation(4096u, unifiedMemoryProperties, &cmdQ); EXPECT_FALSE(memoryManager->multiOsContextCapablePassed); @@ -698,7 +643,7 @@ TEST(UnifiedMemoryTest, givenInternalAllocationsWhenTheyArePreparedForFreeingThe MockDevice device; MockExecutionEnvironment executionEnvironment; auto memoryManager = std::make_unique(false, true, executionEnvironment); - auto unifiedMemoryManager = std::make_unique(memoryManager.get(), false); + auto unifiedMemoryManager = std::make_unique(memoryManager.get()); memoryManager->pageFaultManager = std::make_unique(); RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex}; @@ -751,7 +696,6 @@ TEST_F(UnifiedMemoryManagerPropertiesTest, givenDeviceBitfieldWithMultiDeviceBit std::map deviceBitfields{{mockRootDeviceIndex, DeviceBitfield(0xF)}}; SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); - svmManager->multiOsContextSupport = true; auto ptr = svmManager->createUnifiedAllocationWithDeviceStorage(10 * MemoryConstants::pageSize64k, {}, unifiedMemoryProperties); EXPECT_FALSE(memoryManager->multiOsContextCapablePassed); @@ -761,34 +705,11 @@ TEST_F(UnifiedMemoryManagerPropertiesTest, givenDeviceBitfieldWithMultiDeviceBit svmManager->freeSVMAlloc(ptr); } -TEST_F(UnifiedMemoryManagerPropertiesTest, givenDeviceBitfieldWithMultiDeviceBitSetWhenMultiOsContextFlagFalseThenLowestSubdeviceIsPassedToMemoryManager) { - DebugManagerStateRestore restorer; - debugManager.flags.OverrideLeastOccupiedBank.set(1); - - RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex}; - std::map deviceBitfields{{mockRootDeviceIndex, DeviceBitfield(0xE)}}; - SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); - - svmManager->multiOsContextSupport = false; - auto ptr = svmManager->createUnifiedAllocationWithDeviceStorage(10 * MemoryConstants::pageSize64k, {}, unifiedMemoryProperties); - - auto expectedSubDevices = unifiedMemoryProperties.subdeviceBitfields.at(mockRootDeviceIndex); - expectedSubDevices.reset(); - expectedSubDevices.set(1); - - EXPECT_FALSE(memoryManager->multiOsContextCapablePassed); - EXPECT_FALSE(memoryManager->multiStorageResourcePassed); - EXPECT_EQ(expectedSubDevices, memoryManager->subDevicesBitfieldPassed); - - svmManager->freeSVMAlloc(ptr); -} - TEST_F(UnifiedMemoryManagerPropertiesTest, givenDeviceBitfieldWithSingleDeviceBitSetWhenMultiOsContextFlagTrueThenProperPropertiesArePassedToMemoryManager) { RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex}; std::map deviceBitfields{{mockRootDeviceIndex, DeviceBitfield(0x1)}}; SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); - svmManager->multiOsContextSupport = true; auto ptr = svmManager->createUnifiedAllocationWithDeviceStorage(10 * MemoryConstants::pageSize64k, {}, unifiedMemoryProperties); EXPECT_FALSE(memoryManager->multiOsContextCapablePassed); @@ -819,7 +740,6 @@ TEST_F(UnifiedMemoryManagerPropertiesTest, std::map deviceBitfields{{mockRootDeviceIndex, DeviceBitfield(0x1)}}; SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::hostUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); - svmManager->multiOsContextSupport = true; auto ptr = svmManager->createHostUnifiedMemoryAllocation(MemoryConstants::pageSize64k, unifiedMemoryProperties); EXPECT_FALSE(memoryManager->multiOsContextCapablePassed); @@ -835,7 +755,6 @@ TEST_F(UnifiedMemoryManagerPropertiesTest, std::map deviceBitfields{{mockRootDeviceIndex, DeviceBitfield(0x1)}}; SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::hostUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); - svmManager->multiOsContextSupport = true; auto ptr = svmManager->createHostUnifiedMemoryAllocation(4 * MemoryConstants::pageSize2M + MemoryConstants::pageSize64k, unifiedMemoryProperties); auto allocation = svmManager->getSVMAlloc(ptr); @@ -860,7 +779,6 @@ TEST_F(UnifiedMemoryManagerPropertiesTest, std::map deviceBitfields{{mockRootDeviceIndex, DeviceBitfield(0x1)}}; SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::hostUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); - svmManager->multiOsContextSupport = true; auto ptr = svmManager->createHostUnifiedMemoryAllocation(4 * MemoryConstants::pageSize2M + MemoryConstants::pageSize64k, unifiedMemoryProperties); auto allocation = svmManager->getSVMAlloc(ptr); @@ -877,7 +795,6 @@ TEST_F(UnifiedMemoryManagerPropertiesTest, std::map deviceBitfields{{mockRootDeviceIndex, DeviceBitfield(0x1)}}; SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::hostUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); - svmManager->multiOsContextSupport = true; auto ptr = svmManager->createHostUnifiedMemoryAllocation(1u, unifiedMemoryProperties); auto allocation = svmManager->getSVMAlloc(ptr); @@ -886,29 +803,12 @@ TEST_F(UnifiedMemoryManagerPropertiesTest, svmManager->freeSVMAlloc(ptr); } -TEST_F(UnifiedMemoryManagerPropertiesTest, - givenSvmManagerMultiOsContextSupportFlagFalseWhenRootDeviceIsMultiThenMultiStorageFlagFalse) { - RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex}; - std::map deviceBitfields{{mockRootDeviceIndex, DeviceBitfield(0xF)}}; - SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::hostUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); - - svmManager->multiOsContextSupport = false; - auto ptr = svmManager->createHostUnifiedMemoryAllocation(MemoryConstants::pageSize64k, unifiedMemoryProperties); - - EXPECT_FALSE(memoryManager->multiOsContextCapablePassed); - EXPECT_FALSE(memoryManager->multiStorageResourcePassed); - EXPECT_EQ(unifiedMemoryProperties.subdeviceBitfields.at(mockRootDeviceIndex), memoryManager->subDevicesBitfieldPassed); - - svmManager->freeSVMAlloc(ptr); -} - TEST_F(UnifiedMemoryManagerPropertiesTest, givenSvmManagerMultiOsContextSupportFlagTrueWhenRootDeviceIsMultiThenMultiStorageFlagTrue) { RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex}; std::map deviceBitfields{{mockRootDeviceIndex, DeviceBitfield(0xF)}}; SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::hostUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); - svmManager->multiOsContextSupport = true; auto ptr = svmManager->createHostUnifiedMemoryAllocation(MemoryConstants::pageSize64k, unifiedMemoryProperties); EXPECT_FALSE(memoryManager->multiOsContextCapablePassed); @@ -922,7 +822,7 @@ struct ShareableUnifiedMemoryManagerPropertiesTest : public ::testing::Test { void SetUp() override { executionEnvironment = platform()->peekExecutionEnvironment(); memoryManager = std::make_unique(false, true, *executionEnvironment); - svmManager = std::make_unique(memoryManager.get(), false); + svmManager = std::make_unique(memoryManager.get()); memoryManager->pageFaultManager.reset(new MockPageFaultManager); } diff --git a/opencl/test/unit_test/mocks/mock_context.cpp b/opencl/test/unit_test/mocks/mock_context.cpp index 9948869586..95bbcde0b6 100644 --- a/opencl/test/unit_test/mocks/mock_context.cpp +++ b/opencl/test/unit_test/mocks/mock_context.cpp @@ -109,8 +109,7 @@ void MockContext::initializeWithDevices(const ClDeviceVector &devices, bool noSp this->devices = devices; memoryManager = devices[0]->getMemoryManager(); - svmAllocsManager = new MockSVMAllocsManager(memoryManager, - true); + svmAllocsManager = new MockSVMAllocsManager(memoryManager); for (auto &rootDeviceIndex : rootDeviceIndices) { DeviceBitfield deviceBitfield{}; diff --git a/shared/source/memory_manager/unified_memory_manager.cpp b/shared/source/memory_manager/unified_memory_manager.cpp index 808b5aa12b..eef79d11a4 100644 --- a/shared/source/memory_manager/unified_memory_manager.cpp +++ b/shared/source/memory_manager/unified_memory_manager.cpp @@ -363,8 +363,8 @@ void SVMAllocsManager::makeInternalAllocationsResident(CommandStreamReceiver &co } } -SVMAllocsManager::SVMAllocsManager(MemoryManager *memoryManager, bool multiOsContextSupport) - : memoryManager(memoryManager), multiOsContextSupport(multiOsContextSupport) { +SVMAllocsManager::SVMAllocsManager(MemoryManager *memoryManager) + : memoryManager(memoryManager) { } SVMAllocsManager::~SVMAllocsManager() = default; @@ -413,7 +413,7 @@ void *SVMAllocsManager::createHostUnifiedMemoryAllocation(size_t size, alignedSize, allocationType, false, - (deviceBitfield.count() > 1) && multiOsContextSupport, + (deviceBitfield.count() > 1), deviceBitfield}; unifiedMemoryProperties.alignment = alignUpNonZero(memoryProperties.alignment, pageSizeForAlignment); unifiedMemoryProperties.flags.preferCompressed = compressionEnabled; @@ -470,16 +470,7 @@ void *SVMAllocsManager::createUnifiedMemoryAllocation(size_t size, bool compressionEnabled = false; AllocationType allocationType = getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled); - bool multiStorageAllocation = (deviceBitfield.count() > 1) && multiOsContextSupport; - if ((deviceBitfield.count() > 1) && !multiOsContextSupport) { - for (uint32_t i = 0;; i++) { - if (deviceBitfield.test(i)) { - deviceBitfield.reset(); - deviceBitfield.set(i); - break; - } - } - } + bool multiStorageAllocation = (deviceBitfield.count() > 1); AllocationProperties unifiedMemoryProperties{rootDeviceIndex, !useExternalHostPtrForCpu, // allocateMemory @@ -841,24 +832,13 @@ void *SVMAllocsManager::createUnifiedAllocationWithDeviceStorage(size_t size, co void *svmPtr = allocationCpu->getUnderlyingBuffer(); UNRECOVERABLE_IF(useExternalHostPtrForCpu && (externalPtr != svmPtr)); - bool multiStorageAllocation = (subDevices.count() > 1) && multiOsContextSupport; - if ((subDevices.count() > 1) && !multiOsContextSupport) { - for (uint32_t i = 0;; i++) { - if (subDevices.test(i)) { - subDevices.reset(); - subDevices.set(i); - break; - } - } - } - const size_t alignedGpuSize = alignUp(size, MemoryConstants::pageSize64k); AllocationProperties gpuProperties{rootDeviceIndex, false, alignedGpuSize, AllocationType::svmGpu, false, - multiStorageAllocation, + subDevices.count() > 1, subDevices}; gpuProperties.alignment = alignment; diff --git a/shared/source/memory_manager/unified_memory_manager.h b/shared/source/memory_manager/unified_memory_manager.h index 7473f553e9..19b73bf991 100644 --- a/shared/source/memory_manager/unified_memory_manager.h +++ b/shared/source/memory_manager/unified_memory_manager.h @@ -219,7 +219,7 @@ class SVMAllocsManager { defer = 2 }; - SVMAllocsManager(MemoryManager *memoryManager, bool multiOsContextSupport); + SVMAllocsManager(MemoryManager *memoryManager); MOCKABLE_VIRTUAL ~SVMAllocsManager(); void *createSVMAlloc(size_t size, const SvmAllocationProperties svmProperties, @@ -305,7 +305,6 @@ class SVMAllocsManager { MemoryManager *memoryManager; std::shared_mutex mtx; std::mutex mtxForIndirectAccess; - bool multiOsContextSupport; std::unique_ptr usmDeviceAllocationsCache; std::unique_ptr usmHostAllocationsCache; std::multimap internalAllocationsMap; diff --git a/shared/test/common/fixtures/cpu_page_fault_manager_tests_fixture.h b/shared/test/common/fixtures/cpu_page_fault_manager_tests_fixture.h index 879ba36136..b21a4c7ab6 100644 --- a/shared/test/common/fixtures/cpu_page_fault_manager_tests_fixture.h +++ b/shared/test/common/fixtures/cpu_page_fault_manager_tests_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -34,7 +34,7 @@ class PageFaultManagerTest : public ::testing::Test { public: void SetUp() override { memoryManager = std::make_unique(executionEnvironment); - unifiedMemoryManager = std::make_unique(memoryManager.get(), false); + unifiedMemoryManager = std::make_unique(memoryManager.get()); pageFaultManager = std::make_unique(); } diff --git a/shared/test/common/mocks/mock_svm_manager.h b/shared/test/common/mocks/mock_svm_manager.h index 057d46c2e8..b55bdff51b 100644 --- a/shared/test/common/mocks/mock_svm_manager.h +++ b/shared/test/common/mocks/mock_svm_manager.h @@ -17,7 +17,6 @@ struct MockSVMAllocsManager : public SVMAllocsManager { public: using SVMAllocsManager::memoryManager; using SVMAllocsManager::mtxForIndirectAccess; - using SVMAllocsManager::multiOsContextSupport; using SVMAllocsManager::svmAllocs; using SVMAllocsManager::SVMAllocsManager; using SVMAllocsManager::svmDeferFreeAllocs; @@ -45,7 +44,7 @@ struct SVMMemoryAllocatorFixture { void setUp() { executionEnvironment.initGmm(); memoryManager = std::make_unique(false, enableLocalMemory, executionEnvironment); - svmManager = std::make_unique(memoryManager.get(), false); + svmManager = std::make_unique(memoryManager.get()); if (enableLocalMemory) { memoryManager->pageFaultManager.reset(new MockPageFaultManager); } diff --git a/shared/test/unit_test/command_stream/aub_command_stream_receiver_3_tests.cpp b/shared/test/unit_test/command_stream/aub_command_stream_receiver_3_tests.cpp index a785580fb0..80654ac8bd 100644 --- a/shared/test/unit_test/command_stream/aub_command_stream_receiver_3_tests.cpp +++ b/shared/test/unit_test/command_stream/aub_command_stream_receiver_3_tests.cpp @@ -581,7 +581,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenUsmAllocationWhenDumpAllocationIsCa auto mockHardwareContext = static_cast(aubCsr.hardwareContextController->hardwareContexts[0].get()); auto memoryManager = std::make_unique(false, true, *pDevice->executionEnvironment); - auto svmManager = std::make_unique(memoryManager.get(), false); + auto svmManager = std::make_unique(memoryManager.get()); RootDeviceIndicesContainer rootDeviceIndices = {rootDeviceIndex}; std::map deviceBitfields{{rootDeviceIndex, pDevice->getDeviceBitfield()}}; diff --git a/shared/test/unit_test/memory_manager/memory_manager_tests.cpp b/shared/test/unit_test/memory_manager/memory_manager_tests.cpp index 760db4f076..552a89fdaa 100644 --- a/shared/test/unit_test/memory_manager/memory_manager_tests.cpp +++ b/shared/test/unit_test/memory_manager/memory_manager_tests.cpp @@ -2769,7 +2769,7 @@ TEST(MemoryManagerTest, whenMemoryManagerReturnsNullptrThenAllocateGlobalsSurfac EXPECT_EQ(nullptr, allocation); EXPECT_EQ(deviceBitfield, memoryManager->recentlyPassedDeviceBitfield); - auto svmAllocsManager = std::make_unique(memoryManager, false); + auto svmAllocsManager = std::make_unique(memoryManager); memoryManager->recentlyPassedDeviceBitfield = {}; allocation = allocateGlobalsSurface(svmAllocsManager.get(), device, 1024, 0u, false, &linkerInput, nullptr); EXPECT_EQ(nullptr, allocation); diff --git a/shared/test/unit_test/memory_manager/prefetch_manager_tests.cpp b/shared/test/unit_test/memory_manager/prefetch_manager_tests.cpp index 03d89f3835..394efb2933 100644 --- a/shared/test/unit_test/memory_manager/prefetch_manager_tests.cpp +++ b/shared/test/unit_test/memory_manager/prefetch_manager_tests.cpp @@ -24,7 +24,7 @@ TEST(PrefetchManagerTests, givenPrefetchManagerWhenCallingInterfaceFunctionsThen std::map deviceBitfields{{mockRootDeviceIndex, mockDeviceBitfield}}; auto device = deviceFactory->rootDevices[0]; auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); auto prefetchManager = std::make_unique(); PrefetchContext prefetchContext; @@ -73,7 +73,7 @@ TEST(PrefetchManagerTests, givenPrefetchManagerWhenCallingInterfaceFunctionsThen std::map deviceBitfields{{mockRootDeviceIndex, mockDeviceBitfield}}; auto device = deviceFactory->rootDevices[0]; auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); auto prefetchManager = std::make_unique(); PrefetchContext prefetchContext; @@ -108,7 +108,7 @@ TEST(PrefetchManagerTests, givenPrefetchManagerWhenCallingMigrateAllocationsToGp std::map deviceBitfields{{mockRootDeviceIndex, mockDeviceBitfield}}; auto device = deviceFactory->rootDevices[0]; auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); auto prefetchManager = std::make_unique(); PrefetchContext prefetchContext; diff --git a/shared/test/unit_test/memory_manager/unified_memory_manager_cache_tests.cpp b/shared/test/unit_test/memory_manager/unified_memory_manager_cache_tests.cpp index c158c2da6c..440efa68c1 100644 --- a/shared/test/unit_test/memory_manager/unified_memory_manager_cache_tests.cpp +++ b/shared/test/unit_test/memory_manager/unified_memory_manager_cache_tests.cpp @@ -119,7 +119,7 @@ TEST(SvmAllocationCacheSimpleTest, givenSvmAllocationCacheInfoWhenMarkedForDelet TEST(SvmAllocationCacheSimpleTest, givenAllocationsWhenCheckingIsInUseThenReturnCorrectValue) { SVMAllocsManager::SvmAllocationCache allocationCache; MockMemoryManager memoryManager; - MockSVMAllocsManager svmAllocsManager(&memoryManager, false); + MockSVMAllocsManager svmAllocsManager(&memoryManager); allocationCache.memoryManager = &memoryManager; allocationCache.svmAllocsManager = &svmAllocsManager; @@ -162,7 +162,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenAllocationCacheDisabledWhenCheckingIfE DebugManagerStateRestore restorer; std::unique_ptr deviceFactory(new UltDeviceFactory(1, 1)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(0); EXPECT_EQ(nullptr, svmManager->usmDeviceAllocationsCache); svmManager->initUsmAllocationsCaches(*device); @@ -174,7 +174,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenAllocationCacheEnabledAndMaxSizeZeroWh debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(1); std::unique_ptr deviceFactory(new UltDeviceFactory(1, 1)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); device->usmReuseInfo.init(0, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); EXPECT_NE(nullptr, svmManager->usmDeviceAllocationsCache); @@ -192,7 +192,7 @@ HWTEST_F(SvmDeviceAllocationCacheTest, givenOclApiSpecificConfigWhenCheckingIfEn raii.mockProductHelper->isDeviceUsmAllocationReuseSupportedResult = false; device->initUsmReuseLimits(); EXPECT_EQ(0u, device->usmReuseInfo.getMaxAllocationsSavedForReuseSize()); - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); EXPECT_EQ(nullptr, svmManager->usmDeviceAllocationsCache); svmManager->initUsmAllocationsCaches(*device); EXPECT_EQ(nullptr, svmManager->usmDeviceAllocationsCache); @@ -200,7 +200,7 @@ HWTEST_F(SvmDeviceAllocationCacheTest, givenOclApiSpecificConfigWhenCheckingIfEn { raii.mockProductHelper->isDeviceUsmAllocationReuseSupportedResult = true; device->initUsmReuseLimits(); - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); EXPECT_EQ(nullptr, svmManager->usmDeviceAllocationsCache); svmManager->initUsmAllocationsCaches(*device); EXPECT_NE(nullptr, svmManager->usmDeviceAllocationsCache); @@ -211,7 +211,7 @@ HWTEST_F(SvmDeviceAllocationCacheTest, givenOclApiSpecificConfigWhenCheckingIfEn raii.mockProductHelper->isDeviceUsmAllocationReuseSupportedResult = true; mockAilConfigurationHelper.limitAmountOfDeviceMemoryForRecyclingReturn = true; device->initUsmReuseLimits(); - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); EXPECT_EQ(nullptr, svmManager->usmDeviceAllocationsCache); svmManager->initUsmAllocationsCaches(*device); EXPECT_NE(nullptr, svmManager->usmDeviceAllocationsCache); @@ -227,7 +227,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenAllocationCacheEnabledWhenDirectSubmis debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(1); debugManager.flags.ExperimentalEnableHostAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); device->anyDirectSubmissionEnabledReturnValue = true; svmManager->initUsmAllocationsCaches(*device); @@ -278,7 +278,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenAllocationCacheEnabledWhenFreeingDevic DebugManagerStateRestore restore; debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); device->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); ASSERT_NE(nullptr, svmManager->usmDeviceAllocationsCache); @@ -329,7 +329,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenAllocationCacheEnabledWhenInitializedT debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(2); std::unique_ptr deviceFactory(new UltDeviceFactory(1, 1)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); svmManager->initUsmAllocationsCaches(*device); ASSERT_NE(nullptr, svmManager->usmDeviceAllocationsCache); @@ -344,7 +344,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenAllocationCacheEnabledWhenFreeingDevic DebugManagerStateRestore restore; debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); constexpr auto allocationSize = MemoryConstants::pageSize64k; device->usmReuseInfo.init(allocationSize, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); @@ -415,8 +415,8 @@ TEST_F(SvmDeviceAllocationCacheTest, givenAllocationCacheEnabledAndMultipleSVMMa DebugManagerStateRestore restore; debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); - auto secondSvmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); + auto secondSvmManager = std::make_unique(device->getMemoryManager()); constexpr auto allocationSize = MemoryConstants::pageSize64k; device->usmReuseInfo.init(allocationSize, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); @@ -485,7 +485,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenAllocationsWithDifferentSizesWhenAlloc DebugManagerStateRestore restore; debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); device->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); ASSERT_NE(nullptr, svmManager->usmDeviceAllocationsCache); @@ -534,7 +534,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenAllocationWithDifferentSizeWhenAllocat DebugManagerStateRestore restore; debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); device->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); EXPECT_NE(nullptr, svmManager->usmDeviceAllocationsCache); @@ -579,7 +579,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenAllocationsWithDifferentSizesWhenAlloc DebugManagerStateRestore restore; debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); device->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); ASSERT_NE(nullptr, svmManager->usmDeviceAllocationsCache); @@ -619,7 +619,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenAllocationOverSizeLimitWhenAllocatingA DebugManagerStateRestore restore; debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); device->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); ASSERT_NE(nullptr, svmManager->usmDeviceAllocationsCache); @@ -649,7 +649,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenMultipleAllocationsWhenAllocatingAfter DebugManagerStateRestore restore; debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); device->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); ASSERT_NE(nullptr, svmManager->usmDeviceAllocationsCache); @@ -727,7 +727,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenAllocationsWithDifferentFlagsWhenAlloc auto rootDevice = deviceFactory->rootDevices[0]; auto secondRootDevice = deviceFactory->rootDevices[1]; auto subDevice1 = reinterpret_cast(deviceFactory->subDevices[0]); - auto svmManager = std::make_unique(rootDevice->getMemoryManager(), false); + auto svmManager = std::make_unique(rootDevice->getMemoryManager()); rootDevice->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); secondRootDevice->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); subDevice1->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); @@ -802,7 +802,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenDeviceOutOfMemoryWhenAllocatingThenCac auto device = deviceFactory->rootDevices[0]; device->injectMemoryManager(new MockMemoryManagerWithCapacity(*device->getExecutionEnvironment())); MockMemoryManagerWithCapacity *memoryManager = static_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); device->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); memoryManager->usmReuseInfo.init(0u, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); @@ -841,7 +841,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenAllocationWithIsInternalAllocationSetW DebugManagerStateRestore restore; debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); device->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); EXPECT_NE(nullptr, svmManager->usmDeviceAllocationsCache); @@ -873,7 +873,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenAllocationInUsageWhenAllocatingAfterFr DebugManagerStateRestore restore; debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); device->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); EXPECT_NE(nullptr, svmManager->usmDeviceAllocationsCache); @@ -906,7 +906,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenUsmReuseCleanerWhenTrimOldInCachesCall debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(1); debugManager.flags.ExperimentalEnableHostAllocationCache.set(0); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); device->executionEnvironment->unifiedMemoryReuseCleaner.reset(new MockUnifiedMemoryReuseCleaner(false)); auto mockUnifiedMemoryReuseCleaner = reinterpret_cast(device->executionEnvironment->unifiedMemoryReuseCleaner.get()); EXPECT_EQ(0u, mockUnifiedMemoryReuseCleaner->svmAllocationCaches.size()); @@ -959,7 +959,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenDirectSubmissionLightWhenTrimOldInCach debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(1); debugManager.flags.ExperimentalEnableHostAllocationCache.set(0); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); device->executionEnvironment->unifiedMemoryReuseCleaner.reset(new MockUnifiedMemoryReuseCleaner(true)); auto mockUnifiedMemoryReuseCleaner = reinterpret_cast(device->executionEnvironment->unifiedMemoryReuseCleaner.get()); EXPECT_EQ(0u, mockUnifiedMemoryReuseCleaner->svmAllocationCaches.size()); @@ -1001,7 +1001,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenUsmReuseCleanerWhenTrimOldInCachesCall debugManager.flags.ExperimentalEnableHostAllocationCache.set(0); auto device = deviceFactory->rootDevices[0]; auto memoryManager = reinterpret_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); device->executionEnvironment->unifiedMemoryReuseCleaner.reset(new MockUnifiedMemoryReuseCleaner(false)); auto mockUnifiedMemoryReuseCleaner = reinterpret_cast(device->executionEnvironment->unifiedMemoryReuseCleaner.get()); EXPECT_EQ(0u, mockUnifiedMemoryReuseCleaner->svmAllocationCaches.size()); @@ -1042,7 +1042,7 @@ TEST_F(SvmDeviceAllocationCacheTest, givenAllocationsInReuseWhenTrimOldAllocsCal DebugManagerStateRestore restore; debugManager.flags.ExperimentalEnableDeviceAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); device->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); EXPECT_NE(nullptr, svmManager->usmDeviceAllocationsCache); @@ -1092,7 +1092,7 @@ TEST_F(SvmHostAllocationCacheTest, givenAllocationCacheDisabledWhenCheckingIfEna DebugManagerStateRestore restorer; std::unique_ptr deviceFactory(new UltDeviceFactory(1, 1)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); debugManager.flags.ExperimentalEnableHostAllocationCache.set(0); EXPECT_EQ(nullptr, svmManager->usmHostAllocationsCache); svmManager->initUsmAllocationsCaches(*device); @@ -1122,14 +1122,14 @@ HWTEST_F(SvmHostAllocationCacheTest, givenOclApiSpecificConfigWhenCheckingIfEnab { raii.mockProductHelper->isHostUsmAllocationReuseSupportedResult = false; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); EXPECT_EQ(nullptr, svmManager->usmHostAllocationsCache); svmManager->initUsmAllocationsCaches(*device); EXPECT_EQ(nullptr, svmManager->usmHostAllocationsCache); } { raii.mockProductHelper->isHostUsmAllocationReuseSupportedResult = true; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); EXPECT_EQ(nullptr, svmManager->usmHostAllocationsCache); svmManager->initUsmAllocationsCaches(*device); EXPECT_NE(nullptr, svmManager->usmHostAllocationsCache); @@ -1180,7 +1180,7 @@ TEST_F(SvmHostAllocationCacheTest, givenAllocationCacheEnabledWhenFreeingHostAll debugManager.flags.ExperimentalEnableHostAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; auto memoryManager = reinterpret_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); memoryManager->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); ASSERT_NE(nullptr, svmManager->usmHostAllocationsCache); @@ -1230,7 +1230,7 @@ TEST_F(SvmHostAllocationCacheTest, givenAllocationCacheEnabledWhenInitializedThe DebugManagerStateRestore restore; debugManager.flags.ExperimentalEnableHostAllocationCache.set(2); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); svmManager->initUsmAllocationsCaches(*device); ASSERT_NE(nullptr, svmManager->usmHostAllocationsCache); @@ -1246,7 +1246,7 @@ TEST_F(SvmHostAllocationCacheTest, givenAllocationCacheEnabledWhenFreeingHostAll debugManager.flags.ExperimentalEnableHostAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; auto memoryManager = reinterpret_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); constexpr auto allocationSize = MemoryConstants::pageSize64k; memoryManager->usmReuseInfo.init(allocationSize, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); @@ -1317,7 +1317,7 @@ TEST_F(SvmHostAllocationCacheTest, givenAllocationCacheEnabledWhenFreeingHostAll debugManager.flags.ExperimentalEnableHostAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; auto memoryManager = reinterpret_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); constexpr auto allocationSize = MemoryConstants::pageSize64k; svmManager->initUsmAllocationsCaches(*device); ASSERT_NE(nullptr, svmManager->usmHostAllocationsCache); @@ -1350,8 +1350,8 @@ TEST_F(SvmHostAllocationCacheTest, givenAllocationCacheEnabledAndMultipleSVMMana debugManager.flags.ExperimentalEnableHostAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; auto memoryManager = reinterpret_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); - auto secondSvmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); + auto secondSvmManager = std::make_unique(memoryManager); constexpr auto allocationSize = MemoryConstants::pageSize64k; memoryManager->usmReuseInfo.init(allocationSize, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); @@ -1426,7 +1426,7 @@ TEST_F(SvmHostAllocationCacheTest, givenAllocationsWithDifferentSizesWhenAllocat debugManager.flags.ExperimentalEnableHostAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; auto memoryManager = reinterpret_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); memoryManager->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); ASSERT_NE(nullptr, svmManager->usmHostAllocationsCache); @@ -1478,7 +1478,7 @@ TEST_F(SvmHostAllocationCacheTest, givenAllocationsWithDifferentSizesWhenAllocat debugManager.flags.ExperimentalEnableHostAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; auto memoryManager = reinterpret_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); memoryManager->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); ASSERT_NE(nullptr, svmManager->usmHostAllocationsCache); @@ -1518,7 +1518,7 @@ TEST_F(SvmHostAllocationCacheTest, givenAllocationOverSizeLimitWhenAllocatingAft debugManager.flags.ExperimentalEnableHostAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; auto memoryManager = reinterpret_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); memoryManager->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); ASSERT_NE(nullptr, svmManager->usmHostAllocationsCache); @@ -1547,7 +1547,7 @@ TEST_F(SvmHostAllocationCacheTest, givenMultipleAllocationsWhenAllocatingAfterFr debugManager.flags.ExperimentalEnableHostAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; auto memoryManager = reinterpret_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); memoryManager->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); ASSERT_NE(nullptr, svmManager->usmHostAllocationsCache); @@ -1623,7 +1623,7 @@ TEST_F(SvmHostAllocationCacheTest, givenAllocationsWithDifferentFlagsWhenAllocat debugManager.flags.ExperimentalEnableHostAllocationCache.set(1); auto rootDevice = deviceFactory->rootDevices[0]; auto memoryManager = reinterpret_cast(rootDevice->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); memoryManager->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*rootDevice); ASSERT_NE(nullptr, svmManager->usmHostAllocationsCache); @@ -1690,7 +1690,7 @@ TEST_F(SvmHostAllocationCacheTest, givenHostOutOfMemoryWhenAllocatingThenCacheIs auto device = deviceFactory->rootDevices[0]; device->injectMemoryManager(new MockMemoryManagerWithCapacity(*device->getExecutionEnvironment())); MockMemoryManagerWithCapacity *memoryManager = static_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); memoryManager->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); ASSERT_NE(nullptr, svmManager->usmHostAllocationsCache); @@ -1728,7 +1728,7 @@ TEST_F(SvmHostAllocationCacheTest, givenAllocationInUsageWhenAllocatingAfterFree debugManager.flags.ExperimentalEnableHostAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; auto memoryManager = reinterpret_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); memoryManager->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); EXPECT_NE(nullptr, svmManager->usmHostAllocationsCache); @@ -1759,7 +1759,7 @@ TEST_F(SvmHostAllocationCacheTest, givenAllocationsInReuseWhenTrimOldAllocsCalle debugManager.flags.ExperimentalEnableHostAllocationCache.set(1); auto device = deviceFactory->rootDevices[0]; auto memoryManager = reinterpret_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); memoryManager->usmReuseInfo.init(1 * MemoryConstants::gigaByte, UsmReuseInfo::notLimited); svmManager->initUsmAllocationsCaches(*device); EXPECT_NE(nullptr, svmManager->usmHostAllocationsCache); diff --git a/shared/test/unit_test/memory_manager/unified_memory_manager_tests.cpp b/shared/test/unit_test/memory_manager/unified_memory_manager_tests.cpp index 23ecc79408..4baaa70e65 100644 --- a/shared/test/unit_test/memory_manager/unified_memory_manager_tests.cpp +++ b/shared/test/unit_test/memory_manager/unified_memory_manager_tests.cpp @@ -24,7 +24,7 @@ using namespace NEO; TEST(SvmDeviceAllocationTest, givenGivenSvmAllocsManagerWhenObtainOwnershipCalledThenLockedUniqueLockReturned) { std::unique_ptr deviceFactory(new UltDeviceFactory(1, 1)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); auto lock = svmManager->obtainOwnership(); std::thread th1([&] { @@ -70,7 +70,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, whenFreeSvmAllocationDeferThenAllocationsCou std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); void *cmdQ = reinterpret_cast(0x12345); @@ -100,7 +100,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, whenFreeSVMAllocIsDeferredThenFreedSubsequen std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); void *cmdQ = reinterpret_cast(0x12345); @@ -127,7 +127,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, GivenTwoRootDevicesWhenAllocatingSharedMemor auto device = deviceFactory->rootDevices[1]; std::map deviceBitfieldsLocal; deviceBitfieldsLocal[1] = device->getDeviceBitfield(); - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); void *cmdQ = reinterpret_cast(0x12345); @@ -153,7 +153,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, whenMultipleFreeSVMAllocDeferredThenFreedSub std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); @@ -187,7 +187,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, whenPointerWithOffsetPassedThenProperDataRet std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::deviceUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); unifiedMemoryProperties.device = device; @@ -208,7 +208,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, whenMultiplePointerWithOffsetPassedThenPrope std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::deviceUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); unifiedMemoryProperties.device = device; @@ -247,7 +247,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, givenKmdMigratedSharedAllocationWhenPrefetch std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); void *cmdQ = reinterpret_cast(0x12345); @@ -277,7 +277,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, givenNonKmdMigratedSharedAllocationWhenPrefe std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); void *cmdQ = reinterpret_cast(0x12345); @@ -303,7 +303,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, givenNonSharedUnifiedMemoryAllocationWhenPre std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); void *cmdQ = reinterpret_cast(0x12345); @@ -331,7 +331,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, givenSharedSystemAllocationWhenPrefetchMemor std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); auto &hwInfo = *device->getRootDeviceEnvironment().getMutableHardwareInfo(); @@ -357,7 +357,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, givenSharedSystemAllocationWhenPrefetchMemor std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); @@ -379,7 +379,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, givenForceMemoryPrefetchForKmdMigratedShared std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); void *cmdQ = reinterpret_cast(0x12345); @@ -402,7 +402,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, givenAlignmentThenUnifiedMemoryAllocationsAr std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; auto memoryManager = static_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); @@ -428,7 +428,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, givenAlignmentThenHostUnifiedMemoryAllocatio std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; auto memoryManager = static_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); @@ -454,7 +454,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, givenAlignmentThenSharedUnifiedMemoryAllocat std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; auto memoryManager = static_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); @@ -487,7 +487,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, givenAlignmentWhenLocalMemoryIsEnabledThenSh std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; auto memoryManager = static_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); @@ -519,7 +519,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, givenInternalAllocationWhenItIsMadeResidentT std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; auto memoryManager = static_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); @@ -556,7 +556,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, whenSubmitIndirectAllocationsAsPackCalledBut std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; auto memoryManager = static_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); @@ -587,7 +587,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, givenInternalAllocationWhenItIsMadeResidentT std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; auto memoryManager = static_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); @@ -625,7 +625,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, givenInternalAllocationWhenNewAllocationIsCr std::unique_ptr deviceFactory(new UltDeviceFactory(1, 2)); auto device = deviceFactory->rootDevices[0]; auto memoryManager = static_cast(device->getMemoryManager()); - auto svmManager = std::make_unique(memoryManager, false); + auto svmManager = std::make_unique(memoryManager); auto csr = std::make_unique(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); csr->setupContext(*device->getDefaultEngine().osContext); diff --git a/shared/test/unit_test/memory_manager/unified_memory_pooling_tests.cpp b/shared/test/unit_test/memory_manager/unified_memory_pooling_tests.cpp index e0745cf7dc..8eb5808f2e 100644 --- a/shared/test/unit_test/memory_manager/unified_memory_pooling_tests.cpp +++ b/shared/test/unit_test/memory_manager/unified_memory_pooling_tests.cpp @@ -52,7 +52,7 @@ TEST_F(UnifiedMemoryPoolingTest, givenUsmAllocPoolWhenCallingIsInitializedThenRe std::unique_ptr deviceFactory(new UltDeviceFactory(1, 1)); auto device = deviceFactory->rootDevices[0]; - auto svmManager = std::make_unique(device->getMemoryManager(), false); + auto svmManager = std::make_unique(device->getMemoryManager()); SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::hostUnifiedMemory, MemoryConstants::pageSize2M, rootDeviceIndices, deviceBitfields); @@ -73,7 +73,7 @@ class InitializedUnifiedMemoryPoolingTest : public UnifiedMemoryPoolingTest { deviceFactory = std::unique_ptr(new UltDeviceFactory(1, 1)); device = deviceFactory->rootDevices[0]; - svmManager = std::make_unique(device->getMemoryManager(), false); + svmManager = std::make_unique(device->getMemoryManager()); static_cast(device->getMemoryManager())->failInDevicePoolWithError = failAllocation; poolMemoryProperties = std::make_unique(poolMemoryType, MemoryConstants::pageSize2M, rootDeviceIndices, deviceBitfields); @@ -317,7 +317,7 @@ class UnifiedMemoryPoolingManagerTest : public SVMMemoryAllocatorFixture, poolInfo2MbTo16Mb = usmMemAllocPoolsManager->poolInfos[3]; poolInfo16MbTo64Mb = usmMemAllocPoolsManager->poolInfos[4]; poolInfo64MbTo256Mb = usmMemAllocPoolsManager->poolInfos[5]; - svmManager = std::make_unique(device->getMemoryManager(), false); + svmManager = std::make_unique(device->getMemoryManager()); mockMemoryManager = static_cast(device->getMemoryManager()); mockMemoryManager->failInDevicePoolWithError = failAllocation; if (InternalMemoryType::deviceUnifiedMemory == poolMemoryType) { diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp index c1c1e656ad..000992721d 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp @@ -716,7 +716,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenUseKmdMigrationSetWhenCreateS mock->setBindAvailable(); executionEnvironment->calculateMaxOsContextCount(); - SVMAllocsManager unifiedMemoryManager(memoryManager, false); + SVMAllocsManager unifiedMemoryManager(memoryManager); SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); auto ptr = unifiedMemoryManager.createSharedUnifiedMemoryAllocation(MemoryConstants::pageSize64k, unifiedMemoryProperties, nullptr); @@ -765,7 +765,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, MmapFailWhenCreateSharedUnifiedMem return MAP_FAILED; }; - SVMAllocsManager unifiedMemoryManager(memoryManager, false); + SVMAllocsManager unifiedMemoryManager(memoryManager); SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); auto ptr = unifiedMemoryManager.createSharedUnifiedMemoryAllocation(MemoryConstants::pageSize64k, unifiedMemoryProperties, nullptr); @@ -789,7 +789,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenUseKmdMigrationSetWhenCreateS mock->ioctlCallsCount = 0; mock->setBindAvailable(); - SVMAllocsManager unifiedMemoryManager(memoryManager, false); + SVMAllocsManager unifiedMemoryManager(memoryManager); SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); unifiedMemoryProperties.device = device.get(); @@ -835,7 +835,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSetVmAdviseAtomicAttributeWhe mock->engineInfoQueried = false; mock->queryEngineInfo(); - SVMAllocsManager unifiedMemoryManager(memoryManager, false); + SVMAllocsManager unifiedMemoryManager(memoryManager); SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); unifiedMemoryProperties.device = device.get(); @@ -882,7 +882,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSetVmAdviseDevicePreferredLoc mock->engineInfoQueried = false; mock->queryEngineInfo(); - SVMAllocsManager unifiedMemoryManager(memoryManager, false); + SVMAllocsManager unifiedMemoryManager(memoryManager); SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); unifiedMemoryProperties.device = device.get(); @@ -940,7 +940,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenKmdMigratedSharedAllocationWh mock->engineInfoQueried = false; mock->queryEngineInfo(); - SVMAllocsManager unifiedMemoryManager(memoryManager, false); + SVMAllocsManager unifiedMemoryManager(memoryManager); SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); unifiedMemoryProperties.device = device.get(); @@ -990,7 +990,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCreateContextWithAccessCounte mock->engineInfoQueried = false; mock->queryEngineInfo(); - SVMAllocsManager unifiedMemoryManager(memoryManager, false); + SVMAllocsManager unifiedMemoryManager(memoryManager); SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); unifiedMemoryProperties.device = device.get(); @@ -1033,7 +1033,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCreateContextWithAccessCounte mock->engineInfoQueried = false; mock->queryEngineInfo(); - SVMAllocsManager unifiedMemoryManager(memoryManager, false); + SVMAllocsManager unifiedMemoryManager(memoryManager); SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); unifiedMemoryProperties.device = device.get(); @@ -1090,7 +1090,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenUseKmdMigrationAndUsmInitialP mock->engineInfoQueried = false; mock->queryEngineInfo(); - SVMAllocsManager unifiedMemoryManager(memoryManager, false); + SVMAllocsManager unifiedMemoryManager(memoryManager); SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); unifiedMemoryProperties.device = device.get(); @@ -1134,7 +1134,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenKMDSupportForCrossTileMigrati mock->engineInfoQueried = false; mock->queryEngineInfo(); - SVMAllocsManager unifiedMemoryManager(memoryManager, false); + SVMAllocsManager unifiedMemoryManager(memoryManager); SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); unifiedMemoryProperties.device = device.get(); @@ -1275,7 +1275,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, whenVmAdviseIoctlFailsThenCreateSh mock->queryEngineInfo(); mock->context.vmAdviseReturn = -1; - SVMAllocsManager unifiedMemoryManager(memoryManager, false); + SVMAllocsManager unifiedMemoryManager(memoryManager); SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); @@ -1300,7 +1300,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenUseKmdMigrationSetWhenCreateS mock->queryEngineInfo(); mock->context.mmapOffsetReturn = -1; - SVMAllocsManager unifiedMemoryManager(memoryManager, false); + SVMAllocsManager unifiedMemoryManager(memoryManager); SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); auto ptr = unifiedMemoryManager.createSharedUnifiedMemoryAllocation(MemoryConstants::pageSize64k, unifiedMemoryProperties, nullptr); @@ -1327,7 +1327,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenUseKmdMigrationSetWhenCreateS mock->engineInfoQueried = false; mock->queryEngineInfo(); - SVMAllocsManager unifiedMemoryManager(memoryManager, false); + SVMAllocsManager unifiedMemoryManager(memoryManager); auto size = 2 * MemoryConstants::megaByte; SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); @@ -1375,7 +1375,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCreateKmdMigratedSharedAlloca mock->engineInfoQueried = false; mock->queryEngineInfo(); - SVMAllocsManager unifiedMemoryManager(memoryManager, false); + SVMAllocsManager unifiedMemoryManager(memoryManager); auto size = 2 * MemoryConstants::megaByte; SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); @@ -2068,7 +2068,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenPrintBOCreateDestroyResultFla mock->ioctlCallsCount = 0; mock->setBindAvailable(); - SVMAllocsManager unifiedMemoryManager(memoryManager, false); + SVMAllocsManager unifiedMemoryManager(memoryManager); SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields); diff --git a/shared/test/unit_test/page_fault_manager/cpu_page_fault_manager_tests.cpp b/shared/test/unit_test/page_fault_manager/cpu_page_fault_manager_tests.cpp index 10f444b10b..4593d82ad7 100644 --- a/shared/test/unit_test/page_fault_manager/cpu_page_fault_manager_tests.cpp +++ b/shared/test/unit_test/page_fault_manager/cpu_page_fault_manager_tests.cpp @@ -136,7 +136,7 @@ TEST_F(PageFaultManagerTest, givenNonGpuAllocsContainerWhenMovingToGpuDomainMult } TEST_F(PageFaultManagerTest, givenUnifiedMemoryAllocsWhenMovingToGpuDomainAllocsThenAllocationsInGpuDomainAreNotMoved) { - auto unifiedMemoryManager2 = std::make_unique(memoryManager.get(), false); + auto unifiedMemoryManager2 = std::make_unique(memoryManager.get()); void *cmdQ = reinterpret_cast(0xFFFF); void *alloc1 = reinterpret_cast(0x1); @@ -178,7 +178,7 @@ TEST_F(PageFaultManagerTest, givenUnifiedMemoryAllocsWhenMovingToGpuDomainWithPr DebugManagerStateRestore restorer; debugManager.flags.PrintUmdSharedMigration.set(1); - auto unifiedMemoryManager2 = std::make_unique(memoryManager.get(), false); + auto unifiedMemoryManager2 = std::make_unique(memoryManager.get()); void *cmdQ = reinterpret_cast(0xFFFF); void *alloc1 = reinterpret_cast(0x1); void *alloc2 = reinterpret_cast(0x100); @@ -888,7 +888,7 @@ TEST_F(PageFaultManagerTest, givenHwCsrWhenSelectingHandlerThenHwGpuDomainHandle struct PageFaultManagerTestWithDebugFlag : public ::testing::TestWithParam { void SetUp() override { memoryManager = std::make_unique(executionEnvironment); - unifiedMemoryManager = std::make_unique(memoryManager.get(), false); + unifiedMemoryManager = std::make_unique(memoryManager.get()); pageFaultManager = std::make_unique(); cmdQ = reinterpret_cast(0xFFFF); } @@ -979,7 +979,7 @@ TEST_F(PageFaultManagerTest, givenNoUsmInitialPlacementFlagsWHenInsertingUsmAllo TEST_F(PageFaultManagerTest, givenTbxModeWhenSharedMemoryNotInGpuDomainThenTbxFaultManagerShouldDoNothingBeforeCallingDefaultHandler) { auto memoryManager2 = std::make_unique(executionEnvironment); - auto unifiedMemoryManager2 = std::make_unique(memoryManager2.get(), false); + auto unifiedMemoryManager2 = std::make_unique(memoryManager2.get()); auto pageFaultManager2 = std::make_unique>(); void *cmdQ = reinterpret_cast(0xFFFF); @@ -1000,7 +1000,7 @@ TEST_F(PageFaultManagerTest, givenTbxModeWhenSharedMemoryNotInGpuDomainThenTbxFa TEST_F(PageFaultManagerTest, givenTbxModeWhenSharedMemoryInGpuDomainThenTbxFaultManagerShouldAllowCpuAccessBeforeCallingDefaultHandler) { auto memoryManager2 = std::make_unique(executionEnvironment); - auto unifiedMemoryManager2 = std::make_unique(memoryManager2.get(), false); + auto unifiedMemoryManager2 = std::make_unique(memoryManager2.get()); auto pageFaultManager2 = std::make_unique>(); void *cmdQ = reinterpret_cast(0xFFFF); @@ -1022,7 +1022,7 @@ TEST_F(PageFaultManagerTest, givenTbxModeWhenSharedMemoryInGpuDomainThenTbxFault TEST_F(PageFaultManagerTest, givenTbxModeWhenSharedMemoryIsManagedWhenHandleFaultIsFalseThenTbxFaultManagerShouldNotHandleFault) { auto memoryManager2 = std::make_unique(executionEnvironment); - auto unifiedMemoryManager2 = std::make_unique(memoryManager2.get(), false); + auto unifiedMemoryManager2 = std::make_unique(memoryManager2.get()); auto pageFaultManager2 = std::make_unique>(); void *cmdQ = reinterpret_cast(0xFFFF); diff --git a/shared/test/unit_test/page_fault_manager/windows/cpu_page_fault_manager_windows_tests.cpp b/shared/test/unit_test/page_fault_manager/windows/cpu_page_fault_manager_windows_tests.cpp index 978c6143c4..f7b68488d5 100644 --- a/shared/test/unit_test/page_fault_manager/windows/cpu_page_fault_manager_windows_tests.cpp +++ b/shared/test/unit_test/page_fault_manager/windows/cpu_page_fault_manager_windows_tests.cpp @@ -134,7 +134,7 @@ TEST_F(PageFaultManagerTest, auto osContext = std::make_unique(*wddm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor()); auto csr = std::make_unique(executionEnvironment, 0, 1); csr->setupContext(*osContext); - auto unifiedMemoryManager = std::make_unique(executionEnvironment.memoryManager.get(), false); + auto unifiedMemoryManager = std::make_unique(executionEnvironment.memoryManager.get()); auto pageFaultManager = std::make_unique(); OSInterface osInterface; diff --git a/shared/test/unit_test/program/program_initialization_tests.cpp b/shared/test/unit_test/program/program_initialization_tests.cpp index 4db761a568..e0f6f3eb6a 100644 --- a/shared/test/unit_test/program/program_initialization_tests.cpp +++ b/shared/test/unit_test/program/program_initialization_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2024 Intel Corporation + * Copyright (C) 2020-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -28,7 +28,7 @@ TEST(AllocateGlobalSurfaceTest, GivenSvmAllocsManagerWhenGlobalsAreNotExportedTh MockDevice device{}; REQUIRE_SVM_OR_SKIP(&device); device.injectMemoryManager(new MockMemoryManager()); - MockSVMAllocsManager svmAllocsManager(device.getMemoryManager(), false); + MockSVMAllocsManager svmAllocsManager(device.getMemoryManager()); WhiteBox emptyLinkerInput; std::vector initData; initData.resize(64, 7U); @@ -74,7 +74,7 @@ TEST(AllocateGlobalSurfaceTest, GivenSvmAllocsManagerWhenGlobalsAreExportedThenM MockDevice device{}; REQUIRE_SVM_OR_SKIP(&device); device.injectMemoryManager(new MockMemoryManager()); - MockSVMAllocsManager svmAllocsManager(device.getMemoryManager(), false); + MockSVMAllocsManager svmAllocsManager(device.getMemoryManager()); WhiteBox linkerInputExportGlobalVariables; WhiteBox linkerInputExportGlobalConstants; linkerInputExportGlobalVariables.traits.exportsGlobalVariables = true; @@ -172,7 +172,7 @@ TEST(AllocateGlobalSurfaceTest, WhenGlobalsAreNotExportedAndAllocationFailsThenG auto memoryManager = std::make_unique(*device.getExecutionEnvironment()); memoryManager->failInAllocateWithSizeAndAlignment = true; device.injectMemoryManager(memoryManager.release()); - MockSVMAllocsManager mockSvmAllocsManager(device.getMemoryManager(), false); + MockSVMAllocsManager mockSvmAllocsManager(device.getMemoryManager()); WhiteBox emptyLinkerInput; std::vector initData; initData.resize(64, 7U); @@ -231,7 +231,7 @@ TEST(AllocateGlobalSurfaceTest, GivenAllocationInLocalMemoryWhichRequiresBlitter debugManager.flags.EnableLocalMemory.set(isLocalMemorySupported); MockDevice device; device.getExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true; - MockSVMAllocsManager svmAllocsManager(device.getMemoryManager(), false); + MockSVMAllocsManager svmAllocsManager(device.getMemoryManager()); auto pAllocation = allocateGlobalsSurface(&svmAllocsManager, device, initData.size(), 0u, true /* constant */, nullptr /* linker input */, initData.data()); diff --git a/shared/test/unit_test/utilities/staging_buffer_manager_tests.cpp b/shared/test/unit_test/utilities/staging_buffer_manager_tests.cpp index ecac6d7f93..ce84d5b61e 100644 --- a/shared/test/unit_test/utilities/staging_buffer_manager_tests.cpp +++ b/shared/test/unit_test/utilities/staging_buffer_manager_tests.cpp @@ -33,7 +33,7 @@ class StagingBufferManagerFixture : public DeviceFixture { void setUp() { DeviceFixture::setUp(); REQUIRE_SVM_OR_SKIP(&hardwareInfo); - this->svmAllocsManager = std::make_unique(pDevice->getMemoryManager(), false); + this->svmAllocsManager = std::make_unique(pDevice->getMemoryManager()); debugManager.flags.EnableCopyWithStagingBuffers.set(1); RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex}; std::map deviceBitfields{{mockRootDeviceIndex, mockDeviceBitfield}};