… | |
… | |
28 | specific device ("compiling and linking"), also binary programs. For each |
28 | specific device ("compiling and linking"), also binary programs. For each |
29 | kernel function in a program you can then create an OpenCL::Kernel object |
29 | kernel function in a program you can then create an OpenCL::Kernel object |
30 | which represents basically a function call with argument values. |
30 | which represents basically a function call with argument values. |
31 | |
31 | |
32 | OpenCL::Memory objects of various flavours: OpenCL::Buffer objects (flat |
32 | OpenCL::Memory objects of various flavours: OpenCL::Buffer objects (flat |
33 | memory areas, think arrays or structs) and OpenCL::Image objects (think 2d |
33 | memory areas, think arrays or structs) and OpenCL::Image objects (think 2D |
34 | or 3d array) for bulk data and input and output for kernels. |
34 | or 3D array) for bulk data and input and output for kernels. |
35 | |
35 | |
36 | OpenCL::Sampler objects, which are kind of like texture filter modes in |
36 | OpenCL::Sampler objects, which are kind of like texture filter modes in |
37 | OpenGL. |
37 | OpenGL. |
38 | |
38 | |
39 | OpenCL::Queue objects - command queues, which allow you to submit memory |
39 | OpenCL::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 |
216 | set flight effect. |
216 | set flight effect. |
217 | |
217 | |
218 | This is quite a long example to get you going - you can download it from |
218 | This is quite a long example to get you going - you can also download it |
219 | L<http://cvs.schmorp.de/OpenCL/examples/juliaflight>. |
219 | from 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 |
390 | context, no event is created. In all other contexts an event is returned |
390 | context, no event is created. In all other contexts an event is returned |
391 | by the method. |
391 | by 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 |
394 | other status is returned the function will throw an exception, so you |
394 | other status is returned the function will throw an exception, so you |
395 | don't normally have to to any error checking. |
395 | don't normally have to to any error checking. |
396 | |
396 | |
397 | =back |
397 | =back |
|
|
398 | |
|
|
399 | =head2 CONSTANTS |
|
|
400 | |
|
|
401 | All C<CL_xxx> constants that this module supports are always available |
|
|
402 | in the C<OpenCL> namespace as C<OpenCL::xxx> (i.e. without the C<CL_> |
|
|
403 | prefix). Constants which are not defined in the header files used during |
|
|
404 | compilation, or otherwise are not available, will have the value C<-1>. |
|
|
405 | |
|
|
406 | The latest version of this module knows and exports the constants |
|
|
407 | listed in L<http://cvs.schmorp.de/OpenCL/constiv.h>. |
|
|
408 | |
|
|
409 | =head2 OPENCL 1.1 VS. OPENCL 1.2 |
|
|
410 | |
|
|
411 | This module supports both OpenCL version 1.1 and 1.2, although the OpenCL |
|
|
412 | 1.2 interface hasn't been tested much for lack of availability of an |
|
|
413 | actual implementation. |
|
|
414 | |
|
|
415 | Every function or method in this manual page that interfaces to a |
|
|
416 | particular OpenCL function has a link to the its C manual page. |
|
|
417 | |
|
|
418 | If the link contains a F<1.1>, then this function is an OpenCL 1.1 |
|
|
419 | function. Most but not all also exist in OpenCL 1.2, and this module |
|
|
420 | tries to emulate the missing ones for you, when told to do so at |
|
|
421 | compiletime. You can check whether a function was removed in OpenCL 1.2 by |
|
|
422 | replacing the F<1.1> component in the URL by F<1.2>. |
|
|
423 | |
|
|
424 | If the link contains a F<1.2>, then this is a OpenCL 1.2-only |
|
|
425 | function. Even if the module was compiled with OpenCL 1.2 header files |
|
|
426 | and has an 1.2 OpenCL library, calling such a function on a platform that |
|
|
427 | doesn't implement 1.2 causes undefined behaviour, usually a crash (But |
|
|
428 | this is not guaranteed). |
|
|
429 | |
|
|
430 | You can find out whether this module was compiled to prefer 1.1 |
|
|
431 | functionality by ooking at C<OpenCL::PREFER_1_1> - if it is true, then |
|
|
432 | 1.1 functions generally are implemented using 1.1 OpenCL functions. If it |
|
|
433 | is false, then 1.1 functions missing from 1.2 are emulated by calling 1.2 |
|
|
434 | fucntions. |
|
|
435 | |
|
|
436 | This is a somewhat sorry state of affairs, but the Khronos group choose to |
|
|
437 | make every release of OpenCL source and binary incompatible with previous |
|
|
438 | releases. |
398 | |
439 | |
399 | =head2 PERL AND OPENCL TYPES |
440 | =head2 PERL AND OPENCL TYPES |
400 | |
441 | |
401 | This handy(?) table lists OpenCL types and their perl, PDL and pack/unpack |
442 | This handy(?) table lists OpenCL types and their perl, PDL and pack/unpack |
402 | format equivalents: |
443 | format equivalents: |
… | |
… | |
600 | The last error returned by a function - it's only valid after an error occured |
641 | The last error returned by a function - it's only valid after an error occured |
601 | and before calling another OpenCL function. |
642 | and before calling another OpenCL function. |
602 | |
643 | |
603 | =item $str = OpenCL::err2str [$errval] |
644 | =item $str = OpenCL::err2str [$errval] |
604 | |
645 | |
605 | Converts an error value into a human readable string. IF no error value is |
646 | Converts an error value into a human readable string. If no error value is |
606 | given, then the last error will be used (as returned by OpenCL::errno). |
647 | given, then the last error will be used (as returned by OpenCL::errno). |
|
|
648 | |
|
|
649 | The latest version of this module knows the error constants |
|
|
650 | listed in L<http://cvs.schmorp.de/OpenCL/errstr.h>. |
607 | |
651 | |
608 | =item $str = OpenCL::enum2str $enum |
652 | =item $str = OpenCL::enum2str $enum |
609 | |
653 | |
610 | Converts most enum values (of parameter names, image format constants, |
654 | Converts most enum values (of parameter names, image format constants, |
611 | object types, addressing and filter modes, command types etc.) into a |
655 | object types, addressing and filter modes, command types etc.) into a |
612 | human readable string. When confronted with some random integer it can be |
656 | human readable string. When confronted with some random integer it can be |
613 | very helpful to pass it through this function to maybe get some readable |
657 | very helpful to pass it through this function to maybe get some readable |
614 | string out of it. |
658 | string out of it. |
615 | |
659 | |
|
|
660 | The latest version of this module knows the enumaration constants |
|
|
661 | listed in L<http://cvs.schmorp.de/OpenCL/enumstr.h>. |
|
|
662 | |
616 | =item @platforms = OpenCL::platforms |
663 | =item @platforms = OpenCL::platforms |
617 | |
664 | |
618 | Returns all available OpenCL::Platform objects. |
665 | Returns all available OpenCL::Platform objects. |
619 | |
666 | |
620 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetPlatformIDs.html> |
667 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetPlatformIDs.html> |
621 | |
668 | |
622 | =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 |
623 | |
670 | |
624 | Tries to create a context from a default device and platform type - never worked for me. |
671 | Tries to create a context from a default device and platform type - never worked for me. |
|
|
672 | Consider using C<< $platform->context_from_type >> instead. |
625 | |
673 | |
626 | type: OpenCL::DEVICE_TYPE_DEFAULT, OpenCL::DEVICE_TYPE_CPU, OpenCL::DEVICE_TYPE_GPU, |
674 | type: OpenCL::DEVICE_TYPE_DEFAULT, OpenCL::DEVICE_TYPE_CPU, OpenCL::DEVICE_TYPE_GPU, |
627 | OpenCL::DEVICE_TYPE_ACCELERATOR, OpenCL::DEVICE_TYPE_CUSTOM, OpenCL::DEVICE_TYPE_ALL. |
675 | OpenCL::DEVICE_TYPE_ACCELERATOR, OpenCL::DEVICE_TYPE_CUSTOM, OpenCL::DEVICE_TYPE_ALL. |
628 | |
676 | |
629 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html> |
677 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html> |
630 | |
678 | |
631 | =item $ctx = OpenCL::context $properties, \@devices, $callback->($err, $pvt) = $print_stderr) |
679 | =item $ctx = OpenCL::context $properties, \@devices, $callback->($err, $pvt) = $print_stderr) |
632 | |
680 | |
633 | Create a new OpenCL::Context object using the given device object(s). This |
681 | Create a new OpenCL::Context object using the given device object(s). |
634 | function isn't implemented yet, use C<< $platform->context >> instead. |
682 | Consider using C<< $platform->context >> instead. |
635 | |
683 | |
636 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html> |
684 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html> |
637 | |
685 | |
638 | =item OpenCL::wait_for_events $wait_events... |
686 | =item OpenCL::wait_for_events $wait_events... |
639 | |
687 | |
… | |
… | |
720 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html> |
768 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html> |
721 | |
769 | |
722 | =item $ctx = $platform->context ($properties, \@devices, $callback->($err, $pvt) = $print_stderr) |
770 | =item $ctx = $platform->context ($properties, \@devices, $callback->($err, $pvt) = $print_stderr) |
723 | |
771 | |
724 | Create a new OpenCL::Context object using the given device object(s)- a |
772 | Create a new OpenCL::Context object using the given device object(s)- a |
725 | CL_CONTEXT_PLATFORM property is supplied automatically. |
773 | OpenCL::CONTEXT_PLATFORM property is supplied automatically. |
726 | |
774 | |
727 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html> |
775 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html> |
728 | |
776 | |
729 | =item $packed_value = $platform->info ($name) |
777 | =item $packed_value = $platform->info ($name) |
730 | |
778 | |
… | |
… | |
775 | =over 4 |
823 | =over 4 |
776 | |
824 | |
777 | =item $packed_value = $device->info ($name) |
825 | =item $packed_value = $device->info ($name) |
778 | |
826 | |
779 | See C<< $platform->info >> for details. |
827 | See C<< $platform->info >> for details. |
|
|
828 | |
|
|
829 | type: OpenCL::DEVICE_TYPE_DEFAULT, OpenCL::DEVICE_TYPE_CPU, |
|
|
830 | OpenCL::DEVICE_TYPE_GPU, OpenCL::DEVICE_TYPE_ACCELERATOR, |
|
|
831 | OpenCL::DEVICE_TYPE_CUSTOM, OpenCL::DEVICE_TYPE_ALL. |
|
|
832 | |
|
|
833 | fp_config: OpenCL::FP_DENORM, OpenCL::FP_INF_NAN, OpenCL::FP_ROUND_TO_NEAREST, |
|
|
834 | OpenCL::FP_ROUND_TO_ZERO, OpenCL::FP_ROUND_TO_INF, OpenCL::FP_FMA, |
|
|
835 | OpenCL::FP_SOFT_FLOAT, OpenCL::FP_CORRECTLY_ROUNDED_DIVIDE_SQRT. |
|
|
836 | |
|
|
837 | mem_cache_type: OpenCL::NONE, OpenCL::READ_ONLY_CACHE, OpenCL::READ_WRITE_CACHE. |
|
|
838 | |
|
|
839 | local_mem_type: OpenCL::LOCAL, OpenCL::GLOBAL. |
|
|
840 | |
|
|
841 | exec_capabilities: OpenCL::EXEC_KERNEL, OpenCL::EXEC_NATIVE_KERNEL. |
|
|
842 | |
|
|
843 | command_queue_properties: OpenCL::QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, |
|
|
844 | OpenCL::QUEUE_PROFILING_ENABLE. |
|
|
845 | |
|
|
846 | partition_properties: OpenCL::DEVICE_PARTITION_EQUALLY, |
|
|
847 | OpenCL::DEVICE_PARTITION_BY_COUNTS, OpenCL::DEVICE_PARTITION_BY_COUNTS_LIST_END, |
|
|
848 | OpenCL::DEVICE_PARTITION_BY_AFFINITY_DOMAIN. |
|
|
849 | |
|
|
850 | affinity_domain: OpenCL::DEVICE_AFFINITY_DOMAIN_NUMA, |
|
|
851 | OpenCL::DEVICE_AFFINITY_DOMAIN_L4_CACHE, OpenCL::DEVICE_AFFINITY_DOMAIN_L3_CACHE, |
|
|
852 | OpenCL::DEVICE_AFFINITY_DOMAIN_L2_CACHE, OpenCL::DEVICE_AFFINITY_DOMAIN_L1_CACHE, |
|
|
853 | OpenCL::DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE. |
780 | |
854 | |
781 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetDeviceInfo.html> |
855 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetDeviceInfo.html> |
782 | |
856 | |
783 | =item @devices = $device->sub_devices (\@properties) |
857 | =item @devices = $device->sub_devices (\@properties) |
784 | |
858 | |
… | |
… | |
1164 | OpenCL::UNORM_INT16, OpenCL::UNORM_SHORT_565, OpenCL::UNORM_SHORT_555, |
1238 | OpenCL::UNORM_INT16, OpenCL::UNORM_SHORT_565, OpenCL::UNORM_SHORT_555, |
1165 | OpenCL::UNORM_INT_101010, OpenCL::SIGNED_INT8, OpenCL::SIGNED_INT16, |
1239 | OpenCL::UNORM_INT_101010, OpenCL::SIGNED_INT8, OpenCL::SIGNED_INT16, |
1166 | OpenCL::SIGNED_INT32, OpenCL::UNSIGNED_INT8, OpenCL::UNSIGNED_INT16, |
1240 | OpenCL::SIGNED_INT32, OpenCL::UNSIGNED_INT8, OpenCL::UNSIGNED_INT16, |
1167 | OpenCL::UNSIGNED_INT32, OpenCL::HALF_FLOAT, OpenCL::FLOAT. |
1241 | OpenCL::UNSIGNED_INT32, OpenCL::HALF_FLOAT, OpenCL::FLOAT. |
1168 | |
1242 | |
1169 | |
|
|
1170 | type: OpenCL::MEM_OBJECT_BUFFER, OpenCL::MEM_OBJECT_IMAGE2D, |
1243 | type: OpenCL::MEM_OBJECT_BUFFER, OpenCL::MEM_OBJECT_IMAGE2D, |
1171 | OpenCL::MEM_OBJECT_IMAGE3D, OpenCL::MEM_OBJECT_IMAGE2D_ARRAY, |
1244 | OpenCL::MEM_OBJECT_IMAGE3D, OpenCL::MEM_OBJECT_IMAGE2D_ARRAY, |
1172 | OpenCL::MEM_OBJECT_IMAGE1D, OpenCL::MEM_OBJECT_IMAGE1D_ARRAY, |
1245 | OpenCL::MEM_OBJECT_IMAGE1D, OpenCL::MEM_OBJECT_IMAGE1D_ARRAY, |
1173 | OpenCL::MEM_OBJECT_IMAGE1D_BUFFER. |
1246 | OpenCL::MEM_OBJECT_IMAGE1D_BUFFER. |
1174 | |
1247 | |
… | |
… | |
1271 | |
1344 | |
1272 | Creates a new OpenCL::Program object from the given built-in kernel names. |
1345 | Creates a new OpenCL::Program object from the given built-in kernel names. |
1273 | |
1346 | |
1274 | L<http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clCreateProgramWithBuiltInKernels.html> |
1347 | L<http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clCreateProgramWithBuiltInKernels.html> |
1275 | |
1348 | |
|
|
1349 | =item $program = $ctx->link_program (\@devices, $options, \@programs, $cb->($program) = undef) |
|
|
1350 | |
|
|
1351 | Links all (already compiled) program objects specified in C<@programs> |
|
|
1352 | together and returns a new OpenCL::Program object with the result. |
|
|
1353 | |
|
|
1354 | L<http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clLinkProgram.html> |
|
|
1355 | |
1276 | =item $packed_value = $ctx->info ($name) |
1356 | =item $packed_value = $ctx->info ($name) |
1277 | |
1357 | |
1278 | See C<< $platform->info >> for details. |
1358 | See C<< $platform->info >> for details. |
1279 | |
1359 | |
1280 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetContextInfo.html> |
1360 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetContextInfo.html> |
… | |
… | |
1342 | |
1422 | |
1343 | =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...) |
1344 | |
1424 | |
1345 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBuffer.html> |
1425 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBuffer.html> |
1346 | |
1426 | |
1347 | =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...) |
1348 | |
1428 | |
1349 | http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueReadBufferRect.html |
1429 | http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueReadBufferRect.html |
1350 | |
1430 | |
1351 | =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...) |
1352 | |
1432 | |
1353 | http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWriteBufferRect.html |
1433 | http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWriteBufferRect.html |
1354 | |
1434 | |
1355 | =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...) |
1356 | |
1436 | |
… | |
… | |
1571 | |
1651 | |
1572 | See C<< $platform->info >> for details. |
1652 | See C<< $platform->info >> for details. |
1573 | |
1653 | |
1574 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetMemObjectInfo.html> |
1654 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetMemObjectInfo.html> |
1575 | |
1655 | |
|
|
1656 | =item $memory->destructor_callback ($cb->()) |
|
|
1657 | |
|
|
1658 | Sets a callback that will be invoked after the memory object is destructed. |
|
|
1659 | |
|
|
1660 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clSetMemObjectDestructorCallback.html> |
|
|
1661 | |
1576 | =for gengetinfo begin mem |
1662 | =for gengetinfo begin mem |
1577 | |
1663 | |
1578 | =item $mem_object_type = $mem->type |
1664 | =item $mem_object_type = $mem->type |
1579 | |
1665 | |
1580 | Calls C<clGetMemObjectInfo> with C<OpenCL::MEM_TYPE> and returns the result. |
1666 | Calls C<clGetMemObjectInfo> with C<OpenCL::MEM_TYPE> and returns the result. |
… | |
… | |
1637 | =over 4 |
1723 | =over 4 |
1638 | |
1724 | |
1639 | =item $subbuf = $buf_obj->sub_buffer_region ($flags, $origin, $size) |
1725 | =item $subbuf = $buf_obj->sub_buffer_region ($flags, $origin, $size) |
1640 | |
1726 | |
1641 | Creates an OpenCL::Buffer objects from this buffer and returns it. The |
1727 | Creates an OpenCL::Buffer objects from this buffer and returns it. The |
1642 | C<buffer_create_type> is assumed to be C<CL_BUFFER_CREATE_TYPE_REGION>. |
1728 | C<buffer_create_type> is assumed to be C<OpenCL::BUFFER_CREATE_TYPE_REGION>. |
1643 | |
1729 | |
1644 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateSubBuffer.html> |
1730 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateSubBuffer.html> |
1645 | |
1731 | |
1646 | =back |
1732 | =back |
1647 | |
1733 | |
… | |
… | |
1663 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetImageInfo.html> |
1749 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetImageInfo.html> |
1664 | |
1750 | |
1665 | =item ($channel_order, $channel_data_type) = $image->format |
1751 | =item ($channel_order, $channel_data_type) = $image->format |
1666 | |
1752 | |
1667 | Returns the channel order and type used to create the image by calling |
1753 | Returns the channel order and type used to create the image by calling |
1668 | C<clGetImageInfo> with C<CL_IMAGE_FORMAT>. |
1754 | C<clGetImageInfo> with C<OpenCL::IMAGE_FORMAT>. |
1669 | |
1755 | |
1670 | =for gengetinfo begin image |
1756 | =for gengetinfo begin image |
1671 | |
1757 | |
1672 | =item $int = $image->element_size |
1758 | =item $int = $image->element_size |
1673 | |
1759 | |
… | |
… | |
1773 | C<-cl-mad-enable>, C<-cl-no-signed-zeros>, C<-cl-unsafe-math-optimizations>, |
1859 | C<-cl-mad-enable>, C<-cl-no-signed-zeros>, C<-cl-unsafe-math-optimizations>, |
1774 | C<-cl-finite-math-only>, C<-cl-fast-relaxed-math>, |
1860 | C<-cl-finite-math-only>, C<-cl-fast-relaxed-math>, |
1775 | C<-w>, C<-Werror>, C<-cl-std=CL1.1/CL1.2>, C<-cl-kernel-arg-info>, |
1861 | C<-w>, C<-Werror>, C<-cl-std=CL1.1/CL1.2>, C<-cl-kernel-arg-info>, |
1776 | C<-create-library>, C<-enable-link-options>. |
1862 | C<-create-library>, C<-enable-link-options>. |
1777 | |
1863 | |
|
|
1864 | build_status: OpenCL::BUILD_SUCCESS, OpenCL::BUILD_NONE, |
|
|
1865 | OpenCL::BUILD_ERROR, OpenCL::BUILD_IN_PROGRESS. |
|
|
1866 | |
1778 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clBuildProgram.html> |
1867 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clBuildProgram.html> |
1779 | |
1868 | |
1780 | =item $program->build_async (\@devices = undef, $options = "", $cb->($program) = undef) |
1869 | =item $program->build_async (\@devices = undef, $options = "", $cb->($program) = undef) |
1781 | |
1870 | |
1782 | Similar to C<< ->build >>, except it starts a thread, and never fails (you |
1871 | Similar to C<< ->build >>, except it starts a thread, and never fails (you |
1783 | need to check the compilation status form the callback, or by polling). |
1872 | need to check the compilation status form the callback, or by polling). |
1784 | |
1873 | |
1785 | build_status: OpenCL::BUILD_SUCCESS, OpenCL::BUILD_NONE, |
1874 | =item $program->compile (\@devices = undef, $options = "", \%headers = undef, $cb->($program) = undef) |
1786 | OpenCL::BUILD_ERROR, OpenCL::BUILD_IN_PROGRESS. |
1875 | |
|
|
1876 | Compiles the given program for the given devices (or all devices if |
|
|
1877 | undef). If C<$headers> is given, it must be a hashref with include name => |
|
|
1878 | OpenCL::Program pairs. |
|
|
1879 | |
|
|
1880 | L<http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clCompileProgram.html> |
1787 | |
1881 | |
1788 | =item $packed_value = $program->build_info ($device, $name) |
1882 | =item $packed_value = $program->build_info ($device, $name) |
1789 | |
1883 | |
1790 | Similar to C<< $platform->info >>, but returns build info for a previous |
1884 | Similar to C<< $platform->info >>, but returns build info for a previous |
1791 | build attempt for the given device. |
1885 | build attempt for the given device. |
1792 | |
1886 | |
|
|
1887 | binary_type: OpenCL::PROGRAM_BINARY_TYPE_NONE, |
|
|
1888 | OpenCL::PROGRAM_BINARY_TYPE_COMPILED_OBJECT, |
|
|
1889 | OpenCL::PROGRAM_BINARY_TYPE_LIBRARY, |
|
|
1890 | OpenCL::PROGRAM_BINARY_TYPE_EXECUTABLE. |
|
|
1891 | |
1793 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetBuildInfo.html> |
1892 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetBuildInfo.html> |
1794 | |
1893 | |
1795 | =item $kernel = $program->kernel ($function_name) |
1894 | =item $kernel = $program->kernel ($function_name) |
1796 | |
1895 | |
1797 | Creates an OpenCL::Kernel object out of the named C<__kernel> function in |
1896 | Creates an OpenCL::Kernel object out of the named C<__kernel> function in |
… | |
… | |
1816 | Calls C<clGetProgramBuildInfo> with C<OpenCL::PROGRAM_BUILD_OPTIONS> and returns the result. |
1915 | Calls C<clGetProgramBuildInfo> with C<OpenCL::PROGRAM_BUILD_OPTIONS> and returns the result. |
1817 | |
1916 | |
1818 | =item $string = $program->build_log ($device) |
1917 | =item $string = $program->build_log ($device) |
1819 | |
1918 | |
1820 | Calls C<clGetProgramBuildInfo> with C<OpenCL::PROGRAM_BUILD_LOG> and returns the result. |
1919 | Calls C<clGetProgramBuildInfo> with C<OpenCL::PROGRAM_BUILD_LOG> and returns the result. |
|
|
1920 | |
|
|
1921 | =item $binary_type = $program->binary_type ($device) |
|
|
1922 | |
|
|
1923 | Calls C<clGetProgramBuildInfo> with C<OpenCL::PROGRAM_BINARY_TYPE> and returns the result. |
1821 | |
1924 | |
1822 | =for gengetinfo end program_build |
1925 | =for gengetinfo end program_build |
1823 | |
1926 | |
1824 | =item $packed_value = $program->info ($name) |
1927 | =item $packed_value = $program->info ($name) |
1825 | |
1928 | |