Reverse logic of creating Memory Manager - part 3

-Move a Device::getEnabled64kbPages method's logic
 to the Memory Manager constructor

Change-Id: Ide88898000e5817a79f9a6ad5dfc9d680bec0533
Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
This commit is contained in:
Jobczyk, Lukasz
2019-03-15 10:22:35 +01:00
committed by sys_ocldev
parent cc13045ddd
commit 9ecb3193af
56 changed files with 215 additions and 249 deletions

View File

@@ -15,13 +15,12 @@
namespace OCLRT {
bool overrideMemoryManagerCreation = true;
std::unique_ptr<MemoryManager> MemoryManager::createMemoryManager(bool enable64KBpages, bool enableLocalMemory, ExecutionEnvironment &executionEnvironment) {
std::unique_ptr<MemoryManager> MemoryManager::createMemoryManager(ExecutionEnvironment &executionEnvironment) {
if (overrideMemoryManagerCreation) {
return std::make_unique<OsAgnosticMemoryManager>(enable64KBpages, enableLocalMemory, executionEnvironment);
return std::make_unique<OsAgnosticMemoryManager>(executionEnvironment);
}
return std::make_unique<DrmMemoryManager>(executionEnvironment.osInterface->get()->getDrm(),
gemCloseWorkerMode::gemCloseWorkerInactive,
enableLocalMemory,
DebugManager.flags.EnableForcePin.get(),
true,
executionEnvironment);

View File

@@ -34,7 +34,6 @@ HWTEST_F(DrmCommandStreamMMTest, MMwithPinBB) {
auto memoryManager = new DrmMemoryManager(executionEnvironment.osInterface->get()->getDrm(),
gemCloseWorkerInactive,
false,
DebugManager.flags.EnableForcePin.get(),
true,
executionEnvironment);
@@ -58,7 +57,6 @@ HWTEST_F(DrmCommandStreamMMTest, givenForcePinDisabledWhenMemoryManagerIsCreated
auto memoryManager = new DrmMemoryManager(executionEnvironment.osInterface->get()->getDrm(),
gemCloseWorkerInactive,
false,
DebugManager.flags.EnableForcePin.get(),
true,
executionEnvironment);

View File

@@ -57,7 +57,6 @@ class DrmCommandStreamFixture {
.Times(1);
memoryManager = new DrmMemoryManager(executionEnvironment.osInterface->get()->getDrm(),
gemCloseWorkerActive,
false,
DebugManager.flags.EnableForcePin.get(),
true,
executionEnvironment);
@@ -587,7 +586,6 @@ class DrmCommandStreamEnhancedFixture
ASSERT_NE(nullptr, csr);
mm = new DrmMemoryManager(executionEnvironment->osInterface->get()->getDrm(),
gemCloseWorkerInactive,
false,
DebugManager.flags.EnableForcePin.get(),
true,
*executionEnvironment);

View File

@@ -67,7 +67,7 @@ class DrmGemCloseWorkerFixture {
this->drmMock->gem_close_expected = 0;
this->mm = new DrmMemoryManager(this->drmMock,
gemCloseWorkerMode::gemCloseWorkerInactive, false,
gemCloseWorkerMode::gemCloseWorkerInactive,
false,
false,
executionEnvironment);

View File

@@ -301,12 +301,12 @@ TEST_F(DrmMemoryManagerTest, UnreferenceNullPtr) {
}
TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenDrmMemoryManagerCreatedWithGemCloseWorkerModeInactiveThenGemCloseWorkerIsNotCreated) {
DrmMemoryManager drmMemoryManger(this->mock.get(), gemCloseWorkerMode::gemCloseWorkerInactive, false, false, false, *executionEnvironment);
DrmMemoryManager drmMemoryManger(this->mock.get(), gemCloseWorkerMode::gemCloseWorkerInactive, false, false, *executionEnvironment);
EXPECT_EQ(nullptr, drmMemoryManger.peekGemCloseWorker());
}
TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenDrmMemoryManagerCreatedWithGemCloseWorkerActiveThenGemCloseWorkerIsCreated) {
DrmMemoryManager drmMemoryManger(this->mock.get(), gemCloseWorkerMode::gemCloseWorkerActive, false, false, false, *executionEnvironment);
DrmMemoryManager drmMemoryManger(this->mock.get(), gemCloseWorkerMode::gemCloseWorkerActive, false, false, *executionEnvironment);
EXPECT_NE(nullptr, drmMemoryManger.peekGemCloseWorker());
}
@@ -2358,7 +2358,7 @@ TEST(MmapFlags, givenVariousMmapParametersGetTimeDeltaForTheOperation) {
TEST(DrmMemoryManager, givenDefaultMemoryManagerWhenItIsCreatedThenAsyncDeleterEnabledIsTrue) {
ExecutionEnvironment executionEnvironment;
DrmMemoryManager memoryManager(Drm::get(0), gemCloseWorkerMode::gemCloseWorkerInactive, false, false, true, executionEnvironment);
DrmMemoryManager memoryManager(Drm::get(0), gemCloseWorkerMode::gemCloseWorkerInactive, false, true, executionEnvironment);
EXPECT_FALSE(memoryManager.isAsyncDeleterEnabled());
EXPECT_EQ(nullptr, memoryManager.getDeferredDeleter());
}
@@ -2367,7 +2367,7 @@ TEST(DrmMemoryManager, givenEnabledAsyncDeleterFlagWhenMemoryManagerIsCreatedThe
ExecutionEnvironment executionEnvironment;
DebugManagerStateRestore dbgStateRestore;
DebugManager.flags.EnableDeferredDeleter.set(true);
DrmMemoryManager memoryManager(Drm::get(0), gemCloseWorkerMode::gemCloseWorkerInactive, false, false, true, executionEnvironment);
DrmMemoryManager memoryManager(Drm::get(0), gemCloseWorkerMode::gemCloseWorkerInactive, false, true, executionEnvironment);
EXPECT_FALSE(memoryManager.isAsyncDeleterEnabled());
EXPECT_EQ(nullptr, memoryManager.getDeferredDeleter());
}
@@ -2376,7 +2376,7 @@ TEST(DrmMemoryManager, givenDisabledAsyncDeleterFlagWhenMemoryManagerIsCreatedTh
ExecutionEnvironment executionEnvironment;
DebugManagerStateRestore dbgStateRestore;
DebugManager.flags.EnableDeferredDeleter.set(false);
DrmMemoryManager memoryManager(Drm::get(0), gemCloseWorkerMode::gemCloseWorkerInactive, false, false, true, executionEnvironment);
DrmMemoryManager memoryManager(Drm::get(0), gemCloseWorkerMode::gemCloseWorkerInactive, false, true, executionEnvironment);
EXPECT_FALSE(memoryManager.isAsyncDeleterEnabled());
EXPECT_EQ(nullptr, memoryManager.getDeferredDeleter());
}

View File

@@ -15,10 +15,10 @@
namespace OCLRT {
bool overrideMemoryManagerCreation = true;
std::unique_ptr<MemoryManager> MemoryManager::createMemoryManager(bool enable64KBpages, bool enableLocalMemory, ExecutionEnvironment &executionEnvironment) {
std::unique_ptr<MemoryManager> MemoryManager::createMemoryManager(ExecutionEnvironment &executionEnvironment) {
if (overrideMemoryManagerCreation) {
return std::make_unique<OsAgnosticMemoryManager>(enable64KBpages, enableLocalMemory, executionEnvironment);
return std::make_unique<OsAgnosticMemoryManager>(executionEnvironment);
}
return std::make_unique<WddmMemoryManager>(enable64KBpages, enableLocalMemory, executionEnvironment.osInterface->get()->getWddm(), executionEnvironment);
return std::make_unique<WddmMemoryManager>(executionEnvironment.osInterface->get()->getWddm(), executionEnvironment);
}
} // namespace OCLRT

View File

@@ -121,7 +121,7 @@ class WddmCommandStreamWithMockGdiFixture {
ASSERT_NE(wddm, nullptr);
DebugManager.flags.CsrDispatchMode.set(static_cast<uint32_t>(DispatchMode::ImmediateDispatch));
this->csr = new MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>(*executionEnvironment);
memoryManager = new WddmMemoryManager(false, false, wddm, *executionEnvironment);
memoryManager = new WddmMemoryManager(wddm, *executionEnvironment);
ASSERT_NE(nullptr, memoryManager);
executionEnvironment->memoryManager.reset(memoryManager);
device = std::unique_ptr<MockDevice>(Device::create<MockDevice>(platformDevices[0], executionEnvironment, 0u));
@@ -243,9 +243,8 @@ TEST(WddmPreemptionHeaderTests, givenWddmCommandStreamReceiverWhenPreemptionIsOf
executionEnvironment->setHwInfo(hwInfo);
auto wddm = static_cast<WddmMock *>(executionEnvironment->osInterface->get()->getWddm());
executionEnvironment->commandStreamReceivers.resize(1);
executionEnvironment->commandStreamReceivers[0].push_back(
std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(*executionEnvironment));
executionEnvironment->memoryManager.reset(new WddmMemoryManager(false, false, wddm, *executionEnvironment));
executionEnvironment->commandStreamReceivers[0].push_back(std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(*executionEnvironment));
executionEnvironment->memoryManager.reset(new MemoryManagerCreate<WddmMemoryManager>(false, false, wddm, *executionEnvironment));
executionEnvironment->commandStreamReceivers[0][0]->overrideDispatchPolicy(DispatchMode::ImmediateDispatch);
OsContextWin osContext(*wddm, 0u, 1, HwHelper::get(platformDevices[0]->pPlatform->eRenderCoreFamily).getGpgpuEngineInstances()[0],
PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false);
@@ -271,7 +270,7 @@ TEST(WddmPreemptionHeaderTests, givenWddmCommandStreamReceiverWhenPreemptionIsOn
auto wddm = static_cast<WddmMock *>(executionEnvironment->osInterface->get()->getWddm());
executionEnvironment->commandStreamReceivers.resize(1);
executionEnvironment->commandStreamReceivers[0].push_back(std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(*executionEnvironment));
executionEnvironment->memoryManager.reset(new WddmMemoryManager(false, false, wddm, *executionEnvironment));
executionEnvironment->memoryManager.reset(new MemoryManagerCreate<WddmMemoryManager>(false, false, wddm, *executionEnvironment));
executionEnvironment->commandStreamReceivers[0][0]->overrideDispatchPolicy(DispatchMode::ImmediateDispatch);
OsContextWin osContext(*wddm, 0u, 1, HwHelper::get(platformDevices[0]->pPlatform->eRenderCoreFamily).getGpgpuEngineInstances()[0],
PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false);
@@ -893,7 +892,7 @@ HWTEST_P(WddmCsrCompressionParameterizedTest, givenEnabledCompressionWhenFlushin
auto mockWddmCsr = new MockWddmCsr<FamilyType>(*executionEnvironment);
mockWddmCsr->createPageTableManager();
mockWddmCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
executionEnvironment->memoryManager.reset(new WddmMemoryManager(false, false, executionEnvironment->osInterface->get()->getWddm(), *executionEnvironment));
executionEnvironment->memoryManager.reset(new WddmMemoryManager(executionEnvironment->osInterface->get()->getWddm(), *executionEnvironment));
auto mockMngr = reinterpret_cast<MockGmmPageTableMngr *>(myMockWddm->getPageTableManager());
std::unique_ptr<MockDevice> device(Device::create<MockDevice>(hwInfo, executionEnvironment, 0u));
@@ -939,7 +938,7 @@ HWTEST_F(WddmCsrCompressionTests, givenDisabledCompressionWhenFlushingThenDontIn
auto mockWddmCsr = new MockWddmCsr<FamilyType>(*executionEnvironment);
mockWddmCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
executionEnvironment->memoryManager.reset(new WddmMemoryManager(false, false, executionEnvironment->osInterface->get()->getWddm(), *executionEnvironment));
executionEnvironment->memoryManager.reset(new WddmMemoryManager(executionEnvironment->osInterface->get()->getWddm(), *executionEnvironment));
std::unique_ptr<MockDevice> device(Device::create<MockDevice>(hwInfo, executionEnvironment, 0u));
device->resetCommandStreamReceiver(mockWddmCsr);

View File

@@ -9,9 +9,10 @@
#include "runtime/memory_manager/deferred_deleter.h"
#include "runtime/os_interface/windows/wddm_memory_manager.h"
#include "unit_tests/mocks/mock_host_ptr_manager.h"
#include "unit_tests/mocks/mock_memory_manager.h"
namespace OCLRT {
class MockWddmMemoryManager : public WddmMemoryManager {
class MockWddmMemoryManager : public MemoryManagerCreate<WddmMemoryManager> {
using BaseClass = WddmMemoryManager;
public:
@@ -21,9 +22,9 @@ class MockWddmMemoryManager : public WddmMemoryManager {
using BaseClass::allocateGraphicsMemoryWithProperties;
using BaseClass::createGraphicsAllocation;
using BaseClass::createWddmAllocation;
using BaseClass::WddmMemoryManager;
using MemoryManagerCreate<WddmMemoryManager>::MemoryManagerCreate;
MockWddmMemoryManager(Wddm *wddm, ExecutionEnvironment &executionEnvironment) : WddmMemoryManager(false, false, wddm, executionEnvironment) {
MockWddmMemoryManager(Wddm *wddm, ExecutionEnvironment &executionEnvironment) : MemoryManagerCreate(false, false, wddm, executionEnvironment) {
hostPtrManager.reset(new MockHostPtrManager);
};
void setDeferredDeleter(DeferredDeleter *deleter) {

View File

@@ -22,6 +22,7 @@
#include "unit_tests/helpers/debug_manager_state_restore.h"
#include "unit_tests/mocks/mock_gfx_partition.h"
#include "unit_tests/mocks/mock_gmm_resource_info.h"
#include "unit_tests/mocks/mock_memory_manager.h"
#include "unit_tests/os_interface/windows/mock_wddm_allocation.h"
#include "unit_tests/os_interface/windows/wddm_fixture.h"
@@ -171,7 +172,7 @@ TEST_F(Wddm20Tests, whenInitializeWddmThenContextIsCreated) {
}
TEST_F(Wddm20Tests, allocation) {
OsAgnosticMemoryManager mm(false, false, *executionEnvironment);
OsAgnosticMemoryManager mm(*executionEnvironment);
WddmAllocation allocation(GraphicsAllocation::AllocationType::UNDECIDED, mm.allocateSystemMemory(100, 0), 100, nullptr, MemoryPool::MemoryNull, false);
Gmm *gmm = GmmHelperFunctions::getGmm(allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize());
@@ -303,7 +304,7 @@ TEST_F(Wddm20WithMockGdiDllTests, GivenThreeOsHandlesWhenAskedForDestroyAllocati
}
TEST_F(Wddm20Tests, mapAndFreeGpuVa) {
OsAgnosticMemoryManager mm(false, false, *executionEnvironment);
OsAgnosticMemoryManager mm(*executionEnvironment);
WddmAllocation allocation(GraphicsAllocation::AllocationType::UNDECIDED, mm.allocateSystemMemory(100, 0), 100, nullptr, MemoryPool::MemoryNull, false);
Gmm *gmm = GmmHelperFunctions::getGmm(allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize());
@@ -328,7 +329,7 @@ TEST_F(Wddm20Tests, mapAndFreeGpuVa) {
}
TEST_F(Wddm20Tests, givenNullAllocationWhenCreateThenAllocateAndMap) {
OsAgnosticMemoryManager mm(false, false, *executionEnvironment);
OsAgnosticMemoryManager mm(*executionEnvironment);
WddmAllocation allocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, 100, nullptr, MemoryPool::MemoryNull, false);
Gmm *gmm = GmmHelperFunctions::getGmm(allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize());
@@ -348,7 +349,7 @@ TEST_F(Wddm20Tests, givenNullAllocationWhenCreateThenAllocateAndMap) {
}
TEST_F(Wddm20Tests, makeResidentNonResident) {
OsAgnosticMemoryManager mm(false, false, *executionEnvironment);
OsAgnosticMemoryManager mm(*executionEnvironment);
WddmAllocation allocation(GraphicsAllocation::AllocationType::UNDECIDED, mm.allocateSystemMemory(100, 0), 100, nullptr, MemoryPool::MemoryNull, false);
Gmm *gmm = GmmHelperFunctions::getGmm(allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize());
@@ -387,7 +388,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenSharedHandleWhenCreateGraphicsAllocationF
auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
EXPECT_EQ(0u, status);
WddmMemoryManager mm(false, false, wddm, *executionEnvironment);
MemoryManagerCreate<WddmMemoryManager> mm(false, false, wddm, *executionEnvironment);
auto graphicsAllocation = mm.createGraphicsAllocationFromSharedHandle(ALLOCATION_HANDLE, false);
auto wddmAllocation = (WddmAllocation *)graphicsAllocation;
@@ -423,7 +424,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenSharedHandleWhenCreateGraphicsAllocationF
auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
EXPECT_EQ(0u, status);
WddmMemoryManager mm(false, false, wddm, *executionEnvironment);
MemoryManagerCreate<WddmMemoryManager> mm(false, false, wddm, *executionEnvironment);
auto graphicsAllocation = mm.createGraphicsAllocationFromSharedHandle(ALLOCATION_HANDLE, false);
auto wddmAllocation = (WddmAllocation *)graphicsAllocation;
@@ -939,7 +940,7 @@ TEST_F(WddmLockWithMakeResidentTests, whenEvictingTemporaryResourceThenOtherReso
}
TEST_F(WddmLockWithMakeResidentTests, whenAlllocationNeedsBlockingMakeResidentBeforeLockThenLockWithBlockingMakeResident) {
WddmMemoryManager memoryManager(false, false, wddm, *executionEnvironment);
WddmMemoryManager memoryManager(wddm, *executionEnvironment);
MockWddmAllocation allocation;
allocation.needsMakeResidentBeforeLock = false;
memoryManager.lockResource(&allocation);

View File

@@ -110,7 +110,7 @@ TEST(WddmMemoryManagerAllocator32BitTest, allocator32BitIsCreatedWithCorrectBase
uint64_t size = 0x9000;
wddm->setHeap32(base, size);
std::unique_ptr<WddmMemoryManager> memoryManager = std::unique_ptr<WddmMemoryManager>(new WddmMemoryManager(false, false, wddm.get(), executionEnvironment));
std::unique_ptr<WddmMemoryManager> memoryManager = std::unique_ptr<WddmMemoryManager>(new WddmMemoryManager(wddm.get(), executionEnvironment));
ASSERT_NE(nullptr, memoryManager->allocator32Bit.get());
@@ -1281,7 +1281,7 @@ TEST_F(MockWddmMemoryManagerTest, givenEnabled64kbpagesWhenCreatingGraphicsMemor
auto wddm = std::make_unique<WddmMock>();
EXPECT_TRUE(wddm->init(PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0])));
DebugManager.flags.Enable64kbpages.set(true);
WddmMemoryManager memoryManager64k(true, false, wddm.get(), *executionEnvironment);
MemoryManagerCreate<WddmMemoryManager> memoryManager64k(true, false, wddm.get(), *executionEnvironment);
EXPECT_EQ(0, wddm->createAllocationResult.called);
GraphicsAllocation *galloc = memoryManager64k.allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize64k, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY});
@@ -1337,7 +1337,7 @@ TEST_F(MockWddmMemoryManagerTest, givenWddmWhenallocateGraphicsMemory64kbThenLoc
TEST_F(MockWddmMemoryManagerTest, givenDefaultMemoryManagerWhenItIsCreatedThenAsyncDeleterEnabledIsTrue) {
auto wddm = std::make_unique<WddmMock>();
WddmMemoryManager memoryManager(false, false, wddm.get(), *executionEnvironment);
WddmMemoryManager memoryManager(wddm.get(), *executionEnvironment);
EXPECT_TRUE(memoryManager.isAsyncDeleterEnabled());
EXPECT_NE(nullptr, memoryManager.getDeferredDeleter());
}
@@ -1366,7 +1366,7 @@ TEST_F(MockWddmMemoryManagerTest, givenEnabledAsyncDeleterFlagWhenMemoryManagerI
bool defaultEnableDeferredDeleterFlag = DebugManager.flags.EnableDeferredDeleter.get();
DebugManager.flags.EnableDeferredDeleter.set(true);
auto wddm = std::make_unique<WddmMock>();
WddmMemoryManager memoryManager(false, false, wddm.get(), *executionEnvironment);
WddmMemoryManager memoryManager(wddm.get(), *executionEnvironment);
EXPECT_TRUE(memoryManager.isAsyncDeleterEnabled());
EXPECT_NE(nullptr, memoryManager.getDeferredDeleter());
DebugManager.flags.EnableDeferredDeleter.set(defaultEnableDeferredDeleterFlag);
@@ -1376,7 +1376,7 @@ TEST_F(MockWddmMemoryManagerTest, givenDisabledAsyncDeleterFlagWhenMemoryManager
bool defaultEnableDeferredDeleterFlag = DebugManager.flags.EnableDeferredDeleter.get();
DebugManager.flags.EnableDeferredDeleter.set(false);
auto wddm = std::make_unique<WddmMock>();
WddmMemoryManager memoryManager(false, false, wddm.get(), *executionEnvironment);
WddmMemoryManager memoryManager(wddm.get(), *executionEnvironment);
EXPECT_FALSE(memoryManager.isAsyncDeleterEnabled());
EXPECT_EQ(nullptr, memoryManager.getDeferredDeleter());
DebugManager.flags.EnableDeferredDeleter.set(defaultEnableDeferredDeleterFlag);
@@ -1385,7 +1385,7 @@ TEST_F(MockWddmMemoryManagerTest, givenDisabledAsyncDeleterFlagWhenMemoryManager
TEST_F(MockWddmMemoryManagerTest, givenPageTableManagerWhenMapAuxGpuVaCalledThenUseWddmToMap) {
auto myWddm = std::make_unique<WddmMock>();
EXPECT_TRUE(myWddm->init(PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0])));
WddmMemoryManager memoryManager(false, false, myWddm.get(), *executionEnvironment);
WddmMemoryManager memoryManager(myWddm.get(), *executionEnvironment);
auto mockMngr = new NiceMock<MockGmmPageTableMngr>();
myWddm->resetPageTableManager(mockMngr);
@@ -1438,7 +1438,7 @@ TEST_F(MockWddmMemoryManagerTest, givenRenderCompressedAllocationWhenMappedGpuVa
TEST_F(MockWddmMemoryManagerTest, givenRenderCompressedAllocationWhenReleaseingThenUnmapAuxVa) {
auto wddm = std::make_unique<WddmMock>();
EXPECT_TRUE(wddm->init(PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0])));
WddmMemoryManager memoryManager(false, false, wddm.get(), *executionEnvironment);
WddmMemoryManager memoryManager(wddm.get(), *executionEnvironment);
D3DGPU_VIRTUAL_ADDRESS gpuVa = 123;
auto mockMngr = new NiceMock<MockGmmPageTableMngr>();
@@ -1464,7 +1464,7 @@ TEST_F(MockWddmMemoryManagerTest, givenRenderCompressedAllocationWhenReleaseingT
TEST_F(MockWddmMemoryManagerTest, givenNonRenderCompressedAllocationWhenReleaseingThenDontUnmapAuxVa) {
auto wddm = std::make_unique<WddmMock>();
EXPECT_TRUE(wddm->init(PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0])));
WddmMemoryManager memoryManager(false, false, wddm.get(), *executionEnvironment);
WddmMemoryManager memoryManager(wddm.get(), *executionEnvironment);
auto mockMngr = new NiceMock<MockGmmPageTableMngr>();
wddm->resetPageTableManager(mockMngr);
@@ -1508,7 +1508,7 @@ TEST_F(MockWddmMemoryManagerTest, givenRenderCompressedFlagSetWhenInternalIsUnse
D3DGPU_VIRTUAL_ADDRESS gpuVa = 0;
auto wddm = std::make_unique<WddmMock>();
EXPECT_TRUE(wddm->init(PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0])));
WddmMemoryManager memoryManager(false, false, wddm.get(), *executionEnvironment);
WddmMemoryManager memoryManager(wddm.get(), *executionEnvironment);
auto mockMngr = new NiceMock<MockGmmPageTableMngr>();
wddm->resetPageTableManager(mockMngr);
@@ -1580,8 +1580,7 @@ TEST(WddmMemoryManagerCleanupTest, givenUsedTagAllocationInWddmMemoryManagerWhen
executionEnvironment.osInterface->get()->setWddm(wddm);
executionEnvironment.commandStreamReceivers.resize(1);
executionEnvironment.commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(csr));
executionEnvironment.memoryManager = std::make_unique<WddmMemoryManager>(false, false, wddm, executionEnvironment);
executionEnvironment.memoryManager = std::make_unique<WddmMemoryManager>(wddm, executionEnvironment);
auto osContext = executionEnvironment.memoryManager->createAndRegisterOsContext(csr, ENGINE_RCS, 1, preemptionMode, false);
csr->setupContext(*osContext);
EXPECT_EQ(csr, executionEnvironment.memoryManager->getDefaultCommandStreamReceiver(0));