mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-01 04:23:00 +08:00
Add debug flag CreateMultipleDevices.
- This flag allows to create multiple devices from the same GPU Change-Id: I4b80e4759543ca4559549b2d26c5ddef241f9ebb
This commit is contained in:
committed by
sys_ocldev
parent
bc2403acfd
commit
e47344ec0e
@@ -41,29 +41,30 @@ HardwareInfo *DeviceFactory::hwInfos = nullptr;
|
||||
bool DeviceFactory::getDevices(HardwareInfo **pHWInfos, size_t &numDevices) {
|
||||
std::vector<HardwareInfo> tHwInfos;
|
||||
unsigned int devNum = 0;
|
||||
Drm *drm = nullptr;
|
||||
size_t requiredDeviceCount = 1;
|
||||
|
||||
if (DebugManager.flags.CreateMultipleDevices.get()) {
|
||||
requiredDeviceCount = DebugManager.flags.CreateMultipleDevices.get();
|
||||
}
|
||||
|
||||
Drm *drm = Drm::create(devNum);
|
||||
if (!drm) {
|
||||
return false;
|
||||
}
|
||||
std::unique_ptr<OSInterface> osInterface = std::unique_ptr<OSInterface>(new OSInterface());
|
||||
osInterface.get()->get()->setDrm(drm);
|
||||
const HardwareInfo *pCurrDevice = platformDevices[devNum];
|
||||
|
||||
while ((drm = Drm::create(devNum)) != nullptr) {
|
||||
const HardwareInfo *pCurrDevice = platformDevices[devNum];
|
||||
|
||||
while (devNum < requiredDeviceCount) {
|
||||
HardwareInfo tmpHwInfo;
|
||||
|
||||
osInterface.get()->get()->setDrm(drm);
|
||||
|
||||
HwInfoConfig *hwConfig = HwInfoConfig::get(pCurrDevice->pPlatform->eProductFamily);
|
||||
if (hwConfig->configureHwInfo(pCurrDevice, &tmpHwInfo, osInterface.get())) {
|
||||
return false;
|
||||
}
|
||||
tHwInfos.push_back(tmpHwInfo);
|
||||
|
||||
devNum++;
|
||||
break;
|
||||
}
|
||||
|
||||
if (devNum < 1)
|
||||
return false;
|
||||
|
||||
HardwareInfo *ptr = new HardwareInfo[devNum];
|
||||
for (size_t i = 0; i < tHwInfos.size(); i++)
|
||||
ptr[i] = tHwInfos[i];
|
||||
|
||||
Reference in New Issue
Block a user