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

Comparing OpenCL/OpenCL.xs (file contents):
Revision 1.34 by root, Fri Apr 20 19:36:00 2012 UTC vs.
Revision 1.35 by root, Sat Apr 21 17:47:23 2012 UTC

257 clGetImageInfo (img, CL_IMAGE_ROW_PITCH, sizeof (res), &res, 0); 257 clGetImageInfo (img, CL_IMAGE_ROW_PITCH, sizeof (res), &res, 0);
258 return res; 258 return res;
259} 259}
260 260
261static cl_event * 261static cl_event *
262event_list (SV **items, int count) 262event_list (SV **items, cl_uint *rcount)
263{ 263{
264 cl_uint count = *rcount;
265
264 if (!count) 266 if (!count)
265 return 0; 267 return 0;
266 268
267 cl_event *list = tmpbuf (sizeof (cl_event) * count); 269 cl_event *list = tmpbuf (sizeof (cl_event) * count);
270 int i = 0;
268 271
269 while (count--) 272 do
273 {
274 --count;
275 if (SvOK (items [count]))
270 list [count] = SvPTROBJ ("clEnqueue", "wait_events", items [count], "OpenCL::Event"); 276 list [i++] = SvPTROBJ ("clEnqueue", "wait_events", items [count], "OpenCL::Event");
277 }
278 while (count);
271 279
280 *rcount = i;
281
272 return list; 282 return i ? list : 0;
273} 283}
274 284
275#define EVENT_LIST(items,count) \ 285#define EVENT_LIST(items,count) \
276 cl_uint event_list_count = (count); \ 286 cl_uint event_list_count = (count); \
277 cl_event *event_list_ptr = event_list (&ST (items), event_list_count) 287 cl_event *event_list_ptr = event_list (&ST (items), &event_list_count)
278 288
279#define INFO(class) \ 289#define INFO(class) \
280{ \ 290{ \
281 size_t size; \ 291 size_t size; \
282 NEED_SUCCESS (Get ## class ## Info, (self, name, 0, 0, &size)); \ 292 NEED_SUCCESS (Get ## class ## Info, (self, name, 0, 0, &size)); \

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines