2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2020-01-13 14:47:05 +01:00
|
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2020-02-23 15:20:22 +01:00
|
|
|
#include "opencl/test/unit_test/fixtures/memory_manager_fixture.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
|
2020-02-23 18:46:50 +01:00
|
|
|
#include "command_stream/preemption.h"
|
|
|
|
|
#include "helpers/hw_helper.h"
|
|
|
|
|
#include "os_interface/os_context.h"
|
2020-02-23 15:20:22 +01:00
|
|
|
#include "opencl/test/unit_test/mocks/mock_csr.h"
|
|
|
|
|
#include "opencl/test/unit_test/mocks/mock_memory_manager.h"
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
using namespace NEO;
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
|
void MemoryManagerWithCsrFixture::SetUp() {
|
2019-03-28 15:42:23 +01:00
|
|
|
executionEnvironment.setHwInfo(*platformDevices);
|
2019-11-15 09:59:48 +01:00
|
|
|
executionEnvironment.prepareRootDeviceEnvironments(1);
|
2019-11-05 13:38:20 +01:00
|
|
|
csr = std::make_unique<MockCommandStreamReceiver>(this->executionEnvironment, 0);
|
2018-10-26 11:05:31 +00:00
|
|
|
memoryManager = new MockMemoryManager(executionEnvironment);
|
2018-10-09 11:50:58 +02:00
|
|
|
executionEnvironment.memoryManager.reset(memoryManager);
|
2018-08-08 13:49:09 +02:00
|
|
|
csr->tagAddress = ¤tGpuTag;
|
2019-05-08 16:00:24 +02:00
|
|
|
auto engine = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances()[0];
|
2019-11-05 13:38:20 +01:00
|
|
|
auto osContext = memoryManager->createAndRegisterOsContext(csr.get(), engine, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
2019-02-18 13:59:16 +01:00
|
|
|
csr->setupContext(*osContext);
|
2017-12-21 00:45:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MemoryManagerWithCsrFixture::TearDown() {
|
|
|
|
|
}
|