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

Comparing OpenCL/OpenCL.pm (file contents):
Revision 1.83 by root, Sat May 5 15:11:19 2012 UTC vs.
Revision 1.87 by root, Mon May 7 01:01:33 2012 UTC

399=head2 CONSTANTS 399=head2 CONSTANTS
400 400
401All C<CL_xxx> constants that this module supports are always available 401All C<CL_xxx> constants that this module supports are always available
402in the C<OpenCL> namespace as C<OpenCL::xxx> (i.e. without the C<CL_> 402in the C<OpenCL> namespace as C<OpenCL::xxx> (i.e. without the C<CL_>
403prefix). Constants which are not defined in the header files used during 403prefix). Constants which are not defined in the header files used during
404compilation, or otherwise are not available, will have the value C<-1>. 404compilation, or otherwise are not available, will have the value C<0> (in
405some cases, this will make them indistinguishable from real constants,
406sorry).
405 407
406The latest version of this module knows and exports the constants 408The latest version of this module knows and exports the constants
407listed in L<http://cvs.schmorp.de/OpenCL/constiv.h>. 409listed in L<http://cvs.schmorp.de/OpenCL/constiv.h>.
408 410
409=head2 OPENCL 1.1 VS. OPENCL 1.2 411=head2 OPENCL 1.1 VS. OPENCL 1.2
595use Async::Interrupt (); 597use Async::Interrupt ();
596 598
597our $POLL_FUNC; # set by XS 599our $POLL_FUNC; # set by XS
598 600
599BEGIN { 601BEGIN {
600 our $VERSION = '0.99'; 602 our $VERSION = '1.01';
601 603
602 require XSLoader; 604 require XSLoader;
603 XSLoader::load (__PACKAGE__, $VERSION); 605 XSLoader::load (__PACKAGE__, $VERSION);
604 606
605 @OpenCL::Platform::ISA = 607 @OpenCL::Platform::ISA =
1620it. You are not necessarily meant to do it this way, this example just 1622it. You are not necessarily meant to do it this way, this example just
1621shows you the accessors to use :) 1623shows you the accessors to use :)
1622 1624
1623 my $mapped = $queue->map_image ($image, 1, OpenCL::MAP_WRITE); 1625 my $mapped = $queue->map_image ($image, 1, OpenCL::MAP_WRITE);
1624 1626
1625 $mapped->set ($_ * $mapped->row_pitch, pack "C", 5) 1627 $mapped->write ($_ * $mapped->row_pitch, pack "C", 5)
1626 for 0..$image->height; 1628 for 0 .. $mapped->height - 1;
1627 1629
1628 $mapped->unmap;. 1630 $mapped->unmap;.
1629 $mapped->wait; # only needed for out of order queues normally 1631 $mapped->wait; # only needed for out of order queues normally
1630 1632
1631=item $ev = $queue->unmap ($mapped, $wait_events...) 1633=item $ev = $queue->unmap ($mapped, $wait_events...)
2343 2345
2344This is a subclass of OpenCL::Mapped, representing mapped images. 2346This is a subclass of OpenCL::Mapped, representing mapped images.
2345 2347
2346=over 4 2348=over 4
2347 2349
2350=item $pixels = $mapped->width
2351
2352=item $pixels = $mapped->height
2353
2354=item $pixels = $mapped->depth
2355
2356Return the width/height/depth of the mapped image region, in pixels.
2357
2348=item $bytes = $mapped->row_pitch 2358=item $bytes = $mapped->row_pitch
2349 2359
2350=item $bytes = $mapped->slice_pitch 2360=item $bytes = $mapped->slice_pitch
2351 2361
2352Return the row or slice pitch of the image that has been mapped. 2362Return the row or slice pitch of the image that has been mapped.
2353 2363
2364=item $bytes = $mapped->element_size
2365
2366Return the size of a single pixel.
2367
2368=item $data = $mapped->get_row ($count, $x=0, $y=0, $z=0)
2369
2370Return C<$count> pixels from the given coordinates. The pixel data must
2371be completely contained within a single row.
2372
2373If C<$count> is C<undef>, then all the remaining pixels in that row are
2374returned.
2375
2376=item $mapped->set_row ($data, $x=0, $y=0, $z=0)
2377
2378Write the given pixel data at the given coordinate. The pixel data must
2379be completely contained within a single row.
2380
2354=back 2381=back
2355
2356 2382
2357=cut 2383=cut
2358 2384
23591; 23851;
2360 2386

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines