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

Comparing OpenCL/OpenCL.pm (file contents):
Revision 1.81 by root, Sat May 5 14:17:39 2012 UTC vs.
Revision 1.85 by root, Sat May 5 16:52:17 2012 UTC

595use Async::Interrupt (); 595use Async::Interrupt ();
596 596
597our $POLL_FUNC; # set by XS 597our $POLL_FUNC; # set by XS
598 598
599BEGIN { 599BEGIN {
600 our $VERSION = '0.99'; 600 our $VERSION = '1.0';
601 601
602 require XSLoader; 602 require XSLoader;
603 XSLoader::load (__PACKAGE__, $VERSION); 603 XSLoader::load (__PACKAGE__, $VERSION);
604 604
605 @OpenCL::Platform::ISA = 605 @OpenCL::Platform::ISA =
656human readable string. When confronted with some random integer it can be 656human readable string. When confronted with some random integer it can be
657very helpful to pass it through this function to maybe get some readable 657very helpful to pass it through this function to maybe get some readable
658string out of it. 658string out of it.
659 659
660The latest version of this module knows the enumaration constants 660The latest version of this module knows the enumaration constants
661listed in L<http://cvs.schmorp.de/OpenCL/errstr.h>. 661listed in L<http://cvs.schmorp.de/OpenCL/enumstr.h>.
662 662
663=item @platforms = OpenCL::platforms 663=item @platforms = OpenCL::platforms
664 664
665Returns all available OpenCL::Platform objects. 665Returns all available OpenCL::Platform objects.
666 666
1422 1422
1423=item $ev = $queue->copy_buffer ($src, $dst, $src_offset, $dst_offset, $len, $wait_events...) 1423=item $ev = $queue->copy_buffer ($src, $dst, $src_offset, $dst_offset, $len, $wait_events...)
1424 1424
1425L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBuffer.html> 1425L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBuffer.html>
1426 1426
1427=item $ev = $queue->read_buffer_rect (OpenCL::Memory buf, cl_bool blocking, $buf_x, $buf_y, $buf_z, $host_x, $host_y, $host_z, $width, $height, $depth, $buf_row_pitch, $buf_slice_pitch, $host_row_pitch, $host_slice_pitch, $data, $wait_events...) 1427$eue->read_buffer_rect ($buf, cl_bool blocking, $buf_x, $buf_y, $buf_z, $host_x, $host_y, $host_z, $width, $height, $depth, $buf_row_pitch, $buf_slice_pitch, $host_row_pitch, $host_slice_pitch, $data, $wait_events...)
1428 1428
1429http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueReadBufferRect.html 1429http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueReadBufferRect.html
1430 1430
1431=item $ev = $queue->write_buffer_rect (OpenCL::Memory buf, cl_bool blocking, $buf_x, $buf_y, $buf_z, $host_x, $host_y, $host_z, $width, $height, $depth, $buf_row_pitch, $buf_slice_pitch, $host_row_pitch, $host_slice_pitch, $data, $wait_events...) 1431=item $ev = $queue->write_buffer_rect ($buf, $blocking, $buf_y, $host_x, $host_z, $height, $buf_row_pitch, $host_row_pitch, $data, $wait_events...)
1432 1432
1433http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWriteBufferRect.html 1433http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWriteBufferRect.html
1434 1434
1435=item $ev = $queue->copy_buffer_to_image ($src_buffer, $dst_image, $src_offset, $dst_x, $dst_y, $dst_z, $width, $height, $depth, $wait_events...) 1435=item $ev = $queue->copy_buffer_to_image ($src_buffer, $dst_image, $src_offset, $dst_x, $dst_y, $dst_z, $width, $height, $depth, $wait_events...)
1436 1436
1620it. You are not necessarily meant to do it this way, this example just 1620it. You are not necessarily meant to do it this way, this example just
1621shows you the accessors to use :) 1621shows you the accessors to use :)
1622 1622
1623 my $mapped = $queue->map_image ($image, 1, OpenCL::MAP_WRITE); 1623 my $mapped = $queue->map_image ($image, 1, OpenCL::MAP_WRITE);
1624 1624
1625 $mapped->set ($_ * $mapped->row_pitch, pack "C", 5) 1625 $mapped->write ($_ * $mapped->row_pitch, pack "C", 5)
1626 for 0..$image->height; 1626 for 0 .. $mapped->height - 1;
1627 1627
1628 $mapped->unmap;. 1628 $mapped->unmap;.
1629 $mapped->wait; # only needed for out of order queues normally 1629 $mapped->wait; # only needed for out of order queues normally
1630 1630
1631=item $ev = $queue->unmap ($mapped, $wait_events...) 1631=item $ev = $queue->unmap ($mapped, $wait_events...)
1650=item $packed_value = $memory->info ($name) 1650=item $packed_value = $memory->info ($name)
1651 1651
1652See C<< $platform->info >> for details. 1652See C<< $platform->info >> for details.
1653 1653
1654L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetMemObjectInfo.html> 1654L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetMemObjectInfo.html>
1655
1656=item $memory->destructor_callback ($cb->())
1657
1658Sets a callback that will be invoked after the memory object is destructed.
1659
1660L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clSetMemObjectDestructorCallback.html>
1655 1661
1656=for gengetinfo begin mem 1662=for gengetinfo begin mem
1657 1663
1658=item $mem_object_type = $mem->type 1664=item $mem_object_type = $mem->type
1659 1665
2337 2343
2338This is a subclass of OpenCL::Mapped, representing mapped images. 2344This is a subclass of OpenCL::Mapped, representing mapped images.
2339 2345
2340=over 4 2346=over 4
2341 2347
2348=item $pixels = $mapped->width
2349
2350=item $pixels = $mapped->height
2351
2352=item $pixels = $mapped->depth
2353
2354Return the width/height/depth of the mapped image region, in pixels.
2355
2342=item $bytes = $mapped->row_pitch 2356=item $bytes = $mapped->row_pitch
2343 2357
2344=item $bytes = $mapped->slice_pitch 2358=item $bytes = $mapped->slice_pitch
2345 2359
2346Return the row or slice pitch of the image that has been mapped. 2360Return the row or slice pitch of the image that has been mapped.
2347 2361
2362=item $bytes = $mapped->element_size
2363
2364Return the size of a single pixel.
2365
2366=item $data = $mapped->get_row ($count, $x=0, $y=0, $z=0)
2367
2368Return C<$count> pixels from the given coordinates. The pixel data must
2369be completely contained within a single row.
2370
2371If C<$count> is C<undef>, then all the remaining pixels in that row are
2372returned.
2373
2374=item $mapped->set_row ($data, $x=0, $y=0, $z=0)
2375
2376Write the given pixel data at the given coordinate. The pixel data must
2377be completely contained within a single row.
2378
2348=back 2379=back
2349
2350 2380
2351=cut 2381=cut
2352 2382
23531; 23831;
2354 2384

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines