mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 01:35:20 +08:00
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:
committed by
sys_ocldev
parent
a8a013b0c3
commit
52feced02b
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user