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

Comparing OpenCL/OpenCL.pm (file contents):
Revision 1.82 by root, Sat May 5 14:18:35 2012 UTC vs.
Revision 1.86 by root, Mon May 7 01:00:31 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.0';
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 =
1422 1424
1423=item $ev = $queue->copy_buffer ($src, $dst, $src_offset, $dst_offset, $len, $wait_events...) 1425=item $ev = $queue->copy_buffer ($src, $dst, $src_offset, $dst_offset, $len, $wait_events...)
1424 1426
1425L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBuffer.html> 1427L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBuffer.html>
1426 1428
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...) 1429$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 1430
1429http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueReadBufferRect.html 1431http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueReadBufferRect.html
1430 1432
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...) 1433=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 1434
1433http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWriteBufferRect.html 1435http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWriteBufferRect.html
1434 1436
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...) 1437=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 1438
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...)
1650=item $packed_value = $memory->info ($name) 1652=item $packed_value = $memory->info ($name)
1651 1653
1652See C<< $platform->info >> for details. 1654See C<< $platform->info >> for details.
1653 1655
1654L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetMemObjectInfo.html> 1656L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetMemObjectInfo.html>
1657
1658=item $memory->destructor_callback ($cb->())
1659
1660Sets a callback that will be invoked after the memory object is destructed.
1661
1662L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clSetMemObjectDestructorCallback.html>
1655 1663
1656=for gengetinfo begin mem 1664=for gengetinfo begin mem
1657 1665
1658=item $mem_object_type = $mem->type 1666=item $mem_object_type = $mem->type
1659 1667
2337 2345
2338This is a subclass of OpenCL::Mapped, representing mapped images. 2346This is a subclass of OpenCL::Mapped, representing mapped images.
2339 2347
2340=over 4 2348=over 4
2341 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
2342=item $bytes = $mapped->row_pitch 2358=item $bytes = $mapped->row_pitch
2343 2359
2344=item $bytes = $mapped->slice_pitch 2360=item $bytes = $mapped->slice_pitch
2345 2361
2346Return 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.
2347 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
2348=back 2381=back
2349
2350 2382
2351=cut 2383=cut
2352 2384
23531; 23851;
2354 2386

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines