[PATCH 16/90] Move pocl_cmd_max_grid_dim_width() outside HAVE_DLFCN_H
authorMichal Babej <michal.babej@tuni.fi>
Wed, 8 Sep 2021 15:20:08 +0000 (18:20 +0300)
committerAndreas Beckmann <anbe@debian.org>
Fri, 7 Jan 2022 23:55:22 +0000 (23:55 +0000)
some build configs that don't use dlopen() require it

Gbp-Pq: Name 0016-Move-pocl_cmd_max_grid_dim_width-outside-HAVE_DLFCN_.patch

lib/CL/devices/common.c

index af014026d40d31249ccb01a1870e1fbee2f7b29c..4c49a5e35e3e99b8e91bb1eda68b5a6520eb7d52 100644 (file)
@@ -778,6 +778,17 @@ pocl_fill_dev_sampler_t (dev_sampler_t *ds, struct pocl_argument *parg)
   }
 }
 
+/* Returns the width of the widest dimension in the grid of the given
+   run command. */
+size_t
+pocl_cmd_max_grid_dim_width (_cl_command_run *cmd)
+{
+  return max (max (cmd->pc.local_size[0] * cmd->pc.num_groups[0],
+                   cmd->pc.local_size[1] * cmd->pc.num_groups[1]),
+              cmd->pc.local_size[2] * cmd->pc.local_size[2]);
+}
+
+
 /* CPU driver stuff */
 
 #ifdef HAVE_DLFCN_H
@@ -956,15 +967,6 @@ pocl_check_kernel_disk_cache (_cl_command_node *command, int specialized)
   return module_fn;
 }
 
-/* Returns the width of the widest dimension in the grid of the given
-   run command. */
-size_t
-pocl_cmd_max_grid_dim_width (_cl_command_run *cmd)
-{
-  return max (max (cmd->pc.local_size[0] * cmd->pc.num_groups[0],
-                   cmd->pc.local_size[1] * cmd->pc.num_groups[1]),
-              cmd->pc.local_size[2] * cmd->pc.local_size[2]);
-}
 
 /* Look for a dlhandle in the dlhandle cache for the given kernel command.
    If found, push the handle up in the cache to improve cache hit speed,
@@ -1084,6 +1086,7 @@ pocl_check_kernel_dlhandle_cache (_cl_command_node *command,
 
 #endif
 
+
 #define MIN_MAX_MEM_ALLOC_SIZE (128*1024*1024)
 
 /* accounting object for the main memory */