Skip to content

Commit

Permalink
Fix build failure when MEM_DEBUG_MSG is enabled
Browse files Browse the repository at this point in the history
../../src/acl_kernel.cpp:2856:59: error: ‘needed_physical_id’ was not declared in this scope
         printf("needed_physical_id %d needed_mem_id %d ", needed_physical_id,
                                                           ^~~~~~~~~~~~~~~~~~

Signed-off-by: Peter Colberg <peter.colberg@intel.com>
  • Loading branch information
pcolberg committed Apr 21, 2022
1 parent 079d575 commit df5aa45
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/acl_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2848,7 +2848,9 @@ l_copy_and_adjust_arguments_for_device(cl_kernel kernel, cl_device_id device,
#ifdef MEM_DEBUG_MSG
printf("regular buffer ");
#endif
unsigned needed_mem_id = l_get_kernel_arg_mem_id(kernel, iarg);
const unsigned int needed_mem_id =
l_get_kernel_arg_mem_id(kernel, iarg);
const unsigned int needed_physical_id = device->def.physical_device_id;

// Always enqueue a migration, even if the memory is where it should be there
// could be something in the queue ahead of us which will move the memory.
Expand All @@ -2858,7 +2860,6 @@ l_copy_and_adjust_arguments_for_device(cl_kernel kernel, cl_device_id device,
#endif

// first, is there a reserved region?
unsigned needed_physical_id = device->def.physical_device_id;
if (mem_obj->reserved_allocations_count[needed_physical_id].size() ==
0) {
acl_resize_reserved_allocations_for_device(mem_obj, device->def);
Expand Down

0 comments on commit df5aa45

Please # to comment.