Skip to content

Commit f61e182

Browse files
committed
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION in more cases
Because CL_INVALID_VALUE is returned both when the size of the value being queried is incorrect and when the information being queried is unrecognized, it is difficult to differentiate between the UR INVALID_SIZE and UNSUPPORTED_ENUMERATION errors. For now, we will check for and return INVALID_SIZE first, which is what the tests are expecting.
1 parent b9b6503 commit f61e182

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

unified-runtime/source/adapters/opencl/kernel.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urKernelGetInfo(ur_kernel_handle_t hKernel,
152152
cl_int ClResult =
153153
clGetKernelInfo(hKernel->CLKernel, mapURKernelInfoToCL(propName),
154154
propSize, pPropValue, &CheckPropSize);
155-
if (ClResult == CL_INVALID_VALUE) {
156-
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
157-
}
158155
if (pPropValue && CheckPropSize != propSize) {
159156
return UR_RESULT_ERROR_INVALID_SIZE;
160157
}
158+
if (ClResult == CL_INVALID_VALUE) {
159+
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
160+
}
161161
CL_RETURN_ON_FAILURE(ClResult);
162162
if (pPropSizeRet) {
163163
*pPropSizeRet = CheckPropSize;

0 commit comments

Comments
 (0)