Improve clGetDeviceIDs
Change-Id: If7df41e0c2bae5c615f6fea286baf5d7e740cfc7 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
parent
904c158377
commit
a7d66b0365
|
@ -1,5 +1,5 @@
|
|||
#!groovy
|
||||
dependenciesRevision='ec7183fc6b8fde18df4a38ab2aa6d6f364b507f1-1216'
|
||||
strategy='EQUAL'
|
||||
allowedCD=275
|
||||
allowedCD=274
|
||||
allowedF=4
|
||||
|
|
|
@ -177,8 +177,8 @@ cl_int CL_API_CALL clGetDeviceIDs(cl_platform_id platform,
|
|||
break;
|
||||
}
|
||||
|
||||
Device **allDevs = pPlatform->getDevices();
|
||||
DEBUG_BREAK_IF(allDevs == nullptr);
|
||||
Device *device = pPlatform->getDevice(0);
|
||||
DEBUG_BREAK_IF(device == nullptr);
|
||||
|
||||
if (deviceType == CL_DEVICE_TYPE_ALL) {
|
||||
/* According to Spec, set it to all except TYPE_CUSTOM. */
|
||||
|
@ -190,18 +190,12 @@ cl_int CL_API_CALL clGetDeviceIDs(cl_platform_id platform,
|
|||
}
|
||||
|
||||
cl_uint retNum = 0;
|
||||
for (cl_uint i = 0; i < numDev; i++) {
|
||||
if (deviceType & allDevs[i]->getDeviceInfo().deviceType) {
|
||||
if (devices) {
|
||||
devices[retNum] = allDevs[i];
|
||||
}
|
||||
|
||||
retNum++;
|
||||
if (numEntries > 0 && retNum >= numEntries) {
|
||||
/* find enough, get out. */
|
||||
break;
|
||||
}
|
||||
if (deviceType & device->getDeviceInfo().deviceType) {
|
||||
if (devices) {
|
||||
devices[retNum] = device;
|
||||
}
|
||||
retNum++;
|
||||
}
|
||||
|
||||
if (DebugManager.flags.LimitAmountOfReturnedDevices.get()) {
|
||||
|
|
Loading…
Reference in New Issue