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

Comparing OpenCL/OpenCL.pm (file contents):
Revision 1.55 by root, Tue Apr 24 22:45:38 2012 UTC vs.
Revision 1.57 by root, Tue Apr 24 23:58:34 2012 UTC

43 43
44OpenCL::Event objects are used to signal when something is complete. 44OpenCL::Event objects are used to signal when something is complete.
45 45
46=head2 HELPFUL RESOURCES 46=head2 HELPFUL RESOURCES
47 47
48The OpenCL spec used to develop this module (1.2 spec was available, but 48The OpenCL specs used to develop this module:
49no implementation was available to me :).
50 49
51 http://www.khronos.org/registry/cl/specs/opencl-1.1.pdf 50 http://www.khronos.org/registry/cl/specs/opencl-1.1.pdf
51 http://www.khronos.org/registry/cl/specs/opencl-1.2.pdf
52 http://www.khronos.org/registry/cl/specs/opencl-1.2-extensions.pdf
52 53
53OpenCL manpages: 54OpenCL manpages:
54 55
55 http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/ 56 http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/
57 http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/
56 58
57If you are into UML class diagrams, the following diagram might help - if 59If you are into UML class diagrams, the following diagram might help - if
58not, it will be mildly cobfusing: 60not, it will be mildly confusing (also, the class hierarchy of this module
61is much more fine-grained):
59 62
60 http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/classDiagram.html 63 http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/classDiagram.html
61 64
62Here's a tutorial from AMD (very AMD-centric, too), not sure how useful it 65Here's a tutorial from AMD (very AMD-centric, too), not sure how useful it
63is, but at least it's free of charge: 66is, but at least it's free of charge:
64 67
65 http://developer.amd.com/zones/OpenCLZone/courses/Documents/Introduction_to_OpenCL_Programming%20Training_Guide%20%28201005%29.pdf 68 http://developer.amd.com/zones/OpenCLZone/courses/Documents/Introduction_to_OpenCL_Programming%20Training_Guide%20%28201005%29.pdf
552 555
553Returns all available OpenCL::Platform objects. 556Returns all available OpenCL::Platform objects.
554 557
555L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetPlatformIDs.html> 558L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetPlatformIDs.html>
556 559
557=item $ctx = OpenCL::context_from_type $properties, $type = OpenCL::DEVICE_TYPE_DEFAULT, $notify = $print_stderr 560=item $ctx = OpenCL::context_from_type $properties, $type = OpenCL::DEVICE_TYPE_DEFAULT, $callback->($err, $pvt) = $print_stderr
558 561
559Tries to create a context from a default device and platform - never worked for me. 562Tries to create a context from a default device and platform type - never worked for me.
560 563
561L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html> 564L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html>
565
566=item $ctx = OpenCL::context $properties, \@devices, $callback->($err, $pvt) = $print_stderr)
567
568Create a new OpenCL::Context object using the given device object(s). This
569function isn't implemented yet, use C<< $platform->context >> instead.
570
571L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html>
562 572
563=item OpenCL::wait_for_events $wait_events... 573=item OpenCL::wait_for_events $wait_events...
564 574
565Waits for all events to complete. 575Waits for all events to complete.
566 576
636 646
637=item @devices = $platform->devices ($type = OpenCL::DEVICE_TYPE_ALL) 647=item @devices = $platform->devices ($type = OpenCL::DEVICE_TYPE_ALL)
638 648
639Returns a list of matching OpenCL::Device objects. 649Returns a list of matching OpenCL::Device objects.
640 650
641=item $ctx = $platform->context_from_type ($properties, $type = OpenCL::DEVICE_TYPE_DEFAULT, $notify = $print_stderr) 651=item $ctx = $platform->context_from_type ($properties, $type = OpenCL::DEVICE_TYPE_DEFAULT, $callback->($err, $pvt) = $print_stderr)
642 652
643Tries to create a context. Never worked for me, and you need devices explicitly anyway. 653Tries to create a context. Never worked for me, and you need devices explicitly anyway.
644 654
645L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html> 655L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html>
646 656
647=item $ctx = $platform->context ($properties, @$devices, $notify = $print_stderr) 657=item $ctx = $platform->context ($properties, \@devices, $callback->($err, $pvt) = $print_stderr)
648 658
649Create a new OpenCL::Context object using the given device object(s)- a 659Create a new OpenCL::Context object using the given device object(s)- a
650CL_CONTEXT_PLATFORM property is supplied automatically. 660CL_CONTEXT_PLATFORM property is supplied automatically.
651 661
652L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html> 662L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html>
1234 1244
1235=item $ev = $queue->enqueue_task ($kernel, $wait_events...) 1245=item $ev = $queue->enqueue_task ($kernel, $wait_events...)
1236 1246
1237L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueTask.html> 1247L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueTask.html>
1238 1248
1239=item $ev = $queue->enqueue_nd_range_kernel ($kernel, @$global_work_offset, @$global_work_size, @$local_work_size, $wait_events...) 1249=item $ev = $queue->enqueue_nd_range_kernel ($kernel, \@global_work_offset, \@global_work_size, \@local_work_size, $wait_events...)
1240 1250
1241Enqueues a kernel execution. 1251Enqueues a kernel execution.
1242 1252
1243@$global_work_size must be specified as a reference to an array of 1253\@global_work_size must be specified as a reference to an array of
1244integers specifying the work sizes (element counts). 1254integers specifying the work sizes (element counts).
1245 1255
1246@$global_work_offset must be either C<undef> (in which case all offsets 1256\@global_work_offset must be either C<undef> (in which case all offsets
1247are C<0>), or a reference to an array of work offsets, with the same number 1257are C<0>), or a reference to an array of work offsets, with the same number
1248of elements as @$global_work_size. 1258of elements as \@global_work_size.
1249 1259
1250@$local_work_size must be either C<undef> (in which case the 1260\@local_work_size must be either C<undef> (in which case the
1251implementation is supposed to choose good local work sizes), or a 1261implementation is supposed to choose good local work sizes), or a
1252reference to an array of local work sizes, with the same number of 1262reference to an array of local work sizes, with the same number of
1253elements as @$global_work_size. 1263elements as \@global_work_size.
1254 1264
1255L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueNDRangeKernel.html> 1265L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueNDRangeKernel.html>
1256 1266
1257=item $ev = $queue->enqueue_acquire_gl_objects ([object, ...], $wait_events...) 1267=item $ev = $queue->enqueue_acquire_gl_objects ([object, ...], $wait_events...)
1258 1268

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines