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

Comparing OpenCL/OpenCL.pm (file contents):
Revision 1.73 by root, Fri May 4 14:56:50 2012 UTC vs.
Revision 1.74 by root, Fri May 4 15:04:51 2012 UTC

434OpenCL can generate a number of (potentially) asynchronous events, for 434OpenCL can generate a number of (potentially) asynchronous events, for
435example, after compiling a program, to signal a context-related error or, 435example, after compiling a program, to signal a context-related error or,
436perhaps most important, to signal completion of queued jobs (by setting 436perhaps most important, to signal completion of queued jobs (by setting
437callbacks on OpenCL::Event objects). 437callbacks on OpenCL::Event objects).
438 438
439The OpenCL module converts all these callbacks into events - you can
440still register callbacks, but they are not executed when your OpenCL
441implementation calls the actual callback, but only later. Therefore, none
442of the limitations of OpenCL callbacks apply to the perl implementation:
443it is perfectly safe to make blocking operations from event callbacks, and
444enqueued operations don't need to be flushed.
445
439To facilitate this, this module maintains an event queue - each 446To facilitate this, this module maintains an event queue - each
440time an asynchronous event happens, it is queued, and perl will be 447time an asynchronous event happens, it is queued, and perl will be
441interrupted. This is implemented via the L<Async::Interrupt> module. In 448interrupted. This is implemented via the L<Async::Interrupt> module. In
442addition, this module has L<AnyEvent> support, so it can seamlessly 449addition, this module has L<AnyEvent> support, so it can seamlessly
443integrate itself into many event loops. 450integrate itself into many event loops.
444 451
445Since this module is a bit hard to understand, here are some case examples: 452Since L<Async::Interrupt> is a bit hard to understand, here are some case examples:
446 453
447=head3 Don't use callbacks. 454=head3 Don't use callbacks.
448 455
449When your program never uses any callbacks, then there will never be any 456When your program never uses any callbacks, then there will never be any
450notifications you need to take care of, and therefore no need to worry 457notifications you need to take care of, and therefore no need to worry

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines