From: Michal Babej Date: Wed, 8 Sep 2021 15:20:08 +0000 (+0300) Subject: [PATCH 16/90] Move pocl_cmd_max_grid_dim_width() outside HAVE_DLFCN_H X-Git-Tag: archive/raspbian/1.8-3+rpi1^2~84 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5e14d566f5918014d891c46eecf0f217a4a0a705;p=pocl.git [PATCH 16/90] Move pocl_cmd_max_grid_dim_width() outside HAVE_DLFCN_H 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 --- diff --git a/lib/CL/devices/common.c b/lib/CL/devices/common.c index af01402..4c49a5e 100644 --- a/lib/CL/devices/common.c +++ b/lib/CL/devices/common.c @@ -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 */