cl.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * Copyright (c) 2008-2009 The Khronos Group Inc.
00003  *
00004  * Permission is hereby granted, free of charge, to any person obtaining a
00005  * copy of this software and/or associated documentation files (the
00006  * "Materials"), to deal in the Materials without restriction, including
00007  * without limitation the rights to use, copy, modify, merge, publish,
00008  * distribute, sublicense, and/or sell copies of the Materials, and to
00009  * permit persons to whom the Materials are furnished to do so, subject to
00010  * the following conditions:
00011  *
00012  * The above copyright notice and this permission notice shall be included
00013  * in all copies or substantial portions of the Materials.
00014  *
00015  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00016  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00017  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00018  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00019  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00020  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00021  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
00022  ******************************************************************************/
00023 
00024 #ifndef __OPENCL_CL_H
00025 #define __OPENCL_CL_H
00026 
00027 #ifdef __APPLE__
00028 #include <MiniCL/cl_platform.h>
00029 #else
00030 #include <MiniCL/cl_platform.h>
00031 #endif  
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036 
00037 /******************************************************************************/
00038 
00039 typedef struct _cl_platform_id *    cl_platform_id;
00040 typedef struct _cl_device_id *      cl_device_id;
00041 typedef struct _cl_context *        cl_context;
00042 typedef struct _cl_command_queue *  cl_command_queue;
00043 typedef struct _cl_mem *            cl_mem;
00044 typedef struct _cl_program *        cl_program;
00045 typedef struct _cl_kernel *         cl_kernel;
00046 typedef struct _cl_event *          cl_event;
00047 typedef struct _cl_sampler *        cl_sampler;
00048 
00049 typedef cl_uint             cl_bool;                     /* WARNING!  Unlike cl_ types in cl_platform.h, cl_bool is not guaranteed to be the same size as the bool in kernels. */ 
00050 typedef cl_ulong            cl_bitfield;
00051 typedef cl_bitfield         cl_device_type;
00052 typedef cl_uint             cl_platform_info;
00053 typedef cl_uint             cl_device_info;
00054 typedef cl_bitfield         cl_device_address_info;
00055 typedef cl_bitfield         cl_device_fp_config;
00056 typedef cl_uint             cl_device_mem_cache_type;
00057 typedef cl_uint             cl_device_local_mem_type;
00058 typedef cl_bitfield         cl_device_exec_capabilities;
00059 typedef cl_bitfield         cl_command_queue_properties;
00060 
00061 typedef intptr_t                        cl_context_properties;
00062 typedef cl_uint             cl_context_info;
00063 typedef cl_uint             cl_command_queue_info;
00064 typedef cl_uint             cl_channel_order;
00065 typedef cl_uint             cl_channel_type;
00066 typedef cl_bitfield         cl_mem_flags;
00067 typedef cl_uint             cl_mem_object_type;
00068 typedef cl_uint             cl_mem_info;
00069 typedef cl_uint             cl_image_info;
00070 typedef cl_uint             cl_addressing_mode;
00071 typedef cl_uint             cl_filter_mode;
00072 typedef cl_uint             cl_sampler_info;
00073 typedef cl_bitfield         cl_map_flags;
00074 typedef cl_uint             cl_program_info;
00075 typedef cl_uint             cl_program_build_info;
00076 typedef cl_int              cl_build_status;
00077 typedef cl_uint             cl_kernel_info;
00078 typedef cl_uint             cl_kernel_work_group_info;
00079 typedef cl_uint             cl_event_info;
00080 typedef cl_uint             cl_command_type;
00081 typedef cl_uint             cl_profiling_info;
00082 
00083 typedef struct _cl_image_format {
00084     cl_channel_order        image_channel_order;
00085     cl_channel_type         image_channel_data_type;
00086 } cl_image_format;
00087 
00088 /******************************************************************************/
00089 
00090 // Error Codes
00091 #define CL_SUCCESS                                  0
00092 #define CL_DEVICE_NOT_FOUND                         -1
00093 #define CL_DEVICE_NOT_AVAILABLE                     -2
00094 #define CL_DEVICE_COMPILER_NOT_AVAILABLE            -3
00095 #define CL_MEM_OBJECT_ALLOCATION_FAILURE            -4
00096 #define CL_OUT_OF_RESOURCES                         -5
00097 #define CL_OUT_OF_HOST_MEMORY                       -6
00098 #define CL_PROFILING_INFO_NOT_AVAILABLE             -7
00099 #define CL_MEM_COPY_OVERLAP                         -8
00100 #define CL_IMAGE_FORMAT_MISMATCH                    -9
00101 #define CL_IMAGE_FORMAT_NOT_SUPPORTED               -10
00102 #define CL_BUILD_PROGRAM_FAILURE                    -11
00103 #define CL_MAP_FAILURE                              -12
00104 
00105 #define CL_INVALID_VALUE                            -30
00106 #define CL_INVALID_DEVICE_TYPE                      -31
00107 #define CL_INVALID_PLATFORM                         -32
00108 #define CL_INVALID_DEVICE                           -33
00109 #define CL_INVALID_CONTEXT                          -34
00110 #define CL_INVALID_QUEUE_PROPERTIES                 -35
00111 #define CL_INVALID_COMMAND_QUEUE                    -36
00112 #define CL_INVALID_HOST_PTR                         -37
00113 #define CL_INVALID_MEM_OBJECT                       -38
00114 #define CL_INVALID_IMAGE_FORMAT_DESCRIPTOR          -39
00115 #define CL_INVALID_IMAGE_SIZE                       -40
00116 #define CL_INVALID_SAMPLER                          -41
00117 #define CL_INVALID_BINARY                           -42
00118 #define CL_INVALID_BUILD_OPTIONS                    -43
00119 #define CL_INVALID_PROGRAM                          -44
00120 #define CL_INVALID_PROGRAM_EXECUTABLE               -45
00121 #define CL_INVALID_KERNEL_NAME                      -46
00122 #define CL_INVALID_KERNEL_DEFINITION                -47
00123 #define CL_INVALID_KERNEL                           -48
00124 #define CL_INVALID_ARG_INDEX                        -49
00125 #define CL_INVALID_ARG_VALUE                        -50
00126 #define CL_INVALID_ARG_SIZE                         -51
00127 #define CL_INVALID_KERNEL_ARGS                      -52
00128 #define CL_INVALID_WORK_DIMENSION                   -53
00129 #define CL_INVALID_WORK_GROUP_SIZE                  -54
00130 #define CL_INVALID_WORK_ITEM_SIZE                   -55
00131 #define CL_INVALID_GLOBAL_OFFSET                    -56
00132 #define CL_INVALID_EVENT_WAIT_LIST                  -57
00133 #define CL_INVALID_EVENT                            -58
00134 #define CL_INVALID_OPERATION                        -59
00135 #define CL_INVALID_GL_OBJECT                        -60
00136 #define CL_INVALID_BUFFER_SIZE                      -61
00137 #define CL_INVALID_MIP_LEVEL                        -62
00138 
00139 // OpenCL Version
00140 #define CL_VERSION_1_0                              1
00141 
00142 // cl_bool
00143 #define CL_FALSE                                    0
00144 #define CL_TRUE                                     1
00145 
00146 // cl_platform_info
00147 #define CL_PLATFORM_PROFILE                         0x0900
00148 #define CL_PLATFORM_VERSION                         0x0901
00149 #define CL_PLATFORM_NAME                            0x0902
00150 #define CL_PLATFORM_VENDOR                          0x0903
00151 #define CL_PLATFORM_EXTENSIONS                      0x0904
00152 
00153 // cl_device_type - bitfield
00154 #define CL_DEVICE_TYPE_DEFAULT                      (1 << 0)
00155 #define CL_DEVICE_TYPE_CPU                          (1 << 1)
00156 #define CL_DEVICE_TYPE_GPU                          (1 << 2)
00157 #define CL_DEVICE_TYPE_ACCELERATOR                  (1 << 3)
00158 #define CL_DEVICE_TYPE_DEBUG                                            (1 << 4)
00159 #define CL_DEVICE_TYPE_ALL                          0xFFFFFFFF
00160 
00161 
00162 // cl_device_info
00163 #define CL_DEVICE_TYPE                              0x1000
00164 #define CL_DEVICE_VENDOR_ID                         0x1001
00165 #define CL_DEVICE_MAX_COMPUTE_UNITS                 0x1002
00166 #define CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS          0x1003
00167 #define CL_DEVICE_MAX_WORK_GROUP_SIZE               0x1004
00168 #define CL_DEVICE_MAX_WORK_ITEM_SIZES               0x1005
00169 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR       0x1006
00170 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT      0x1007
00171 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT        0x1008
00172 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG       0x1009
00173 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT      0x100A
00174 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE     0x100B
00175 #define CL_DEVICE_MAX_CLOCK_FREQUENCY               0x100C
00176 #define CL_DEVICE_ADDRESS_BITS                      0x100D
00177 #define CL_DEVICE_MAX_READ_IMAGE_ARGS               0x100E
00178 #define CL_DEVICE_MAX_WRITE_IMAGE_ARGS              0x100F
00179 #define CL_DEVICE_MAX_MEM_ALLOC_SIZE                0x1010
00180 #define CL_DEVICE_IMAGE2D_MAX_WIDTH                 0x1011
00181 #define CL_DEVICE_IMAGE2D_MAX_HEIGHT                0x1012
00182 #define CL_DEVICE_IMAGE3D_MAX_WIDTH                 0x1013
00183 #define CL_DEVICE_IMAGE3D_MAX_HEIGHT                0x1014
00184 #define CL_DEVICE_IMAGE3D_MAX_DEPTH                 0x1015
00185 #define CL_DEVICE_IMAGE_SUPPORT                     0x1016
00186 #define CL_DEVICE_MAX_PARAMETER_SIZE                0x1017
00187 #define CL_DEVICE_MAX_SAMPLERS                      0x1018
00188 #define CL_DEVICE_MEM_BASE_ADDR_ALIGN               0x1019
00189 #define CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE          0x101A
00190 #define CL_DEVICE_SINGLE_FP_CONFIG                  0x101B
00191 #define CL_DEVICE_GLOBAL_MEM_CACHE_TYPE             0x101C
00192 #define CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE         0x101D
00193 #define CL_DEVICE_GLOBAL_MEM_CACHE_SIZE             0x101E
00194 #define CL_DEVICE_GLOBAL_MEM_SIZE                   0x101F
00195 #define CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE          0x1020
00196 #define CL_DEVICE_MAX_CONSTANT_ARGS                 0x1021
00197 #define CL_DEVICE_LOCAL_MEM_TYPE                    0x1022
00198 #define CL_DEVICE_LOCAL_MEM_SIZE                    0x1023
00199 #define CL_DEVICE_ERROR_CORRECTION_SUPPORT          0x1024
00200 #define CL_DEVICE_PROFILING_TIMER_RESOLUTION        0x1025
00201 #define CL_DEVICE_ENDIAN_LITTLE                     0x1026
00202 #define CL_DEVICE_AVAILABLE                         0x1027
00203 #define CL_DEVICE_COMPILER_AVAILABLE                0x1028
00204 #define CL_DEVICE_EXECUTION_CAPABILITIES            0x1029
00205 #define CL_DEVICE_QUEUE_PROPERTIES                  0x102A
00206 #define CL_DEVICE_NAME                              0x102B
00207 #define CL_DEVICE_VENDOR                            0x102C
00208 #define CL_DRIVER_VERSION                           0x102D
00209 #define CL_DEVICE_PROFILE                           0x102E
00210 #define CL_DEVICE_VERSION                           0x102F
00211 #define CL_DEVICE_EXTENSIONS                        0x1030
00212 #define CL_DEVICE_PLATFORM                          0x1031
00213         
00214 // cl_device_address_info - bitfield
00215 #define CL_DEVICE_ADDRESS_32_BITS                   (1 << 0)
00216 #define CL_DEVICE_ADDRESS_64_BITS                   (1 << 1)
00217 
00218 // cl_device_fp_config - bitfield
00219 #define CL_FP_DENORM                                (1 << 0)
00220 #define CL_FP_INF_NAN                               (1 << 1)
00221 #define CL_FP_ROUND_TO_NEAREST                      (1 << 2)
00222 #define CL_FP_ROUND_TO_ZERO                         (1 << 3)
00223 #define CL_FP_ROUND_TO_INF                          (1 << 4)
00224 #define CL_FP_FMA                                   (1 << 5)
00225 
00226 // cl_device_mem_cache_type
00227 #define CL_NONE                                     0x0
00228 #define CL_READ_ONLY_CACHE                          0x1
00229 #define CL_READ_WRITE_CACHE                         0x2
00230 
00231 // cl_device_local_mem_type
00232 #define CL_LOCAL                                    0x1
00233 #define CL_GLOBAL                                   0x2
00234 
00235 // cl_device_exec_capabilities - bitfield
00236 #define CL_EXEC_KERNEL                              (1 << 0)
00237 #define CL_EXEC_NATIVE_KERNEL                       (1 << 1)
00238 
00239 // cl_command_queue_properties - bitfield
00240 #define CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE      (1 << 0)
00241 #define CL_QUEUE_PROFILING_ENABLE                   (1 << 1)
00242 
00243 // cl_context_info
00244 #define CL_CONTEXT_REFERENCE_COUNT                  0x1080
00245 #define CL_CONTEXT_NUM_DEVICES                      0x1081
00246 #define CL_CONTEXT_DEVICES                          0x1082
00247 #define CL_CONTEXT_PROPERTIES                       0x1083
00248 #define CL_CONTEXT_PLATFORM                         0x1084
00249 
00250 // cl_command_queue_info
00251 #define CL_QUEUE_CONTEXT                            0x1090
00252 #define CL_QUEUE_DEVICE                             0x1091
00253 #define CL_QUEUE_REFERENCE_COUNT                    0x1092
00254 #define CL_QUEUE_PROPERTIES                         0x1093
00255 
00256 // cl_mem_flags - bitfield
00257 #define CL_MEM_READ_WRITE                           (1 << 0)
00258 #define CL_MEM_WRITE_ONLY                           (1 << 1)
00259 #define CL_MEM_READ_ONLY                            (1 << 2)
00260 #define CL_MEM_USE_HOST_PTR                         (1 << 3)
00261 #define CL_MEM_ALLOC_HOST_PTR                       (1 << 4)
00262 #define CL_MEM_COPY_HOST_PTR                        (1 << 5)
00263 
00264 // cl_channel_order
00265 #define CL_R                                        0x10B0
00266 #define CL_A                                        0x10B1
00267 #define CL_RG                                       0x10B2
00268 #define CL_RA                                       0x10B3
00269 #define CL_RGB                                      0x10B4
00270 #define CL_RGBA                                     0x10B5
00271 #define CL_BGRA                                     0x10B6
00272 #define CL_ARGB                                     0x10B7
00273 #define CL_INTENSITY                                0x10B8
00274 #define CL_LUMINANCE                                0x10B9
00275 
00276 // cl_channel_type
00277 #define CL_SNORM_INT8                               0x10D0
00278 #define CL_SNORM_INT16                              0x10D1
00279 #define CL_UNORM_INT8                               0x10D2
00280 #define CL_UNORM_INT16                              0x10D3
00281 #define CL_UNORM_SHORT_565                          0x10D4
00282 #define CL_UNORM_SHORT_555                          0x10D5
00283 #define CL_UNORM_INT_101010                         0x10D6
00284 #define CL_SIGNED_INT8                              0x10D7
00285 #define CL_SIGNED_INT16                             0x10D8
00286 #define CL_SIGNED_INT32                             0x10D9
00287 #define CL_UNSIGNED_INT8                            0x10DA
00288 #define CL_UNSIGNED_INT16                           0x10DB
00289 #define CL_UNSIGNED_INT32                           0x10DC
00290 #define CL_HALF_FLOAT                               0x10DD
00291 #define CL_FLOAT                                    0x10DE
00292 
00293 // cl_mem_object_type
00294 #define CL_MEM_OBJECT_BUFFER                        0x10F0
00295 #define CL_MEM_OBJECT_IMAGE2D                       0x10F1
00296 #define CL_MEM_OBJECT_IMAGE3D                       0x10F2
00297 
00298 // cl_mem_info
00299 #define CL_MEM_TYPE                                 0x1100
00300 #define CL_MEM_FLAGS                                0x1101
00301 #define CL_MEM_SIZE                                 0x1102
00302 #define CL_MEM_HOST_PTR                             0x1103
00303 #define CL_MEM_MAP_COUNT                            0x1104
00304 #define CL_MEM_REFERENCE_COUNT                      0x1105
00305 #define CL_MEM_CONTEXT                              0x1106
00306 
00307 // cl_image_info
00308 #define CL_IMAGE_FORMAT                             0x1110
00309 #define CL_IMAGE_ELEMENT_SIZE                       0x1111
00310 #define CL_IMAGE_ROW_PITCH                          0x1112
00311 #define CL_IMAGE_SLICE_PITCH                        0x1113
00312 #define CL_IMAGE_WIDTH                              0x1114
00313 #define CL_IMAGE_HEIGHT                             0x1115
00314 #define CL_IMAGE_DEPTH                              0x1116
00315 
00316 // cl_addressing_mode
00317 #define CL_ADDRESS_NONE                             0x1130
00318 #define CL_ADDRESS_CLAMP_TO_EDGE                    0x1131
00319 #define CL_ADDRESS_CLAMP                            0x1132
00320 #define CL_ADDRESS_REPEAT                           0x1133
00321 
00322 // cl_filter_mode
00323 #define CL_FILTER_NEAREST                           0x1140
00324 #define CL_FILTER_LINEAR                            0x1141
00325 
00326 // cl_sampler_info
00327 #define CL_SAMPLER_REFERENCE_COUNT                  0x1150
00328 #define CL_SAMPLER_CONTEXT                          0x1151
00329 #define CL_SAMPLER_NORMALIZED_COORDS                0x1152
00330 #define CL_SAMPLER_ADDRESSING_MODE                  0x1153
00331 #define CL_SAMPLER_FILTER_MODE                      0x1154
00332 
00333 // cl_map_flags - bitfield
00334 #define CL_MAP_READ                                 (1 << 0)
00335 #define CL_MAP_WRITE                                (1 << 1)
00336 
00337 // cl_program_info
00338 #define CL_PROGRAM_REFERENCE_COUNT                  0x1160
00339 #define CL_PROGRAM_CONTEXT                          0x1161
00340 #define CL_PROGRAM_NUM_DEVICES                      0x1162
00341 #define CL_PROGRAM_DEVICES                          0x1163
00342 #define CL_PROGRAM_SOURCE                           0x1164
00343 #define CL_PROGRAM_BINARY_SIZES                     0x1165
00344 #define CL_PROGRAM_BINARIES                         0x1166
00345 
00346 // cl_program_build_info
00347 #define CL_PROGRAM_BUILD_STATUS                     0x1181
00348 #define CL_PROGRAM_BUILD_OPTIONS                    0x1182
00349 #define CL_PROGRAM_BUILD_LOG                        0x1183
00350 
00351 // cl_build_status
00352 #define CL_BUILD_SUCCESS                            0
00353 #define CL_BUILD_NONE                               -1
00354 #define CL_BUILD_ERROR                              -2
00355 #define CL_BUILD_IN_PROGRESS                        -3
00356 
00357 // cl_kernel_info
00358 #define CL_KERNEL_FUNCTION_NAME                     0x1190
00359 #define CL_KERNEL_NUM_ARGS                          0x1191
00360 #define CL_KERNEL_REFERENCE_COUNT                   0x1192
00361 #define CL_KERNEL_CONTEXT                           0x1193
00362 #define CL_KERNEL_PROGRAM                           0x1194
00363 
00364 // cl_kernel_work_group_info
00365 #define CL_KERNEL_WORK_GROUP_SIZE                   0x11B0
00366 #define CL_KERNEL_COMPILE_WORK_GROUP_SIZE           0x11B1
00367 #define CL_KERNEL_LOCAL_MEM_SIZE                    0x11B2
00368 
00369 // cl_event_info
00370 #define CL_EVENT_COMMAND_QUEUE                      0x11D0
00371 #define CL_EVENT_COMMAND_TYPE                       0x11D1
00372 #define CL_EVENT_REFERENCE_COUNT                    0x11D2
00373 #define CL_EVENT_COMMAND_EXECUTION_STATUS           0x11D3
00374 
00375 // cl_command_type
00376 #define CL_COMMAND_NDRANGE_KERNEL                   0x11F0
00377 #define CL_COMMAND_TASK                             0x11F1
00378 #define CL_COMMAND_NATIVE_KERNEL                    0x11F2
00379 #define CL_COMMAND_READ_BUFFER                      0x11F3
00380 #define CL_COMMAND_WRITE_BUFFER                     0x11F4
00381 #define CL_COMMAND_COPY_BUFFER                      0x11F5
00382 #define CL_COMMAND_READ_IMAGE                       0x11F6
00383 #define CL_COMMAND_WRITE_IMAGE                      0x11F7
00384 #define CL_COMMAND_COPY_IMAGE                       0x11F8
00385 #define CL_COMMAND_COPY_IMAGE_TO_BUFFER             0x11F9
00386 #define CL_COMMAND_COPY_BUFFER_TO_IMAGE             0x11FA
00387 #define CL_COMMAND_MAP_BUFFER                       0x11FB
00388 #define CL_COMMAND_MAP_IMAGE                        0x11FC
00389 #define CL_COMMAND_UNMAP_MEM_OBJECT                 0x11FD
00390 #define CL_COMMAND_MARKER                           0x11FE
00391 #define CL_COMMAND_WAIT_FOR_EVENTS                  0x11FF
00392 #define CL_COMMAND_BARRIER                          0x1200
00393 #define CL_COMMAND_ACQUIRE_GL_OBJECTS               0x1201
00394 #define CL_COMMAND_RELEASE_GL_OBJECTS               0x1202
00395 
00396 // command execution status
00397 #define CL_COMPLETE                                 0x0
00398 #define CL_RUNNING                                  0x1
00399 #define CL_SUBMITTED                                0x2
00400 #define CL_QUEUED                                   0x3
00401   
00402 // cl_profiling_info
00403 #define CL_PROFILING_COMMAND_QUEUED                 0x1280
00404 #define CL_PROFILING_COMMAND_SUBMIT                 0x1281
00405 #define CL_PROFILING_COMMAND_START                  0x1282
00406 #define CL_PROFILING_COMMAND_END                    0x1283
00407 
00408 /********************************************************************************************************/
00409 
00410 // Platform API
00411 extern CL_API_ENTRY cl_int CL_API_CALL
00412 clGetPlatformIDs(cl_uint          /* num_entries */,
00413                  cl_platform_id * /* platforms */,
00414                  cl_uint *        /* num_platforms */) CL_API_SUFFIX__VERSION_1_0;
00415 
00416 extern CL_API_ENTRY cl_int CL_API_CALL 
00417 clGetPlatformInfo(cl_platform_id   /* platform */, 
00418                   cl_platform_info /* param_name */,
00419                   size_t           /* param_value_size */, 
00420                   void *           /* param_value */,
00421                   size_t *         /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
00422 
00423 // Device APIs
00424 extern CL_API_ENTRY cl_int CL_API_CALL
00425 clGetDeviceIDs(cl_platform_id   /* platform */,
00426                cl_device_type   /* device_type */, 
00427                cl_uint          /* num_entries */, 
00428                cl_device_id *   /* devices */, 
00429                cl_uint *        /* num_devices */) CL_API_SUFFIX__VERSION_1_0;
00430 
00431 extern CL_API_ENTRY cl_int CL_API_CALL
00432 clGetDeviceInfo(cl_device_id    /* device */,
00433                 cl_device_info  /* param_name */, 
00434                 size_t          /* param_value_size */, 
00435                 void *          /* param_value */,
00436                 size_t *        /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
00437 
00438 // Context APIs  
00439 extern CL_API_ENTRY cl_context CL_API_CALL
00440 clCreateContext(const cl_context_properties * /* properties */,
00441                 cl_uint                 /* num_devices */,
00442                 const cl_device_id *    /* devices */,
00443                 void (*pfn_notify)(const char *, const void *, size_t, void *) /* pfn_notify */,
00444                 void *                  /* user_data */,
00445                 cl_int *                /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
00446 
00447 extern CL_API_ENTRY cl_context CL_API_CALL
00448 clCreateContextFromType(const cl_context_properties * /* properties */,
00449                         cl_device_type          /* device_type */,
00450                         void (*pfn_notify)(const char *, const void *, size_t, void *) /* pfn_notify */,
00451                         void *                  /* user_data */,
00452                         cl_int *                /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
00453 
00454 extern CL_API_ENTRY cl_int CL_API_CALL
00455 clRetainContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
00456 
00457 extern CL_API_ENTRY cl_int CL_API_CALL
00458 clReleaseContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
00459 
00460 extern CL_API_ENTRY cl_int CL_API_CALL
00461 clGetContextInfo(cl_context         /* context */, 
00462                  cl_context_info    /* param_name */, 
00463                  size_t             /* param_value_size */, 
00464                  void *             /* param_value */, 
00465                  size_t *           /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
00466 
00467 // Command Queue APIs
00468 extern CL_API_ENTRY cl_command_queue CL_API_CALL
00469 clCreateCommandQueue(cl_context                     /* context */, 
00470                      cl_device_id                   /* device */, 
00471                      cl_command_queue_properties    /* properties */,
00472                      cl_int *                       /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
00473 
00474 extern CL_API_ENTRY cl_int CL_API_CALL
00475 clRetainCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
00476 
00477 extern CL_API_ENTRY cl_int CL_API_CALL
00478 clReleaseCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
00479 
00480 extern CL_API_ENTRY cl_int CL_API_CALL
00481 clGetCommandQueueInfo(cl_command_queue      /* command_queue */,
00482                       cl_command_queue_info /* param_name */,
00483                       size_t                /* param_value_size */,
00484                       void *                /* param_value */,
00485                       size_t *              /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
00486 
00487 extern CL_API_ENTRY cl_int CL_API_CALL
00488 clSetCommandQueueProperty(cl_command_queue              /* command_queue */,
00489                           cl_command_queue_properties   /* properties */, 
00490                           cl_bool                        /* enable */,
00491                           cl_command_queue_properties * /* old_properties */) CL_API_SUFFIX__VERSION_1_0;
00492 
00493 // Memory Object APIs
00494 extern CL_API_ENTRY cl_mem CL_API_CALL
00495 clCreateBuffer(cl_context   /* context */,
00496                cl_mem_flags /* flags */,
00497                size_t       /* size */,
00498                void *       /* host_ptr */,
00499                cl_int *     /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
00500 
00501 extern CL_API_ENTRY cl_mem CL_API_CALL
00502 clCreateImage2D(cl_context              /* context */,
00503                 cl_mem_flags            /* flags */,
00504                 const cl_image_format * /* image_format */,
00505                 size_t                  /* image_width */,
00506                 size_t                  /* image_height */,
00507                 size_t                  /* image_row_pitch */, 
00508                 void *                  /* host_ptr */,
00509                 cl_int *                /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
00510                         
00511 extern CL_API_ENTRY cl_mem CL_API_CALL
00512 clCreateImage3D(cl_context              /* context */,
00513                 cl_mem_flags            /* flags */,
00514                 const cl_image_format * /* image_format */,
00515                 size_t                  /* image_width */, 
00516                 size_t                  /* image_height */,
00517                 size_t                  /* image_depth */, 
00518                 size_t                  /* image_row_pitch */, 
00519                 size_t                  /* image_slice_pitch */, 
00520                 void *                  /* host_ptr */,
00521                 cl_int *                /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
00522                         
00523 extern CL_API_ENTRY cl_int CL_API_CALL
00524 clRetainMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
00525 
00526 extern CL_API_ENTRY cl_int CL_API_CALL
00527 clReleaseMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
00528 
00529 extern CL_API_ENTRY cl_int CL_API_CALL
00530 clGetSupportedImageFormats(cl_context           /* context */,
00531                            cl_mem_flags         /* flags */,
00532                            cl_mem_object_type   /* image_type */,
00533                            cl_uint              /* num_entries */,
00534                            cl_image_format *    /* image_formats */,
00535                            cl_uint *            /* num_image_formats */) CL_API_SUFFIX__VERSION_1_0;
00536                                     
00537 extern CL_API_ENTRY cl_int CL_API_CALL
00538 clGetMemObjectInfo(cl_mem           /* memobj */,
00539                    cl_mem_info      /* param_name */, 
00540                    size_t           /* param_value_size */,
00541                    void *           /* param_value */,
00542                    size_t *         /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
00543 
00544 extern CL_API_ENTRY cl_int CL_API_CALL
00545 clGetImageInfo(cl_mem           /* image */,
00546                cl_image_info    /* param_name */, 
00547                size_t           /* param_value_size */,
00548                void *           /* param_value */,
00549                size_t *         /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
00550 
00551 // Sampler APIs
00552 extern CL_API_ENTRY cl_sampler CL_API_CALL
00553 clCreateSampler(cl_context          /* context */,
00554                 cl_bool             /* normalized_coords */, 
00555                 cl_addressing_mode  /* addressing_mode */, 
00556                 cl_filter_mode      /* filter_mode */,
00557                 cl_int *            /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
00558 
00559 extern CL_API_ENTRY cl_int CL_API_CALL
00560 clRetainSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
00561 
00562 extern CL_API_ENTRY cl_int CL_API_CALL
00563 clReleaseSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
00564 
00565 extern CL_API_ENTRY cl_int CL_API_CALL
00566 clGetSamplerInfo(cl_sampler         /* sampler */,
00567                  cl_sampler_info    /* param_name */,
00568                  size_t             /* param_value_size */,
00569                  void *             /* param_value */,
00570                  size_t *           /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
00571                             
00572 // Program Object APIs
00573 extern CL_API_ENTRY cl_program CL_API_CALL
00574 clCreateProgramWithSource(cl_context        /* context */,
00575                           cl_uint           /* count */,
00576                           const char **     /* strings */,
00577                           const size_t *    /* lengths */,
00578                           cl_int *          /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
00579 
00580 extern CL_API_ENTRY cl_program CL_API_CALL
00581 clCreateProgramWithBinary(cl_context                     /* context */,
00582                           cl_uint                        /* num_devices */,
00583                           const cl_device_id *           /* device_list */,
00584                           const size_t *                 /* lengths */,
00585                           const unsigned char **         /* binaries */,
00586                           cl_int *                       /* binary_status */,
00587                           cl_int *                       /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
00588 
00589 extern CL_API_ENTRY cl_int CL_API_CALL
00590 clRetainProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
00591 
00592 extern CL_API_ENTRY cl_int CL_API_CALL
00593 clReleaseProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
00594 
00595 extern CL_API_ENTRY cl_int CL_API_CALL
00596 clBuildProgram(cl_program           /* program */,
00597                cl_uint              /* num_devices */,
00598                const cl_device_id * /* device_list */,
00599                const char *         /* options */, 
00600                void (*pfn_notify)(cl_program /* program */, void * /* user_data */),
00601                void *               /* user_data */) CL_API_SUFFIX__VERSION_1_0;
00602 
00603 extern CL_API_ENTRY cl_int CL_API_CALL
00604 clUnloadCompiler(void) CL_API_SUFFIX__VERSION_1_0;
00605 
00606 extern CL_API_ENTRY cl_int CL_API_CALL
00607 clGetProgramInfo(cl_program         /* program */,
00608                  cl_program_info    /* param_name */,
00609                  size_t             /* param_value_size */,
00610                  void *             /* param_value */,
00611                  size_t *           /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
00612 
00613 extern CL_API_ENTRY cl_int CL_API_CALL
00614 clGetProgramBuildInfo(cl_program            /* program */,
00615                       cl_device_id          /* device */,
00616                       cl_program_build_info /* param_name */,
00617                       size_t                /* param_value_size */,
00618                       void *                /* param_value */,
00619                       size_t *              /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
00620                             
00621 // Kernel Object APIs
00622 extern CL_API_ENTRY cl_kernel CL_API_CALL
00623 clCreateKernel(cl_program      /* program */,
00624                const char *    /* kernel_name */,
00625                cl_int *        /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
00626 
00627 extern CL_API_ENTRY cl_int CL_API_CALL
00628 clCreateKernelsInProgram(cl_program     /* program */,
00629                          cl_uint        /* num_kernels */,
00630                          cl_kernel *    /* kernels */,
00631                          cl_uint *      /* num_kernels_ret */) CL_API_SUFFIX__VERSION_1_0;
00632 
00633 extern CL_API_ENTRY cl_int CL_API_CALL
00634 clRetainKernel(cl_kernel    /* kernel */) CL_API_SUFFIX__VERSION_1_0;
00635 
00636 extern CL_API_ENTRY cl_int CL_API_CALL
00637 clReleaseKernel(cl_kernel   /* kernel */) CL_API_SUFFIX__VERSION_1_0;
00638 
00639 extern CL_API_ENTRY cl_int CL_API_CALL
00640 clSetKernelArg(cl_kernel    /* kernel */,
00641                cl_uint      /* arg_index */,
00642                size_t       /* arg_size */,
00643                const void * /* arg_value */) CL_API_SUFFIX__VERSION_1_0;
00644 
00645 extern CL_API_ENTRY cl_int CL_API_CALL
00646 clGetKernelInfo(cl_kernel       /* kernel */,
00647                 cl_kernel_info  /* param_name */,
00648                 size_t          /* param_value_size */,
00649                 void *          /* param_value */,
00650                 size_t *        /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
00651 
00652 extern CL_API_ENTRY cl_int CL_API_CALL
00653 clGetKernelWorkGroupInfo(cl_kernel                  /* kernel */,
00654                          cl_device_id               /* device */,
00655                          cl_kernel_work_group_info  /* param_name */,
00656                          size_t                     /* param_value_size */,
00657                          void *                     /* param_value */,
00658                          size_t *                   /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
00659 
00660 // Event Object APIs
00661 extern CL_API_ENTRY cl_int CL_API_CALL
00662 clWaitForEvents(cl_uint             /* num_events */,
00663                 const cl_event *    /* event_list */) CL_API_SUFFIX__VERSION_1_0;
00664 
00665 extern CL_API_ENTRY cl_int CL_API_CALL
00666 clGetEventInfo(cl_event         /* event */,
00667                cl_event_info    /* param_name */,
00668                size_t           /* param_value_size */,
00669                void *           /* param_value */,
00670                size_t *         /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
00671                             
00672 extern CL_API_ENTRY cl_int CL_API_CALL
00673 clRetainEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
00674 
00675 extern CL_API_ENTRY cl_int CL_API_CALL
00676 clReleaseEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
00677 
00678 // Profiling APIs
00679 extern CL_API_ENTRY cl_int CL_API_CALL
00680 clGetEventProfilingInfo(cl_event            /* event */,
00681                         cl_profiling_info   /* param_name */,
00682                         size_t              /* param_value_size */,
00683                         void *              /* param_value */,
00684                         size_t *            /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
00685                                 
00686 // Flush and Finish APIs
00687 extern CL_API_ENTRY cl_int CL_API_CALL
00688 clFlush(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
00689 
00690 extern CL_API_ENTRY cl_int CL_API_CALL
00691 clFinish(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
00692 
00693 // Enqueued Commands APIs
00694 extern CL_API_ENTRY cl_int CL_API_CALL
00695 clEnqueueReadBuffer(cl_command_queue    /* command_queue */,
00696                     cl_mem              /* buffer */,
00697                     cl_bool             /* blocking_read */,
00698                     size_t              /* offset */,
00699                     size_t              /* cb */, 
00700                     void *              /* ptr */,
00701                     cl_uint             /* num_events_in_wait_list */,
00702                     const cl_event *    /* event_wait_list */,
00703                     cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_0;
00704                             
00705 extern CL_API_ENTRY cl_int CL_API_CALL
00706 clEnqueueWriteBuffer(cl_command_queue   /* command_queue */, 
00707                      cl_mem             /* buffer */, 
00708                      cl_bool            /* blocking_write */, 
00709                      size_t             /* offset */, 
00710                      size_t             /* cb */, 
00711                      const void *       /* ptr */, 
00712                      cl_uint            /* num_events_in_wait_list */, 
00713                      const cl_event *   /* event_wait_list */, 
00714                      cl_event *         /* event */) CL_API_SUFFIX__VERSION_1_0;
00715                             
00716 extern CL_API_ENTRY cl_int CL_API_CALL
00717 clEnqueueCopyBuffer(cl_command_queue    /* command_queue */, 
00718                     cl_mem              /* src_buffer */,
00719                     cl_mem              /* dst_buffer */, 
00720                     size_t              /* src_offset */,
00721                     size_t              /* dst_offset */,
00722                     size_t              /* cb */, 
00723                     cl_uint             /* num_events_in_wait_list */,
00724                     const cl_event *    /* event_wait_list */,
00725                     cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_0;
00726                             
00727 extern CL_API_ENTRY cl_int CL_API_CALL
00728 clEnqueueReadImage(cl_command_queue     /* command_queue */,
00729                    cl_mem               /* image */,
00730                    cl_bool              /* blocking_read */, 
00731                    const size_t *       /* origin[3] */,
00732                    const size_t *       /* region[3] */,
00733                    size_t               /* row_pitch */,
00734                    size_t               /* slice_pitch */, 
00735                    void *               /* ptr */,
00736                    cl_uint              /* num_events_in_wait_list */,
00737                    const cl_event *     /* event_wait_list */,
00738                    cl_event *           /* event */) CL_API_SUFFIX__VERSION_1_0;
00739 
00740 extern CL_API_ENTRY cl_int CL_API_CALL
00741 clEnqueueWriteImage(cl_command_queue    /* command_queue */,
00742                     cl_mem              /* image */,
00743                     cl_bool             /* blocking_write */, 
00744                     const size_t *      /* origin[3] */,
00745                     const size_t *      /* region[3] */,
00746                     size_t              /* input_row_pitch */,
00747                     size_t              /* input_slice_pitch */, 
00748                     const void *        /* ptr */,
00749                     cl_uint             /* num_events_in_wait_list */,
00750                     const cl_event *    /* event_wait_list */,
00751                     cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_0;
00752 
00753 extern CL_API_ENTRY cl_int CL_API_CALL
00754 clEnqueueCopyImage(cl_command_queue     /* command_queue */,
00755                    cl_mem               /* src_image */,
00756                    cl_mem               /* dst_image */, 
00757                    const size_t *       /* src_origin[3] */,
00758                    const size_t *       /* dst_origin[3] */,
00759                    const size_t *       /* region[3] */, 
00760                    cl_uint              /* num_events_in_wait_list */,
00761                    const cl_event *     /* event_wait_list */,
00762                    cl_event *           /* event */) CL_API_SUFFIX__VERSION_1_0;
00763 
00764 extern CL_API_ENTRY cl_int CL_API_CALL
00765 clEnqueueCopyImageToBuffer(cl_command_queue /* command_queue */,
00766                            cl_mem           /* src_image */,
00767                            cl_mem           /* dst_buffer */, 
00768                            const size_t *   /* src_origin[3] */,
00769                            const size_t *   /* region[3] */, 
00770                            size_t           /* dst_offset */,
00771                            cl_uint          /* num_events_in_wait_list */,
00772                            const cl_event * /* event_wait_list */,
00773                            cl_event *       /* event */) CL_API_SUFFIX__VERSION_1_0;
00774 
00775 extern CL_API_ENTRY cl_int CL_API_CALL
00776 clEnqueueCopyBufferToImage(cl_command_queue /* command_queue */,
00777                            cl_mem           /* src_buffer */,
00778                            cl_mem           /* dst_image */, 
00779                            size_t           /* src_offset */,
00780                            const size_t *   /* dst_origin[3] */,
00781                            const size_t *   /* region[3] */, 
00782                            cl_uint          /* num_events_in_wait_list */,
00783                            const cl_event * /* event_wait_list */,
00784                            cl_event *       /* event */) CL_API_SUFFIX__VERSION_1_0;
00785 
00786 extern CL_API_ENTRY void * CL_API_CALL
00787 clEnqueueMapBuffer(cl_command_queue /* command_queue */,
00788                    cl_mem           /* buffer */,
00789                    cl_bool          /* blocking_map */, 
00790                    cl_map_flags     /* map_flags */,
00791                    size_t           /* offset */,
00792                    size_t           /* cb */,
00793                    cl_uint          /* num_events_in_wait_list */,
00794                    const cl_event * /* event_wait_list */,
00795                    cl_event *       /* event */,
00796                    cl_int *         /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
00797 
00798 extern CL_API_ENTRY void * CL_API_CALL
00799 clEnqueueMapImage(cl_command_queue  /* command_queue */,
00800                   cl_mem            /* image */, 
00801                   cl_bool           /* blocking_map */, 
00802                   cl_map_flags      /* map_flags */, 
00803                   const size_t *    /* origin[3] */,
00804                   const size_t *    /* region[3] */,
00805                   size_t *          /* image_row_pitch */,
00806                   size_t *          /* image_slice_pitch */,
00807                   cl_uint           /* num_events_in_wait_list */,
00808                   const cl_event *  /* event_wait_list */,
00809                   cl_event *        /* event */,
00810                   cl_int *          /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
00811 
00812 extern CL_API_ENTRY cl_int CL_API_CALL
00813 clEnqueueUnmapMemObject(cl_command_queue /* command_queue */,
00814                         cl_mem           /* memobj */,
00815                         void *           /* mapped_ptr */,
00816                         cl_uint          /* num_events_in_wait_list */,
00817                         const cl_event *  /* event_wait_list */,
00818                         cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_0;
00819 
00820 extern CL_API_ENTRY cl_int CL_API_CALL
00821 clEnqueueNDRangeKernel(cl_command_queue /* command_queue */,
00822                        cl_kernel        /* kernel */,
00823                        cl_uint          /* work_dim */,
00824                        const size_t *   /* global_work_offset */,
00825                        const size_t *   /* global_work_size */,
00826                        const size_t *   /* local_work_size */,
00827                        cl_uint          /* num_events_in_wait_list */,
00828                        const cl_event * /* event_wait_list */,
00829                        cl_event *       /* event */) CL_API_SUFFIX__VERSION_1_0;
00830 
00831 extern CL_API_ENTRY cl_int CL_API_CALL
00832 clEnqueueTask(cl_command_queue  /* command_queue */,
00833               cl_kernel         /* kernel */,
00834               cl_uint           /* num_events_in_wait_list */,
00835               const cl_event *  /* event_wait_list */,
00836               cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_0;
00837 
00838 extern CL_API_ENTRY cl_int CL_API_CALL
00839 clEnqueueNativeKernel(cl_command_queue  /* command_queue */,
00840                                           void (*user_func)(void *), 
00841                       void *            /* args */,
00842                       size_t            /* cb_args */, 
00843                       cl_uint           /* num_mem_objects */,
00844                       const cl_mem *    /* mem_list */,
00845                       const void **     /* args_mem_loc */,
00846                       cl_uint           /* num_events_in_wait_list */,
00847                       const cl_event *  /* event_wait_list */,
00848                       cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_0;
00849 
00850 extern CL_API_ENTRY cl_int CL_API_CALL
00851 clEnqueueMarker(cl_command_queue    /* command_queue */,
00852                 cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_0;
00853 
00854 extern CL_API_ENTRY cl_int CL_API_CALL
00855 clEnqueueWaitForEvents(cl_command_queue /* command_queue */,
00856                        cl_uint          /* num_events */,
00857                        const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
00858 
00859 extern CL_API_ENTRY cl_int CL_API_CALL
00860 clEnqueueBarrier(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
00861 
00862 #ifdef __cplusplus
00863 }
00864 #endif
00865 
00866 #endif  // __OPENCL_CL_H
00867