@@ -19,18 +19,32 @@ struct BufferFillCommandTest
1919 &buffer));
2020
2121 // First argument is buffer to fill
22- ASSERT_SUCCESS (urKernelSetArgMemObj (kernel, 0 , nullptr , buffer));
23-
24- // second arg is hidden accessor
25- struct {
26- size_t offsets[1 ] = {0 };
27- } accessor;
28- ASSERT_SUCCESS (urKernelSetArgValue (kernel, 1 , sizeof (accessor), nullptr ,
29- &accessor));
30-
31- // Second argument is scalar to fill with.
22+ unsigned current_arg_index = 0 ;
3223 ASSERT_SUCCESS (
33- urKernelSetArgValue (kernel, 2 , sizeof (val), nullptr , &val));
24+ urKernelSetArgMemObj (kernel, current_arg_index++, nullptr , buffer));
25+
26+ // Add accessor arguments depending on backend.
27+ // HIP has 3 offset parameters and other backends only have 1.
28+ if (backend == UR_PLATFORM_BACKEND_HIP) {
29+ size_t val = 0 ;
30+ ASSERT_SUCCESS (urKernelSetArgValue (kernel, current_arg_index++,
31+ sizeof (size_t ), nullptr , &val));
32+ ASSERT_SUCCESS (urKernelSetArgValue (kernel, current_arg_index++,
33+ sizeof (size_t ), nullptr , &val));
34+ ASSERT_SUCCESS (urKernelSetArgValue (kernel, current_arg_index++,
35+ sizeof (size_t ), nullptr , &val));
36+ } else {
37+ struct {
38+ size_t offsets[1 ] = {0 };
39+ } accessor;
40+ ASSERT_SUCCESS (urKernelSetArgValue (kernel, current_arg_index++,
41+ sizeof (accessor), nullptr ,
42+ &accessor));
43+ }
44+
45+ // Second user defined argument is scalar to fill with.
46+ ASSERT_SUCCESS (urKernelSetArgValue (kernel, current_arg_index++,
47+ sizeof (val), nullptr , &val));
3448
3549 // Append kernel command to command-buffer and close command-buffer
3650 ASSERT_SUCCESS (urCommandBufferAppendKernelLaunchExp (
0 commit comments