Skip to content

Commit dabca21

Browse files
committed
l_copy_and_adjust_arguments_for_device: reduce scope of device-side buffer increment
This ensures the buffer increment is initialized to zero for every kernel argument, not only the first one. This has no functional impact since all kernel argument types use a non-default buffer increment. Signed-off-by: Peter Colberg <[email protected]>
1 parent 7325d07 commit dabca21

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/acl_kernel.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,8 +2758,6 @@ l_copy_and_adjust_arguments_for_device(cl_kernel kernel, cl_device_id device,
27582758
cl_uint dev_local_ptr_size = 4; // Always.
27592759
cl_uint dev_global_ptr_size = device->address_bits >> 3;
27602760

2761-
cl_uint buf_incr = 0;
2762-
27632761
// Bump allocator pointer for each local aspace
27642762
// Maps the aspace ID to the next available local memory address.
27652763
std::unordered_map<unsigned, size_t> next_local;
@@ -2784,6 +2782,9 @@ l_copy_and_adjust_arguments_for_device(cl_kernel kernel, cl_device_id device,
27842782
const acl_kernel_arg_info_t *arg_info =
27852783
&(kernel->accel_def->iface.args[iarg]);
27862784

2785+
// Exclude kernel argument value from device-side buffer by default.
2786+
cl_uint buf_incr = 0;
2787+
27872788
if (arg_info->addr_space == ACL_ARG_ADDR_LOCAL) {
27882789
#ifdef MEM_DEBUG_MSG
27892790
printf("local");

0 commit comments

Comments
 (0)