Add new debug flag to limit the number of returned devices.

Change-Id: I01e1b6804291956fb62b84ff5df68c57b51bd17d
This commit is contained in:
Mrozek, Michal
2018-10-08 14:23:29 -07:00
committed by sys_ocldev
parent 118d3ed0e2
commit 12b4d44375
4 changed files with 30 additions and 1 deletions

View File

@@ -6,6 +6,7 @@
*/
#include "config.h"
#include <algorithm>
#include "api.h"
#include "CL/cl.h"
#include "runtime/accelerators/intel_motion_estimation.h"
@@ -199,6 +200,10 @@ cl_int CL_API_CALL clGetDeviceIDs(cl_platform_id platform,
}
}
if (DebugManager.flags.LimitAmountOfReturnedDevices.get()) {
retNum = std::min(static_cast<uint32_t>(DebugManager.flags.LimitAmountOfReturnedDevices.get()), retNum);
}
if (numDevices) {
*numDevices = retNum;
}