Remove redundant parameter from getDevices functions

Change-Id: I3da50a69adb8ec64fd1d09021142b278e34c4cbe
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2020-03-20 16:54:09 +01:00
committed by sys_ocldev
parent 819896bca2
commit 0f3730f5d9
16 changed files with 59 additions and 131 deletions

View File

@@ -22,7 +22,7 @@
namespace NEO {
bool DeviceFactory::getDevicesForProductFamilyOverride(size_t &numDevices, ExecutionEnvironment &executionEnvironment) {
bool DeviceFactory::getDevicesForProductFamilyOverride(ExecutionEnvironment &executionEnvironment) {
auto numRootDevices = 1u;
if (DebugManager.flags.CreateMultipleRootDevices.get()) {
numRootDevices = DebugManager.flags.CreateMultipleRootDevices.get();
@@ -32,7 +32,6 @@ bool DeviceFactory::getDevicesForProductFamilyOverride(size_t &numDevices, Execu
auto productFamily = DebugManager.flags.ProductFamilyOverride.get();
const HardwareInfo *hwInfoConst = &DEFAULT_PLATFORM::hwInfo;
getHwInfoForPlatformString(productFamily, hwInfoConst);
numDevices = 0;
std::string hwInfoConfigStr;
uint64_t hwInfoConfig = 0x0;
DebugManager.getHardwareInfoOverride(hwInfoConfigStr);
@@ -68,8 +67,6 @@ bool DeviceFactory::getDevicesForProductFamilyOverride(size_t &numDevices, Execu
}
executionEnvironment.calculateMaxOsContextCount();
numDevices = numRootDevices;
return true;
}
@@ -85,16 +82,15 @@ bool DeviceFactory::isHwModeSelected() {
}
}
bool DeviceFactory::getDevices(size_t &totalNumRootDevices, ExecutionEnvironment &executionEnvironment) {
bool DeviceFactory::getDevices(ExecutionEnvironment &executionEnvironment) {
using HwDeviceIds = std::vector<std::unique_ptr<HwDeviceId>>;
HwDeviceIds hwDeviceIds = OSInterface::discoverDevices(executionEnvironment);
totalNumRootDevices = hwDeviceIds.size();
if (totalNumRootDevices == 0) {
if (hwDeviceIds.empty()) {
return false;
}
executionEnvironment.prepareRootDeviceEnvironments(static_cast<uint32_t>(totalNumRootDevices));
executionEnvironment.prepareRootDeviceEnvironments(static_cast<uint32_t>(hwDeviceIds.size()));
uint32_t rootDeviceIndex = 0u;
@@ -118,8 +114,7 @@ bool DeviceFactory::getDevices(size_t &totalNumRootDevices, ExecutionEnvironment
std::vector<std::unique_ptr<Device>> DeviceFactory::createDevices(ExecutionEnvironment &executionEnvironment) {
std::vector<std::unique_ptr<Device>> devices;
size_t numDevices;
auto status = NEO::getDevices(numDevices, executionEnvironment);
auto status = NEO::getDevices(executionEnvironment);
if (!status) {
return devices;
}

View File

@@ -14,11 +14,11 @@ namespace NEO {
class ExecutionEnvironment;
class Device;
bool getDevices(size_t &numDevicesReturned, ExecutionEnvironment &executionEnvironment);
bool getDevices(ExecutionEnvironment &executionEnvironment);
class DeviceFactory {
public:
static bool getDevices(size_t &numDevices, ExecutionEnvironment &executionEnvironment);
static bool getDevicesForProductFamilyOverride(size_t &numDevices, ExecutionEnvironment &executionEnvironment);
static bool getDevices(ExecutionEnvironment &executionEnvironment);
static bool getDevicesForProductFamilyOverride(ExecutionEnvironment &executionEnvironment);
static std::vector<std::unique_ptr<Device>> createDevices(ExecutionEnvironment &executionEnvironment);
static bool isHwModeSelected();