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

Comparing OpenCL/OpenCL.pm (file contents):
Revision 1.16 by root, Thu Nov 17 03:42:03 2011 UTC vs.
Revision 1.19 by root, Sat Nov 19 19:54:04 2011 UTC

52 52
53OpenCL manpages: 53OpenCL manpages:
54 54
55 http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/ 55 http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/
56 56
57If you are into UML class diagrams, the following diagram might help - if
58not, it will be mildly cobfusing:
59
60 http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/classDiagram.html
61
57Here's a tutorial from AMD (very AMD-centric, too), not sure how useful it 62Here's a tutorial from AMD (very AMD-centric, too), not sure how useful it
58is, but at least it's free of charge: 63is, but at least it's free of charge:
59 64
60 http://developer.amd.com/zones/OpenCLZone/courses/Documents/Introduction_to_OpenCL_Programming%20Training_Guide%20%28201005%29.pdf 65 http://developer.amd.com/zones/OpenCLZone/courses/Documents/Introduction_to_OpenCL_Programming%20Training_Guide%20%28201005%29.pdf
61 66
62If you are into UML class diagrams, the following diagram might help - if 67And here's NVIDIA's OpenCL Best Practises Guide:
63not, it will be mildly cofusing:
64 68
65 http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/classDiagram.html 69 http://developer.download.nvidia.com/compute/cuda/3_2/toolkit/docs/OpenCL_Best_Practices_Guide.pdf
66 70
67=head1 BASIC WORKFLOW 71=head1 BASIC WORKFLOW
68 72
69To get something done, you basically have to do this once (refer to the 73To get something done, you basically have to do this once (refer to the
70examples below for actual code, this is just a high-level description): 74examples below for actual code, this is just a high-level description):
222 226
223=item * Object lifetime managament is automatic - there is no need 227=item * Object lifetime managament is automatic - there is no need
224to free objects explicitly (C<clReleaseXXX>), the release function 228to free objects explicitly (C<clReleaseXXX>), the release function
225is called automatically once all Perl references to it go away. 229is called automatically once all Perl references to it go away.
226 230
227=item * OpenCL uses CamelCase for function names (C<clGetPlatformInfo>), 231=item * OpenCL uses CamelCase for function names (e.g. C<clGetPlatformIDs>, C<clGetPlatformInfo>),
228while this module uses underscores as word separator and often leaves out 232while this module uses underscores as word separator and often leaves out
229prefixes (C<< $platform->info >>). 233prefixes (C<OpenCL::platforms>, C<< $platform->info >>).
230 234
231=item * OpenCL often specifies fixed vector function arguments as short 235=item * OpenCL often specifies fixed vector function arguments as short
232arrays (C<$origin[3]>), while this module explicitly expects the 236arrays (C<size_t origin[3]>), while this module explicitly expects the
233components as separate arguments- 237components as separate arguments (C<$orig_x, $orig_y, $orig_z>) in
238function calls.
234 239
235=item * Structures are often specified with their components, and returned 240=item * Structures are often specified by flattening out their components
236as arrayrefs. 241as with short vectors, and returned as arrayrefs.
237
238=item * Where possible, one of the pitch values is calculated from the
239perl scalar length and need not be specified.
240 242
241=item * When enqueuing commands, the wait list is specified by adding 243=item * When enqueuing commands, the wait list is specified by adding
242extra arguments to the function - anywhere a C<$wait_events...> argument 244extra arguments to the function - anywhere a C<$wait_events...> argument
243is documented this can be any number of event objects. 245is documented this can be any number of event objects.
244 246
384 386
385=item $buf = $ctx->buffer_sv ($flags, $data) 387=item $buf = $ctx->buffer_sv ($flags, $data)
386 388
387Creates a new OpenCL::Buffer object and initialise it with the given data values. 389Creates a new OpenCL::Buffer object and initialise it with the given data values.
388 390
389=item $img = $ctx->image2d ($flags, $channel_order, $channel_type, $width, $height, $data) 391=item $img = $ctx->image2d ($flags, $channel_order, $channel_type, $width, $height, $row_pitch = 0, $data = undef)
390 392
391Creates a new OpenCL::Image2D object and optionally initialises it with the given data values. 393Creates a new OpenCL::Image2D object and optionally initialises it with the given data values.
392 394
393L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateImage2D.html> 395L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateImage2D.html>
394 396
395=item $img = $ctx->image3d ($flags, $channel_order, $channel_type, $width, $height, $depth, $slice_pitch, $data) 397=item $img = $ctx->image3d ($flags, $channel_order, $channel_type, $width, $height, $depth, $row_pitch = 0, $slice_pitch = 0, $data = undef)
396 398
397Creates a new OpenCL::Image3D object and optionally initialises it with the given data values. 399Creates a new OpenCL::Image3D object and optionally initialises it with the given data values.
398 400
399L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateImage3D.html> 401L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateImage3D.html>
400 402
463 465
464=item $ev = $queue->enqueue_read_image ($src, $blocking, $x, $y, $z, $width, $height, $depth, $row_pitch, $slice_pitch, $data, $wait_events...) 466=item $ev = $queue->enqueue_read_image ($src, $blocking, $x, $y, $z, $width, $height, $depth, $row_pitch, $slice_pitch, $data, $wait_events...)
465 467
466L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueReadImage.html> 468L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueReadImage.html>
467 469
468=item $ev = $queue->enqueue_write_image ($src, $blocking, $x, $y, $z, $width, $height, $depth, $row_pitch, $data, $wait_events...) 470=item $ev = $queue->enqueue_write_image ($src, $blocking, $x, $y, $z, $width, $height, $depth, $row_pitch, $slice_pitch, $data, $wait_events...)
469 471
470L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWriteImage.html> 472L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWriteImage.html>
471 473
472=item $ev = $queue->enqueue_copy_buffer_rect ($src, $dst, $src_x, $src_y, $src_z, $dst_x, $dst_y, $dst_z, $width, $height, $depth, $src_row_pitch, $src_slice_pitch, 4dst_row_pitch, $dst_slice_pitch, $wait_event...) 474=item $ev = $queue->enqueue_copy_buffer_rect ($src, $dst, $src_x, $src_y, $src_z, $dst_x, $dst_y, $dst_z, $width, $height, $depth, $src_row_pitch, $src_slice_pitch, $dst_row_pitch, $dst_slice_pitch, $wait_event...)
473 475
474Yeah. 476Yeah.
475 477
476L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBufferRect.html> 478L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBufferRect.html>
477 479
656package OpenCL; 658package OpenCL;
657 659
658use common::sense; 660use common::sense;
659 661
660BEGIN { 662BEGIN {
661 our $VERSION = '0.14'; 663 our $VERSION = '0.15';
662 664
663 require XSLoader; 665 require XSLoader;
664 XSLoader::load (__PACKAGE__, $VERSION); 666 XSLoader::load (__PACKAGE__, $VERSION);
665 667
666 @OpenCL::Buffer::ISA = 668 @OpenCL::Buffer::ISA =

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines