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

@ -7,8 +7,6 @@
#include "unit_tests/helpers/execution_environment_helper.h"
#include "runtime/device/device.h"
#include "runtime/helpers/hw_helper.h"
#include "runtime/os_interface/device_factory.h"
#include "runtime/platform/platform.h"
@ -19,8 +17,7 @@ ExecutionEnvironment *getExecutionEnvironmentImpl(HardwareInfo *&hwInfo) {
size_t numDevicesReturned = 0;
hwInfo = nullptr;
DeviceFactory::getDevices(&hwInfo, numDevicesReturned, *executionEnvironment);
bool enableLocalMemory = HwHelper::get(hwInfo->pPlatform->eRenderCoreFamily).getEnableLocalMemory(*hwInfo);
executionEnvironment->initializeMemoryManager(Device::getEnabled64kbPages(*hwInfo), enableLocalMemory);
executionEnvironment->initializeMemoryManager();
return executionEnvironment;
}

View File

@ -8,6 +8,7 @@
#include "runtime/helpers/properties_helper.h"
#include "unit_tests/helpers/debug_manager_state_restore.h"
#include "unit_tests/mocks/mock_buffer.h"
#include "unit_tests/mocks/mock_memory_manager.h"
#include "gtest/gtest.h"
@ -24,7 +25,7 @@ TEST(TransferPropertiesTest, givenTransferPropertiesCreatedWhenDefaultDebugSetti
TEST(TransferPropertiesTest, givenAllocationInNonSystemPoolWhenTransferPropertiesAreCreatedForMapBufferThenLockPtrIsSet) {
ExecutionEnvironment executionEnvironment;
OsAgnosticMemoryManager memoryManager(false, true, executionEnvironment);
MemoryManagerCreate<OsAgnosticMemoryManager> memoryManager(false, true, executionEnvironment);
MockContext ctx;
ctx.setMemoryManager(&memoryManager);
@ -41,7 +42,7 @@ TEST(TransferPropertiesTest, givenAllocationInNonSystemPoolWhenTransferPropertie
TEST(TransferPropertiesTest, givenAllocationInSystemPoolWhenTransferPropertiesAreCreatedForMapBufferThenLockPtrIsNotSet) {
ExecutionEnvironment executionEnvironment;
OsAgnosticMemoryManager memoryManager(false, true, executionEnvironment);
MemoryManagerCreate<OsAgnosticMemoryManager> memoryManager(false, true, executionEnvironment);
MockContext ctx;
ctx.setMemoryManager(&memoryManager);
@ -67,7 +68,7 @@ TEST(TransferPropertiesTest, givenTransferPropertiesCreatedWhenMemoryManagerInMe
TEST(TransferPropertiesTest, givenTransferPropertiesWhenLockedPtrIsSetThenItIsReturnedForReadWrite) {
ExecutionEnvironment executionEnvironment;
OsAgnosticMemoryManager memoryManager(false, true, executionEnvironment);
MemoryManagerCreate<OsAgnosticMemoryManager> memoryManager(false, true, executionEnvironment);
MockContext ctx;
ctx.setMemoryManager(&memoryManager);