blob: ad3ef4816288026b84a28cae60509a8dbf082386 [file] [log] [blame]
cristydbba8212013-07-19 14:53:50 +00001/*
cristyb56bb242014-11-25 17:12:48 +00002 Copyright 1999-2015 ImageMagick Studio LLC, a non-profit organization
cristydbba8212013-07-19 14:53:50 +00003 dedicated to making software imaging solutions freely available.
4
5 You may not use this file except in compliance with the License.
6 obtain a copy of the License at
7
8 http://www.imagemagick.org/script/license.php
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16 MagickCore OpenCL public methods.
17*/
18#ifndef _MAGICKCORE_OPENCL_H
19#define _MAGICKCORE_OPENCL_H
20
cristyf034abb2013-11-24 14:16:14 +000021
cristydbba8212013-07-19 14:53:50 +000022#if defined(__cplusplus) || defined(c_plusplus)
23extern "C" {
24#endif
25
cristyf034abb2013-11-24 14:16:14 +000026/* OpenCL program modules */
27typedef enum {
28 MAGICK_OPENCL_ACCELERATE = 0
29 ,MAGICK_OPENCL_NUM_PROGRAMS /* !!! This has to be the last entry !!! */
30} MagickOpenCLProgram;
31
32
33typedef struct _MagickCLEnv* MagickCLEnv;
34
35extern MagickExport
36 MagickCLEnv AcquireMagickOpenCLEnv();
37
38extern MagickExport
39 MagickBooleanType RelinquishMagickOpenCLEnv(MagickCLEnv);
40
41extern MagickExport
42 MagickCLEnv GetDefaultOpenCLEnv();
43
44extern MagickExport
45 MagickCLEnv SetDefaultOpenCLEnv(MagickCLEnv);
46
47
48/* Parameter type accepted by SetMagickOpenCLEnvParm and GetMagickOpenCLEnvParm */
49typedef enum {
dirk20932d32013-12-12 06:16:19 +000050 MAGICK_OPENCL_ENV_PARAM_DEVICE /* cl_device_id (from OpenCL) */
51 , MAGICK_OPENCL_ENV_PARAM_OPENCL_DISABLED /* MagickBooleanType */
52 , MAGICK_OPENCL_ENV_PARAM_OPENCL_INITIALIZED /* MagickBooleanType */
53 , MAGICK_OPENCL_ENV_PARAM_PROGRAM_CACHE_DISABLED /* MagickBooleanType */
54 /* if true, disable the kernel binary cache */
55 , MAGICK_OPENCL_ENV_PARAM_REGENERATE_PROFILE /* MagickBooleanType */
56 /* if true, rerun microbenchmark in auto device selection */
cristyf034abb2013-11-24 14:16:14 +000057} MagickOpenCLEnvParam;
58
59extern MagickExport
60 MagickBooleanType SetMagickOpenCLEnvParam(MagickCLEnv, MagickOpenCLEnvParam, size_t, void*, ExceptionInfo*);
61
62extern MagickExport
63 MagickBooleanType GetMagickOpenCLEnvParam(MagickCLEnv, MagickOpenCLEnvParam, size_t, void*, ExceptionInfo*);
64
65
66extern MagickExport
67 MagickBooleanType InitOpenCLEnv(MagickCLEnv, ExceptionInfo*);
68
69typedef enum {
70 MAGICK_OPENCL_OFF = 0
71, MAGICK_OPENCL_DEVICE_SELECT_AUTO = 1
72, MAGICK_OPENCL_DEVICE_SELECT_USER = 2
dirk20932d32013-12-12 06:16:19 +000073, MAGICK_OPENCL_DEVICE_SELECT_AUTO_CLEAR_CACHE = 3
cristyf034abb2013-11-24 14:16:14 +000074} ImageMagickOpenCLMode ;
75
76extern MagickExport
77MagickBooleanType InitImageMagickOpenCL(ImageMagickOpenCLMode, void*, void*, ExceptionInfo*);
78
cristydbba8212013-07-19 14:53:50 +000079#if defined(__cplusplus) || defined(c_plusplus)
80}
81#endif
82
83#endif