From 2a223ecec637842b55a688c38305ed48fa396459 Mon Sep 17 00:00:00 2001 From: Vladislav Sytchenko Date: Tue, 24 Mar 2020 15:30:12 -0400 Subject: [PATCH] (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 --- rocclr/device/device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rocclr/device/device.cpp b/rocclr/device/device.cpp index cafff5f3ea..7d91b0d0be 100644 --- a/rocclr/device/device.cpp +++ b/rocclr/device/device.cpp @@ -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");