Use only one device when creating context from type

Related-To: NEO-3691
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2021-05-25 17:22:20 +00:00
committed by Compute-Runtime-Automation
parent a52815eee1
commit 0602a9c285
2 changed files with 4 additions and 34 deletions

View File

@ -438,17 +438,12 @@ cl_context CL_API_CALL clCreateContextFromType(const cl_context_properties *prop
}
DEBUG_BREAK_IF(numDevices <= 0);
StackVec<cl_device_id, 2> supportedDevs;
supportedDevs.resize(numDevices);
cl_device_id device = nullptr;
retVal = clGetDeviceIDs(pPlatform, deviceType, numDevices, supportedDevs.begin(), nullptr);
retVal = clGetDeviceIDs(pPlatform, deviceType, 1, &device, nullptr);
DEBUG_BREAK_IF(retVal != CL_SUCCESS);
if (!DebugManager.flags.EnableMultiRootDeviceContexts.get()) {
numDevices = 1u;
}
ClDeviceVector deviceVector(supportedDevs.begin(), numDevices);
ClDeviceVector deviceVector(&device, 1);
pContext = Context::create<Context>(properties, deviceVector, funcNotify, userData, retVal);
} while (false);