From df5aa4528079540e2fc3273ecff543038a114c20 Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Wed, 20 Apr 2022 20:29:40 -0400 Subject: [PATCH] Fix build failure when MEM_DEBUG_MSG is enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../../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 --- src/acl_kernel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/acl_kernel.cpp b/src/acl_kernel.cpp index e93ffc42..08dfe738 100644 --- a/src/acl_kernel.cpp +++ b/src/acl_kernel.cpp @@ -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. @@ -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);