86#include <glib/gstdio.h>
172 "[dt_opencl_get_device_info] could not query the actual size in bytes of info %d: %i\n",
param_name,
err);
181 "[dt_opencl_get_device_info] ERROR: no size returned, or zero size returned for data %d: %" G_GSIZE_FORMAT "\n",
193 "[dt_opencl_get_device_info] memory allocation failed! tried to allocate %" G_GSIZE_FORMAT " bytes for data %d: %i",
246 if(devid < 0)
return;
248 gchar buf[256] = { 0 };
296 if(devid < 0)
return FALSE;
311 safety_ok |= (wd > 1) && (wd < 513) && (ht > 1) && (ht < 513);
367 "[dt_opencl_read_device_config] '%s' had pinned memory transfer off from an older "
368 "configuration; enabling it, which is the default\n", cl->
dev[devid].
cname);
420 gchar
key[256] = { 0 };
433 gchar
key[256] = { 0 };
441 gboolean opencl_enabled =
enabled;
446 for(
int dev = 0; dev < cl->num_detected_devs; dev++)
450 opencl_enabled =
TRUE;
465 gchar
key[256] = { 0 };
478 gchar
key[256] = { 0 };
499 gchar
key[256] = { 0 };
511 gchar
key[256] = { 0 };
623 &host_unified_memory,
NULL);
805 "[opencl_init] disabling device %d `%s' (%s runtime, driver %s): the last %d"
806 " crashes happened inside this OpenCL runtime. Re-enable it in preferences once"
807 " the driver is updated; devices on other runtimes are unaffected.\n",
921 for(
int i = 0;
i < len;
i++)
927 for(
int i = 0;
i < len;
i++)
1004 const char *
clincludes[
DT_OPENCL_MAX_INCLUDES] = {
"rgb_norms.h",
"noise_generator.h",
"color_conversion.h",
"colorspaces.cl",
"colorspace.h",
"common.h",
"lensserious_eval.h",
NULL };
1026 if(
rd != 1)
continue;
1029 for(
size_t pos = 0; pos < end; pos++)
1033 for(
int l = pos - 1; l >= 0; l--)
1184 {
"RusticlOpenCL",
"rusticl",
"rusticl" },
1185 {
"libMesaOpenCL",
"Clover",
"clover" },
1186 {
"amdocl",
"AMD",
"amd" },
1187 {
"libigdfcl",
"Intel(R) OpenCL",
"intel" },
1188 {
"libigdrcl",
"Intel(R) OpenCL",
"intel" },
1189 {
"intelocl",
"Intel(R) OpenCL",
"intel" },
1190 {
"libnvidia-opencl",
"NVIDIA",
"nvidia" },
1191 {
"nvopencl",
"NVIDIA",
"nvidia" },
1202 const char *runtime =
NULL;
1217 snprintf(
key,
sizeof(
key),
"opencl_driver_crash_streak_%s", runtime);
1225 snprintf(
key,
sizeof(
key),
"opencl_driver_crash_streak_%s", runtime);
1285 for(
int l = 0; lines[l]; l++)
1287 if(lines[l][0] ==
'\0')
continue;
1374 "[opencl_init] no working opencl library found. Continue with opencl disabled\n");
1421 char profile[64] = { 0 };
1422 size_t profile_size;
1432 if(
strcmp(
"FULL_PROFILE", profile) != 0)
1525 cl->
inited ?
"" :
"NOT ");
1590 "successful and %d events lost. max event=%d%s\n",
1729 if(!cl->
inited || devid < 0)
return -1;
1737 while(*list != -1 && *list !=
value) list++;
1742 *list = *(list + 1);
1754 char tmp[2048] = { 0 };
1783 while(*in !=
'\0' && len <
maxlen - 1)
1785 int n =
strcspn(in,
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
1787 if(
n != 0)
continue;
1802 int *full =
malloc(
sizeof(
int) * (
devs + 1));
1822 for(
int i = 0;
i <
devs;
i++) full[
i] =
i;
1841 while(*
str ==
'!')
str++;
1848 for(
int i = 0;
i <
devs && full[
i] != -1;
i++)
1855 else if(*
str !=
'\0')
1866 if(number < 0 || (number == 0 &&
endptr ==
str)) number = -1;
1931 if(!cl->
inited)
return -1;
1967 const int usec = 5000;
1973 const int *
prio = priority;
1994 dt_print(
DT_DEBUG_OPENCL,
"[opencl_lock_device] reached opencl_mandatory_timeout trying to lock mandatory device, fallback to CPU\n");
2038 if(!cl->
inited)
return 1;
2046 if(!cl || !cl->
inited)
return 0;
2099 if(
fstat(fd, st) < 0)
2182 "[opencl_load_source] program number `%d' already in use when loading file `%s'!\n",
prog,
2202 char *end = start + 2048;
2205 cl_device_id devid = cl->
dev[dev].
devid;
2216 len =
g_strlcpy(start, options_md5, end - start);
2266 "[opencl_load_program] could not allocate %zu bytes for cached binary '%s'!\n",
2284 "[opencl_load_program] could not load cached binary program from file '%s' MD5: '%s'! (%i)\n",
2318 "[opencl_load_program] could not load cached binary program, trying to compile source\n");
2492 if(!cl->
inited)
return -1;
2496 for(
int dev = 0; dev < cl->
num_devs; dev++)
2538 for(
int dev = 0; dev < cl->
num_devs; dev++)
2549 if(!cl->
inited || dev < 0)
return -1;
2558 if(!cl->
inited || dev < 0)
return -1;
2577 if(!cl->
inited || dev < 0)
return -1;
2590 if(!cl->
inited || dev < 0)
return -1;
2602 const size_t *local)
2605 if(!cl->
inited || dev < 0)
return -1;
2638 const size_t origin[] = { 0, 0, 0 };
2656 const size_t origin[] = { 0, 0, 0 };
2685 const size_t origin[] = { 0, 0, 0 };
2702 const size_t origin[] = { 0, 0, 0 };
2732 size_t *
origin,
size_t *region,
size_t offset)
2744 size_t offset,
size_t *
origin,
size_t *region)
2799 "[opencl copy_host_to_device_constant] could not alloc buffer on device %d: %i\n", devid,
err);
2819 if(
bpp == 4 *
sizeof(
float))
2821 else if(
bpp ==
sizeof(
float))
2823 else if(
bpp ==
sizeof(uint16_t))
2834 "[opencl copy_host_to_device] could not alloc/copy img buffer on device %d: %i\n", devid,
err);
2879 size_t origin[3] = {0, 0, 0};
2907 const char *
const context)
2920 "[opencl %s] out of memory on device %d, flushing cached pinned buffers and retrying\n",
2978 "alloc_device_use_host_pointer");
2994 "[opencl alloc_device_buffer] out of memory on device %d, flushing cached pinned buffers and retrying\n",
3102 if(devid < 0)
return;
3157 if(!cl->
inited || devid < 0)
return;
3166 "[dt_opencl_check_tuning] use %" G_GSIZE_FORMAT " MiB on device `%s' id=%i\n",
3229 const size_t overhead,
size_t *
needed,
size_t *
limit)
3231 size_t n = 0, l = 0;
3235 if(!cl->
inited || devid < 0)
3254 "[opencl] trying to allocate %" PRIu64 " MiB of memory while the vRAM has %" PRIu64
3264 "[opencl] trying to allocate %" PRIu64 " MiB of memory while the vRAM has %" PRIu64
3277 const float factor,
const size_t overhead)
3381 if(!*eventlist || !*eventtags)
3404 (*eventtags)[*numevents - 1].tag[0] =
'\0';
3408 return (*eventlist) + *numevents - 1;
3412 if((*numevents - *eventsconsolidated + 1 > cl->
dev[devid].
event_handles) || (*numevents == *maxevents))
3416 if(*numevents == *maxevents)
3447 (*eventtags)[*numevents - 1].tag[0] =
'\0';
3451 *maxeventslot =
MAX(*maxeventslot, *numevents - 1);
3452 return (*eventlist) + *numevents - 1;
3460 if(!cl->
inited || devid < 0)
return;
3471 if(
IS_NULL_PTR(*eventlist) || *numevents == 0)
return;
3478 for(
int k = *eventsconsolidated;
k < *numevents;
k++)
3486 *eventsconsolidated = 0;
3498 if(!cl->
inited || devid < 0)
return;
3508 if(
IS_NULL_PTR(*eventlist) || *numevents == 0)
return;
3518 if(*numevents == *eventsconsolidated)
return;
3520 assert(*numevents > *eventsconsolidated);
3533 for(
int k = *eventsconsolidated;
k < *numevents;
k++)
3575 for(
int k = *eventsconsolidated;
k < *numevents;
k++)
3585 (*eventsconsolidated)++;
3590 char *tag = (*eventtags)[
k].tag;
3591 cl_int *retval = &((*eventtags)[
k].retval);
3595 sizeof(cl_int), retval,
NULL);
3599 tag[0] ==
'\0' ?
"<?>" : tag,
err);
3604 tag[0] ==
'\0' ?
"<?>" : tag, *retval ==
CL_COMPLETE ?
"was successful" :
"failed", *retval);
3618 sizeof(cl_ulong), &end,
NULL);
3621 (*eventtags)[
k].timelapsed = end - start;
3625 (*eventtags)[
k].timelapsed = 0;
3630 (*eventtags)[
k].timelapsed = 0;
3634 (*eventsconsolidated)++;
3637 cl_int result = *summary;
3658 if(!cl->
inited || devid < 0)
return;
3670 char **
tags =
malloc(
sizeof(
char *) * (*eventsconsolidated + 1));
3671 float *
timings =
malloc(
sizeof(
float) * (*eventsconsolidated + 1));
3677 for(
int k = 0;
k < *eventsconsolidated;
k++)
3718 "[opencl_profiling] profiling device %d ('%s'):\n", devid, cl->
dev[devid].
name);
3735 "[opencl_profiling] spent %7.4f seconds totally in command queue (with %d event%s missing)\n",
3736 (
double)total, *lostevents, *lostevents == 1 ?
"" :
"s");
3764 int *blocksizex = &
factors->sizex;
3765 int *blocksizey = &
factors->sizey;
3780 if(*blocksizex == 1 && *blocksizey == 1)
return FALSE;
3782 if(*blocksizex > *blocksizey)
3790 dt_print(
DT_DEBUG_OPENCL,
"[dt_opencl_local_buffer_opt] can not identify resource limits for device %d\n", devid);
static void error(char *msg)
void dt_bilateral_init_cl_global(void)
void dt_bilateral_free_cl_global(void)
void dt_develop_blend_free_cl_global(void)
void dt_develop_blend_init_cl_global(void)
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
void dt_colorspaces_init_cl_global(void)
Compile the colorspace kernels. Called once by common/opencl.c at device init.
void dt_colorspaces_free_cl_global(void)
Release the kernels and the struct from dt_colorspaces_init_cl_global(). NULL-safe.
const dt_colormatrix_t dt_aligned_pixel_t out
void dt_conf_set_bool(const char *name, int val)
int dt_conf_get_bool(const char *name)
int dt_conf_key_exists(const char *key)
Does key have a value?
gchar * dt_conf_get_string(const char *name)
Read the stored string for name as a private copy.
void dt_conf_set_int(const char *name, int val)
int dt_conf_get_int(const char *name)
Integer for name, clamped to the bounds declared in the XML.
int64_t dt_conf_get_int64(const char *name)
64-bit integer for name, clamped to its declared bounds.
void dt_conf_set_string(const char *name, const char *val)
const char * dt_conf_get_string_const(const char *name)
Borrow the stored string for name without copying it.
void dt_conf_save(dt_conf_t *cf)
Write cf back to its file. Overridden keys keep their stored value.
gboolean dt_conf_key_not_empty(const char *name)
void reset(dt_view_t *self)
size_t dt_get_system_available_mem(void)
void dt_capabilities_remove(char *capability)
void dt_capabilities_add(char *capability)
dt_dlopencl_t * dt_dlopencl_init(const char *name)
GtkWidget * preview
what the selected row actually captures
gboolean enabled
–doc was passed on the command line
static int dt_pthread_mutex_BAD_lock(dt_pthread_mutex_t *mutex)
static int dt_pthread_mutex_BAD_trylock(dt_pthread_mutex_t *mutex)
static int dt_pthread_mutex_BAD_unlock(dt_pthread_mutex_t *mutex)
static int dt_pthread_mutex_unlock(dt_pthread_mutex_t *mutex) RELEASE(mutex) NO_THREAD_SAFETY_ANALYSIS
static int dt_pthread_mutex_init(dt_pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr)
Initialise a mutex. With mutexattr NULL – which is how 54 of the 56 call sites in this tree spell it ...
static int dt_pthread_mutex_destroy(dt_pthread_mutex_t *mutex)
static int dt_pthread_mutex_lock(dt_pthread_mutex_t *mutex) ACQUIRE(mutex) NO_THREAD_SAFETY_ANALYSIS
void dt_dwt_init_cl_global(void)
void dt_dwt_free_cl_global(void)
void dt_loc_get_user_cache_dir(char *cachedir, size_t bufsize)
void dt_loc_get_kerneldir(char *kerneldir, size_t bufsize)
const dt_collection_sort_t items[]
void dt_gaussian_free_cl_global(void)
void dt_gaussian_init_cl_global(void)
void dt_guided_filter_init_cl_global(void)
void dt_guided_filter_free_cl_global(void)
void dt_heal_free_cl_global(void)
void dt_heal_init_cl_global(void)
void dt_iop_nap(int32_t usec)
void dt_interpolation_free_cl_global(void)
void dt_interpolation_init_cl_global(void)
static float kernel(const float *x, const float *y)
void dt_local_laplacian_init_cl_global(void)
void dt_local_laplacian_free_cl_global(void)
_lib_location_type_t type
int32_t dt_get_debug_flags(void)
void void dt_print_nts(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
dt_print() without the timestamp prefix (nts = no time stamp).
void dt_print(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
Print to stdout when thread is enabled, prefixed with seconds since startup.
void void void dt_vprint(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
dt_print() that additionally requires DT_DEBUG_VERBOSE to be enabled, i.e. both -d <channel> and -d v...
float *const restrict const size_t k
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
dt_mipmap_buffer_dsc_flags flags
static int dt_nvidia_gpu_supports_sm_20(const char *model)
cl_ulong dt_opencl_get_device_available(const int devid)
int dt_opencl_get_kernel_work_group_size(const int dev, const int kernel, size_t *kernelworkgroupsize)
cl_event * dt_opencl_events_get_slot(const int devid, const char *tag)
static void * _dt_opencl_alloc_image2d(const int devid, const int width, const int height, const size_t bytes, const cl_mem_flags flags, const cl_image_format fmt, void *host, const char *const context)
int dt_opencl_local_buffer_opt(const int devid, const int kernel, dt_opencl_local_buffer_t *factors)
int dt_opencl_enqueue_kernel_2d(const int dev, const int kernel, const size_t *sizes)
static void dt_opencl_update_priorities()
void * dt_opencl_alloc_device_buffer(const int devid, const size_t size)
const char * dt_opencl_get_device_name(const int devid)
Human-readable device name, owned by the OpenCL module.
dt_opencl_fit_reason_t dt_opencl_image_fits_device_reason(const int devid, const size_t width, const size_t height, const unsigned bpp, const float factor, const size_t overhead, size_t *needed, size_t *limit)
int dt_opencl_read_host_from_device_rowpitch(const int devid, void *host, void *device, const int width, const int height, const int rowpitch)
void * dt_opencl_alloc_device_use_host_pointer(const int devid, const int width, const int height, const int bpp, void *host, const int flags)
size_t dt_opencl_get_mem_object_size(cl_mem mem)
gboolean dt_opencl_is_pinned_memory(cl_mem mem)
static char * _ascii_str_canonical(const char *in, char *out, int maxlen)
int dt_opencl_enqueue_copy_buffer_to_image(const int devid, cl_mem src_buffer, cl_mem dst_image, size_t offset, size_t *origin, size_t *region)
void dt_opencl_events_reset(const int devid)
cl_int dt_opencl_events_flush(const int devid, const int reset)
void dt_opencl_note_crash_backtrace(const char *backtrace, size_t backtrace_len)
Tell the OpenCL module that the process crashed, and let it judge whether the crash was its driver's ...
int dt_opencl_copy_device_to_host(const int devid, void *host, void *device, const int width, const int height, const int bpp)
gboolean dt_opencl_read_device_config(const int devid)
void dt_opencl_check_tuning(const int devid)
void * dt_opencl_alloc_device(const int devid, const int width, const int height, const int bpp)
int dt_opencl_is_inited(void)
int dt_opencl_create_kernel(const int prog, const char *name)
void * dt_opencl_copy_host_to_device_constant(const int devid, const size_t size, void *host)
int dt_opencl_dev_roundup_height(int size, const int devid)
void * dt_opencl_copy_host_to_device_rowpitch(const int devid, void *host, const int width, const int height, const int bpp, const int rowpitch)
int dt_opencl_write_host_to_device_rowpitch(const int devid, void *host, void *device, const int width, const int height, const int rowpitch)
int dt_opencl_dev_roundup_width(int size, const int devid)
static const _gpu_runtime_t _gpu_runtimes[]
void dt_opencl_write_device_config(const int devid)
static void dt_opencl_set_synchronization_timeout(int value)
static int dt_opencl_device_init(dt_opencl_t *cl, const int dev, cl_device_id *devices, const int k)
void dt_opencl_cleanup(void)
static void _opencl_driver_crash_marker_path(char *buf, size_t buf_len)
int dt_opencl_get_mem_context_id(cl_mem mem)
int dt_opencl_write_host_to_device_non_blocking(const int devid, void *host, void *device, const int width, const int height, const int bpp)
int dt_opencl_load_program(const int dev, const int prog, const char *filename, const char *binname, const char *cachedir, char *md5sum, char **includemd5, int *loaded_cached)
static char _driver_crash_marker[DT_PATH_MAX]
void * dt_opencl_map_buffer(const int devid, cl_mem buffer, const int blocking, const int flags, size_t offset, size_t size)
static void _gpu_runtime_set_crash_streak(const char *runtime, int value)
static void dt_opencl_apply_scheduling_profile()
static int _dt_opencl_get_conf_int(const gchar *key_device, const gchar *conf_name, gboolean *safety_ok)
int dt_opencl_report_pipe_error(void)
Record that a pipe run failed on OpenCL, and decide whether to give up on it.
int dt_opencl_get_image_height(cl_mem mem)
void dt_opencl_reserve_device_by_id(const int devid)
Reserve a device the caller has already identified, blocking until it is free.
int dt_opencl_read_host_from_device_rowpitch_non_blocking(const int devid, void *host, void *device, const int width, const int height, const int rowpitch)
int dt_opencl_write_buffer_to_device(const int devid, void *host, void *device, const size_t offset, const size_t size, const int blocking)
int dt_opencl_micro_nap(const int devid)
static cl_ulong _opencl_get_device_memalloc(const int devid)
int dt_opencl_enqueue_copy_image(const int devid, cl_mem src, cl_mem dst, size_t *orig_src, size_t *orig_dst, size_t *region)
static int _take_from_list(int *list, int value)
gboolean dt_opencl_get_device_max_image_size(const int devid, int *width, int *height)
Largest 2D image the device will accept, which is what bounds tile size.
int dt_opencl_set_detected_device_enabled(const int detected, const gboolean enabled)
static const char * _gpu_runtime_of_platform(const char *platform_name)
int dt_opencl_try_reserve_device_by_id(const int devid)
Reserve a device only if it is free right now.
int dt_opencl_read_buffer_from_device(const int devid, void *host, void *device, const size_t offset, const size_t size, const int blocking)
int dt_opencl_build_program(const int dev, const int prog, const char *binname, const char *cachedir, char *md5sum, int loaded_cached)
int dt_opencl_get_max_work_item_sizes(const int dev, size_t *sizes)
static void _opencl_fold_driver_crashes(void)
void dt_opencl_clear_driver_crash_streak(void)
int dt_opencl_enqueue_barrier(const int devid)
static FILE * fopen_stat(const char *filename, struct stat *st)
gboolean dt_opencl_image_fits_device(const int devid, const size_t width, const size_t height, const unsigned bpp, const float factor, const size_t overhead)
static void dt_opencl_cleanup_device(dt_opencl_t *cl, int i)
int dt_opencl_unmap_mem_object(const int devid, cl_mem mem_object, void *mapped_ptr)
int dt_opencl_read_host_from_device_raw(const int devid, void *host, void *device, const size_t *origin, const size_t *region, const int rowpitch, const int blocking)
gboolean dt_opencl_detected_device_pinned_memory(const int detected)
int dt_opencl_reserve_device_for_pipe(const int pipetype)
Reserve a device for a pipe run: choose a free one by the pipe's priority list and take its lock....
int dt_opencl_set_detected_device_headroom(const int detected, const size_t headroom)
int dt_opencl_is_enabled(void)
void dt_opencl_memory_statistics(int devid, cl_mem mem, size_t size, dt_opencl_memory_t action)
void dt_opencl_md5sum(const char **files, char **md5sums)
static int nextpow2(int n)
void dt_opencl_free_kernel(const int kernel)
gboolean dt_opencl_use_pinned_memory(const int devid)
int dt_opencl_get_image_width(cl_mem mem)
cl_ulong dt_opencl_get_device_memalloc(const int devid)
static dt_opencl_t * _opencl
static int _gpu_runtime_crash_streak(const char *runtime)
int dt_opencl_read_host_from_device_non_blocking(const int devid, void *host, void *device, const int width, const int height, const int bpp)
int dt_opencl_get_detected_device_count(void)
void * dt_opencl_map_image(const int devid, cl_mem buffer, const int blocking, const int flags, size_t width, size_t height, int bpp)
void * dt_opencl_alloc_device_buffer_with_flags(const int devid, const size_t size, const int flags, void *host_ptr)
int dt_opencl_write_host_to_device_rowpitch_non_blocking(const int devid, void *host, void *device, const int width, const int height, const int rowpitch)
static void dt_opencl_priority_parse(dt_opencl_t *cl, char *configstr, int *priority_list, int *mandatory)
int dt_opencl_set_kernel_arg(const int dev, const int kernel, const int num, const size_t size, const void *arg)
gboolean dt_opencl_finish(const int devid)
int dt_opencl_enqueue_copy_image_to_buffer(const int devid, cl_mem src_image, cl_mem dst_buffer, size_t *origin, size_t *region, size_t offset)
static void _opencl_splash_update_compile(const char *programname)
int dt_opencl_update_settings(void)
size_t dt_opencl_get_device_max_global_mem(const int devid)
Total device memory in bytes, or 0 for an out-of-range id.
void dt_opencl_events_wait_for(const int devid)
int dt_opencl_set_detected_device_pinned_memory(const int detected, const gboolean enabled)
int dt_opencl_read_host_from_device(const int devid, void *host, void *device, const int width, const int height, const int bpp)
void dt_opencl_events_profiling(const int devid, const int aggregated)
void dt_opencl_release_device(const int devid)
Release a device reserved by either reserve function.
int dt_opencl_get_work_group_limits(const int dev, size_t *sizes, size_t *workgroupsize, unsigned long *localmemsize)
int dt_opencl_enqueue_kernel_2d_with_local(const int dev, const int kernel, const size_t *sizes, const size_t *local)
cl_mem_flags dt_opencl_get_mem_flags(cl_mem mem)
int dt_opencl_enqueue_copy_buffer_to_buffer(const int devid, cl_mem src_buffer, cl_mem dst_buffer, size_t srcoffset, size_t dstoffset, size_t size)
static int dt_opencl_get_device_info(dt_opencl_t *cl, cl_device_id device, cl_device_info param_name, void **param_value, size_t *param_value_size)
const dt_opencl_detected_device_t * dt_opencl_get_detected_device(const int detected)
void * dt_opencl_copy_host_to_device(const int devid, void *host, const int width, const int height, const int bpp)
int dt_opencl_write_host_to_device_raw(const int devid, const void *host, void *device, const size_t *origin, const size_t *region, const int rowpitch, const int blocking)
size_t dt_opencl_detected_device_headroom(const int detected)
void dt_opencl_release_mem_object(cl_mem mem)
void dt_opencl_init(const gboolean exclude_opencl, const gboolean print_statistics)
static int _device_by_cname(const char *name)
int dt_opencl_get_image_element_size(cl_mem mem)
int dt_opencl_get_num_devices(void)
Number of usable OpenCL devices; 0 when OpenCL is unavailable.
gboolean dt_opencl_detected_device_enabled(const int detected)
static const char * dt_opencl_get_vendor_by_id(unsigned int id)
int dt_opencl_avoid_atomics(const int devid)
int dt_opencl_write_host_to_device(const int devid, void *host, void *device, const int width, const int height, const int bpp)
void dt_opencl_disable(void)
#define DT_OPENCL_MAX_INCLUDES
#define DT_OPENCL_EVENTLISTSIZE
#define DT_OPENCL_BPP_DECODE(bpp)
@ DT_OPENCL_PINNING_DISABLED
@ DT_OPENCL_FIT_ALLOC_LIMIT
@ DT_OPENCL_FIT_AVAILABLE
@ DT_OPENCL_FIT_DIMENSION
#define DT_OPENCL_DEFAULT_COMPILE
#define DT_OPENCL_DEFAULT_COMPILE_INTEL
#define DT_OPENCL_MAX_ERRORS
#define DT_OPENCL_BPP_IS_RGBA8(bpp)
#define DT_OPENCL_CBUFFSIZE
#define DT_OPENCL_EVENTNAMELENGTH
#define DT_OPENCL_VENDOR_INTEL
#define DT_OPENCL_MAX_PROGRAMS
#define DT_OPENCL_MAX_PLATFORMS
#define DT_OPENCL_DEFAULT_COMPILE_AMD
#define DT_OPENCL_DEFAULT_COMPILE_NVIDIA
#define DT_OPENCL_VENDOR_NVIDIA
#define DT_OPENCL_VENDOR_AMD
#define DT_OPENCL_MAX_KERNELS
static gboolean dt_opencl_check_driver_blacklist(const char *device_version)
#define DT_PATH_MAX
Buffer size for a filesystem path anywhere in Ansel.
void dt_concat_path_file(char destination[4096], const char path[4096], const char *const file)
Append a constant filename to a variable, stack-based, fixed-sized, directory, and add a / in-between...
@ DT_DEV_PIXELPIPE_THUMBNAIL
@ DT_DEV_PIXELPIPE_EXPORT
@ DT_DEV_PIXELPIPE_PREVIEW
void dt_dev_pixelpipe_cache_flush_clmem(const int devid)
Release cached OpenCL buffers for a single device.
Pixelpipe cache for storing intermediate results in the pixelpipe.
static const dt_aligned_pixel_simd_t value
void dt_startup_progress_report(const char *format,...)
unsigned __int64 uint64_t
const char *const char * platform
dt_clEnqueueReadImage_t dt_clEnqueueReadImage
dt_clGetEventInfo_t dt_clGetEventInfo
dt_clReleaseCommandQueue_t dt_clReleaseCommandQueue
dt_clEnqueueUnmapMemObject_t dt_clEnqueueUnmapMemObject
dt_clGetKernelInfo_t dt_clGetKernelInfo
dt_clGetEventProfilingInfo_t dt_clGetEventProfilingInfo
dt_clCreateCommandQueue_t dt_clCreateCommandQueue
dt_clCreateImage2D_t dt_clCreateImage2D
dt_clEnqueueCopyBuffer_t dt_clEnqueueCopyBuffer
dt_clGetPlatformInfo_t dt_clGetPlatformInfo
dt_clBuildProgram_t dt_clBuildProgram
dt_clEnqueueWriteBuffer_t dt_clEnqueueWriteBuffer
dt_clCreateContext_t dt_clCreateContext
dt_clGetDeviceIDs_t dt_clGetDeviceIDs
dt_clGetMemObjectInfo_t dt_clGetMemObjectInfo
dt_clEnqueueCopyImage_t dt_clEnqueueCopyImage
dt_clReleaseContext_t dt_clReleaseContext
dt_clFinish_t dt_clFinish
dt_clGetDeviceInfo_t dt_clGetDeviceInfo
dt_clEnqueueCopyImageToBuffer_t dt_clEnqueueCopyImageToBuffer
dt_clGetImageInfo_t dt_clGetImageInfo
dt_clCreateBuffer_t dt_clCreateBuffer
dt_clCreateProgramWithBinary_t dt_clCreateProgramWithBinary
dt_clReleaseKernel_t dt_clReleaseKernel
dt_clEnqueueWriteImage_t dt_clEnqueueWriteImage
dt_clSetKernelArg_t dt_clSetKernelArg
dt_clReleaseEvent_t dt_clReleaseEvent
dt_clEnqueueMapImage_t dt_clEnqueueMapImage
dt_clEnqueueBarrier_t dt_clEnqueueBarrier
dt_clGetPlatformIDs_t dt_clGetPlatformIDs
dt_clGetProgramInfo_t dt_clGetProgramInfo
dt_clGetKernelWorkGroupInfo_t dt_clGetKernelWorkGroupInfo
dt_clReleaseMemObject_t dt_clReleaseMemObject
dt_clGetProgramBuildInfo_t dt_clGetProgramBuildInfo
dt_clReleaseProgram_t dt_clReleaseProgram
dt_clEnqueueNDRangeKernel_t dt_clEnqueueNDRangeKernel
dt_clWaitForEvents_t dt_clWaitForEvents
dt_clEnqueueReadBuffer_t dt_clEnqueueReadBuffer
dt_clEnqueueCopyBufferToImage_t dt_clEnqueueCopyBufferToImage
dt_clEnqueueMapBuffer_t dt_clEnqueueMapBuffer
dt_clCreateKernel_t dt_clCreateKernel
dt_clCreateProgramWithSource_t dt_clCreateProgramWithSource
dt_dlopencl_symbols_t * symbols
gboolean host_unified_memory
cl_command_queue cmd_queue
dt_opencl_eventtag_t * eventtags
int opencl_synchronization_timeout
int * dev_priority_preview
int * dev_priority_export
dt_pthread_mutex_t mem_sizes_lock
dt_opencl_detected_device_t * detected_devs
int * dev_priority_thumbnail
static double dt_get_wtime(void)
gchar * dt_util_str_replace(const gchar *string, const gchar *pattern, const gchar *substitute)