[PATCH 81/90] rename alloc_buffer_from_region() to pocl_alloc_buffer_from_region()
authorAndreas Beckmann <anbe@debian.org>
Fri, 3 Dec 2021 10:21:48 +0000 (11:21 +0100)
committerAndreas Beckmann <anbe@debian.org>
Fri, 7 Jan 2022 23:55:22 +0000 (23:55 +0000)
Gbp-Pq: Name 0081-rename-alloc_buffer_from_region-to-pocl_alloc_buffer.patch

lib/CL/devices/accel/accel.cc
lib/CL/devices/bufalloc.c
lib/CL/devices/bufalloc.h

index e68f9485a11c04f650fb64a1f8b3caeea704fff8..c04fbd935782569ade9ca9dae56adf5f1409a9a8 100644 (file)
@@ -384,7 +384,7 @@ cl_int pocl_accel_alloc_mem_obj(cl_device_id device, cl_mem mem_obj,
   if ((mem_obj->flags & CL_MEM_ALLOC_HOST_PTR) && (mem_obj->mem_host_ptr == NULL))
     return CL_MEM_OBJECT_ALLOCATION_FAILURE;
 
-  chunk = alloc_buffer_from_region(&data->AllocRegion, mem_obj->size);
+  chunk = pocl_alloc_buffer_from_region(&data->AllocRegion, mem_obj->size);
   if (chunk == NULL)
     return CL_MEM_OBJECT_ALLOCATION_FAILURE;
 
@@ -697,7 +697,8 @@ size_t scheduleNDRange(AccelData *data, _cl_command_run *run, size_t arg_size,
   }
   // Additional space for a signal
   size_t extraAlloc = sizeof(uint32_t);
-  chunk_info_t *chunk = alloc_buffer_from_region(&data->AllocRegion, arg_size + extraAlloc);
+  chunk_info_t *chunk =
+      pocl_alloc_buffer_from_region(&data->AllocRegion, arg_size + extraAlloc);
   assert(chunk && "Failed to allocate signal/argument buffer");
 
   POCL_MSG_PRINT_INFO("accel: allocated 0x%zx bytes for signal/arguments "
index a6fc67d081209052591bf094d00b33637745673e..0a063a66459c8b1ab47c0cdc8d6d5b5f63d765e8 100644 (file)
@@ -182,8 +182,8 @@ append_new_chunk (memory_region_t *region,
  *
  * @return The chunk, or NULL if no space available in the region.
  */
-chunk_info_t*
-alloc_buffer_from_region (memory_region_t *region, size_t size)
+chunk_info_t *
+pocl_alloc_buffer_from_region (memory_region_t *region, size_t size)
 {
 #ifdef ENABLE_ASSERTS
   assert (region != NULL);
@@ -258,7 +258,7 @@ alloc_buffer (memory_region_t *regions, size_t size)
   memory_region_t *region = NULL;
   LL_FOREACH(regions, region)
     {
-      chunk = alloc_buffer_from_region (region, size);
+      chunk = pocl_alloc_buffer_from_region (region, size);
       if (chunk != NULL)
         return chunk;
     }
index e22f3e4c1bb37c9687d1975bb675f90c35bfb6e2..6f70c9d921ce2b3694777ce810c0eb436f4452e1 100644 (file)
@@ -146,7 +146,9 @@ struct memory_region
   ba_lock_t lock;
 };
 
-chunk_info_t *alloc_buffer_from_region(memory_region_t *region, size_t size);
+POCL_EXPORT
+chunk_info_t *pocl_alloc_buffer_from_region (memory_region_t *region,
+                                             size_t size);
 chunk_info_t *alloc_buffer(memory_region_t *regions, size_t size);
 
 memory_region_t *free_buffer (memory_region_t *regions, memory_address_t addr);