Skip to content

Commit c6bca1b

Browse files
committed
Set minimum L0 device support to support UR kernel update
In order to support all the ways a kernel command in a command-buffer can be updated in Unified Runtime, the following capabilities need to be available from the device: * `ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_ARGUMENTS` * `ZE_MUTABLE_COMMAND_EXP_FLAG_GROUP_COUNT` * `ZE_MUTABLE_COMMAND_EXP_FLAG_GROUP_SIZE` * `ZE_MUTABLE_COMMAND_EXP_FLAG_GLOBAL_OFFSET` Only supporting kernel argument update is not sufficient, as is currently the case. There is also no way in the UR API currently to take advantage of the `ZE_MUTABLE_COMMAND_EXP_FLAG_SIGNAL_EVENT` and `ZE_MUTABLE_COMMAND_EXP_FLAG_WAIT_EVENTS` capabilities.
1 parent 5083f4f commit c6bca1b

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

source/adapters/level_zero/device.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -947,18 +947,17 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
947947
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP:
948948
return ReturnValue(true);
949949
case UR_DEVICE_INFO_COMMAND_BUFFER_UPDATE_SUPPORT_EXP: {
950-
// TODO: Level Zero API allows to check support for all sub-features:
951-
// ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_ARGUMENTS,
952-
// ZE_MUTABLE_COMMAND_EXP_FLAG_GROUP_COUNT,
953-
// ZE_MUTABLE_COMMAND_EXP_FLAG_GROUP_SIZE,
954-
// ZE_MUTABLE_COMMAND_EXP_FLAG_GLOBAL_OFFSET,
955-
// ZE_MUTABLE_COMMAND_EXP_FLAG_SIGNAL_EVENT,
956-
// ZE_MUTABLE_COMMAND_EXP_FLAG_WAIT_EVENTS
957-
// but UR has only one property to check the mutable command lists feature
958-
// support. For now return true if kernel arguments can be updated.
959-
auto KernelArgUpdateSupport =
960-
Device->ZeDeviceMutableCmdListsProperties->mutableCommandFlags &
961-
ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_ARGUMENTS;
950+
// Update support requires being able to update kernel arguments and all
951+
// aspects of the kernel NDRange.
952+
const ze_mutable_command_exp_flags_t UpdateMask =
953+
ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_ARGUMENTS |
954+
ZE_MUTABLE_COMMAND_EXP_FLAG_GROUP_COUNT |
955+
ZE_MUTABLE_COMMAND_EXP_FLAG_GROUP_SIZE |
956+
ZE_MUTABLE_COMMAND_EXP_FLAG_GLOBAL_OFFSET;
957+
958+
const bool KernelArgUpdateSupport =
959+
(Device->ZeDeviceMutableCmdListsProperties->mutableCommandFlags &
960+
UpdateMask) == UpdateMask;
962961
return ReturnValue(KernelArgUpdateSupport &&
963962
Device->Platform->ZeMutableCmdListExt.Supported);
964963
}

0 commit comments

Comments
 (0)