2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2018-09-18 09:11:08 +02:00
|
|
|
* Copyright (C) 2017-2018 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
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2018-12-10 10:30:39 +01:00
|
|
|
#include "runtime/command_stream/preemption.h"
|
2018-12-03 10:05:36 +01:00
|
|
|
#include "runtime/os_interface/os_context.h"
|
2017-12-21 00:45:38 +01:00
|
|
|
#include "unit_tests/fixtures/memory_manager_fixture.h"
|
|
|
|
|
#include "unit_tests/mocks/mock_csr.h"
|
|
|
|
|
#include "unit_tests/mocks/mock_memory_manager.h"
|
|
|
|
|
|
|
|
|
|
using namespace OCLRT;
|
|
|
|
|
|
|
|
|
|
void MemoryManagerWithCsrFixture::SetUp() {
|
2018-10-01 16:10:54 +02:00
|
|
|
csr = new MockCommandStreamReceiver(this->executionEnvironment);
|
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;
|
2018-11-20 13:58:15 +01:00
|
|
|
executionEnvironment.commandStreamReceivers.resize(1);
|
2018-11-23 14:59:27 +01:00
|
|
|
executionEnvironment.commandStreamReceivers[0][0].reset(csr);
|
2018-12-03 10:05:36 +01:00
|
|
|
|
2018-12-10 10:30:39 +01:00
|
|
|
csr->setOsContext(*memoryManager->createAndRegisterOsContext(gpgpuEngineInstances[0], PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0])));
|
2017-12-21 00:45:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MemoryManagerWithCsrFixture::TearDown() {
|
|
|
|
|
}
|