@@ -25,7 +25,6 @@ ur_exp_command_buffer_handle_t_::ur_exp_command_buffer_handle_t_(
2525 ZeCommandListDesc(ZeDesc), ZeFencesList(), QueueProperties(),
2626 SyncPoints(), NextSyncPoint(0 ),
2727 IsUpdatable(Desc ? Desc->isUpdatable : false ) {
28- (void )Desc;
2928 urContextRetain (Context);
3029 urDeviceRetain (Device);
3130}
@@ -1045,6 +1044,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp(
10451044 auto CommandBuffer = Command->CommandBuffer ;
10461045 uint32_t Dim = CommandDesc->newWorkDim ;
10471046 const void *NextDesc = nullptr ;
1047+ auto SupportedFeatures =
1048+ Command->CommandBuffer ->Device ->ZeDeviceMutableCmdListsProperties
1049+ ->mutableCommandFlags ;
10481050
10491051 // We need the created descriptors to live till the point when
10501052 // zexCommandListUpdateMutableCommandsExp is called at the end of the
@@ -1060,6 +1062,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp(
10601062
10611063 // Check if new global offset is provided.
10621064 size_t *NewGlobalWorkOffset = CommandDesc->pNewGlobalWorkOffset ;
1065+ UR_ASSERT (!NewGlobalWorkOffset ||
1066+ (SupportedFeatures & ZE_MUTABLE_COMMAND_EXP_FLAG_GLOBAL_OFFSET),
1067+ UR_RESULT_ERROR_UNSUPPORTED_FEATURE);
10631068 if (NewGlobalWorkOffset && Dim > 0 ) {
10641069 if (!CommandBuffer->Context ->getPlatform ()
10651070 ->ZeDriverGlobalOffsetExtensionFound ) {
@@ -1079,6 +1084,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp(
10791084
10801085 // Check if new group size is provided.
10811086 size_t *NewLocalWorkSize = CommandDesc->pNewLocalWorkSize ;
1087+ UR_ASSERT (!NewLocalWorkSize ||
1088+ (SupportedFeatures & ZE_MUTABLE_COMMAND_EXP_FLAG_GROUP_SIZE),
1089+ UR_RESULT_ERROR_UNSUPPORTED_FEATURE);
10821090 if (NewLocalWorkSize && Dim > 0 ) {
10831091 auto MutableGroupSizeDesc =
10841092 std::make_unique<ZeStruct<ze_mutable_group_size_exp_desc_t >>();
@@ -1093,6 +1101,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp(
10931101
10941102 // Check if new global size is provided and we need to update group count.
10951103 size_t *NewGlobalWorkSize = CommandDesc->pNewGlobalWorkSize ;
1104+ UR_ASSERT (!NewGlobalWorkSize ||
1105+ (SupportedFeatures & ZE_MUTABLE_COMMAND_EXP_FLAG_GROUP_COUNT),
1106+ UR_RESULT_ERROR_UNSUPPORTED_FEATURE);
1107+ UR_ASSERT (!(NewGlobalWorkSize && !NewLocalWorkSize) ||
1108+ (SupportedFeatures & ZE_MUTABLE_COMMAND_EXP_FLAG_GROUP_SIZE),
1109+ UR_RESULT_ERROR_UNSUPPORTED_FEATURE);
10961110 if (NewGlobalWorkSize && Dim > 0 ) {
10971111 ze_group_count_t ZeThreadGroupDimensions{1 , 1 , 1 };
10981112 uint32_t WG[3 ];
@@ -1124,6 +1138,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp(
11241138 }
11251139 }
11261140
1141+ UR_ASSERT (
1142+ (!CommandDesc->numNewMemObjArgs && !CommandDesc->numNewPointerArgs &&
1143+ !CommandDesc->numNewValueArgs ) ||
1144+ (SupportedFeatures & ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_ARGUMENTS),
1145+ UR_RESULT_ERROR_UNSUPPORTED_FEATURE);
1146+
11271147 // Check if new memory object arguments are provided.
11281148 for (uint32_t NewMemObjArgNum = CommandDesc->numNewMemObjArgs ;
11291149 NewMemObjArgNum-- > 0 ;) {
0 commit comments