Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
opencl_drivers_blacklist.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2010 Henrik Andersson.
4 Copyright (C) 2010 Stuart Henderson.
5 Copyright (C) 2011-2012 johannes hanika.
6 Copyright (C) 2012 Richard Wonka.
7 Copyright (C) 2014, 2016 Tobias Ellinghaus.
8 Copyright (C) 2016 Roman Lebedev.
9 Copyright (C) 2019 Andy Dodd.
10 Copyright (C) 2019-2020 Pascal Obry.
11 Copyright (C) 2022 Hanno Schwalm.
12 Copyright (C) 2022 Martin Bařinka.
13 Copyright (C) 2023, 2025 Aurélien PIERRE.
14
15 darktable is free software: you can redistribute it and/or modify
16 it under the terms of the GNU General Public License as published by
17 the Free Software Foundation, either version 3 of the License, or
18 (at your option) any later version.
19
20 darktable is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with darktable. If not, see <http://www.gnu.org/licenses/>.
27*/
28
29#pragma once
30
31#include <string.h>
32
33// FIXME: in the future, we may want to also take DRIVER_VERSION into account
34static const gchar *bad_opencl_drivers[] =
35{
36 // clang-format off
37
38 "beignet",
39 "pocl",
40 NULL
41
42 // clang-format on
43};
44
45// returns TRUE if blacklisted
46static gboolean dt_opencl_check_driver_blacklist(const char *device_version)
47{
48 gchar *device = g_ascii_strdown(device_version, -1);
49
50 for(int i = 0; bad_opencl_drivers[i]; i++)
51 {
52 if(!g_strrstr(device, bad_opencl_drivers[i])) continue;
53
54 // oops, found in black list
55 dt_free(device);
56 return TRUE;
57 }
58
59 // did not find in the black list, guess it's ok.
60 dt_free(device);
61 return FALSE;
62}
63
64// clang-format off
65// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
66// vim: shiftwidth=2 expandtab tabstop=2 cindent
67// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
68// clang-format on
#define TRUE
Definition ashift_lsd.c:162
#define FALSE
Definition ashift_lsd.c:158
const float i
Definition colorspaces_inline_conversions.h:669
#define dt_free(ptr)
Definition darktable.h:380
static gboolean dt_opencl_check_driver_blacklist(const char *device_version)
Definition opencl_drivers_blacklist.h:46
static const gchar * bad_opencl_drivers[]
Definition opencl_drivers_blacklist.h:34