(SWDEV-210228)

Don't error when querying the number of devices if there are no devices present in the system.

We should just return 0 for the number of devices in this case and let the application handle this situation.

Change-Id: I20614ade5e649f3ce9ddd970d4b38bfe296f6cdb


[ROCm/clr commit: 2a223ecec6]
This commit is contained in:
Vladislav Sytchenko
2020-03-24 15:30:12 -04:00
committed by Vladislav Sytchenko
parent 8bda935a71
commit 9ce8e0eeb8
+1 -1
View File
@@ -399,7 +399,7 @@ bool Device::getDeviceIDs(cl_device_type deviceType, uint32_t numEntries, cl_dev
uint32_t* numDevices, bool offlineDevices) {
if (numDevices != nullptr && devices == nullptr) {
*numDevices = (uint32_t)amd::Device::numDevices(deviceType, offlineDevices);
return (*numDevices > 0) ? true : false;
return true;
}
assert(devices != nullptr && "check the code above");