… | |
… | |
22 | typedef cl_program OpenCL__Program; |
22 | typedef cl_program OpenCL__Program; |
23 | typedef cl_kernel OpenCL__Kernel; |
23 | typedef cl_kernel OpenCL__Kernel; |
24 | typedef cl_event OpenCL__Event; |
24 | typedef cl_event OpenCL__Event; |
25 | typedef cl_event OpenCL__UserEvent; |
25 | typedef cl_event OpenCL__UserEvent; |
26 | |
26 | |
|
|
27 | typedef SV *FUTURE; |
|
|
28 | |
27 | /*****************************************************************************/ |
29 | /*****************************************************************************/ |
28 | |
30 | |
29 | /* up to two temporary buffers */ |
31 | /* up to two temporary buffers */ |
30 | static void * |
32 | static void * |
31 | tmpbuf (size_t size) |
33 | tmpbuf (size_t size) |
… | |
… | |
202 | for (i = 0; i < count; ++i) |
204 | for (i = 0; i < count; ++i) |
203 | PUSHs (NEW_MORTAL_OBJ ("OpenCL::Platform", list [i])); |
205 | PUSHs (NEW_MORTAL_OBJ ("OpenCL::Platform", list [i])); |
204 | } |
206 | } |
205 | |
207 | |
206 | void |
208 | void |
207 | context_from_type_simple (cl_device_type type = CL_DEVICE_TYPE_DEFAULT) |
209 | context_from_type (FUTURE properties = 0, cl_device_type type = CL_DEVICE_TYPE_DEFAULT, FUTURE notify = 0) |
208 | PPCODE: |
210 | PPCODE: |
209 | { |
211 | { |
210 | cl_int res; |
212 | cl_int res; |
211 | cl_context ctx = clCreateContextFromType (0, type, 0, 0, &res); |
213 | cl_context ctx = clCreateContextFromType (0, type, 0, 0, &res); |
212 | |
214 | |
… | |
… | |
249 | for (i = 0; i < count; ++i) |
251 | for (i = 0; i < count; ++i) |
250 | PUSHs (sv_setref_pv (sv_newmortal (), "OpenCL::Device", list [i])); |
252 | PUSHs (sv_setref_pv (sv_newmortal (), "OpenCL::Device", list [i])); |
251 | } |
253 | } |
252 | |
254 | |
253 | void |
255 | void |
254 | context_from_type_simple (OpenCL::Platform this, cl_device_type type = CL_DEVICE_TYPE_DEFAULT) |
256 | context_from_type (OpenCL::Platform this, FUTURE properties = 0, cl_device_type type = CL_DEVICE_TYPE_DEFAULT, FUTURE notify = 0) |
255 | PPCODE: |
257 | PPCODE: |
256 | { |
258 | { |
257 | cl_int res; |
259 | cl_int res; |
258 | cl_context_properties props[] = { CL_CONTEXT_PLATFORM, (cl_context_properties)this, 0 }; |
260 | cl_context_properties props[] = { CL_CONTEXT_PLATFORM, (cl_context_properties)this, 0 }; |
259 | cl_context ctx = clCreateContextFromType (props, type, 0, 0, &res); |
261 | cl_context ctx = clCreateContextFromType (props, type, 0, 0, &res); |
… | |
… | |
270 | info (OpenCL::Device this, cl_device_info name) |
272 | info (OpenCL::Device this, cl_device_info name) |
271 | PPCODE: |
273 | PPCODE: |
272 | INFO (Device) |
274 | INFO (Device) |
273 | |
275 | |
274 | void |
276 | void |
275 | context_simple (OpenCL::Device this) |
277 | context (OpenCL::Device this, FUTURE properties = 0, FUTURE notify = 0) |
276 | PPCODE: |
278 | PPCODE: |
277 | { |
279 | { |
278 | cl_int res; |
280 | cl_int res; |
279 | cl_context ctx = clCreateContext (0, 1, &this, 0, 0, &res); |
281 | cl_context ctx = clCreateContext (0, 1, &this, 0, 0, &res); |
280 | |
282 | |
… | |
… | |
295 | info (OpenCL::Context this, cl_context_info name) |
297 | info (OpenCL::Context this, cl_context_info name) |
296 | PPCODE: |
298 | PPCODE: |
297 | INFO (Context) |
299 | INFO (Context) |
298 | |
300 | |
299 | void |
301 | void |
300 | queue (OpenCL::Context this, OpenCL::Device device, cl_command_queue_properties properties) |
302 | queue (OpenCL::Context this, OpenCL::Device device, cl_command_queue_properties properties = 0) |
301 | PPCODE: |
303 | PPCODE: |
302 | { |
304 | { |
303 | cl_int res; |
305 | cl_int res; |
304 | cl_command_queue queue = clCreateCommandQueue (this, device, properties, &res); |
306 | cl_command_queue queue = clCreateCommandQueue (this, device, properties, &res); |
305 | |
307 | |