mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
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:

committed by
sys_ocldev

parent
cc13045ddd
commit
9ecb3193af
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user