mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 20:39:56 +08:00
fail platform initialization when no device found
Change-Id: I76c8e12cd908be36cd8747346c6e543e3b748933
This commit is contained in:
committed by
sys_ocldev
parent
e738e6aa48
commit
89627bd81e
@@ -117,9 +117,11 @@ bool Platform::initialize(size_t numDevices,
|
||||
return true;
|
||||
}
|
||||
|
||||
state = StateIniting;
|
||||
state = OCLRT::getDevices(&hwInfo, numDevicesReturned) ? StateIniting : StateNone;
|
||||
|
||||
OCLRT::getDevices(&hwInfo, numDevicesReturned);
|
||||
if (state == StateNone) {
|
||||
return false;
|
||||
}
|
||||
|
||||
hwInfoConst = (hwInfo != nullptr) ? const_cast<const HardwareInfo **>(&hwInfo) : devices;
|
||||
numDevicesReturned = (hwInfo != nullptr) ? numDevicesReturned : numDevices;
|
||||
|
||||
Reference in New Issue
Block a user