Remove csrsContainer from root device environment

improve mocking:
- add method to create RootDevice in Platform
- add method to create SubDevice in RootDevice
- add method to create CommandStreamReceiver in Device

Related-To: NEO-3691

Change-Id: Ie9fe3de260492604333c8ca93796bfbffae518c4
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2019-11-05 13:38:20 +01:00
committed by sys_ocldev
parent 4102b9cf3d
commit 5a8f455a84
51 changed files with 253 additions and 351 deletions

View File

@@ -8,7 +8,6 @@ set(RUNTIME_SRCS_EXECUTION_ENVIRONMENT
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/execution_environment.h
${CMAKE_CURRENT_SOURCE_DIR}/execution_environment.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/execution_environment_initialize.cpp
)
get_property(NEO_CORE_EXECUTION_ENVIRONMENT GLOBAL PROPERTY NEO_CORE_EXECUTION_ENVIRONMENT)

View File

@@ -31,7 +31,6 @@ ExecutionEnvironment::~ExecutionEnvironment() {
builtins.reset();
rootDeviceEnvironments.clear();
}
extern CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex);
void ExecutionEnvironment::initAubCenter(bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType) {
if (!rootDeviceEnvironments[0].aubCenter) {
@@ -46,27 +45,6 @@ void ExecutionEnvironment::initGmm() {
void ExecutionEnvironment::setHwInfo(const HardwareInfo *hwInfo) {
*this->hwInfo = *hwInfo;
}
bool ExecutionEnvironment::initializeCommandStreamReceiver(uint32_t rootDeviceIndex, uint32_t internalDeviceIndex, uint32_t deviceCsrIndex) {
if (internalDeviceIndex + 1 > rootDeviceEnvironments[rootDeviceIndex].commandStreamReceivers.size()) {
rootDeviceEnvironments[rootDeviceIndex].commandStreamReceivers.resize(internalDeviceIndex + 1);
}
if (deviceCsrIndex + 1 > rootDeviceEnvironments[rootDeviceIndex].commandStreamReceivers[internalDeviceIndex].size()) {
rootDeviceEnvironments[rootDeviceIndex].commandStreamReceivers[internalDeviceIndex].resize(deviceCsrIndex + 1);
}
if (this->rootDeviceEnvironments[rootDeviceIndex].commandStreamReceivers[internalDeviceIndex][deviceCsrIndex]) {
return true;
}
std::unique_ptr<CommandStreamReceiver> commandStreamReceiver(createCommandStream(*this, rootDeviceIndex));
if (!commandStreamReceiver) {
return false;
}
if (HwHelper::get(hwInfo->platform.eRenderCoreFamily).isPageTableManagerSupported(*hwInfo)) {
commandStreamReceiver->createPageTableManager();
}
this->rootDeviceEnvironments[rootDeviceIndex].commandStreamReceivers[internalDeviceIndex][deviceCsrIndex] = std::move(commandStreamReceiver);
return true;
}
void ExecutionEnvironment::initializeMemoryManager() {
if (this->memoryManager) {
return;

View File

@@ -12,10 +12,10 @@
#include "runtime/os_interface/device_factory.h"
#include <mutex>
#include <vector>
namespace NEO {
class BuiltIns;
class CommandStreamReceiver;
class CompilerInterface;
class GmmHelper;
class MemoryManager;
@@ -40,8 +40,6 @@ class ExecutionEnvironment : public ReferenceTrackedObject<ExecutionEnvironment>
MOCKABLE_VIRTUAL void initAubCenter(bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType);
void initGmm();
bool initializeCommandStreamReceiver(uint32_t rootDeviceIndex, uint32_t internalDeviceIndex, uint32_t deviceCsrIndex);
MOCKABLE_VIRTUAL bool initializeRootCommandStreamReceiver(RootDevice &rootDevice);
void initializeMemoryManager();
void initSourceLevelDebugger();
void setHwInfo(const HardwareInfo *hwInfo);

View File

@@ -1,15 +0,0 @@
/*
* Copyright (C) 2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/execution_environment/execution_environment.h"
namespace NEO {
bool ExecutionEnvironment::initializeRootCommandStreamReceiver(RootDevice &device) {
return false;
}
} // namespace NEO