Correct exposing devices from program created with source

Related-To: NEO-5001
Change-Id: I15dd7480ecd8dc5cf2e4347cd06837ea573ecd95
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2020-10-20 13:15:39 +02:00
committed by sys_ocldev
parent a8a013b0c3
commit 52feced02b
5 changed files with 58 additions and 7 deletions

View File

@@ -75,9 +75,7 @@ T *Program::create(
lengths);
if (CL_SUCCESS == retVal) {
ClDeviceVector deviceVector;
deviceVector.push_back(pContext->getDevice(0));
program = new T(pContext, false, deviceVector);
program = new T(pContext, false, pContext->getDevices());
program->sourceCode.swap(combinedString);
program->createdFrom = CreatedFrom::SOURCE;
}

View File

@@ -27,12 +27,12 @@ cl_int Program::getInfo(cl_program_info paramName, size_t paramValueSize,
size_t srcSize = GetInfo::invalidSourceSize;
size_t retSize = 0;
std::string kernelNamesString;
cl_device_id device_id = pDevice->getSpecializedDevice<ClDevice>();
cl_uint refCount = 0;
size_t numKernels;
cl_context clContext = context;
cl_uint clFalse = CL_FALSE;
auto rootDeviceIndex = pDevice->getRootDeviceIndex();
std::vector<cl_device_id> devicesToExpose;
switch (paramName) {
case CL_PROGRAM_CONTEXT:
@@ -87,8 +87,9 @@ cl_int Program::getInfo(cl_program_info paramName, size_t paramValueSize,
break;
case CL_PROGRAM_DEVICES:
pSrc = &device_id;
retSize = srcSize = sizeof(cl_device_id);
clDevices.toDeviceIDs(devicesToExpose);
pSrc = devicesToExpose.data();
retSize = srcSize = devicesToExpose.size() * sizeof(cl_device_id);
break;
case CL_PROGRAM_REFERENCE_COUNT:

View File

@@ -45,7 +45,7 @@ Program::Program(Context *context, bool isBuiltIn, const ClDeviceVector &clDevic
blockKernelManager = new BlockKernelManager();
ClDevice *pClDevice = castToObject<ClDevice>(pDevice->getSpecializedDevice<ClDevice>());
numDevices = 1;
numDevices = static_cast<uint32_t>(clDevicesIn.size());
bool force32BitAddressess = false;
uint32_t maxRootDeviceIndex = pDevice->getRootDeviceIndex();