Skip to content

Commit a19a9f2

Browse files
Fix misleading OpenCL oversize buffer log
Fallback to non-const buffer should only be reported in DT_DEBUG_VERBOSE mode.
1 parent 65fe2e9 commit a19a9f2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/common/opencl.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of darktable,
3-
Copyright (C) 2010-2025 darktable developers.
3+
Copyright (C) 2010-2026 darktable developers.
44
55
darktable is free software: you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -3152,12 +3152,16 @@ void *dt_opencl_copy_host_to_device_constant(const int devid,
31523152
cl_mem dev = (darktable.opencl->dlocl->symbols->dt_clCreateBuffer)
31533153
(darktable.opencl->dev[devid].context, mode, size, host, &err);
31543154

3155-
if(err != CL_SUCCESS || oversize)
3155+
if(err != CL_SUCCESS)
31563156
dt_print(DT_DEBUG_OPENCL,
31573157
"[opencl copy_host_to_device_constant]"
3158-
" could not allocate %sbuffer on device '%s' id=%d: %s",
3159-
oversize ? "oversize " : "",
3158+
" could not allocate buffer on device '%s' id=%d: %s",
31603159
darktable.opencl->dev[devid].fullname, devid, cl_errstr(err));
3160+
if(oversize)
3161+
dt_print(DT_DEBUG_OPENCL | DT_DEBUG_VERBOSE,
3162+
"[opencl copy_host_to_device_constant]"
3163+
" fallback to non-const buffer on device '%s' id=%d",
3164+
darktable.opencl->dev[devid].fullname, devid);
31613165

31623166
dt_opencl_memory_statistics(devid, dev, OPENCL_MEMORY_ADD);
31633167

0 commit comments

Comments
 (0)