ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/OpenCL/OpenCL.xs
(Generate patch)

Comparing OpenCL/OpenCL.xs (file contents):
Revision 1.6 by root, Thu Nov 17 01:36:52 2011 UTC vs.
Revision 1.7 by root, Thu Nov 17 02:10:39 2011 UTC

22typedef cl_program OpenCL__Program; 22typedef cl_program OpenCL__Program;
23typedef cl_kernel OpenCL__Kernel; 23typedef cl_kernel OpenCL__Kernel;
24typedef cl_event OpenCL__Event; 24typedef cl_event OpenCL__Event;
25typedef cl_event OpenCL__UserEvent; 25typedef cl_event OpenCL__UserEvent;
26 26
27typedef SV *FUTURE;
28
27/*****************************************************************************/ 29/*****************************************************************************/
28 30
29/* up to two temporary buffers */ 31/* up to two temporary buffers */
30static void * 32static void *
31tmpbuf (size_t size) 33tmpbuf (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
206void 208void
207context_from_type_simple (cl_device_type type = CL_DEVICE_TYPE_DEFAULT) 209context_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
253void 255void
254context_from_type_simple (OpenCL::Platform this, cl_device_type type = CL_DEVICE_TYPE_DEFAULT) 256context_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);
270info (OpenCL::Device this, cl_device_info name) 272info (OpenCL::Device this, cl_device_info name)
271 PPCODE: 273 PPCODE:
272 INFO (Device) 274 INFO (Device)
273 275
274void 276void
275context_simple (OpenCL::Device this) 277context (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
295info (OpenCL::Context this, cl_context_info name) 297info (OpenCL::Context this, cl_context_info name)
296 PPCODE: 298 PPCODE:
297 INFO (Context) 299 INFO (Context)
298 300
299void 301void
300queue (OpenCL::Context this, OpenCL::Device device, cl_command_queue_properties properties) 302queue (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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines