mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Return vector of HwDeviceIds from OSInterface::discoverDevices
Resolves: NEO-4310 Related-To: NEO-4208 Change-Id: Ib4ce27a18a860214b76505f6e122666c86207783 Signed-off-by: Jablonski, Mateusz <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
428b123bdd
commit
624b418756
@@ -89,24 +89,13 @@ bool DeviceFactory::isHwModeSelected() {
|
||||
bool DeviceFactory::getDevices(size_t &totalNumRootDevices, ExecutionEnvironment &executionEnvironment) {
|
||||
using HwDeviceIds = std::vector<std::unique_ptr<HwDeviceId>>;
|
||||
|
||||
HwDeviceIds hwDeviceIds;
|
||||
|
||||
size_t numRootDevices = 1u;
|
||||
if (DebugManager.flags.CreateMultipleRootDevices.get()) {
|
||||
numRootDevices = DebugManager.flags.CreateMultipleRootDevices.get();
|
||||
}
|
||||
for (size_t i = 0; i < numRootDevices; i++) {
|
||||
auto hwDeviceId = OSInterface::discoverDevices();
|
||||
if (hwDeviceId) {
|
||||
hwDeviceIds.push_back(std::move(hwDeviceId));
|
||||
}
|
||||
}
|
||||
if (hwDeviceIds.empty()) {
|
||||
HwDeviceIds hwDeviceIds = OSInterface::discoverDevices();
|
||||
totalNumRootDevices = hwDeviceIds.size();
|
||||
if (totalNumRootDevices == 0) {
|
||||
return false;
|
||||
}
|
||||
totalNumRootDevices = numRootDevices;
|
||||
|
||||
executionEnvironment.prepareRootDeviceEnvironments(static_cast<uint32_t>(numRootDevices));
|
||||
executionEnvironment.prepareRootDeviceEnvironments(static_cast<uint32_t>(totalNumRootDevices));
|
||||
|
||||
uint32_t rootDeviceIndex = 0u;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user