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

Comparing OpenCL/OpenCL.pm (file contents):
Revision 1.10 by root, Thu Nov 17 02:10:39 2011 UTC vs.
Revision 1.20 by root, Sun Nov 20 01:09:48 2011 UTC

18vendors) - usually there is only one. 18vendors) - usually there is only one.
19 19
20Each platform gives you access to a number of OpenCL::Device objects, e.g. 20Each platform gives you access to a number of OpenCL::Device objects, e.g.
21your graphics card. 21your graphics card.
22 22
23From a platform and some devices, you create an OpenCL::Context, which is 23From a platform and some device(s), you create an OpenCL::Context, which is
24a very central object in OpenCL: Once you have a context you can create 24a very central object in OpenCL: Once you have a context you can create
25most other objects: 25most other objects:
26 26
27OpenCL::Program objects, which store source code and, after building 27OpenCL::Program objects, which store source code and, after building for a
28("compiling and linking"), also binary programs. For each kernel function 28specific device ("compiling and linking"), also binary programs. For each
29in a program you can then create an OpenCL::Kernel object which represents 29kernel function in a program you can then create an OpenCL::Kernel object
30basically a function call with argument values. 30which represents basically a function call with argument values.
31 31
32OpenCL::Memory objects of various flavours: OpenCL::Buffers objects (flat 32OpenCL::Memory objects of various flavours: OpenCL::Buffer objects (flat
33memory areas, think array) and OpenCL::Image objects (think 2d or 3d 33memory areas, think arrays or structs) and OpenCL::Image objects (think 2d
34array) for bulk data and input and output for kernels. 34or 3d array) for bulk data and input and output for kernels.
35 35
36OpenCL::Sampler objects, which are kind of like texture filter modes in 36OpenCL::Sampler objects, which are kind of like texture filter modes in
37OpenGL. 37OpenGL.
38 38
39OpenCL::Queue objects - command queues, which allow you to submit memory 39OpenCL::Queue objects - command queues, which allow you to submit memory
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
62Here's a tutorial from AMD (very AMD-centric, too), not sure how useful it
63is, but at least it's free of charge:
64
65 http://developer.amd.com/zones/OpenCLZone/courses/Documents/Introduction_to_OpenCL_Programming%20Training_Guide%20%28201005%29.pdf
66
67And here's NVIDIA's OpenCL Best Practises Guide:
68
69 http://developer.download.nvidia.com/compute/cuda/3_2/toolkit/docs/OpenCL_Best_Practices_Guide.pdf
70
57=head1 BASIC WORKFLOW 71=head1 BASIC WORKFLOW
58 72
59To get something done, you basically have to do this once: 73To get something done, you basically have to do this once (refer to the
74examples below for actual code, this is just a high-level description):
60 75
61Find some platform (e.g. the first one) and some device (e.g. the first 76Find some platform (e.g. the first one) and some device(s) (e.g. the first
62device you can find), and create a context from those. 77device of the platform), and create a context from those.
63 78
64Create a command queue from your context, and program objects from your 79Create program objects from your OpenCL source code, then build (compile)
65OpenCL source code, build the programs. 80the programs for each device you want to run them on.
66 81
67Create kernel objects for all kernels you want to use. 82Create kernel objects for all kernels you want to use (surprisingly, these
83are not device-specific).
68 84
69Then, to execute stuff, you repeat this: 85Then, to execute stuff, you repeat these steps, possibly resuing or
86sharing some buffers:
70 87
71Create some input and output buffers from your context. Initialise the 88Create some input and output buffers from your context. Set these as
72input buffers with data. Set these as arguments to your kernel. 89arguments to your kernel.
90
91Enqueue buffer writes to initialise your input buffers (when not
92initialised at creation time).
73 93
74Enqueue the kernel execution. 94Enqueue the kernel execution.
75 95
76Enqueue buffer reads for your output buffer to read results. 96Enqueue buffer reads for your output buffer to read results.
77 97
78The next section shows how this can be done.
79
80=head1 EXAMPLES 98=head1 EXAMPLES
81 99
82=head2 Enumerate all devices and get contexts for them. 100=head2 Enumerate all devices and get contexts for them.
101
102Best run this once to get a feel for the platforms and devices in your
103system.
83 104
84 for my $platform (OpenCL::platforms) { 105 for my $platform (OpenCL::platforms) {
85 printf "platform: %s\n", $platform->info (OpenCL::PLATFORM_NAME); 106 printf "platform: %s\n", $platform->info (OpenCL::PLATFORM_NAME);
86 printf "extensions: %s\n", $platform->info (OpenCL::PLATFORM_EXTENSIONS); 107 printf "extensions: %s\n", $platform->info (OpenCL::PLATFORM_EXTENSIONS);
87 for my $device ($platform->devices) { 108 for my $device ($platform->devices) {
91 } 112 }
92 } 113 }
93 114
94=head2 Get a useful context and a command queue. 115=head2 Get a useful context and a command queue.
95 116
96 my $dev = ((OpenCL::platforms)[0]->devices)[0]; 117This is a useful boilerplate for any OpenCL program that only wants to use
97 my $ctx = $dev->context; 118one device,
98 my $queue = $ctx->queue ($dev); 119
120 my ($platform) = OpenCL::platforms; # find first platform
121 my ($dev) = $platform->devices; # find first device of platform
122 my $ctx = $platform->context (undef, [$dev]); # create context out of those
123 my $queue = $ctx->queue ($dev); # create a command queue for the device
99 124
100=head2 Print all supported image formats of a context. 125=head2 Print all supported image formats of a context.
126
127Best run this once for your context, to see whats available and how to
128gather information.
101 129
102 for my $type (OpenCL::MEM_OBJECT_IMAGE2D, OpenCL::MEM_OBJECT_IMAGE3D) { 130 for my $type (OpenCL::MEM_OBJECT_IMAGE2D, OpenCL::MEM_OBJECT_IMAGE3D) {
103 print "supported image formats for ", OpenCL::enum2str $type, "\n"; 131 print "supported image formats for ", OpenCL::enum2str $type, "\n";
104 132
105 for my $f ($ctx->supported_image_formats (0, $type)) { 133 for my $f ($ctx->supported_image_formats (0, $type)) {
124 152
125 my $src = ' 153 my $src = '
126 __kernel void 154 __kernel void
127 squareit (__global float *input, __global float *output) 155 squareit (__global float *input, __global float *output)
128 { 156 {
129 size_t id = get_global_id (0); 157 $id = get_global_id (0);
130 output [id] = input [id] * input [id]; 158 output [id] = input [id] * input [id];
131 } 159 }
132 '; 160 ';
133 161
134 my $prog = $ctx->program_with_source ($src); 162 my $prog = $ctx->program_with_source ($src);
135 163
164 # build croaks on compile errors, so catch it and print the compile errors
136 eval { $prog->build ($dev); 1 } 165 eval { $prog->build ($dev); 1 }
137 or die $prog->build_info ($dev, OpenCL::PROGRAM_BUILD_LOG); 166 or die $prog->build_info ($dev, OpenCL::PROGRAM_BUILD_LOG);
138 167
139 my $kernel = $prog->kernel ("squareit"); 168 my $kernel = $prog->kernel ("squareit");
140 169
141=head2 Create some input and output float buffers, then call squareit on them. 170=head2 Create some input and output float buffers, then call the
171'squareit' kernel on them.
142 172
143 my $input = $ctx->buffer_sv (OpenCL::MEM_COPY_HOST_PTR, pack "f*", 1, 2, 3, 4.5); 173 my $input = $ctx->buffer_sv (OpenCL::MEM_COPY_HOST_PTR, pack "f*", 1, 2, 3, 4.5);
144 my $output = $ctx->buffer (0, OpenCL::SIZEOF_FLOAT * 5); 174 my $output = $ctx->buffer (0, OpenCL::SIZEOF_FLOAT * 5);
145 175
146 # set buffer 176 # set buffer
185 215
186=head1 DOCUMENTATION 216=head1 DOCUMENTATION
187 217
188=head2 BASIC CONVENTIONS 218=head2 BASIC CONVENTIONS
189 219
190This is not a 1:1 C-style translation of OpenCL to Perl - instead I 220This is not a one-to-one C-style translation of OpenCL to Perl - instead
191attempted to make the interface as type-safe as possible and introducing 221I attempted to make the interface as type-safe as possible by introducing
192object syntax where it makes sense. There are a number of important 222object syntax where it makes sense. There are a number of important
193differences between the OpenCL C API and this module: 223differences between the OpenCL C API and this module:
194 224
195=over 4 225=over 4
196 226
197=item * Object lifetime managament is automatic - there is no need 227=item * Object lifetime managament is automatic - there is no need
198to free objects explicitly (C<clReleaseXXX>), the release function 228to free objects explicitly (C<clReleaseXXX>), the release function
199is called automatically once all Perl references to it go away. 229is called automatically once all Perl references to it go away.
200 230
201=item * OpenCL uses CamelCase for function names (C<clGetPlatformInfo>), 231=item * OpenCL uses CamelCase for function names
232(e.g. C<clGetPlatformIDs>, C<clGetPlatformInfo>), while this module
202while this module uses underscores as word separator and often leaves out 233uses underscores as word separator and often leaves out prefixes
203prefixes (C<< $platform->info >>). 234(C<OpenCL::platforms>, C<< $platform->info >>).
204 235
205=item * OpenCL often specifies fixed vector function arguments as short 236=item * OpenCL often specifies fixed vector function arguments as short
206arrays (C<size_t origin[3]>), while this module explicitly expects the 237arrays (C<size_t origin[3]>), while this module explicitly expects the
207components as separate arguments- 238components as separate arguments (C<$orig_x, $orig_y, $orig_z>) in
239function calls.
208 240
209=item * Where possible, one of the pitch values is calculated from the 241=item * Structures are often specified by flattening out their components
210perl scalar length and need not be specified. 242as with short vectors, and returned as arrayrefs.
211 243
212=item * When enqueuing commands, the wait list is specified by adding 244=item * When enqueuing commands, the wait list is specified by adding
213extra arguments to the function - anywhere a C<$wait_events...> argument 245extra arguments to the function - anywhere a C<$wait_events...> argument
214is documented this can be any number of event objects. 246is documented this can be any number of event objects.
215 247
245 277
246=over 4 278=over 4
247 279
248=item $int = OpenCL::errno 280=item $int = OpenCL::errno
249 281
250The last error returned by a function - it's only changed on errors. 282The last error returned by a function - it's only valid after an error occured
283and before calling another OpenCL function.
251 284
252=item $str = OpenCL::err2str $errval 285=item $str = OpenCL::err2str $errval
253 286
254Comverts an error value into a human readable string. 287Comverts an error value into a human readable string.
255 288
283 316
284=head2 THE OpenCL::Platform CLASS 317=head2 THE OpenCL::Platform CLASS
285 318
286=over 4 319=over 4
287 320
321=item @devices = $platform->devices ($type = OpenCL::DEVICE_TYPE_ALL)
322
323Returns a list of matching OpenCL::Device objects.
324
325=item $ctx = $platform->context_from_type ($properties, $type = OpenCL::DEVICE_TYPE_DEFAULT, $notify = undef)
326
327Tries to create a context. Never worked for me, and you need devices explitly anyway.
328
329L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html>
330
331=item $ctx = $device->context ($properties = undef, @$devices, $notify = undef)
332
333Create a new OpenCL::Context object using the given device object(s)- a
334CL_CONTEXT_PLATFORM property is supplied automatically.
335
336L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html>
337
288=item $packed_value = $platform->info ($name) 338=item $packed_value = $platform->info ($name)
289 339
290Calls C<clGetPlatformInfo> and returns the packed, raw value - for 340Calls C<clGetPlatformInfo> and returns the packed, raw value - for
291strings, this will be the string, for other values you probably need to 341strings, this will be the string, for other values you probably need to
292use the correct C<unpack>. This might get improved in the future. Hopefully. 342use the correct C<unpack>.
343
344It's best to avoid this method and use one of the predefined C<get_*>
345methods.
293 346
294L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetPlatformInfo.html> 347L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetPlatformInfo.html>
295 348
296=item @devices = $platform->devices ($type = OpenCL::DEVICE_TYPE_ALL) 349=for gengetinfo begin platform
297 350
298Returns a list of matching OpenCL::Device objects.
299 351
300=item $ctx = $platform->context_from_type ($properties, $type = OpenCL::DEVICE_TYPE_DEFAULT, $notify = undef) 352=item $string = $platform->profile
301 353
302Tries to create a context. Never worked for me. 354Calls C<clGetPlatformInfo> with C<CL_PLATFORM_PROFILE> and returns the result(s).
303 355
304L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html> 356=item $string = $platform->version
357
358Calls C<clGetPlatformInfo> with C<CL_PLATFORM_VERSION> and returns the result(s).
359
360=item $string = $platform->name
361
362Calls C<clGetPlatformInfo> with C<CL_PLATFORM_NAME> and returns the result(s).
363
364=item $string = $platform->vendor
365
366Calls C<clGetPlatformInfo> with C<CL_PLATFORM_VENDOR> and returns the result(s).
367
368=item $string = $platform->extensions
369
370Calls C<clGetPlatformInfo> with C<CL_PLATFORM_EXTENSIONS> and returns the result(s).
371=for gengetinfo end platform
305 372
306=back 373=back
307 374
308=head2 THE OpenCL::Device CLASS 375=head2 THE OpenCL::Device CLASS
309 376
313 380
314See C<< $platform->info >> for details. 381See C<< $platform->info >> for details.
315 382
316L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetDeviceInfo.html> 383L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetDeviceInfo.html>
317 384
318=item $ctx = $device->context ($properties = undef, $notify = undef)
319
320Create a new OpenCL::Context object.
321
322L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html>
323
324=back 385=back
325 386
326=head2 THE OpenCL::Context CLASS 387=head2 THE OpenCL::Context CLASS
327 388
328=over 4 389=over 4
329 390
330=item $packed_value = $ctx->info ($name)
331
332See C<< $platform->info >> for details.
333
334L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetContextInfo.html>
335
336=item $queue = $ctx->queue ($device, $properties) 391=item $queue = $ctx->queue ($device, $properties)
337 392
338Create a new OpenCL::Queue object from the context and the given device. 393Create a new OpenCL::Queue object from the context and the given device.
339 394
340L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateCommandQueue.html> 395L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateCommandQueue.html>
353 408
354=item $buf = $ctx->buffer_sv ($flags, $data) 409=item $buf = $ctx->buffer_sv ($flags, $data)
355 410
356Creates a new OpenCL::Buffer object and initialise it with the given data values. 411Creates a new OpenCL::Buffer object and initialise it with the given data values.
357 412
358=item $img = $ctx->image2d ($flags, $channel_order, $channel_type, $width, $height, $data) 413=item $img = $ctx->image2d ($flags, $channel_order, $channel_type, $width, $height, $row_pitch = 0, $data = undef)
359 414
360Creates a new OpenCL::Image2D object and optionally initialises it with the given data values. 415Creates a new OpenCL::Image2D object and optionally initialises it with the given data values.
361 416
362L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateImage2D.html> 417L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateImage2D.html>
363 418
364=item $img = $ctx->image3d ($flags, $channel_order, $channel_type, $width, $height, $depth, $slice_pitch, $data) 419=item $img = $ctx->image3d ($flags, $channel_order, $channel_type, $width, $height, $depth, $row_pitch = 0, $slice_pitch = 0, $data = undef)
365 420
366Creates a new OpenCL::Image3D object and optionally initialises it with the given data values. 421Creates a new OpenCL::Image3D object and optionally initialises it with the given data values.
367 422
368L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateImage3D.html> 423L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateImage3D.html>
369 424
383=item $program = $ctx->program_with_source ($string) 438=item $program = $ctx->program_with_source ($string)
384 439
385Creates a new OpenCL::Program object from the given source code. 440Creates a new OpenCL::Program object from the given source code.
386 441
387L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateProgramWithSource.html> 442L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateProgramWithSource.html>
443
444=item $packed_value = $ctx->info ($name)
445
446See C<< $platform->info >> for details.
447
448L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetContextInfo.html>
449
450=for gengetinfo begin context
451
452=for gengetinfo end context
388 453
389=back 454=back
390 455
391=head2 THE OpenCL::Queue CLASS 456=head2 THE OpenCL::Queue CLASS
392 457
432 497
433=item $ev = $queue->enqueue_read_image ($src, $blocking, $x, $y, $z, $width, $height, $depth, $row_pitch, $slice_pitch, $data, $wait_events...) 498=item $ev = $queue->enqueue_read_image ($src, $blocking, $x, $y, $z, $width, $height, $depth, $row_pitch, $slice_pitch, $data, $wait_events...)
434 499
435L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueReadImage.html> 500L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueReadImage.html>
436 501
437=item $ev = $queue->enqueue_write_image ($src, $blocking, $x, $y, $z, $width, $height, $depth, $row_pitch, $data, $wait_events...) 502=item $ev = $queue->enqueue_write_image ($src, $blocking, $x, $y, $z, $width, $height, $depth, $row_pitch, $slice_pitch, $data, $wait_events...)
438 503
439L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWriteImage.html> 504L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWriteImage.html>
440 505
441=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...) 506=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...)
442 507
443Yeah. 508Yeah.
444 509
445L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBufferRect.html> 510L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBufferRect.html>
446 511
447=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, ...) 512=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...)
448 513
449L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBufferToImage.html>. 514L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBufferToImage.html>.
450 515
451=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, ...) 516=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...)
452 517
453L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyImage.html> 518L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyImage.html>
454 519
455=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, ...) 520=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...)
456 521
457L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyImageToBuffer.html> 522L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyImageToBuffer.html>
458 523
459=item $ev = $queue->enqueue_task ($kernel, $wait_events...) 524=item $ev = $queue->enqueue_task ($kernel, $wait_events...)
460 525
514 579
515L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetMemObjectInfo.html> 580L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetMemObjectInfo.html>
516 581
517=back 582=back
518 583
584=head2 THE OpenCL::Image CLASS
585
586This is the superclass of all image objects - OpenCL::Image2D and OpenCL::Image3D.
587
588=over 4
589
590=item $packed_value = $ev->image_info ($name)
591
592See C<< $platform->info >> for details.
593
594The reason this method is not called C<info> is that there already is an
595C<< ->info >> method inherited from C<OpenCL::Memory>.
596
597L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetImageInfo.html>
598
599=back
600
519=head2 THE OpenCL::Sampler CLASS 601=head2 THE OpenCL::Sampler CLASS
520 602
521=over 4 603=over 4
522 604
523=item $packed_value = $sampler->info ($name) 605=item $packed_value = $sampler->info ($name)
567=item $packed_value = $kernel->info ($name) 649=item $packed_value = $kernel->info ($name)
568 650
569See C<< $platform->info >> for details. 651See C<< $platform->info >> for details.
570 652
571L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetKernelInfo.html> 653L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetKernelInfo.html>
654
655=item $packed_value = $kernel->work_group_info ($device, $name)
656
657See C<< $platform->info >> for details.
658
659The reason this method is not called C<info> is that there already is an
660C<< ->info >> method.
661
662L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetKernelWorkGroupInfo.html>
572 663
573=item $kernel->set_TYPE ($index, $value) 664=item $kernel->set_TYPE ($index, $value)
574 665
575This is a family of methods to set the kernel argument with the number C<$index> to the give C<$value>. 666This is a family of methods to set the kernel argument with the number C<$index> to the give C<$value>.
576 667
598 689
599See C<< $platform->info >> for details. 690See C<< $platform->info >> for details.
600 691
601L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetEventInfo.html> 692L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetEventInfo.html>
602 693
694=item $packed_value = $ev->profiling_info ($name)
695
696See C<< $platform->info >> for details.
697
698The reason this method is not called C<info> is that there already is an
699C<< ->info >> method.
700
701L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetProfilingInfo.html>
702
603=item $ev->wait 703=item $ev->wait
604 704
605Waits for the event to complete. 705Waits for the event to complete.
606 706
607L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clWaitForEvents.html> 707L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clWaitForEvents.html>
625package OpenCL; 725package OpenCL;
626 726
627use common::sense; 727use common::sense;
628 728
629BEGIN { 729BEGIN {
630 our $VERSION = '0.03'; 730 our $VERSION = '0.15';
631 731
632 require XSLoader; 732 require XSLoader;
633 XSLoader::load (__PACKAGE__, $VERSION); 733 XSLoader::load (__PACKAGE__, $VERSION);
634 734
635 @OpenCL::Buffer::ISA = 735 @OpenCL::Buffer::ISA =

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines