mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-31 20:13:04 +08:00
make RootDeviceEnvironments vector of unique_ptr Related-To: NEO-3857 Change-Id: I23998502198307c8535cdd5c9c4af5223a5d69a5 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
32 lines
1.1 KiB
C++
32 lines
1.1 KiB
C++
/*
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "unit_tests/fixtures/memory_manager_fixture.h"
|
|
|
|
#include "core/command_stream/preemption.h"
|
|
#include "core/helpers/hw_helper.h"
|
|
#include "runtime/os_interface/os_context.h"
|
|
#include "unit_tests/mocks/mock_csr.h"
|
|
#include "unit_tests/mocks/mock_memory_manager.h"
|
|
|
|
using namespace NEO;
|
|
|
|
void MemoryManagerWithCsrFixture::SetUp() {
|
|
executionEnvironment.setHwInfo(*platformDevices);
|
|
executionEnvironment.prepareRootDeviceEnvironments(1);
|
|
csr = std::make_unique<MockCommandStreamReceiver>(this->executionEnvironment, 0);
|
|
memoryManager = new MockMemoryManager(executionEnvironment);
|
|
executionEnvironment.memoryManager.reset(memoryManager);
|
|
csr->tagAddress = ¤tGpuTag;
|
|
auto engine = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances()[0];
|
|
auto osContext = memoryManager->createAndRegisterOsContext(csr.get(), engine, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
|
csr->setupContext(*osContext);
|
|
}
|
|
|
|
void MemoryManagerWithCsrFixture::TearDown() {
|
|
}
|