@@ -2755,8 +2755,8 @@ l_copy_and_adjust_arguments_for_device(cl_kernel kernel, cl_device_id device,
2755
2755
// with a base address of 0
2756
2756
2757
2757
// Need to determine sizeof device's pointers.
2758
- cl_uint dev_local_ptr_size = 4 ; // Always.
2759
- cl_uint dev_global_ptr_size = device->address_bits >> 3 ;
2758
+ const cl_uint dev_local_ptr_size = 4 ; // Always.
2759
+ const cl_uint dev_global_ptr_size = device->address_bits >> 3 ;
2760
2760
2761
2761
// Bump allocator pointer for each local aspace
2762
2762
// Maps the aspace ID to the next available local memory address.
@@ -2790,7 +2790,8 @@ l_copy_and_adjust_arguments_for_device(cl_kernel kernel, cl_device_id device,
2790
2790
printf (" local" );
2791
2791
#endif
2792
2792
2793
- unsigned this_aspace = kernel->accel_def ->iface .args [iarg].aspace_number ;
2793
+ const unsigned int this_aspace =
2794
+ kernel->accel_def ->iface .args [iarg].aspace_number ;
2794
2795
2795
2796
// This arg is a pointer to __local.
2796
2797
cl_ulong local_size = 0 ;
@@ -2812,7 +2813,8 @@ l_copy_and_adjust_arguments_for_device(cl_kernel kernel, cl_device_id device,
2812
2813
2813
2814
// On the emulator, the argument size of a pipe (which is a mem object) is
2814
2815
// 0. Since we copy in 0 bytes, we should read out 0 bytes.
2815
- size_t copy_sz = (arg_info->size == 0 ) ? arg_info->size : sizeof (cl_mem);
2816
+ const size_t copy_sz =
2817
+ (arg_info->size == 0 ) ? arg_info->size : sizeof (cl_mem);
2816
2818
safe_memcpy (&mem_obj, &(kernel->arg_value [host_idx]), copy_sz,
2817
2819
sizeof (cl_mem), copy_sz);
2818
2820
@@ -2832,7 +2834,7 @@ l_copy_and_adjust_arguments_for_device(cl_kernel kernel, cl_device_id device,
2832
2834
value for the argument declared as a pointer to global or constant
2833
2835
memory in the kernel."
2834
2836
*/
2835
- cl_ulong null_ptr = 0 ;
2837
+ const cl_ulong null_ptr = 0 ;
2836
2838
safe_memcpy (buf + device_idx, &null_ptr, dev_global_ptr_size,
2837
2839
dev_global_ptr_size, dev_global_ptr_size);
2838
2840
// Shared physical memory:
@@ -2902,7 +2904,7 @@ l_copy_and_adjust_arguments_for_device(cl_kernel kernel, cl_device_id device,
2902
2904
2903
2905
// copy the address of the reserved allocation into the invocation
2904
2906
// image:
2905
- void *mem_addr =
2907
+ const void *mem_addr =
2906
2908
mem_obj->reserved_allocations [needed_physical_id][needed_mem_id]
2907
2909
->range .begin ;
2908
2910
safe_memcpy (buf + device_idx, &mem_addr, dev_global_ptr_size,
@@ -2911,7 +2913,7 @@ l_copy_and_adjust_arguments_for_device(cl_kernel kernel, cl_device_id device,
2911
2913
if (memory_migration->num_mem_objects == 0 ) {
2912
2914
// First time allocation, 128 was chosen because previously, number of
2913
2915
// kernel arguments were set to an hardcoded limit of 128
2914
- const unsigned initial_alloc = 128 ;
2916
+ const unsigned int initial_alloc = 128 ;
2915
2917
2916
2918
memory_migration->src_mem_list =
2917
2919
(acl_mem_migrate_wrapper_t *)acl_malloc (
@@ -2923,7 +2925,7 @@ l_copy_and_adjust_arguments_for_device(cl_kernel kernel, cl_device_id device,
2923
2925
memory_migration->num_alloc = initial_alloc;
2924
2926
} else if (memory_migration->num_mem_objects >=
2925
2927
memory_migration->num_alloc ) {
2926
- const unsigned next_alloc = memory_migration->num_alloc * 2 ;
2928
+ const unsigned int next_alloc = memory_migration->num_alloc * 2 ;
2927
2929
// check for overflow, num_alloc is a 32-bit unsigned integer and
2928
2930
// unsigned integer overflow is defined behaviour
2929
2931
if (next_alloc < memory_migration->num_alloc )
0 commit comments