Files
compute-runtime/opencl/test/unit_test/fixtures/memory_manager_fixture.cpp
lgotszal 3bd4bca911 Copyright header update
Dates corrected in copyright headers to reflect original publication date
(2018 for OpenCL, 2020 for Level Zero).

Signed-off-by: lgotszal <lukasz.gotszald@intel.com>
2021-05-17 20:38:19 +02:00

36 lines
1.4 KiB
C++

/*
* Copyright (C) 2018-2021 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(defaultHwInfo.get());
csr = std::make_unique<MockCommandStreamReceiver>(this->executionEnvironment, 0, 1);
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(), EngineTypeUsage{engine.first, EngineUsage::Regular}, 1,
PreemptionHelper::getDefaultPreemptionMode(*hwInfo),
false);
csr->setupContext(*osContext);
}
void MemoryManagerWithCsrFixture::TearDown() {
}