--- OpenCL/OpenCL.pm 2011/11/17 03:02:25 1.14 +++ OpenCL/OpenCL.pm 2011/11/17 03:56:07 1.17 @@ -30,8 +30,8 @@ which represents basically a function call with argument values. OpenCL::Memory objects of various flavours: OpenCL::Buffers objects (flat -memory areas, think array) and OpenCL::Image objects (think 2d or 3d -array) for bulk data and input and output for kernels. +memory areas, think arrays or structs) and OpenCL::Image objects (think 2d +or 3d array) for bulk data and input and output for kernels. OpenCL::Sampler objects, which are kind of like texture filter modes in OpenGL. @@ -54,6 +54,16 @@ http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/ +Here's a tutorial from AMD (very AMD-centric, too), not sure how useful it +is, but at least it's free of charge: + + http://developer.amd.com/zones/OpenCLZone/courses/Documents/Introduction_to_OpenCL_Programming%20Training_Guide%20%28201005%29.pdf + +If you are into UML class diagrams, the following diagram might help - if +not, it will be mildly cofusing: + + http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/classDiagram.html + =head1 BASIC WORKFLOW To get something done, you basically have to do this once (refer to the @@ -140,7 +150,7 @@ __kernel void squareit (__global float *input, __global float *output) { - size_t id = get_global_id (0); + $id = get_global_id (0); output [id] = input [id] * input [id]; } '; @@ -219,7 +229,7 @@ prefixes (C<< $platform->info >>). =item * OpenCL often specifies fixed vector function arguments as short -arrays (C), while this module explicitly expects the +arrays (C<$origin[3]>), while this module explicitly expects the components as separate arguments- =item * Structures are often specified with their components, and returned @@ -455,25 +465,25 @@ L -=item $ev = $queue->enqueue_write_image ($src, $blocking, $x, $y, $z, $width, $height, $depth, $row_pitch, $data, $wait_events...) +=item $ev = $queue->enqueue_write_image ($src, $blocking, $x, $y, $z, $width, $height, $depth, $row_pitch, $slice_pitch, $data, $wait_events...) L -=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, $ait_event...) +=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...) Yeah. L -=item $ev = $queue->enqueue_copy_buffer_to_image (OpenCL::Buffer src, OpenCL::Image dst, size_t src_offset, size_t dst_x, size_t dst_y, size_t dst_z, size_t width, size_t height, size_t depth, ...) +=item $ev = $queue->enqueue_copy_buffer_to_image ($src_buffer, $dst_image, $src_offset, $dst_x, $dst_y, $dst_z, $width, $height, $depth, $wait_events...) L. -=item $ev = $queue->enqueue_copy_image (OpenCL::Image src, OpenCL::Buffer dst, size_t src_x, size_t src_y, size_t src_z, size_t dst_x, size_t dst_y, size_t dst_z, size_t width, size_t height, size_t depth, ...) +=item $ev = $queue->enqueue_copy_image ($src_image, $dst_image, $src_x, $src_y, $src_z, $dst_x, $dst_y, $dst_z, $width, $height, $depth, $wait_events...) L -=item $ev = $queue->enqueue_copy_image_to_buffer (OpenCL::Image src, OpenCL::Buffer dst, size_t src_x, size_t src_y, size_t src_z, size_t width, size_t height, size_t depth, size_t dst_offset, ...) +=item $ev = $queue->enqueue_copy_image_to_buffer ($src_image, $dst_image, $src_x, $src_y, $src_z, $width, $height, $depth, $dst_offset, $wait_events...) L