Skip to content

Commit 8164138

Browse files
authored
[UR][Offload] Implement UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES (#19275)
1 parent a37449a commit 8164138

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

unified-runtime/source/adapters/offload/device.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,26 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
8484
case UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL:
8585
// TODO: Implement subgroups in Offload
8686
return ReturnValue(1);
87+
case UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES: {
88+
// OL dimensions are uint32_t while UR is size_t, so they need to be mapped
89+
if (pPropSizeRet) {
90+
*pPropSizeRet = sizeof(size_t) * 3;
91+
}
92+
93+
if (pPropValue) {
94+
ol_dimensions_t olVec;
95+
size_t *urVec = reinterpret_cast<size_t *>(pPropValue);
96+
OL_RETURN_ON_ERR(olGetDeviceInfo(hDevice->OffloadDevice,
97+
OL_DEVICE_INFO_MAX_WORK_GROUP_SIZE,
98+
sizeof(olVec), &olVec));
99+
100+
urVec[0] = olVec.x;
101+
urVec[1] = olVec.y;
102+
urVec[2] = olVec.z;
103+
}
104+
105+
return UR_RESULT_SUCCESS;
106+
}
87107
// Unimplemented features
88108
case UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS:
89109
case UR_DEVICE_INFO_USM_POOL_SUPPORT:

0 commit comments

Comments
 (0)