Group created devices based on product family

Related-To: NEO-4208

Change-Id: Ida9ec309a83d609d85778ac8ef6d838651f04cbd
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2020-02-18 16:02:26 +01:00
parent 0b16d9cc26
commit c3a33b6ca7
5 changed files with 76 additions and 6 deletions

View File

@@ -87,12 +87,19 @@ cl_int CL_API_CALL clGetPlatformIDs(cl_uint numEntries,
retVal = CL_OUT_OF_HOST_MEMORY;
break;
}
auto pPlatform = Platform::createFunc(*executionEnvironment.release());
if (!pPlatform || !pPlatform->initialize(std::move(allDevices))) {
retVal = CL_OUT_OF_HOST_MEMORY;
auto groupedDevices = Platform::groupDevices(std::move(allDevices));
for (auto &deviceVector : groupedDevices) {
auto pPlatform = Platform::createFunc(*executionEnvironment.release());
if (!pPlatform || !pPlatform->initialize(std::move(deviceVector))) {
retVal = CL_OUT_OF_HOST_MEMORY;
break;
}
platformsImpl.push_back(std::move(pPlatform));
}
if (retVal != CL_SUCCESS) {
break;
}
platformsImpl.push_back(std::move(pPlatform));
}
if (platforms) {
// we only have one platform so we can program that directly