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

Comparing OpenCL/OpenCL.pm (file contents):
Revision 1.56 by root, Tue Apr 24 23:53:12 2012 UTC vs.
Revision 1.58 by root, Wed Apr 25 20:29:03 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
1241 1244
1242=item $ev = $queue->enqueue_task ($kernel, $wait_events...) 1245=item $ev = $queue->enqueue_task ($kernel, $wait_events...)
1243 1246
1244L<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>
1245 1248
1246=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...)
1247 1250
1248Enqueues a kernel execution. 1251Enqueues a kernel execution.
1249 1252
1250@$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
1251integers specifying the work sizes (element counts). 1254integers specifying the work sizes (element counts).
1252 1255
1253@$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
1254are 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
1255of elements as @$global_work_size. 1258of elements as \@global_work_size.
1256 1259
1257@$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
1258implementation is supposed to choose good local work sizes), or a 1261implementation is supposed to choose good local work sizes), or a
1259reference 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
1260elements as @$global_work_size. 1263elements as \@global_work_size.
1261 1264
1262L<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>
1263 1266
1264=item $ev = $queue->enqueue_acquire_gl_objects ([object, ...], $wait_events...) 1267=item $ev = $queue->enqueue_acquire_gl_objects ([object, ...], $wait_events...)
1265 1268
1682 1685
1683Calls C<clGetKernelWorkGroupInfo> with C<CL_KERNEL_PRIVATE_MEM_SIZE> and returns the result. 1686Calls C<clGetKernelWorkGroupInfo> with C<CL_KERNEL_PRIVATE_MEM_SIZE> and returns the result.
1684 1687
1685=for gengetinfo end kernel_work_group 1688=for gengetinfo end kernel_work_group
1686 1689
1687=item $kernel->set_TYPE ($index, $value) 1690=item $kernel->set_TYPE ($index, $value)
1688 1691
1692=item $kernel->set_char ($index, $value)
1693
1694=item $kernel->set_uchar ($index, $value)
1695
1696=item $kernel->set_short ($index, $value)
1697
1698=item $kernel->set_ushort ($index, $value)
1699
1700=item $kernel->set_int ($index, $value)
1701
1702=item $kernel->set_uint ($index, $value)
1703
1704=item $kernel->set_long ($index, $value)
1705
1706=item $kernel->set_ulong ($index, $value)
1707
1708=item $kernel->set_half ($index, $value)
1709
1710=item $kernel->set_float ($index, $value)
1711
1712=item $kernel->set_double ($index, $value)
1713
1714=item $kernel->set_memory ($index, $value)
1715
1716=item $kernel->set_buffer ($index, $value)
1717
1718=item $kernel->set_image ($index, $value)
1719
1720=item $kernel->set_sampler ($index, $value)
1721
1722=item $kernel->set_local ($index, $value)
1723
1724=item $kernel->set_event ($index, $value)
1725
1689This is a family of methods to set the kernel argument with the number C<$index> to the give C<$value>. 1726This is a family of methods to set the kernel argument with the number
1690 1727C<$index> to the give C<$value>.
1691TYPE is one of C<char>, C<uchar>, C<short>, C<ushort>, C<int>, C<uint>,
1692C<long>, C<ulong>, C<half>, C<float>, C<double>, C<memory>, C<buffer>,
1693C<image2d>, C<image3d>, C<sampler>, C<local> or C<event>.
1694 1728
1695Chars and integers (including the half type) are specified as integers, 1729Chars and integers (including the half type) are specified as integers,
1696float and double as floating point values, memory/buffer/image2d/image3d 1730float and double as floating point values, memory/buffer/image must be
1697must be an object of that type or C<undef>, local-memory arguments are 1731an object of that type or C<undef>, local-memory arguments are set by
1698set by specifying the size, and sampler and event must be objects of that 1732specifying the size, and sampler and event must be objects of that type.
1699type. 1733
1734Note that C<set_memory> works for all memory objects (all types of buffers
1735and images) - the main purpose of the more specific C<set_TYPE> functions
1736is type checking.
1700 1737
1701Setting an argument for a kernel does NOT keep a reference to the object - 1738Setting an argument for a kernel does NOT keep a reference to the object -
1702for example, if you set an argument to some image object, free the image, 1739for example, if you set an argument to some image object, free the image,
1703and call the kernel, you will run into undefined behaviour. 1740and call the kernel, you will run into undefined behaviour.
1704 1741

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines