Files
compute-runtime/runtime/os_interface/device_factory.cpp
Mateusz Jablonski d408b82a19 Move aub center and command stream receivers to root device environment
resize root device environments to 1 by default

Related-To: NEO-3691, NEO-3857

Change-Id: Idf3d61e84f8265f30381c18216632d0ffb2a16de
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2019-10-28 14:40:43 +01:00

51 lines
1.9 KiB
C++

/*
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "core/os_interface/aub_memory_operations_handler.h"
#include "runtime/aub/aub_center.h"
#include "runtime/device/device.h"
#include "runtime/helpers/options.h"
#include "runtime/os_interface/debug_settings_manager.h"
#include "runtime/os_interface/hw_info_config.h"
namespace NEO {
bool DeviceFactory::getDevicesForProductFamilyOverride(size_t &numDevices, ExecutionEnvironment &executionEnvironment) {
auto numRootDevices = 1u;
if (DebugManager.flags.CreateMultipleRootDevices.get()) {
numRootDevices = DebugManager.flags.CreateMultipleRootDevices.get();
}
executionEnvironment.rootDeviceEnvironments.resize(numRootDevices);
auto productFamily = DebugManager.flags.ProductFamilyOverride.get();
auto hwInfoConst = *platformDevices;
getHwInfoForPlatformString(productFamily, hwInfoConst);
numDevices = 0;
std::string hwInfoConfig;
DebugManager.getHardwareInfoOverride(hwInfoConfig);
auto hardwareInfo = executionEnvironment.getMutableHardwareInfo();
*hardwareInfo = *hwInfoConst;
hardwareInfoSetup[hwInfoConst->platform.eProductFamily](hardwareInfo, true, hwInfoConfig);
HwInfoConfig *hwConfig = HwInfoConfig::get(hardwareInfo->platform.eProductFamily);
hwConfig->configureHardwareCustom(hardwareInfo, nullptr);
numDevices = numRootDevices;
DeviceFactory::numDevices = numDevices;
auto csr = DebugManager.flags.SetCommandStreamReceiver.get();
if (csr > 0) {
executionEnvironment.initAubCenter(DebugManager.flags.EnableLocalMemory.get(), "", static_cast<CommandStreamReceiverType>(csr));
auto aubCenter = executionEnvironment.rootDeviceEnvironments[0].aubCenter.get();
executionEnvironment.memoryOperationsInterface = std::make_unique<AubMemoryOperationsHandler>(aubCenter->getAubManager());
}
return true;
}
} // namespace NEO