(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
This commit is contained in:
zatwierdzone przez
Vladislav Sytchenko
rodzic
481d526859
commit
2a223ecec6
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user