Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
opencl.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2010-2012, 2016 johannes hanika.
4 Copyright (C) 2010, 2020-2021 Pascal Obry.
5 Copyright (C) 2011 Henrik Andersson.
6 Copyright (C) 2011, 2013-2014, 2016 Tobias Ellinghaus.
7 Copyright (C) 2011-2017 Ulrich Pegelow.
8 Copyright (C) 2012 Michal Babej.
9 Copyright (C) 2012 Richard Wonka.
10 Copyright (C) 2013 Pascal de Bruijn.
11 Copyright (C) 2015, 2019 Dan Torop.
12 Copyright (C) 2016 Roman Lebedev.
13 Copyright (C) 2017-2019 Edgardo Hoszowski.
14 Copyright (C) 2017 luzpaz.
15 Copyright (C) 2019 Heiko Bauke.
16 Copyright (C) 2019 jakubfi.
17 Copyright (C) 2021-2022, 2025-2026 Aurélien PIERRE.
18 Copyright (C) 2021 Hubert Kowalski.
19 Copyright (C) 2022 Hanno Schwalm.
20 Copyright (C) 2022 Martin Bařinka.
21 Copyright (C) 2025 Alynx Zhou.
22 Copyright (C) 2025 Guillaume Stutin.
23
24 darktable is free software: you can redistribute it and/or modify
25 it under the terms of the GNU General Public License as published by
26 the Free Software Foundation, either version 3 of the License, or
27 (at your option) any later version.
28
29 darktable is distributed in the hope that it will be useful,
30 but WITHOUT ANY WARRANTY; without even the implied warranty of
31 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 GNU General Public License for more details.
33
34 You should have received a copy of the GNU General Public License
35 along with darktable. If not, see <http://www.gnu.org/licenses/>.
36*/
37
38#pragma once
39
40#ifdef HAVE_CONFIG_H
41#include "config.h"
42#endif
43
44#define DT_OPENCL_MAX_PLATFORMS 5
45#define DT_OPENCL_MAX_PROGRAMS 256
46#define DT_OPENCL_MAX_KERNELS 512
47#define DT_OPENCL_EVENTLISTSIZE 256
48#define DT_OPENCL_EVENTNAMELENGTH 64
49#define DT_OPENCL_MAX_ERRORS 5
50#define DT_OPENCL_MAX_INCLUDES 7
51#define DT_OPENCL_VENDOR_AMD 4098
52#define DT_OPENCL_VENDOR_NVIDIA 4318
53#define DT_OPENCL_VENDOR_INTEL 0x8086u
54#define DT_OPENCL_CBUFFSIZE 1024
55
56// some pseudo error codes in dt opencl usage
57#define DT_OPENCL_DEFAULT_ERROR -999
58#define DT_OPENCL_SYSMEM_ALLOCATION -998
59
60#include "common/darktable.h"
61
62#ifdef HAVE_OPENCL
63
64#include "common/dlopencl.h"
65#include "common/dtpthread.h"
66#include "common/iop_profile.h"
67#include "control/conf.h"
68
69// #pragma GCC diagnostic push
70// #pragma GCC diagnostic ignored "-Wcomment"
71#include <CL/cl.h>
72// #pragma GCC diagnostic
73
74#ifdef __cplusplus
75extern "C" {
76#endif
77
78#define ROUNDUP(a, n) ((a) % (n) == 0 ? (a) : ((a) / (n)+1) * (n))
79
80// use per device roundups here
81#define ROUNDUPDWD(a, b) dt_opencl_dev_roundup_width(a, b)
82#define ROUNDUPDHT(a, b) dt_opencl_dev_roundup_height(a, b)
83
84#define DT_OPENCL_BPP_TAG_RGBA8 (1u << 30)
85#define DT_OPENCL_BPP_ENCODE_RGBA8(bpp) ((int)((unsigned int)(bpp) | DT_OPENCL_BPP_TAG_RGBA8))
86#define DT_OPENCL_BPP_IS_RGBA8(bpp) ((((unsigned int)(bpp)) & DT_OPENCL_BPP_TAG_RGBA8) != 0u)
87#define DT_OPENCL_BPP_DECODE(bpp) ((int)(((unsigned int)(bpp)) & ~DT_OPENCL_BPP_TAG_RGBA8))
88
89#define DT_OPENCL_DEFAULT_COMPILE_INTEL ("-cl-fast-relaxed-math")
90#define DT_OPENCL_DEFAULT_COMPILE_AMD ("-cl-fast-relaxed-math")
91#define DT_OPENCL_DEFAULT_COMPILE_NVIDIA ("-cl-fast-relaxed-math")
92#define DT_OPENCL_DEFAULT_COMPILE ("-cl-fast-relaxed-math")
93#define DT_CLDEVICE_HEAD ("cldevice_v4")
94
95typedef enum dt_opencl_memory_t
96{
97 OPENCL_MEMORY_ADD,
98 OPENCL_MEMORY_SUB
99} dt_opencl_memory_t;
100
104typedef struct dt_opencl_eventtag_t
105{
106 cl_int retval;
107 cl_ulong timelapsed;
109} dt_opencl_eventtag_t;
110
111typedef enum dt_opencl_pinmode_t
112{
113 DT_OPENCL_PINNING_OFF = 0,
114 DT_OPENCL_PINNING_ON = 1,
115 DT_OPENCL_PINNING_DISABLED = 2
116} dt_opencl_pinmode_t;
117
122typedef struct dt_opencl_device_t
123{
124 dt_pthread_mutex_t lock;
125 cl_device_id devid;
126 cl_context context;
127 cl_command_queue cmd_queue;
128 size_t max_image_width;
129 size_t max_image_height;
130 cl_ulong max_mem_alloc;
131 cl_ulong max_global_mem;
132 cl_ulong used_global_mem;
133 cl_program program[DT_OPENCL_MAX_PROGRAMS];
134 cl_kernel kernel[DT_OPENCL_MAX_KERNELS];
135 int program_used[DT_OPENCL_MAX_PROGRAMS];
136 int kernel_used[DT_OPENCL_MAX_KERNELS];
137 cl_event *eventlist;
138 dt_opencl_eventtag_t *eventtags;
139 int numevents;
140 int eventsconsolidated;
141 int maxevents;
142 int lostevents;
143 int totalevents;
144 int totalsuccess;
145 int totallost;
146 int maxeventslot;
147 int nvidia_sm_20;
148 const char *vendor;
149 const char *name;
150 const char *cname;
151 const char *options;
152 const char *options_md5;
153 cl_int summary;
154 size_t memory_in_use;
155 size_t peak_memory;
156 size_t used_available;
157
158 // flags detected errors
159 int runtime_error;
160 // if set to TRUE darktable will not use OpenCL kernels which contain atomic operations (example bilateral).
161 // pixelpipe processing will be done on CPU for the affected modules.
162 // useful (only for very old devices) if your OpenCL implementation freezes/crashes on atomics or if
163 // they are processed with a bad performance.
164 int avoid_atomics;
165
166 // pause OpenCL processing for this number of microseconds from time to time
167 int micro_nap;
168
169 // During tiling huge amounts of memory need to be transferred between host and device.
170 // For some OpenCL implementations direct memory transfers give a drastic performance penalty,
171 // this can often be avoided by using indirect transfers via pinned memory,
172 // other devices have more efficient direct memory transfer implementations.
173 // We can't predict on solid grounds if a device belongs to the first or second group,
174 // also pinned mem transfer requires slightly more ram.
175 // this holds a bitmask defined by dt_opencl_pinmode_t
176 // the device specific conf key might hold
177 // 0 -> disabled by default; might be switched on by tune for performance
178 // 1 -> enabled by default
179 // 2 -> disabled under all circumstances. This could/should be used if we give away / ship specific keys for buggy systems
180 int pinned_memory;
181
182 // in OpenCL processing round width/height of global work groups to a multiple of these values.
183 // reasonable values are powers of 2. this parameter can have high impact on OpenCL performance.
184 int clroundup_wd;
185 int clroundup_ht;
186
187 // A bitfield that identifies the type of OpenCL device required to test for on-CPU and more.
188 unsigned int cltype;
189
190 // This defines how often should dt_opencl_events_get_slot do a dt_opencl_events_flush.
191 // It should definitely le lower than the number of events that can be handled by the device/driver.
192 // FIXME we should be able to test for that with using >= OpenCl 2.0
193 int event_handles;
194
195 // opencl_events enabled for the device, set internally via event_handles
196 int use_events;
197
198 // a device might be turned off by force by setting this value to 1
199 // also used for blacklisted drivers
200 int disabled;
201
202 // Some devices are known to be unused by other apps so there is no need to test for available memory at all.
203 // Also some devices might behave badly with the checking code, in this case we could enforce a headroom here.
204 size_t forced_headroom;
205} dt_opencl_device_t;
206
207struct dt_bilateral_cl_global_t;
208struct dt_local_laplacian_cl_global_t;
209struct dt_dwt_cl_global_t; // wavelet decompose
210struct dt_heal_cl_global_t; // healing
211struct dt_colorspaces_cl_global_t; // colorspaces transform
212struct dt_guided_filter_cl_global_t;
213
218typedef struct dt_opencl_t
219{
220 dt_pthread_mutex_t lock;
221 int inited;
222 int print_statistics;
223 int enabled;
224 int stopped;
225 int num_devs;
226 int error_count;
227 int opencl_synchronization_timeout;
228 uint32_t crc;
229 int mandatory[5];
230 int *dev_priority_image;
231 int *dev_priority_preview;
232 int *dev_priority_export;
233 int *dev_priority_thumbnail;
234 dt_opencl_device_t *dev;
235 dt_dlopencl_t *dlocl;
236
237 // global kernels for blending operations.
238 struct dt_blendop_cl_global_t *blendop;
239
240 // global kernels for bilateral filtering, to be reused by a few plugins.
241 struct dt_bilateral_cl_global_t *bilateral;
242
243 // global kernels for gaussian filtering, to be reused by a few plugins.
244 struct dt_gaussian_cl_global_t *gaussian;
245
246 // global kernels for interpolation resampling.
247 struct dt_interpolation_cl_global_t *interpolation;
248
249 // global kernels for local laplacian filter.
250 struct dt_local_laplacian_cl_global_t *local_laplacian;
251
252 // global kernels for dwt filter.
253 struct dt_dwt_cl_global_t *dwt;
254
255 // global kernels for heal filter.
256 struct dt_heal_cl_global_t *heal;
257
258 // global kernels for colorspaces filter.
259 struct dt_colorspaces_cl_global_t *colorspaces;
260
261 // global kernels for guided filter.
262 struct dt_guided_filter_cl_global_t *guided_filter;
264
268typedef struct dt_opencl_local_buffer_t
269{
270 const int xoffset;
271 const int xfactor;
272 const int yoffset;
273 const int yfactor;
274 const size_t cellsize;
275 const size_t overhead;
276 int sizex; // initial value and final values after optimization
277 int sizey; // initial value and final values after optimization
278} dt_opencl_local_buffer_t;
279
283int dt_opencl_get_device_info(dt_opencl_t *cl, cl_device_id device, cl_device_info param_name, void **param_value,
284 size_t *param_value_size);
285
287void dt_opencl_init(dt_opencl_t *cl, const gboolean exclude_opencl, const gboolean print_statistics);
288
291
293void dt_opencl_cleanup_device(dt_opencl_t *cl, int i);
294
297int dt_opencl_finish(const int devid);
298
300int dt_opencl_enqueue_barrier(const int devid);
301
303int dt_opencl_lock_device(const int pipetype);
304
306void dt_opencl_unlock_device(const int dev);
307
309void dt_opencl_md5sum(const char **files, char **md5sums);
310
312int dt_opencl_load_program(const int dev, const int prog, const char *filename, const char *binname,
313 const char *cachedir, char *md5sum, char **includemd5, int *loaded_cached);
314
316int dt_opencl_build_program(const int dev, const int prog, const char *binname, const char *cachedir,
317 char *md5sum, int loaded_cached);
318
320int dt_opencl_create_kernel(const int program, const char *name);
321
323void dt_opencl_free_kernel(const int kernel);
324
326int dt_opencl_get_max_work_item_sizes(const int dev, size_t *sizes);
327
329int dt_opencl_get_work_group_limits(const int dev, size_t *sizes, size_t *workgroupsize,
330 unsigned long *localmemsize);
331
333int dt_opencl_get_kernel_work_group_size(const int dev, const int kernel, size_t *kernelworkgroupsize);
334
336int dt_opencl_set_kernel_arg(const int dev, const int kernel, const int num, const size_t size,
337 const void *arg);
338
340int dt_opencl_enqueue_kernel_2d(const int dev, const int kernel, const size_t *sizes);
341
343int dt_opencl_enqueue_kernel_2d_with_local(const int dev, const int kernel, const size_t *sizes,
344 const size_t *local);
345
347int dt_opencl_is_inited(void);
348
350int dt_opencl_is_enabled(void);
351
353void dt_opencl_disable(void);
354
357
359int dt_opencl_copy_device_to_host(const int devid, void *host, void *device, const int width,
360 const int height, const int bpp);
361
362int dt_opencl_read_host_from_device(const int devid, void *host, void *device, const int width,
363 const int height, const int bpp);
364
365int dt_opencl_read_host_from_device_rowpitch(const int devid, void *host, void *device, const int width,
366 const int height, const int rowpitch);
367
368int dt_opencl_read_host_from_device_non_blocking(const int devid, void *host, void *device, const int width,
369 const int height, const int bpp);
370
371int dt_opencl_read_host_from_device_rowpitch_non_blocking(const int devid, void *host, void *device,
372 const int width, const int height,
373 const int rowpitch);
374
375int dt_opencl_read_host_from_device_raw(const int devid, void *host, void *device, const size_t *origin,
376 const size_t *region, const int rowpitch, const int blocking);
377
378int dt_opencl_write_host_to_device(const int devid, void *host, void *device, const int width,
379 const int height, const int bpp);
380
381int dt_opencl_write_host_to_device_rowpitch(const int devid, void *host, void *device, const int width,
382 const int height, const int rowpitch);
383
384int dt_opencl_write_host_to_device_non_blocking(const int devid, void *host, void *device, const int width,
385 const int height, const int bpp);
386
387int dt_opencl_write_host_to_device_rowpitch_non_blocking(const int devid, void *host, void *device,
388 const int width, const int height,
389 const int rowpitch);
390
391int dt_opencl_write_host_to_device_raw(const int devid, void *host, void *device, const size_t *origin,
392 const size_t *region, const int rowpitch, const int blocking);
393
394void *dt_opencl_copy_host_to_device(const int devid, void *host, const int width, const int height,
395 const int bpp);
396
397void *dt_opencl_copy_host_to_device_rowpitch(const int devid, void *host, const int width, const int height,
398 const int bpp, const int rowpitch);
399
400void *dt_opencl_copy_host_to_device_constant(const int devid, const size_t size, void *host);
401
402int dt_opencl_enqueue_copy_image(const int devid, cl_mem src, cl_mem dst, size_t *orig_src, size_t *orig_dst,
403 size_t *region);
404
405void *dt_opencl_alloc_device(const int devid, const int width, const int height, const int bpp);
406
407void *dt_opencl_alloc_device_use_host_pointer(const int devid, const int width, const int height,
408 const int bpp, void *host, const int flags);
409
410int dt_opencl_enqueue_copy_image_to_buffer(const int devid, cl_mem src_image, cl_mem dst_buffer,
411 size_t *origin, size_t *region, size_t offset);
412
413int dt_opencl_enqueue_copy_buffer_to_image(const int devid, cl_mem src_buffer, cl_mem dst_image,
414 size_t offset, size_t *origin, size_t *region);
415
416int dt_opencl_enqueue_copy_buffer_to_buffer(const int devid, cl_mem src_buffer, cl_mem dst_buffer,
417 size_t srcoffset, size_t dstoffset, size_t size);
418
419int dt_opencl_read_buffer_from_device(const int devid, void *host, void *device, const size_t offset,
420 const size_t size, const int blocking);
421
422int dt_opencl_write_buffer_to_device(const int devid, void *host, void *device, const size_t offset,
423 const size_t size, const int blocking);
424
425void *dt_opencl_alloc_device_buffer(const int devid, const size_t size);
426
427void *dt_opencl_alloc_device_buffer_with_flags(const int devid, const size_t size, const int flags);
428
429void dt_opencl_release_mem_object(cl_mem mem);
430
431void *dt_opencl_map_buffer(const int devid, cl_mem buffer, const int blocking, const int flags, size_t offset,
432 size_t size);
433
434void *dt_opencl_map_image(const int devid, cl_mem buffer, const int blocking, const int flags, size_t width, size_t height, int bpp);
435
436int dt_opencl_unmap_mem_object(const int devid, cl_mem mem_object, void *mapped_ptr);
437
438size_t dt_opencl_get_mem_object_size(cl_mem mem);
439
440int dt_opencl_get_image_width(cl_mem mem);
441
442int dt_opencl_get_image_height(cl_mem mem);
443
444int dt_opencl_get_image_element_size(cl_mem mem);
445
446int dt_opencl_get_mem_context_id(cl_mem mem);
447cl_mem_flags dt_opencl_get_mem_flags(cl_mem mem);
448
449void dt_opencl_memory_statistics(int devid, cl_mem mem, dt_opencl_memory_t action);
450
452gboolean dt_opencl_image_fits_device(const int devid, const size_t width, const size_t height, const unsigned bpp,
453 const float factor, const size_t overhead);
455cl_ulong dt_opencl_get_device_available(const int devid);
456
458void dt_opencl_check_tuning(const int devid);
459
461cl_ulong dt_opencl_get_device_memalloc(const int devid);
462
464int dt_opencl_dev_roundup_width(int size, const int devid);
465int dt_opencl_dev_roundup_height(int size, const int devid);
466
468cl_event *dt_opencl_events_get_slot(const int devid, const char *tag);
469
471void dt_opencl_events_reset(const int devid);
472
475void dt_opencl_events_wait_for(const int devid);
476
479cl_int dt_opencl_events_flush(const int devid, const int reset);
480
482void dt_opencl_events_profiling(const int devid, const int aggregated);
483
485int dt_opencl_local_buffer_opt(const int devid, const int kernel, dt_opencl_local_buffer_t *factors);
486
488void dt_opencl_write_device_config(const int devid);
489gboolean dt_opencl_read_device_config(const int devid);
490int dt_opencl_avoid_atomics(const int devid);
491int dt_opencl_micro_nap(const int devid);
492gboolean dt_opencl_use_pinned_memory(const int devid);
493
494#ifdef __cplusplus
495}
496#endif
497
498#else
499
500#include "control/conf.h"
501#include <stdlib.h>
502
503#ifdef __cplusplus
504extern "C" {
505#endif
506
514static inline void dt_opencl_init(dt_opencl_t *cl, const gboolean exclude_opencl, const gboolean print_statistics)
515{
516 cl->inited = 0;
517 cl->enabled = 0;
518 cl->stopped = 0;
519 cl->error_count = 0;
520 dt_conf_set_bool("opencl", FALSE);
521 dt_print(DT_DEBUG_OPENCL, "[opencl_init] this version of darktable was built without opencl support\n");
522}
523static inline void dt_opencl_cleanup(dt_opencl_t *cl)
524{
525}
526static inline gboolean dt_opencl_finish(const int devid)
527{
528 return -1;
529}
530static inline int dt_opencl_enqueue_barrier(const int devid)
531{
532 return -1;
533}
534static inline int dt_opencl_lock_device(const int dev)
535{
536 return -1;
537}
538static inline void dt_opencl_unlock_device(const int dev)
539{
540}
541static inline int dt_opencl_load_program(const int dev, const char *filename)
542{
543 return -1;
544}
545static inline int dt_opencl_build_program(const int dev, const int program)
546{
547 return -1;
548}
549static inline int dt_opencl_create_kernel(const int program, const char *name)
550{
551 return -1;
552}
553static inline void dt_opencl_free_kernel(const int kernel)
554{
555}
556static inline int dt_opencl_get_max_work_item_sizes(const int dev, size_t *sizes)
557{
558 return -1;
559}
560static inline int dt_opencl_get_work_group_limits(const int dev, size_t *sizes, size_t *workgroupsize,
561 unsigned long *localmemsize)
562{
563 return -1;
564}
565static inline int dt_opencl_get_kernel_work_group_size(const int dev, const int kernel,
566 size_t *kernelworkgroupsize)
567{
568 return -1;
569}
570static inline int dt_opencl_set_kernel_arg(const int dev, const int kernel, const size_t size, const void *arg)
571{
572 return -1;
573}
574static inline int dt_opencl_enqueue_kernel_2d(const int dev, const int kernel, const size_t *sizes)
575{
576 return -1;
577}
578static inline int dt_opencl_enqueue_kernel_2d_with_local(const int dev, const int kernel, const size_t *sizes,
579 const size_t *local)
580{
581 return -1;
582}
583static inline int dt_opencl_is_inited(void)
584{
585 return 0;
586}
587static inline int dt_opencl_is_enabled(void)
588{
589 return 0;
590}
591static inline void dt_opencl_disable(void)
592{
593}
594static inline int dt_opencl_update_settings(void)
595{
596 return 0;
597}
598static inline gboolean dt_opencl_image_fits_device(const int devid, const size_t width, const size_t height,
599 const unsigned bpp, const float factor, const size_t overhead)
600{
601 return FALSE;
602}
603static inline size_t dt_opencl_get_device_available(const int devid)
604{
605 return 0;
606}
607static inline void dt_opencl_check_tuning(const int devid)
608{
609 return;
610}
611static inline size_t dt_opencl_get_device_memalloc(const int devid)
612{
613 return 0;
614}
615static inline unsigned long dt_opencl_get_mem_flags(void *mem)
616{
617 return 0;
618}
619static inline void dt_opencl_release_mem_object(void *mem)
620{
621}
622static inline void *dt_opencl_events_get_slot(const int devid, const char *tag)
623{
624 return NULL;
625}
626static inline void dt_opencl_events_reset(const int devid)
627{
628}
629static inline void dt_opencl_events_wait_for(const int devid)
630{
631}
632static inline int dt_opencl_events_flush(const int devid, const int reset)
633{
634 return 0;
635}
636static inline void dt_opencl_events_profiling(const int devid, const int aggregated)
637{
638}
639
640#ifdef __cplusplus
641}
642#endif
643
644#endif
645
646// clang-format off
647// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
648// vim: shiftwidth=2 expandtab tabstop=2 cindent
649// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
650// clang-format on
#define FALSE
Definition ashift_lsd.c:158
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
static float kernel(const float *x, const float *y)
Definition colorchecker.c:469
const float i
Definition colorspaces_inline_conversions.h:669
const float factors[2]
Definition colorspaces_inline_conversions.h:1579
char * name
Definition common/metadata.c:61
void dt_conf_set_bool(const char *name, int val)
Definition control/conf.c:158
void reset(dt_view_t *self)
Definition darkroom.c:1102
void dt_print(dt_debug_thread_t thread, const char *msg,...)
Definition darktable.c:1530
@ DT_DEBUG_OPENCL
Definition darktable.h:642
static float gaussian(float x, float std)
Definition filmic.c:401
int guided_filter(const float *const guide, const float *const in, float *const out, const int width, const int height, const int ch, const int w, const float sqrt_eps, const float guide_weight, const float min, const float max)
Definition guided_filter.c:360
int bpp
Definition imageio/format/pdf.c:88
int local_laplacian(const float *const input, float *const out, const int wd, const int ht, const float sigma, const float shadows, const float highlights, const float clarity, local_laplacian_boundary_t *b)
Definition locallaplacian.h:69
size_t size
Definition mipmap_cache.c:3
dt_mipmap_buffer_dsc_flags flags
Definition mipmap_cache.c:4
static int dt_opencl_enqueue_kernel_2d(const int dev, const int kernel, const size_t *sizes)
Definition opencl.h:574
static int dt_opencl_is_enabled(void)
Definition opencl.h:587
static unsigned long dt_opencl_get_mem_flags(void *mem)
Definition opencl.h:615
static int dt_opencl_get_kernel_work_group_size(const int dev, const int kernel, size_t *kernelworkgroupsize)
Definition opencl.h:565
static size_t dt_opencl_get_device_available(const int devid)
Definition opencl.h:603
static int dt_opencl_set_kernel_arg(const int dev, const int kernel, const size_t size, const void *arg)
Definition opencl.h:570
static void dt_opencl_events_profiling(const int devid, const int aggregated)
Definition opencl.h:636
static size_t dt_opencl_get_device_memalloc(const int devid)
Definition opencl.h:611
static void * dt_opencl_events_get_slot(const int devid, const char *tag)
Definition opencl.h:622
static int dt_opencl_create_kernel(const int program, const char *name)
Definition opencl.h:549
static int dt_opencl_build_program(const int dev, const int program)
Definition opencl.h:545
static void dt_opencl_events_reset(const int devid)
Definition opencl.h:626
static void dt_opencl_unlock_device(const int dev)
Definition opencl.h:538
static int dt_opencl_update_settings(void)
Definition opencl.h:594
static void dt_opencl_check_tuning(const int devid)
Definition opencl.h:607
static int dt_opencl_is_inited(void)
Definition opencl.h:583
static int dt_opencl_lock_device(const int dev)
Definition opencl.h:534
static int dt_opencl_events_flush(const int devid, const int reset)
Definition opencl.h:632
static int dt_opencl_get_max_work_item_sizes(const int dev, size_t *sizes)
Definition opencl.h:556
static 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)
Definition opencl.h:598
static gboolean dt_opencl_finish(const int devid)
Definition opencl.h:526
#define DT_OPENCL_EVENTNAMELENGTH
Definition opencl.h:48
static void dt_opencl_free_kernel(const int kernel)
Definition opencl.h:553
static int dt_opencl_enqueue_barrier(const int devid)
Definition opencl.h:530
static int dt_opencl_get_work_group_limits(const int dev, size_t *sizes, size_t *workgroupsize, unsigned long *localmemsize)
Definition opencl.h:560
static void dt_opencl_release_mem_object(void *mem)
Definition opencl.h:619
#define DT_OPENCL_MAX_PROGRAMS
Definition opencl.h:45
static void dt_opencl_init(dt_opencl_t *cl, const gboolean exclude_opencl, const gboolean print_statistics)
Definition opencl.h:514
static void dt_opencl_disable(void)
Definition opencl.h:591
static void dt_opencl_events_wait_for(const int devid)
Definition opencl.h:629
static int dt_opencl_load_program(const int dev, const char *filename)
Definition opencl.h:541
static void dt_opencl_cleanup(dt_opencl_t *cl)
Definition opencl.h:523
static int dt_opencl_enqueue_kernel_2d_with_local(const int dev, const int kernel, const size_t *sizes, const size_t *local)
Definition opencl.h:578
#define DT_OPENCL_MAX_KERNELS
Definition opencl.h:46
const float factor
Definition pdf.h:90
Definition blend.h:241
Definition opencl.h:508
int error_count
Definition opencl.h:512
int stopped
Definition opencl.h:511
int enabled
Definition opencl.h:510
int inited
Definition opencl.h:509
Definition ansel-curve-tool.c:523