Skip to content

[UR][Offload] Implement UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES #19275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions unified-runtime/source/adapters/offload/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,26 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
case UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL:
// TODO: Implement subgroups in Offload
return ReturnValue(1);
case UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES: {
// OL dimensions are uint32_t while UR is size_t, so they need to be mapped
if (pPropSizeRet) {
*pPropSizeRet = sizeof(size_t) * 3;
}

if (pPropValue) {
ol_dimensions_t olVec;
size_t *urVec = reinterpret_cast<size_t *>(pPropValue);
OL_RETURN_ON_ERR(olGetDeviceInfo(hDevice->OffloadDevice,
OL_DEVICE_INFO_MAX_WORK_GROUP_SIZE,
sizeof(olVec), &olVec));

urVec[0] = olVec.x;
urVec[1] = olVec.y;
urVec[2] = olVec.z;
}

return UR_RESULT_SUCCESS;
}
// Unimplemented features
case UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS:
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT:
Expand Down
Loading