@@ -284,6 +284,59 @@ TEST_P(USMMultiSaxpyKernelTest, UpdateParameters) {
284284 Validate (new_output, new_X, new_Y, new_A, global_size);
285285}
286286
287+ // Checks that passing nullptr to hNewKernel even when kernel binary updates
288+ // is not supported by the adapter.
289+ TEST_P (USMMultiSaxpyKernelTest, UpdateNullptrKernel) {
290+ ASSERT_SUCCESS (urCommandBufferEnqueueExp (updatable_cmd_buf_handle, queue, 0 ,
291+ nullptr , nullptr ));
292+ ASSERT_SUCCESS (urQueueFinish (queue));
293+
294+ uint32_t *output = (uint32_t *)shared_ptrs[0 ];
295+ uint32_t *X = (uint32_t *)shared_ptrs[1 ];
296+ uint32_t *Y = (uint32_t *)shared_ptrs[2 ];
297+ Validate (output, X, Y, A, global_size);
298+
299+ // New A at index 1
300+ uint32_t new_A = 33 ;
301+ ur_exp_command_buffer_update_value_arg_desc_t new_A_desc = {
302+ UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_UPDATE_VALUE_ARG_DESC, // stype
303+ nullptr , // pNext
304+ 1 , // argIndex
305+ sizeof (new_A), // argSize
306+ nullptr , // pProperties
307+ &new_A, // hArgValue
308+ };
309+
310+ // Update kernel inputs
311+ ur_exp_command_buffer_update_kernel_launch_desc_t update_desc = {
312+ UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_UPDATE_KERNEL_LAUNCH_DESC, // stype
313+ nullptr , // pNext
314+ nullptr , // hNewKernel
315+ 0 , // numNewMemObjArgs
316+ 0 , // numNewPointerArgs
317+ 1 , // numNewValueArgs
318+ n_dimensions, // newWorkDim
319+ nullptr , // pNewMemObjArgList
320+ nullptr , // pNewPointerArgList
321+ &new_A_desc, // pNewValueArgList
322+ nullptr , // pNewGlobalWorkOffset
323+ nullptr , // pNewGlobalWorkSize
324+ nullptr , // pNewLocalWorkSize
325+ };
326+
327+ for (auto &handle : command_handles) {
328+ ASSERT_SUCCESS (
329+ urCommandBufferUpdateKernelLaunchExp (handle, &update_desc));
330+ }
331+ ASSERT_SUCCESS (urCommandBufferEnqueueExp (updatable_cmd_buf_handle, queue, 0 ,
332+ nullptr , nullptr ));
333+ ASSERT_SUCCESS (urQueueFinish (queue));
334+
335+ // Verify that update occurred correctly
336+ uint32_t *new_output = (uint32_t *)shared_ptrs[0 ];
337+ Validate (new_output, X, Y, new_A, global_size);
338+ }
339+
287340TEST_P (USMMultiSaxpyKernelTest, UpdateWithoutBlocking) {
288341 // Prepare new inputs
289342 ur_exp_command_buffer_update_pointer_arg_desc_t new_input_descs[2 ];
0 commit comments