Files
compute-runtime/opencl/test/unit_test/fixtures/memory_manager_fixture.cpp
Lukasz Jobczyk e9c576393e Move hwInfo to root device environment
Related-To: NEO-3857

Change-Id: Ic23077cad080a249457cec39462ca7407e75b227
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2020-03-10 17:13:08 +01:00

36 lines
1.4 KiB
C++

/*
* Copyright (C) 2017-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "opencl/test/unit_test/fixtures/memory_manager_fixture.h"
#include "shared/source/command_stream/preemption.h"
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/os_interface/os_context.h"
#include "opencl/test/unit_test/mocks/mock_csr.h"
#include "opencl/test/unit_test/mocks/mock_memory_manager.h"
using namespace NEO;
void MemoryManagerWithCsrFixture::SetUp() {
executionEnvironment.prepareRootDeviceEnvironments(1);
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(*platformDevices);
csr = std::make_unique<MockCommandStreamReceiver>(this->executionEnvironment, 0);
memoryManager = new MockMemoryManager(executionEnvironment);
executionEnvironment.memoryManager.reset(memoryManager);
csr->tagAddress = &currentGpuTag;
auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo();
auto engine = HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0];
auto osContext = memoryManager->createAndRegisterOsContext(csr.get(), engine, 1,
PreemptionHelper::getDefaultPreemptionMode(*hwInfo),
false, false, false);
csr->setupContext(*osContext);
}
void MemoryManagerWithCsrFixture::TearDown() {
}