Improve clGetDeviceIDs

Change-Id: If7df41e0c2bae5c615f6fea286baf5d7e740cfc7
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz 2019-03-20 13:17:17 +01:00 committed by sys_ocldev
parent 904c158377
commit a7d66b0365
2 changed files with 7 additions and 13 deletions

2
Jenkinsfile vendored
View File

@ -1,5 +1,5 @@
#!groovy
dependenciesRevision='ec7183fc6b8fde18df4a38ab2aa6d6f364b507f1-1216'
strategy='EQUAL'
allowedCD=275
allowedCD=274
allowedF=4

View File

@ -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()) {