2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2019-01-10 16:37:56 +08:00
|
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "unit_tests/fixtures/memory_manager_fixture.h"
|
|
|
|
|
2018-12-10 17:30:39 +08:00
|
|
|
#include "runtime/command_stream/preemption.h"
|
2019-02-13 00:27:13 +08:00
|
|
|
#include "runtime/helpers/hw_helper.h"
|
2018-12-03 17:05:36 +08:00
|
|
|
#include "runtime/os_interface/os_context.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
#include "unit_tests/mocks/mock_csr.h"
|
|
|
|
#include "unit_tests/mocks/mock_memory_manager.h"
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
void MemoryManagerWithCsrFixture::SetUp() {
|
2019-03-28 22:42:23 +08:00
|
|
|
executionEnvironment.setHwInfo(*platformDevices);
|
2018-10-01 22:10:54 +08:00
|
|
|
csr = new MockCommandStreamReceiver(this->executionEnvironment);
|
2018-10-26 19:05:31 +08:00
|
|
|
memoryManager = new MockMemoryManager(executionEnvironment);
|
2018-10-09 17:50:58 +08:00
|
|
|
executionEnvironment.memoryManager.reset(memoryManager);
|
2018-08-08 19:49:09 +08:00
|
|
|
csr->tagAddress = ¤tGpuTag;
|
2018-11-20 20:58:15 +08:00
|
|
|
executionEnvironment.commandStreamReceivers.resize(1);
|
2019-01-10 20:57:40 +08:00
|
|
|
executionEnvironment.commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(csr));
|
2019-05-06 18:33:44 +08:00
|
|
|
auto engine = HwHelper::get(platformDevices[0]->pPlatform.eRenderCoreFamily).getGpgpuEngineInstances()[0];
|
2019-03-18 20:57:59 +08:00
|
|
|
auto osContext = memoryManager->createAndRegisterOsContext(csr, engine, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
2019-02-18 20:59:16 +08:00
|
|
|
csr->setupContext(*osContext);
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void MemoryManagerWithCsrFixture::TearDown() {
|
|
|
|
}
|