Use device from API function in clGetKernelWorkGroupInfo/SubGroupInfo

store execution environment reference in Kernel class

Related-To: NEO-5001
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2020-11-24 14:20:33 +00:00
committed by Compute-Runtime-Automation
parent ae3ad3e8bc
commit 52d96af5f0
5 changed files with 42 additions and 32 deletions

View File

@@ -1918,15 +1918,19 @@ cl_int CL_API_CALL clGetKernelWorkGroupInfo(cl_kernel kernel,
"paramValue", NEO::FileLoggerInstance().infoPointerToString(paramValue, paramValueSize),
"paramValueSizeRet", paramValueSizeRet);
auto pKernel = castToObject<Kernel>(kernel);
retVal = pKernel
? pKernel->getWorkGroupInfo(
device,
paramName,
paramValueSize,
paramValue,
paramValueSizeRet)
: CL_INVALID_KERNEL;
Kernel *pKernel = nullptr;
ClDevice *pClDevice = nullptr;
retVal = validateObjects(WithCastToInternal(device, &pClDevice),
WithCastToInternal(kernel, &pKernel));
if (CL_SUCCESS == retVal) {
retVal = pKernel->getWorkGroupInfo(
*pClDevice,
paramName,
paramValueSize,
paramValue,
paramValueSizeRet);
}
TRACING_EXIT(clGetKernelWorkGroupInfo, &retVal);
return retVal;
}
@@ -5067,7 +5071,8 @@ cl_int CL_API_CALL clGetKernelSubGroupInfoKHR(cl_kernel kernel,
"paramValueSizeRet", paramValueSizeRet);
Kernel *pKernel = nullptr;
retVal = validateObjects(device,
ClDevice *pClDevice = nullptr;
retVal = validateObjects(WithCastToInternal(device, &pClDevice),
WithCastToInternal(kernel, &pKernel));
if (CL_SUCCESS != retVal) {
@@ -5078,7 +5083,7 @@ cl_int CL_API_CALL clGetKernelSubGroupInfoKHR(cl_kernel kernel,
case CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE:
case CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE:
case CL_KERNEL_COMPILE_SUB_GROUP_SIZE_INTEL:
return pKernel->getSubGroupInfo(paramName,
return pKernel->getSubGroupInfo(*pClDevice, paramName,
inputValueSize, inputValue,
paramValueSize, paramValue,
paramValueSizeRet);
@@ -5167,7 +5172,8 @@ cl_int CL_API_CALL clGetKernelSubGroupInfo(cl_kernel kernel,
"paramValueSizeRet", paramValueSizeRet);
Kernel *pKernel = nullptr;
retVal = validateObjects(device,
ClDevice *pClDevice = nullptr;
retVal = validateObjects(WithCastToInternal(device, &pClDevice),
WithCastToInternal(kernel, &pKernel));
if (CL_SUCCESS != retVal) {
@@ -5175,7 +5181,7 @@ cl_int CL_API_CALL clGetKernelSubGroupInfo(cl_kernel kernel,
return retVal;
}
retVal = pKernel->getSubGroupInfo(paramName,
retVal = pKernel->getSubGroupInfo(*pClDevice, paramName,
inputValueSize, inputValue,
paramValueSize, paramValue,
paramValueSizeRet);