@@ -241,6 +241,70 @@ TEST_P(LocalMemoryUpdateTest, UpdateParametersSameLocalSize) {
241241 Validate (new_output, new_X, new_Y, new_A, global_size, local_size);
242242}
243243
244+ // Test only passing local memory parameters to update with the original values.
245+ TEST_P (LocalMemoryUpdateTest, UpdateLocalOnly) {
246+ // Run command-buffer prior to update an verify output
247+ ASSERT_SUCCESS (urCommandBufferEnqueueExp (updatable_cmd_buf_handle, queue, 0 ,
248+ nullptr , nullptr ));
249+ ASSERT_SUCCESS (urQueueFinish (queue));
250+
251+ uint32_t *output = (uint32_t *)shared_ptrs[0 ];
252+ uint32_t *X = (uint32_t *)shared_ptrs[1 ];
253+ uint32_t *Y = (uint32_t *)shared_ptrs[2 ];
254+ Validate (output, X, Y, A, global_size, local_size);
255+
256+ // Update inputs
257+ std::array<ur_exp_command_buffer_update_value_arg_desc_t , 2 >
258+ new_value_descs;
259+
260+ // New local_mem_a at index 0
261+ new_value_descs[0 ] = {
262+ UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_UPDATE_VALUE_ARG_DESC, // stype
263+ nullptr , // pNext
264+ 0 , // argIndex
265+ local_mem_a_size, // argSize
266+ nullptr , // pProperties
267+ nullptr , // hArgValue
268+ };
269+
270+ // New local_mem_b at index 1
271+ new_value_descs[1 ] = {
272+ UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_UPDATE_VALUE_ARG_DESC, // stype
273+ nullptr , // pNext
274+ 1 + hip_arg_offset, // argIndex
275+ local_mem_b_size, // argSize
276+ nullptr , // pProperties
277+ nullptr , // hArgValue
278+ };
279+
280+ // Update kernel inputs
281+ ur_exp_command_buffer_update_kernel_launch_desc_t update_desc = {
282+ UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_UPDATE_KERNEL_LAUNCH_DESC, // stype
283+ nullptr , // pNext
284+ kernel, // hNewKernel
285+ 0 , // numNewMemObjArgs
286+ 0 , // numNewPointerArgs
287+ new_value_descs.size (), // numNewValueArgs
288+ n_dimensions, // newWorkDim
289+ nullptr , // pNewMemObjArgList
290+ nullptr , // pNewPointerArgList
291+ new_value_descs.data (), // pNewValueArgList
292+ nullptr , // pNewGlobalWorkOffset
293+ nullptr , // pNewGlobalWorkSize
294+ nullptr , // pNewLocalWorkSize
295+ };
296+
297+ // Update kernel and enqueue command-buffer again
298+ ASSERT_SUCCESS (
299+ urCommandBufferUpdateKernelLaunchExp (command_handle, &update_desc));
300+ ASSERT_SUCCESS (urCommandBufferEnqueueExp (updatable_cmd_buf_handle, queue, 0 ,
301+ nullptr , nullptr ));
302+ ASSERT_SUCCESS (urQueueFinish (queue));
303+
304+ // Verify that update occurred correctly
305+ Validate (output, X, Y, A, global_size, local_size);
306+ }
307+
244308// Test updating A,X,Y parameters to new values and omitting local memory parameters
245309// from the update.
246310TEST_P (LocalMemoryUpdateTest, UpdateParametersEmptyLocalSize) {
0 commit comments