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

Comparing OpenCL/OpenCL.pm (file contents):
Revision 1.73 by root, Fri May 4 14:56:50 2012 UTC vs.
Revision 1.83 by root, Sat May 5 15:11:19 2012 UTC

28specific device ("compiling and linking"), also binary programs. For each 28specific device ("compiling and linking"), also binary programs. For each
29kernel function in a program you can then create an OpenCL::Kernel object 29kernel function in a program you can then create an OpenCL::Kernel object
30which represents basically a function call with argument values. 30which represents basically a function call with argument values.
31 31
32OpenCL::Memory objects of various flavours: OpenCL::Buffer objects (flat 32OpenCL::Memory objects of various flavours: OpenCL::Buffer objects (flat
33memory areas, think arrays or structs) and OpenCL::Image objects (think 2d 33memory areas, think arrays or structs) and OpenCL::Image objects (think 2D
34or 3d array) 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
213 $ev->wait; 213 $ev->wait;
214 214
215=head2 Use the OpenGL module to share a texture between OpenCL and OpenGL and draw some julia 215=head2 Use the OpenGL module to share a texture between OpenCL and OpenGL and draw some julia
216set flight effect. 216set flight effect.
217 217
218This is quite a long example to get you going - you can download it from 218This is quite a long example to get you going - you can also download it
219L<http://cvs.schmorp.de/OpenCL/examples/juliaflight>. 219from L<http://cvs.schmorp.de/OpenCL/examples/juliaflight>.
220 220
221 use OpenGL ":all"; 221 use OpenGL ":all";
222 use OpenCL; 222 use OpenCL;
223 223
224 my $S = $ARGV[0] || 256; # window/texture size, smaller is faster 224 my $S = $ARGV[0] || 256; # window/texture size, smaller is faster
388 388
389=item * When enqueuing commands, if the enqueue method is called in void 389=item * When enqueuing commands, if the enqueue method is called in void
390context, no event is created. In all other contexts an event is returned 390context, no event is created. In all other contexts an event is returned
391by the method. 391by the method.
392 392
393=item * This module expects all functions to return C<CL_SUCCESS>. If any 393=item * This module expects all functions to return C<OpenCL::SUCCESS>. If any
394other status is returned the function will throw an exception, so you 394other status is returned the function will throw an exception, so you
395don't normally have to to any error checking. 395don't normally have to to any error checking.
396 396
397=back 397=back
398
399=head2 CONSTANTS
400
401All C<CL_xxx> constants that this module supports are always available
402in the C<OpenCL> namespace as C<OpenCL::xxx> (i.e. without the C<CL_>
403prefix). Constants which are not defined in the header files used during
404compilation, or otherwise are not available, will have the value C<-1>.
405
406The latest version of this module knows and exports the constants
407listed in L<http://cvs.schmorp.de/OpenCL/constiv.h>.
408
409=head2 OPENCL 1.1 VS. OPENCL 1.2
410
411This module supports both OpenCL version 1.1 and 1.2, although the OpenCL
4121.2 interface hasn't been tested much for lack of availability of an
413actual implementation.
414
415Every function or method in this manual page that interfaces to a
416particular OpenCL function has a link to the its C manual page.
417
418If the link contains a F<1.1>, then this function is an OpenCL 1.1
419function. Most but not all also exist in OpenCL 1.2, and this module
420tries to emulate the missing ones for you, when told to do so at
421compiletime. You can check whether a function was removed in OpenCL 1.2 by
422replacing the F<1.1> component in the URL by F<1.2>.
423
424If the link contains a F<1.2>, then this is a OpenCL 1.2-only
425function. Even if the module was compiled with OpenCL 1.2 header files
426and has an 1.2 OpenCL library, calling such a function on a platform that
427doesn't implement 1.2 causes undefined behaviour, usually a crash (But
428this is not guaranteed).
429
430You can find out whether this module was compiled to prefer 1.1
431functionality by ooking at C<OpenCL::PREFER_1_1> - if it is true, then
4321.1 functions generally are implemented using 1.1 OpenCL functions. If it
433is false, then 1.1 functions missing from 1.2 are emulated by calling 1.2
434fucntions.
435
436This is a somewhat sorry state of affairs, but the Khronos group choose to
437make every release of OpenCL source and binary incompatible with previous
438releases.
398 439
399=head2 PERL AND OPENCL TYPES 440=head2 PERL AND OPENCL TYPES
400 441
401This handy(?) table lists OpenCL types and their perl, PDL and pack/unpack 442This handy(?) table lists OpenCL types and their perl, PDL and pack/unpack
402format equivalents: 443format equivalents:
434OpenCL can generate a number of (potentially) asynchronous events, for 475OpenCL can generate a number of (potentially) asynchronous events, for
435example, after compiling a program, to signal a context-related error or, 476example, after compiling a program, to signal a context-related error or,
436perhaps most important, to signal completion of queued jobs (by setting 477perhaps most important, to signal completion of queued jobs (by setting
437callbacks on OpenCL::Event objects). 478callbacks on OpenCL::Event objects).
438 479
480The OpenCL module converts all these callbacks into events - you can
481still register callbacks, but they are not executed when your OpenCL
482implementation calls the actual callback, but only later. Therefore, none
483of the limitations of OpenCL callbacks apply to the perl implementation:
484it is perfectly safe to make blocking operations from event callbacks, and
485enqueued operations don't need to be flushed.
486
439To facilitate this, this module maintains an event queue - each 487To facilitate this, this module maintains an event queue - each
440time an asynchronous event happens, it is queued, and perl will be 488time an asynchronous event happens, it is queued, and perl will be
441interrupted. This is implemented via the L<Async::Interrupt> module. In 489interrupted. This is implemented via the L<Async::Interrupt> module. In
442addition, this module has L<AnyEvent> support, so it can seamlessly 490addition, this module has L<AnyEvent> support, so it can seamlessly
443integrate itself into many event loops. 491integrate itself into many event loops.
444 492
445Since this module is a bit hard to understand, here are some case examples: 493Since L<Async::Interrupt> is a bit hard to understand, here are some case examples:
446 494
447=head3 Don't use callbacks. 495=head3 Don't use callbacks.
448 496
449When your program never uses any callbacks, then there will never be any 497When your program never uses any callbacks, then there will never be any
450notifications you need to take care of, and therefore no need to worry 498notifications you need to take care of, and therefore no need to worry
593The last error returned by a function - it's only valid after an error occured 641The last error returned by a function - it's only valid after an error occured
594and before calling another OpenCL function. 642and before calling another OpenCL function.
595 643
596=item $str = OpenCL::err2str [$errval] 644=item $str = OpenCL::err2str [$errval]
597 645
598Converts an error value into a human readable string. IF no error value is 646Converts an error value into a human readable string. If no error value is
599given, then the last error will be used (as returned by OpenCL::errno). 647given, then the last error will be used (as returned by OpenCL::errno).
648
649The latest version of this module knows the error constants
650listed in L<http://cvs.schmorp.de/OpenCL/errstr.h>.
600 651
601=item $str = OpenCL::enum2str $enum 652=item $str = OpenCL::enum2str $enum
602 653
603Converts most enum values (of parameter names, image format constants, 654Converts most enum values (of parameter names, image format constants,
604object types, addressing and filter modes, command types etc.) into a 655object types, addressing and filter modes, command types etc.) into a
605human readable string. When confronted with some random integer it can be 656human readable string. When confronted with some random integer it can be
606very helpful to pass it through this function to maybe get some readable 657very helpful to pass it through this function to maybe get some readable
607string out of it. 658string out of it.
608 659
660The latest version of this module knows the enumaration constants
661listed in L<http://cvs.schmorp.de/OpenCL/enumstr.h>.
662
609=item @platforms = OpenCL::platforms 663=item @platforms = OpenCL::platforms
610 664
611Returns all available OpenCL::Platform objects. 665Returns all available OpenCL::Platform objects.
612 666
613L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetPlatformIDs.html> 667L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetPlatformIDs.html>
614 668
615=item $ctx = OpenCL::context_from_type $properties, $type = OpenCL::DEVICE_TYPE_DEFAULT, $callback->($err, $pvt) = $print_stderr 669=item $ctx = OpenCL::context_from_type $properties, $type = OpenCL::DEVICE_TYPE_DEFAULT, $callback->($err, $pvt) = $print_stderr
616 670
617Tries to create a context from a default device and platform type - never worked for me. 671Tries to create a context from a default device and platform type - never worked for me.
672Consider using C<< $platform->context_from_type >> instead.
618 673
619type: OpenCL::DEVICE_TYPE_DEFAULT, OpenCL::DEVICE_TYPE_CPU, OpenCL::DEVICE_TYPE_GPU, 674type: OpenCL::DEVICE_TYPE_DEFAULT, OpenCL::DEVICE_TYPE_CPU, OpenCL::DEVICE_TYPE_GPU,
620OpenCL::DEVICE_TYPE_ACCELERATOR, OpenCL::DEVICE_TYPE_CUSTOM, OpenCL::DEVICE_TYPE_ALL. 675OpenCL::DEVICE_TYPE_ACCELERATOR, OpenCL::DEVICE_TYPE_CUSTOM, OpenCL::DEVICE_TYPE_ALL.
621 676
622L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html> 677L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html>
623 678
624=item $ctx = OpenCL::context $properties, \@devices, $callback->($err, $pvt) = $print_stderr) 679=item $ctx = OpenCL::context $properties, \@devices, $callback->($err, $pvt) = $print_stderr)
625 680
626Create a new OpenCL::Context object using the given device object(s). This 681Create a new OpenCL::Context object using the given device object(s).
627function isn't implemented yet, use C<< $platform->context >> instead. 682Consider using C<< $platform->context >> instead.
628 683
629L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html> 684L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html>
630 685
631=item OpenCL::wait_for_events $wait_events... 686=item OpenCL::wait_for_events $wait_events...
632 687
713L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html> 768L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html>
714 769
715=item $ctx = $platform->context ($properties, \@devices, $callback->($err, $pvt) = $print_stderr) 770=item $ctx = $platform->context ($properties, \@devices, $callback->($err, $pvt) = $print_stderr)
716 771
717Create a new OpenCL::Context object using the given device object(s)- a 772Create a new OpenCL::Context object using the given device object(s)- a
718CL_CONTEXT_PLATFORM property is supplied automatically. 773OpenCL::CONTEXT_PLATFORM property is supplied automatically.
719 774
720L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html> 775L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html>
721 776
722=item $packed_value = $platform->info ($name) 777=item $packed_value = $platform->info ($name)
723 778
768=over 4 823=over 4
769 824
770=item $packed_value = $device->info ($name) 825=item $packed_value = $device->info ($name)
771 826
772See C<< $platform->info >> for details. 827See C<< $platform->info >> for details.
828
829type: OpenCL::DEVICE_TYPE_DEFAULT, OpenCL::DEVICE_TYPE_CPU,
830OpenCL::DEVICE_TYPE_GPU, OpenCL::DEVICE_TYPE_ACCELERATOR,
831OpenCL::DEVICE_TYPE_CUSTOM, OpenCL::DEVICE_TYPE_ALL.
832
833fp_config: OpenCL::FP_DENORM, OpenCL::FP_INF_NAN, OpenCL::FP_ROUND_TO_NEAREST,
834OpenCL::FP_ROUND_TO_ZERO, OpenCL::FP_ROUND_TO_INF, OpenCL::FP_FMA,
835OpenCL::FP_SOFT_FLOAT, OpenCL::FP_CORRECTLY_ROUNDED_DIVIDE_SQRT.
836
837mem_cache_type: OpenCL::NONE, OpenCL::READ_ONLY_CACHE, OpenCL::READ_WRITE_CACHE.
838
839local_mem_type: OpenCL::LOCAL, OpenCL::GLOBAL.
840
841exec_capabilities: OpenCL::EXEC_KERNEL, OpenCL::EXEC_NATIVE_KERNEL.
842
843command_queue_properties: OpenCL::QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE,
844OpenCL::QUEUE_PROFILING_ENABLE.
845
846partition_properties: OpenCL::DEVICE_PARTITION_EQUALLY,
847OpenCL::DEVICE_PARTITION_BY_COUNTS, OpenCL::DEVICE_PARTITION_BY_COUNTS_LIST_END,
848OpenCL::DEVICE_PARTITION_BY_AFFINITY_DOMAIN.
849
850affinity_domain: OpenCL::DEVICE_AFFINITY_DOMAIN_NUMA,
851OpenCL::DEVICE_AFFINITY_DOMAIN_L4_CACHE, OpenCL::DEVICE_AFFINITY_DOMAIN_L3_CACHE,
852OpenCL::DEVICE_AFFINITY_DOMAIN_L2_CACHE, OpenCL::DEVICE_AFFINITY_DOMAIN_L1_CACHE,
853OpenCL::DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE.
773 854
774L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetDeviceInfo.html> 855L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetDeviceInfo.html>
775 856
776=item @devices = $device->sub_devices (\@properties) 857=item @devices = $device->sub_devices (\@properties)
777 858
1157OpenCL::UNORM_INT16, OpenCL::UNORM_SHORT_565, OpenCL::UNORM_SHORT_555, 1238OpenCL::UNORM_INT16, OpenCL::UNORM_SHORT_565, OpenCL::UNORM_SHORT_555,
1158OpenCL::UNORM_INT_101010, OpenCL::SIGNED_INT8, OpenCL::SIGNED_INT16, 1239OpenCL::UNORM_INT_101010, OpenCL::SIGNED_INT8, OpenCL::SIGNED_INT16,
1159OpenCL::SIGNED_INT32, OpenCL::UNSIGNED_INT8, OpenCL::UNSIGNED_INT16, 1240OpenCL::SIGNED_INT32, OpenCL::UNSIGNED_INT8, OpenCL::UNSIGNED_INT16,
1160OpenCL::UNSIGNED_INT32, OpenCL::HALF_FLOAT, OpenCL::FLOAT. 1241OpenCL::UNSIGNED_INT32, OpenCL::HALF_FLOAT, OpenCL::FLOAT.
1161 1242
1162
1163type: OpenCL::MEM_OBJECT_BUFFER, OpenCL::MEM_OBJECT_IMAGE2D, 1243type: OpenCL::MEM_OBJECT_BUFFER, OpenCL::MEM_OBJECT_IMAGE2D,
1164OpenCL::MEM_OBJECT_IMAGE3D, OpenCL::MEM_OBJECT_IMAGE2D_ARRAY, 1244OpenCL::MEM_OBJECT_IMAGE3D, OpenCL::MEM_OBJECT_IMAGE2D_ARRAY,
1165OpenCL::MEM_OBJECT_IMAGE1D, OpenCL::MEM_OBJECT_IMAGE1D_ARRAY, 1245OpenCL::MEM_OBJECT_IMAGE1D, OpenCL::MEM_OBJECT_IMAGE1D_ARRAY,
1166OpenCL::MEM_OBJECT_IMAGE1D_BUFFER. 1246OpenCL::MEM_OBJECT_IMAGE1D_BUFFER.
1167 1247
1264 1344
1265Creates a new OpenCL::Program object from the given built-in kernel names. 1345Creates a new OpenCL::Program object from the given built-in kernel names.
1266 1346
1267L<http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clCreateProgramWithBuiltInKernels.html> 1347L<http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clCreateProgramWithBuiltInKernels.html>
1268 1348
1349=item $program = $ctx->link_program (\@devices, $options, \@programs, $cb->($program) = undef)
1350
1351Links all (already compiled) program objects specified in C<@programs>
1352together and returns a new OpenCL::Program object with the result.
1353
1354L<http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clLinkProgram.html>
1355
1269=item $packed_value = $ctx->info ($name) 1356=item $packed_value = $ctx->info ($name)
1270 1357
1271See C<< $platform->info >> for details. 1358See C<< $platform->info >> for details.
1272 1359
1273L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetContextInfo.html> 1360L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetContextInfo.html>
1335 1422
1336=item $ev = $queue->copy_buffer ($src, $dst, $src_offset, $dst_offset, $len, $wait_events...) 1423=item $ev = $queue->copy_buffer ($src, $dst, $src_offset, $dst_offset, $len, $wait_events...)
1337 1424
1338L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBuffer.html> 1425L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBuffer.html>
1339 1426
1340=item $ev = $queue->read_buffer_rect (OpenCL::Memory buf, cl_bool blocking, $buf_x, $buf_y, $buf_z, $host_x, $host_y, $host_z, $width, $height, $depth, $buf_row_pitch, $buf_slice_pitch, $host_row_pitch, $host_slice_pitch, $data, $wait_events...) 1427$eue->read_buffer_rect ($buf, cl_bool blocking, $buf_x, $buf_y, $buf_z, $host_x, $host_y, $host_z, $width, $height, $depth, $buf_row_pitch, $buf_slice_pitch, $host_row_pitch, $host_slice_pitch, $data, $wait_events...)
1341 1428
1342http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueReadBufferRect.html 1429http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueReadBufferRect.html
1343 1430
1344=item $ev = $queue->write_buffer_rect (OpenCL::Memory buf, cl_bool blocking, $buf_x, $buf_y, $buf_z, $host_x, $host_y, $host_z, $width, $height, $depth, $buf_row_pitch, $buf_slice_pitch, $host_row_pitch, $host_slice_pitch, $data, $wait_events...) 1431=item $ev = $queue->write_buffer_rect ($buf, $blocking, $buf_y, $host_x, $host_z, $height, $buf_row_pitch, $host_row_pitch, $data, $wait_events...)
1345 1432
1346http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWriteBufferRect.html 1433http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWriteBufferRect.html
1347 1434
1348=item $ev = $queue->copy_buffer_to_image ($src_buffer, $dst_image, $src_offset, $dst_x, $dst_y, $dst_z, $width, $height, $depth, $wait_events...) 1435=item $ev = $queue->copy_buffer_to_image ($src_buffer, $dst_image, $src_offset, $dst_x, $dst_y, $dst_z, $width, $height, $depth, $wait_events...)
1349 1436
1564 1651
1565See C<< $platform->info >> for details. 1652See C<< $platform->info >> for details.
1566 1653
1567L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetMemObjectInfo.html> 1654L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetMemObjectInfo.html>
1568 1655
1656=item $memory->destructor_callback ($cb->())
1657
1658Sets a callback that will be invoked after the memory object is destructed.
1659
1660L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clSetMemObjectDestructorCallback.html>
1661
1569=for gengetinfo begin mem 1662=for gengetinfo begin mem
1570 1663
1571=item $mem_object_type = $mem->type 1664=item $mem_object_type = $mem->type
1572 1665
1573Calls C<clGetMemObjectInfo> with C<OpenCL::MEM_TYPE> and returns the result. 1666Calls C<clGetMemObjectInfo> with C<OpenCL::MEM_TYPE> and returns the result.
1630=over 4 1723=over 4
1631 1724
1632=item $subbuf = $buf_obj->sub_buffer_region ($flags, $origin, $size) 1725=item $subbuf = $buf_obj->sub_buffer_region ($flags, $origin, $size)
1633 1726
1634Creates an OpenCL::Buffer objects from this buffer and returns it. The 1727Creates an OpenCL::Buffer objects from this buffer and returns it. The
1635C<buffer_create_type> is assumed to be C<CL_BUFFER_CREATE_TYPE_REGION>. 1728C<buffer_create_type> is assumed to be C<OpenCL::BUFFER_CREATE_TYPE_REGION>.
1636 1729
1637L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateSubBuffer.html> 1730L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateSubBuffer.html>
1638 1731
1639=back 1732=back
1640 1733
1656L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetImageInfo.html> 1749L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetImageInfo.html>
1657 1750
1658=item ($channel_order, $channel_data_type) = $image->format 1751=item ($channel_order, $channel_data_type) = $image->format
1659 1752
1660Returns the channel order and type used to create the image by calling 1753Returns the channel order and type used to create the image by calling
1661C<clGetImageInfo> with C<CL_IMAGE_FORMAT>. 1754C<clGetImageInfo> with C<OpenCL::IMAGE_FORMAT>.
1662 1755
1663=for gengetinfo begin image 1756=for gengetinfo begin image
1664 1757
1665=item $int = $image->element_size 1758=item $int = $image->element_size
1666 1759
1766C<-cl-mad-enable>, C<-cl-no-signed-zeros>, C<-cl-unsafe-math-optimizations>, 1859C<-cl-mad-enable>, C<-cl-no-signed-zeros>, C<-cl-unsafe-math-optimizations>,
1767C<-cl-finite-math-only>, C<-cl-fast-relaxed-math>, 1860C<-cl-finite-math-only>, C<-cl-fast-relaxed-math>,
1768C<-w>, C<-Werror>, C<-cl-std=CL1.1/CL1.2>, C<-cl-kernel-arg-info>, 1861C<-w>, C<-Werror>, C<-cl-std=CL1.1/CL1.2>, C<-cl-kernel-arg-info>,
1769C<-create-library>, C<-enable-link-options>. 1862C<-create-library>, C<-enable-link-options>.
1770 1863
1864build_status: OpenCL::BUILD_SUCCESS, OpenCL::BUILD_NONE,
1865OpenCL::BUILD_ERROR, OpenCL::BUILD_IN_PROGRESS.
1866
1771L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clBuildProgram.html> 1867L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clBuildProgram.html>
1772 1868
1773=item $program->build_async (\@devices = undef, $options = "", $cb->($program) = undef) 1869=item $program->build_async (\@devices = undef, $options = "", $cb->($program) = undef)
1774 1870
1775Similar to C<< ->build >>, except it starts a thread, and never fails (you 1871Similar to C<< ->build >>, except it starts a thread, and never fails (you
1776need to check the compilation status form the callback, or by polling). 1872need to check the compilation status form the callback, or by polling).
1777 1873
1778build_status: OpenCL::BUILD_SUCCESS, OpenCL::BUILD_NONE, 1874=item $program->compile (\@devices = undef, $options = "", \%headers = undef, $cb->($program) = undef)
1779OpenCL::BUILD_ERROR, OpenCL::BUILD_IN_PROGRESS. 1875
1876Compiles the given program for the given devices (or all devices if
1877undef). If C<$headers> is given, it must be a hashref with include name =>
1878OpenCL::Program pairs.
1879
1880L<http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clCompileProgram.html>
1780 1881
1781=item $packed_value = $program->build_info ($device, $name) 1882=item $packed_value = $program->build_info ($device, $name)
1782 1883
1783Similar to C<< $platform->info >>, but returns build info for a previous 1884Similar to C<< $platform->info >>, but returns build info for a previous
1784build attempt for the given device. 1885build attempt for the given device.
1785 1886
1887binary_type: OpenCL::PROGRAM_BINARY_TYPE_NONE,
1888OpenCL::PROGRAM_BINARY_TYPE_COMPILED_OBJECT,
1889OpenCL::PROGRAM_BINARY_TYPE_LIBRARY,
1890OpenCL::PROGRAM_BINARY_TYPE_EXECUTABLE.
1891
1786L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetBuildInfo.html> 1892L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetBuildInfo.html>
1787 1893
1788=item $kernel = $program->kernel ($function_name) 1894=item $kernel = $program->kernel ($function_name)
1789 1895
1790Creates an OpenCL::Kernel object out of the named C<__kernel> function in 1896Creates an OpenCL::Kernel object out of the named C<__kernel> function in
1809Calls C<clGetProgramBuildInfo> with C<OpenCL::PROGRAM_BUILD_OPTIONS> and returns the result. 1915Calls C<clGetProgramBuildInfo> with C<OpenCL::PROGRAM_BUILD_OPTIONS> and returns the result.
1810 1916
1811=item $string = $program->build_log ($device) 1917=item $string = $program->build_log ($device)
1812 1918
1813Calls C<clGetProgramBuildInfo> with C<OpenCL::PROGRAM_BUILD_LOG> and returns the result. 1919Calls C<clGetProgramBuildInfo> with C<OpenCL::PROGRAM_BUILD_LOG> and returns the result.
1920
1921=item $binary_type = $program->binary_type ($device)
1922
1923Calls C<clGetProgramBuildInfo> with C<OpenCL::PROGRAM_BINARY_TYPE> and returns the result.
1814 1924
1815=for gengetinfo end program_build 1925=for gengetinfo end program_build
1816 1926
1817=item $packed_value = $program->info ($name) 1927=item $packed_value = $program->info ($name)
1818 1928

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines