fosphor/cl: Don't fail fatally if a platform fails to return devices

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
Sylvain Munaut 2015-08-25 14:50:54 -04:00
parent 436b966b76
commit a969e7fbb0
1 changed files with 7 additions and 1 deletions

View File

@ -275,7 +275,13 @@ cl_find_device(cl_platform_id *pl_id_p, cl_device_id *dev_id_p,
{
/* Scan all devices */
err = clGetDeviceIDs(pl_list[i], CL_DEVICE_TYPE_ALL, MAX_DEVICES, dev_list, &dev_count);
CL_ERR_CHECK(err, "Unable to fetch device IDs");
if (err != CL_SUCCESS)
{
fprintf(stderr, "[w] CL Error (%d, %s:%d): "
"Unable to fetch device IDs for platform %d. Skipping.\n",
err, __FILE__, __LINE__, i);
continue;
}
for (j=0; j<dev_count; j++)
{