cristy | dbba821 | 2013-07-19 14:53:50 +0000 | [diff] [blame] | 1 | /* |
cristy | b56bb24 | 2014-11-25 17:12:48 +0000 | [diff] [blame] | 2 | Copyright 1999-2015 ImageMagick Studio LLC, a non-profit organization |
cristy | dbba821 | 2013-07-19 14:53:50 +0000 | [diff] [blame] | 3 | 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 | |
cristy | f034abb | 2013-11-24 14:16:14 +0000 | [diff] [blame] | 21 | |
cristy | dbba821 | 2013-07-19 14:53:50 +0000 | [diff] [blame] | 22 | #if defined(__cplusplus) || defined(c_plusplus) |
| 23 | extern "C" { |
| 24 | #endif |
| 25 | |
cristy | f034abb | 2013-11-24 14:16:14 +0000 | [diff] [blame] | 26 | /* OpenCL program modules */ |
| 27 | typedef enum { |
| 28 | MAGICK_OPENCL_ACCELERATE = 0 |
| 29 | ,MAGICK_OPENCL_NUM_PROGRAMS /* !!! This has to be the last entry !!! */ |
| 30 | } MagickOpenCLProgram; |
| 31 | |
| 32 | |
| 33 | typedef struct _MagickCLEnv* MagickCLEnv; |
| 34 | |
| 35 | extern MagickExport |
| 36 | MagickCLEnv AcquireMagickOpenCLEnv(); |
| 37 | |
| 38 | extern MagickExport |
| 39 | MagickBooleanType RelinquishMagickOpenCLEnv(MagickCLEnv); |
| 40 | |
| 41 | extern MagickExport |
| 42 | MagickCLEnv GetDefaultOpenCLEnv(); |
| 43 | |
| 44 | extern MagickExport |
| 45 | MagickCLEnv SetDefaultOpenCLEnv(MagickCLEnv); |
| 46 | |
| 47 | |
| 48 | /* Parameter type accepted by SetMagickOpenCLEnvParm and GetMagickOpenCLEnvParm */ |
| 49 | typedef enum { |
dirk | 20932d3 | 2013-12-12 06:16:19 +0000 | [diff] [blame] | 50 | 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 */ |
cristy | f034abb | 2013-11-24 14:16:14 +0000 | [diff] [blame] | 57 | } MagickOpenCLEnvParam; |
| 58 | |
| 59 | extern MagickExport |
| 60 | MagickBooleanType SetMagickOpenCLEnvParam(MagickCLEnv, MagickOpenCLEnvParam, size_t, void*, ExceptionInfo*); |
| 61 | |
| 62 | extern MagickExport |
| 63 | MagickBooleanType GetMagickOpenCLEnvParam(MagickCLEnv, MagickOpenCLEnvParam, size_t, void*, ExceptionInfo*); |
| 64 | |
| 65 | |
| 66 | extern MagickExport |
| 67 | MagickBooleanType InitOpenCLEnv(MagickCLEnv, ExceptionInfo*); |
| 68 | |
| 69 | typedef enum { |
| 70 | MAGICK_OPENCL_OFF = 0 |
| 71 | , MAGICK_OPENCL_DEVICE_SELECT_AUTO = 1 |
| 72 | , MAGICK_OPENCL_DEVICE_SELECT_USER = 2 |
dirk | 20932d3 | 2013-12-12 06:16:19 +0000 | [diff] [blame] | 73 | , MAGICK_OPENCL_DEVICE_SELECT_AUTO_CLEAR_CACHE = 3 |
cristy | f034abb | 2013-11-24 14:16:14 +0000 | [diff] [blame] | 74 | } ImageMagickOpenCLMode ; |
| 75 | |
| 76 | extern MagickExport |
| 77 | MagickBooleanType InitImageMagickOpenCL(ImageMagickOpenCLMode, void*, void*, ExceptionInfo*); |
| 78 | |
cristy | dbba821 | 2013-07-19 14:53:50 +0000 | [diff] [blame] | 79 | #if defined(__cplusplus) || defined(c_plusplus) |
| 80 | } |
| 81 | #endif |
| 82 | |
| 83 | #endif |