ffi-opencl 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,366 @@
1
+
2
+ module CL
3
+ extend FFI::Library
4
+ CL_CHAR_BIT = 8
5
+ CL_SCHAR_MAX = 127
6
+ CL_SCHAR_MIN = (-127-1)
7
+ CL_CHAR_MAX = 127
8
+ CL_CHAR_MIN = (-127-1)
9
+ CL_UCHAR_MAX = 255
10
+ CL_SHRT_MAX = 32767
11
+ CL_SHRT_MIN = (-32767-1)
12
+ CL_USHRT_MAX = 65535
13
+ CL_INT_MAX = 2147483647
14
+ CL_INT_MIN = (-2147483647-1)
15
+ CL_UINT_MAX = 0xffffffff
16
+ CL_FLT_DIG = 6
17
+ CL_FLT_MANT_DIG = 24
18
+ CL_FLT_MAX_10_EXP = +38
19
+ CL_FLT_MAX_EXP = +128
20
+ CL_FLT_MIN_10_EXP = -37
21
+ CL_FLT_MIN_EXP = -125
22
+ CL_FLT_RADIX = 2
23
+ CL_DBL_DIG = 15
24
+ CL_DBL_MANT_DIG = 53
25
+ CL_DBL_MAX_10_EXP = +308
26
+ CL_DBL_MAX_EXP = +1024
27
+ CL_DBL_MIN_10_EXP = -307
28
+ CL_DBL_MIN_EXP = -1021
29
+ CL_DBL_RADIX = 2
30
+ attach_function :__clGetExtensionFunctionAddress, [ :string ], :pointer
31
+ class ClImageFormat < FFI::Struct
32
+ layout(
33
+ :image_channel_order, :uint,
34
+ :image_channel_data_type, :uint
35
+ )
36
+ end
37
+ CL_SUCCESS = 0
38
+ CL_DEVICE_NOT_FOUND = -1
39
+ CL_DEVICE_NOT_AVAILABLE = -2
40
+ CL_DEVICE_COMPILER_NOT_AVAILABLE = -3
41
+ CL_MEM_OBJECT_ALLOCATION_FAILURE = -4
42
+ CL_OUT_OF_RESOURCES = -5
43
+ CL_OUT_OF_HOST_MEMORY = -6
44
+ CL_PROFILING_INFO_NOT_AVAILABLE = -7
45
+ CL_MEM_COPY_OVERLAP = -8
46
+ CL_IMAGE_FORMAT_MISMATCH = -9
47
+ CL_IMAGE_FORMAT_NOT_SUPPORTED = -10
48
+ CL_BUILD_PROGRAM_FAILURE = -11
49
+ CL_MAP_FAILURE = -12
50
+ CL_INVALID_VALUE = -30
51
+ CL_INVALID_DEVICE_TYPE = -31
52
+ CL_INVALID_PLATFORM = -32
53
+ CL_INVALID_DEVICE = -33
54
+ CL_INVALID_CONTEXT = -34
55
+ CL_INVALID_QUEUE_PROPERTIES = -35
56
+ CL_INVALID_COMMAND_QUEUE = -36
57
+ CL_INVALID_HOST_PTR = -37
58
+ CL_INVALID_MEM_OBJECT = -38
59
+ CL_INVALID_IMAGE_FORMAT_DESCRIPTOR = -39
60
+ CL_INVALID_IMAGE_SIZE = -40
61
+ CL_INVALID_SAMPLER = -41
62
+ CL_INVALID_BINARY = -42
63
+ CL_INVALID_BUILD_OPTIONS = -43
64
+ CL_INVALID_PROGRAM = -44
65
+ CL_INVALID_PROGRAM_EXECUTABLE = -45
66
+ CL_INVALID_KERNEL_NAME = -46
67
+ CL_INVALID_KERNEL_DEFINITION = -47
68
+ CL_INVALID_KERNEL = -48
69
+ CL_INVALID_ARG_INDEX = -49
70
+ CL_INVALID_ARG_VALUE = -50
71
+ CL_INVALID_ARG_SIZE = -51
72
+ CL_INVALID_KERNEL_ARGS = -52
73
+ CL_INVALID_WORK_DIMENSION = -53
74
+ CL_INVALID_WORK_GROUP_SIZE = -54
75
+ CL_INVALID_WORK_ITEM_SIZE = -55
76
+ CL_INVALID_GLOBAL_OFFSET = -56
77
+ CL_INVALID_EVENT_WAIT_LIST = -57
78
+ CL_INVALID_EVENT = -58
79
+ CL_INVALID_OPERATION = -59
80
+ CL_INVALID_GL_OBJECT = -60
81
+ CL_INVALID_BUFFER_SIZE = -61
82
+ CL_INVALID_MIP_LEVEL = -62
83
+ CL_VERSION_1_0 = 1
84
+ CL_FALSE = 0
85
+ CL_TRUE = 1
86
+ CL_PLATFORM_PROFILE = 0x0900
87
+ CL_PLATFORM_VERSION = 0x0901
88
+ CL_PLATFORM_NAME = 0x0902
89
+ CL_PLATFORM_VENDOR = 0x0903
90
+ CL_PLATFORM_EXTENSIONS = 0x0904
91
+ CL_DEVICE_TYPE_DEFAULT = (1 << 0)
92
+ CL_DEVICE_TYPE_CPU = (1 << 1)
93
+ CL_DEVICE_TYPE_GPU = (1 << 2)
94
+ CL_DEVICE_TYPE_ACCELERATOR = (1 << 3)
95
+ CL_DEVICE_TYPE_ALL = 0xFFFFFFFF
96
+ CL_DEVICE_TYPE = 0x1000
97
+ CL_DEVICE_VENDOR_ID = 0x1001
98
+ CL_DEVICE_MAX_COMPUTE_UNITS = 0x1002
99
+ CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS = 0x1003
100
+ CL_DEVICE_MAX_WORK_GROUP_SIZE = 0x1004
101
+ CL_DEVICE_MAX_WORK_ITEM_SIZES = 0x1005
102
+ CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR = 0x1006
103
+ CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT = 0x1007
104
+ CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT = 0x1008
105
+ CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG = 0x1009
106
+ CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT = 0x100A
107
+ CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE = 0x100B
108
+ CL_DEVICE_MAX_CLOCK_FREQUENCY = 0x100C
109
+ CL_DEVICE_ADDRESS_BITS = 0x100D
110
+ CL_DEVICE_MAX_READ_IMAGE_ARGS = 0x100E
111
+ CL_DEVICE_MAX_WRITE_IMAGE_ARGS = 0x100F
112
+ CL_DEVICE_MAX_MEM_ALLOC_SIZE = 0x1010
113
+ CL_DEVICE_IMAGE2D_MAX_WIDTH = 0x1011
114
+ CL_DEVICE_IMAGE2D_MAX_HEIGHT = 0x1012
115
+ CL_DEVICE_IMAGE3D_MAX_WIDTH = 0x1013
116
+ CL_DEVICE_IMAGE3D_MAX_HEIGHT = 0x1014
117
+ CL_DEVICE_IMAGE3D_MAX_DEPTH = 0x1015
118
+ CL_DEVICE_IMAGE_SUPPORT = 0x1016
119
+ CL_DEVICE_MAX_PARAMETER_SIZE = 0x1017
120
+ CL_DEVICE_MAX_SAMPLERS = 0x1018
121
+ CL_DEVICE_MEM_BASE_ADDR_ALIGN = 0x1019
122
+ CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE = 0x101A
123
+ CL_DEVICE_SINGLE_FP_CONFIG = 0x101B
124
+ CL_DEVICE_GLOBAL_MEM_CACHE_TYPE = 0x101C
125
+ CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE = 0x101D
126
+ CL_DEVICE_GLOBAL_MEM_CACHE_SIZE = 0x101E
127
+ CL_DEVICE_GLOBAL_MEM_SIZE = 0x101F
128
+ CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE = 0x1020
129
+ CL_DEVICE_MAX_CONSTANT_ARGS = 0x1021
130
+ CL_DEVICE_LOCAL_MEM_TYPE = 0x1022
131
+ CL_DEVICE_LOCAL_MEM_SIZE = 0x1023
132
+ CL_DEVICE_ERROR_CORRECTION_SUPPORT = 0x1024
133
+ CL_DEVICE_PROFILING_TIMER_RESOLUTION = 0x1025
134
+ CL_DEVICE_ENDIAN_LITTLE = 0x1026
135
+ CL_DEVICE_AVAILABLE = 0x1027
136
+ CL_DEVICE_COMPILER_AVAILABLE = 0x1028
137
+ CL_DEVICE_EXECUTION_CAPABILITIES = 0x1029
138
+ CL_DEVICE_QUEUE_PROPERTIES = 0x102A
139
+ CL_DEVICE_NAME = 0x102B
140
+ CL_DEVICE_VENDOR = 0x102C
141
+ CL_DRIVER_VERSION = 0x102D
142
+ CL_DEVICE_PROFILE = 0x102E
143
+ CL_DEVICE_VERSION = 0x102F
144
+ CL_DEVICE_EXTENSIONS = 0x1030
145
+ CL_DEVICE_PLATFORM = 0x1031
146
+ CL_DEVICE_ADDRESS_32_BITS = (1 << 0)
147
+ CL_DEVICE_ADDRESS_64_BITS = (1 << 1)
148
+ CL_FP_DENORM = (1 << 0)
149
+ CL_FP_INF_NAN = (1 << 1)
150
+ CL_FP_ROUND_TO_NEAREST = (1 << 2)
151
+ CL_FP_ROUND_TO_ZERO = (1 << 3)
152
+ CL_FP_ROUND_TO_INF = (1 << 4)
153
+ CL_FP_FMA = (1 << 5)
154
+ CL_NONE = 0x0
155
+ CL_READ_ONLY_CACHE = 0x1
156
+ CL_READ_WRITE_CACHE = 0x2
157
+ CL_LOCAL = 0x1
158
+ CL_GLOBAL = 0x2
159
+ CL_EXEC_KERNEL = (1 << 0)
160
+ CL_EXEC_NATIVE_KERNEL = (1 << 1)
161
+ CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE = (1 << 0)
162
+ CL_QUEUE_PROFILING_ENABLE = (1 << 1)
163
+ CL_CONTEXT_REFERENCE_COUNT = 0x1080
164
+ CL_CONTEXT_NUM_DEVICES = 0x1081
165
+ CL_CONTEXT_DEVICES = 0x1082
166
+ CL_CONTEXT_PROPERTIES = 0x1083
167
+ CL_CONTEXT_PLATFORM = 0x1084
168
+ CL_QUEUE_CONTEXT = 0x1090
169
+ CL_QUEUE_DEVICE = 0x1091
170
+ CL_QUEUE_REFERENCE_COUNT = 0x1092
171
+ CL_QUEUE_PROPERTIES = 0x1093
172
+ CL_MEM_READ_WRITE = (1 << 0)
173
+ CL_MEM_WRITE_ONLY = (1 << 1)
174
+ CL_MEM_READ_ONLY = (1 << 2)
175
+ CL_MEM_USE_HOST_PTR = (1 << 3)
176
+ CL_MEM_ALLOC_HOST_PTR = (1 << 4)
177
+ CL_MEM_COPY_HOST_PTR = (1 << 5)
178
+ CL_R = 0x10B0
179
+ CL_A = 0x10B1
180
+ CL_RG = 0x10B2
181
+ CL_RA = 0x10B3
182
+ CL_RGB = 0x10B4
183
+ CL_RGBA = 0x10B5
184
+ CL_BGRA = 0x10B6
185
+ CL_ARGB = 0x10B7
186
+ CL_INTENSITY = 0x10B8
187
+ CL_LUMINANCE = 0x10B9
188
+ CL_SNORM_INT8 = 0x10D0
189
+ CL_SNORM_INT16 = 0x10D1
190
+ CL_UNORM_INT8 = 0x10D2
191
+ CL_UNORM_INT16 = 0x10D3
192
+ CL_UNORM_SHORT_565 = 0x10D4
193
+ CL_UNORM_SHORT_555 = 0x10D5
194
+ CL_UNORM_INT_101010 = 0x10D6
195
+ CL_SIGNED_INT8 = 0x10D7
196
+ CL_SIGNED_INT16 = 0x10D8
197
+ CL_SIGNED_INT32 = 0x10D9
198
+ CL_UNSIGNED_INT8 = 0x10DA
199
+ CL_UNSIGNED_INT16 = 0x10DB
200
+ CL_UNSIGNED_INT32 = 0x10DC
201
+ CL_HALF_FLOAT = 0x10DD
202
+ CL_FLOAT = 0x10DE
203
+ CL_MEM_OBJECT_BUFFER = 0x10F0
204
+ CL_MEM_OBJECT_IMAGE2D = 0x10F1
205
+ CL_MEM_OBJECT_IMAGE3D = 0x10F2
206
+ CL_MEM_TYPE = 0x1100
207
+ CL_MEM_FLAGS = 0x1101
208
+ CL_MEM_SIZE = 0x1102
209
+ CL_MEM_HOST_PTR = 0x1103
210
+ CL_MEM_MAP_COUNT = 0x1104
211
+ CL_MEM_REFERENCE_COUNT = 0x1105
212
+ CL_MEM_CONTEXT = 0x1106
213
+ CL_IMAGE_FORMAT = 0x1110
214
+ CL_IMAGE_ELEMENT_SIZE = 0x1111
215
+ CL_IMAGE_ROW_PITCH = 0x1112
216
+ CL_IMAGE_SLICE_PITCH = 0x1113
217
+ CL_IMAGE_WIDTH = 0x1114
218
+ CL_IMAGE_HEIGHT = 0x1115
219
+ CL_IMAGE_DEPTH = 0x1116
220
+ CL_ADDRESS_NONE = 0x1130
221
+ CL_ADDRESS_CLAMP_TO_EDGE = 0x1131
222
+ CL_ADDRESS_CLAMP = 0x1132
223
+ CL_ADDRESS_REPEAT = 0x1133
224
+ CL_FILTER_NEAREST = 0x1140
225
+ CL_FILTER_LINEAR = 0x1141
226
+ CL_SAMPLER_REFERENCE_COUNT = 0x1150
227
+ CL_SAMPLER_CONTEXT = 0x1151
228
+ CL_SAMPLER_NORMALIZED_COORDS = 0x1152
229
+ CL_SAMPLER_ADDRESSING_MODE = 0x1153
230
+ CL_SAMPLER_FILTER_MODE = 0x1154
231
+ CL_MAP_READ = (1 << 0)
232
+ CL_MAP_WRITE = (1 << 1)
233
+ CL_PROGRAM_REFERENCE_COUNT = 0x1160
234
+ CL_PROGRAM_CONTEXT = 0x1161
235
+ CL_PROGRAM_NUM_DEVICES = 0x1162
236
+ CL_PROGRAM_DEVICES = 0x1163
237
+ CL_PROGRAM_SOURCE = 0x1164
238
+ CL_PROGRAM_BINARY_SIZES = 0x1165
239
+ CL_PROGRAM_BINARIES = 0x1166
240
+ CL_PROGRAM_BUILD_STATUS = 0x1181
241
+ CL_PROGRAM_BUILD_OPTIONS = 0x1182
242
+ CL_PROGRAM_BUILD_LOG = 0x1183
243
+ CL_BUILD_SUCCESS = 0
244
+ CL_BUILD_NONE = -1
245
+ CL_BUILD_ERROR = -2
246
+ CL_BUILD_IN_PROGRESS = -3
247
+ CL_KERNEL_FUNCTION_NAME = 0x1190
248
+ CL_KERNEL_NUM_ARGS = 0x1191
249
+ CL_KERNEL_REFERENCE_COUNT = 0x1192
250
+ CL_KERNEL_CONTEXT = 0x1193
251
+ CL_KERNEL_PROGRAM = 0x1194
252
+ CL_KERNEL_WORK_GROUP_SIZE = 0x11B0
253
+ CL_KERNEL_COMPILE_WORK_GROUP_SIZE = 0x11B1
254
+ CL_KERNEL_LOCAL_MEM_SIZE = 0x11B2
255
+ CL_EVENT_COMMAND_QUEUE = 0x11D0
256
+ CL_EVENT_COMMAND_TYPE = 0x11D1
257
+ CL_EVENT_REFERENCE_COUNT = 0x11D2
258
+ CL_EVENT_COMMAND_EXECUTION_STATUS = 0x11D3
259
+ CL_COMMAND_NDRANGE_KERNEL = 0x11F0
260
+ CL_COMMAND_TASK = 0x11F1
261
+ CL_COMMAND_NATIVE_KERNEL = 0x11F2
262
+ CL_COMMAND_READ_BUFFER = 0x11F3
263
+ CL_COMMAND_WRITE_BUFFER = 0x11F4
264
+ CL_COMMAND_COPY_BUFFER = 0x11F5
265
+ CL_COMMAND_READ_IMAGE = 0x11F6
266
+ CL_COMMAND_WRITE_IMAGE = 0x11F7
267
+ CL_COMMAND_COPY_IMAGE = 0x11F8
268
+ CL_COMMAND_COPY_IMAGE_TO_BUFFER = 0x11F9
269
+ CL_COMMAND_COPY_BUFFER_TO_IMAGE = 0x11FA
270
+ CL_COMMAND_MAP_BUFFER = 0x11FB
271
+ CL_COMMAND_MAP_IMAGE = 0x11FC
272
+ CL_COMMAND_UNMAP_MEM_OBJECT = 0x11FD
273
+ CL_COMMAND_MARKER = 0x11FE
274
+ CL_COMMAND_WAIT_FOR_EVENTS = 0x11FF
275
+ CL_COMMAND_BARRIER = 0x1200
276
+ CL_COMMAND_ACQUIRE_GL_OBJECTS = 0x1201
277
+ CL_COMMAND_RELEASE_GL_OBJECTS = 0x1202
278
+ CL_COMPLETE = 0x0
279
+ CL_RUNNING = 0x1
280
+ CL_SUBMITTED = 0x2
281
+ CL_QUEUED = 0x3
282
+ CL_PROFILING_COMMAND_QUEUED = 0x1280
283
+ CL_PROFILING_COMMAND_SUBMIT = 0x1281
284
+ CL_PROFILING_COMMAND_START = 0x1282
285
+ CL_PROFILING_COMMAND_END = 0x1283
286
+ attach_function :clGetPlatformIDs, [ :uint, :pointer, :pointer ], :int
287
+ attach_function :clGetPlatformInfo, [ :pointer, :uint, :uint, :pointer, :pointer ], :int
288
+ attach_function :clGetDeviceIDs, [ :pointer, :ulong_long, :uint, :pointer, :pointer ], :int
289
+ attach_function :clGetDeviceInfo, [ :pointer, :uint, :uint, :pointer, :pointer ], :int
290
+ attach_function :clCreateContext, [ :pointer, :uint, :pointer, callback([ :string, :pointer, :uint, :pointer ], :void), :pointer, :pointer ], :pointer
291
+ attach_function :clCreateContextFromType, [ :pointer, :ulong_long, callback([ :string, :pointer, :uint, :pointer ], :void), :pointer, :pointer ], :pointer
292
+ attach_function :clRetainContext, [ :pointer ], :int
293
+ attach_function :clReleaseContext, [ :pointer ], :int
294
+ attach_function :clGetContextInfo, [ :pointer, :uint, :uint, :pointer, :pointer ], :int
295
+ attach_function :clCreateCommandQueue, [ :pointer, :pointer, :ulong_long, :pointer ], :pointer
296
+ attach_function :clRetainCommandQueue, [ :pointer ], :int
297
+ attach_function :clReleaseCommandQueue, [ :pointer ], :int
298
+ attach_function :clGetCommandQueueInfo, [ :pointer, :uint, :uint, :pointer, :pointer ], :int
299
+ attach_function :clSetCommandQueueProperty, [ :pointer, :ulong_long, :uint, :pointer ], :int
300
+ attach_function :clCreateBuffer, [ :pointer, :ulong_long, :uint, :pointer, :pointer ], :pointer
301
+ attach_function :clCreateImage2D, [ :pointer, :ulong_long, :pointer, :uint, :uint, :uint, :pointer, :pointer ], :pointer
302
+ attach_function :clCreateImage3D, [ :pointer, :ulong_long, :pointer, :uint, :uint, :uint, :uint, :uint, :pointer, :pointer ], :pointer
303
+ attach_function :clRetainMemObject, [ :pointer ], :int
304
+ attach_function :clReleaseMemObject, [ :pointer ], :int
305
+ attach_function :clGetSupportedImageFormats, [ :pointer, :ulong_long, :uint, :uint, :pointer, :pointer ], :int
306
+ attach_function :clGetMemObjectInfo, [ :pointer, :uint, :uint, :pointer, :pointer ], :int
307
+ attach_function :clGetImageInfo, [ :pointer, :uint, :uint, :pointer, :pointer ], :int
308
+ attach_function :clCreateSampler, [ :pointer, :uint, :uint, :uint, :pointer ], :pointer
309
+ attach_function :clRetainSampler, [ :pointer ], :int
310
+ attach_function :clReleaseSampler, [ :pointer ], :int
311
+ attach_function :clGetSamplerInfo, [ :pointer, :uint, :uint, :pointer, :pointer ], :int
312
+ attach_function :clCreateProgramWithSource, [ :pointer, :uint, :pointer, :pointer, :pointer ], :pointer
313
+ attach_function :clCreateProgramWithBinary, [ :pointer, :uint, :pointer, :pointer, :pointer, :pointer, :pointer ], :pointer
314
+ attach_function :clRetainProgram, [ :pointer ], :int
315
+ attach_function :clReleaseProgram, [ :pointer ], :int
316
+ attach_function :clBuildProgram, [ :pointer, :uint, :pointer, :string, callback([ :pointer, :pointer ], :void), :pointer ], :int
317
+ attach_function :clUnloadCompiler, [ ], :int
318
+ attach_function :clGetProgramInfo, [ :pointer, :uint, :uint, :pointer, :pointer ], :int
319
+ attach_function :clGetProgramBuildInfo, [ :pointer, :pointer, :uint, :uint, :pointer, :pointer ], :int
320
+ attach_function :clCreateKernel, [ :pointer, :string, :pointer ], :pointer
321
+ attach_function :clCreateKernelsInProgram, [ :pointer, :uint, :pointer, :pointer ], :int
322
+ attach_function :clRetainKernel, [ :pointer ], :int
323
+ attach_function :clReleaseKernel, [ :pointer ], :int
324
+ attach_function :clSetKernelArg, [ :pointer, :uint, :uint, :pointer ], :int
325
+ attach_function :clGetKernelInfo, [ :pointer, :uint, :uint, :pointer, :pointer ], :int
326
+ attach_function :clGetKernelWorkGroupInfo, [ :pointer, :pointer, :uint, :uint, :pointer, :pointer ], :int
327
+ attach_function :clWaitForEvents, [ :uint, :pointer ], :int
328
+ attach_function :clGetEventInfo, [ :pointer, :uint, :uint, :pointer, :pointer ], :int
329
+ attach_function :clRetainEvent, [ :pointer ], :int
330
+ attach_function :clReleaseEvent, [ :pointer ], :int
331
+ attach_function :clGetEventProfilingInfo, [ :pointer, :uint, :uint, :pointer, :pointer ], :int
332
+ attach_function :clFlush, [ :pointer ], :int
333
+ attach_function :clFinish, [ :pointer ], :int
334
+ attach_function :clEnqueueReadBuffer, [ :pointer, :pointer, :uint, :uint, :uint, :pointer, :uint, :pointer, :pointer ], :int
335
+ attach_function :clEnqueueWriteBuffer, [ :pointer, :pointer, :uint, :uint, :uint, :pointer, :uint, :pointer, :pointer ], :int
336
+ attach_function :clEnqueueCopyBuffer, [ :pointer, :pointer, :pointer, :uint, :uint, :uint, :uint, :pointer, :pointer ], :int
337
+ attach_function :clEnqueueReadImage, [ :pointer, :pointer, :uint, :pointer, :pointer, :uint, :uint, :pointer, :uint, :pointer, :pointer ], :int
338
+ attach_function :clEnqueueWriteImage, [ :pointer, :pointer, :uint, :pointer, :pointer, :uint, :uint, :pointer, :uint, :pointer, :pointer ], :int
339
+ attach_function :clEnqueueCopyImage, [ :pointer, :pointer, :pointer, :pointer, :pointer, :pointer, :uint, :pointer, :pointer ], :int
340
+ attach_function :clEnqueueCopyImageToBuffer, [ :pointer, :pointer, :pointer, :pointer, :pointer, :uint, :uint, :pointer, :pointer ], :int
341
+ attach_function :clEnqueueCopyBufferToImage, [ :pointer, :pointer, :pointer, :uint, :pointer, :pointer, :uint, :pointer, :pointer ], :int
342
+ attach_function :clEnqueueMapBuffer, [ :pointer, :pointer, :uint, :ulong_long, :uint, :uint, :uint, :pointer, :pointer, :pointer ], :pointer
343
+ attach_function :clEnqueueMapImage, [ :pointer, :pointer, :uint, :ulong_long, :pointer, :pointer, :pointer, :pointer, :uint, :pointer, :pointer, :pointer ], :pointer
344
+ attach_function :clEnqueueUnmapMemObject, [ :pointer, :pointer, :pointer, :uint, :pointer, :pointer ], :int
345
+ attach_function :clEnqueueNDRangeKernel, [ :pointer, :pointer, :uint, :pointer, :pointer, :pointer, :uint, :pointer, :pointer ], :int
346
+ attach_function :clEnqueueTask, [ :pointer, :pointer, :uint, :pointer, :pointer ], :int
347
+ attach_function :clEnqueueNativeKernel, [ :pointer, callback([ :pointer ], :void), :pointer, :uint, :uint, :pointer, :pointer, :uint, :pointer, :pointer ], :int
348
+ attach_function :clEnqueueMarker, [ :pointer, :pointer ], :int
349
+ attach_function :clEnqueueWaitForEvents, [ :pointer, :uint, :pointer ], :int
350
+ attach_function :clEnqueueBarrier, [ :pointer ], :int
351
+ CL_GL_OBJECT_BUFFER = 0x2000
352
+ CL_GL_OBJECT_TEXTURE2D = 0x2001
353
+ CL_GL_OBJECT_TEXTURE3D = 0x2002
354
+ CL_GL_OBJECT_RENDERBUFFER = 0x2003
355
+ CL_GL_TEXTURE_TARGET = 0x2004
356
+ CL_GL_MIPMAP_LEVEL = 0x2005
357
+ attach_function :clCreateFromGLBuffer, [ :pointer, :ulong_long, :uint, :pointer ], :pointer
358
+ attach_function :clCreateFromGLTexture2D, [ :pointer, :ulong_long, :uint, :int, :uint, :pointer ], :pointer
359
+ attach_function :clCreateFromGLTexture3D, [ :pointer, :ulong_long, :uint, :int, :uint, :pointer ], :pointer
360
+ attach_function :clCreateFromGLRenderbuffer, [ :pointer, :ulong_long, :uint, :pointer ], :pointer
361
+ attach_function :clGetGLObjectInfo, [ :pointer, :pointer, :pointer ], :int
362
+ attach_function :clGetGLTextureInfo, [ :pointer, :uint, :uint, :pointer, :pointer ], :int
363
+ attach_function :clEnqueueAcquireGLObjects, [ :pointer, :uint, :pointer, :uint, :pointer, :pointer ], :int
364
+ attach_function :clEnqueueReleaseGLObjects, [ :pointer, :uint, :pointer, :uint, :pointer, :pointer ], :int
365
+
366
+ end
@@ -0,0 +1,10 @@
1
+ require 'rbconfig'
2
+ module CL
3
+ extend FFI::Library
4
+ case Config::CONFIG['target_os']
5
+ when /linux/
6
+ ffi_lib 'libCL.so.1'
7
+ when /darwin/
8
+ ffi_lib '/System/Library/Frameworks/OpenCL.framework/OpenCL'
9
+ end
10
+ end
data/lib/ffi-opencl.rb ADDED
@@ -0,0 +1,12 @@
1
+ $: << "../lib"
2
+
3
+ begin
4
+ require 'rubygems'
5
+ rescue
6
+ nil # try without it
7
+ end
8
+
9
+ require 'ffi'
10
+ require 'ffi-opencl/platform'
11
+ require 'ffi-opencl/cl'
12
+
@@ -0,0 +1,7 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "FfiOpencl" do
4
+ it "fails" do
5
+ fail "hey buddy, you should probably rename this file and start specing for real"
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec'
2
+
3
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
4
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
5
+ require 'ffi-opencl'
6
+
7
+ Spec::Runner.configure do |config|
8
+
9
+ end
@@ -0,0 +1,11 @@
1
+ begin
2
+ require 'ffi-swig-generator'
3
+ FFI::Generator::Task.new do |task|
4
+ task.input_fn = 'interfaces/*.i'
5
+ task.output_dir = 'generated/'
6
+ end
7
+ rescue LoadError
8
+ nil
9
+ end
10
+
11
+
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class FfiOpenclTest < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ require 'ffi-opencl'
8
+
9
+ class Test::Unit::TestCase
10
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ffi-opencl
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Martin Hess
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-06-25 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: ffi
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.3.0
24
+ version:
25
+ description:
26
+ email: martinhes@mac.com
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - LICENSE
33
+ - README.rdoc
34
+ files:
35
+ - .document
36
+ - .gitignore
37
+ - LICENSE
38
+ - README.rdoc
39
+ - Rakefile
40
+ - VERSION
41
+ - examples/capabilities.rb
42
+ - ffi-opencl.gemspec
43
+ - interfaces/cl.h
44
+ - interfaces/cl.i
45
+ - interfaces/cl_gl.h
46
+ - interfaces/cl_platform.h
47
+ - lib/ffi-opencl.rb
48
+ - lib/ffi-opencl/cl.rb
49
+ - lib/ffi-opencl/platform.rb
50
+ - spec/ffi-opencl_spec.rb
51
+ - spec/spec_helper.rb
52
+ - tasks/generator.rake
53
+ - test/ffi-opencl_test.rb
54
+ - test/test_helper.rb
55
+ has_rdoc: true
56
+ homepage: http://github.com/hessml/ffi-opencl
57
+ post_install_message:
58
+ rdoc_options:
59
+ - --charset=UTF-8
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: "0"
67
+ version:
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: "0"
73
+ version:
74
+ requirements:
75
+ - libffi
76
+ - swig
77
+ - opencl 1.0 driver
78
+ rubyforge_project: ffi-opencl
79
+ rubygems_version: 1.3.1
80
+ signing_key:
81
+ specification_version: 2
82
+ summary: TODO
83
+ test_files:
84
+ - spec/ffi-opencl_spec.rb
85
+ - spec/spec_helper.rb
86
+ - test/ffi-opencl_test.rb
87
+ - test/test_helper.rb
88
+ - examples/capabilities.rb