… | |
… | |
96 | initialised at creation time). |
96 | initialised at creation time). |
97 | |
97 | |
98 | Enqueue the kernel execution. |
98 | Enqueue the kernel execution. |
99 | |
99 | |
100 | Enqueue buffer reads for your output buffer to read results. |
100 | Enqueue buffer reads for your output buffer to read results. |
|
|
101 | |
|
|
102 | =head1 OPENCL 1.1 VS. OPENCL 1.2 |
|
|
103 | |
|
|
104 | This module supports both OpenCL version 1.1 and 1.2, although the OpenCL |
|
|
105 | 1.2 interface hasn't been tested much for lack of availability of an |
|
|
106 | actual implementation. |
|
|
107 | |
|
|
108 | Every function or method in this manual page that interfaces to a |
|
|
109 | particular OpenCL function has a link to the its C manual page. |
|
|
110 | |
|
|
111 | If the link contains a F<1.1>, then this function is an OpenCL 1.1 |
|
|
112 | function. Most but not all also exist in OpenCL 1.2, and this module |
|
|
113 | tries to emulate the missing ones for you, when told to do so at |
|
|
114 | compiletime. You cna check whether a function was removed in OpenCL 1.2 by |
|
|
115 | replacing the F<1.1> component in the URL by F<1.2>. |
|
|
116 | |
|
|
117 | If the link contains a F<1.2>, then this is a OpenCL 1.2-only |
|
|
118 | function. Even if the module was compiled with OpenCL 1.2 header files |
|
|
119 | and has an 1.2 OpenCL library, calling such a function on a platform that |
|
|
120 | doesn't implement 1.2 causes undefined behaviour, usually a crash (But |
|
|
121 | this is not guaranteed). |
|
|
122 | |
|
|
123 | You can find out whether this module was compiled to prefer 1.1 |
|
|
124 | functionality by ooking at C<OpenCL::PREFER_1_1> - if it is true, then |
|
|
125 | 1.1 functions generally are implemented using 1.1 OpenCL functions. If it |
|
|
126 | is false, then 1.1 functions missing from 1.2 are emulated by calling 1.2 |
|
|
127 | fucntions. |
|
|
128 | |
|
|
129 | This is a somewhat sorry state of affairs, but the Khronos group choose to |
|
|
130 | make every release of OpenCL source and binary incompatible with previous |
|
|
131 | releases. |
101 | |
132 | |
102 | =head1 EXAMPLES |
133 | =head1 EXAMPLES |
103 | |
134 | |
104 | =head2 Enumerate all devices and get contexts for them. |
135 | =head2 Enumerate all devices and get contexts for them. |
105 | |
136 | |
… | |
… | |
620 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetPlatformIDs.html> |
651 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetPlatformIDs.html> |
621 | |
652 | |
622 | =item $ctx = OpenCL::context_from_type $properties, $type = OpenCL::DEVICE_TYPE_DEFAULT, $callback->($err, $pvt) = $print_stderr |
653 | =item $ctx = OpenCL::context_from_type $properties, $type = OpenCL::DEVICE_TYPE_DEFAULT, $callback->($err, $pvt) = $print_stderr |
623 | |
654 | |
624 | Tries to create a context from a default device and platform type - never worked for me. |
655 | Tries to create a context from a default device and platform type - never worked for me. |
|
|
656 | Consider using C<< $platform->context_from_type >> instead. |
625 | |
657 | |
626 | type: OpenCL::DEVICE_TYPE_DEFAULT, OpenCL::DEVICE_TYPE_CPU, OpenCL::DEVICE_TYPE_GPU, |
658 | 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. |
659 | OpenCL::DEVICE_TYPE_ACCELERATOR, OpenCL::DEVICE_TYPE_CUSTOM, OpenCL::DEVICE_TYPE_ALL. |
628 | |
660 | |
629 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html> |
661 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html> |
630 | |
662 | |
631 | =item $ctx = OpenCL::context $properties, \@devices, $callback->($err, $pvt) = $print_stderr) |
663 | =item $ctx = OpenCL::context $properties, \@devices, $callback->($err, $pvt) = $print_stderr) |
632 | |
664 | |
633 | Create a new OpenCL::Context object using the given device object(s). This |
665 | Create a new OpenCL::Context object using the given device object(s). |
634 | function isn't implemented yet, use C<< $platform->context >> instead. |
666 | Consider using C<< $platform->context >> instead. |
635 | |
667 | |
636 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html> |
668 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html> |
637 | |
669 | |
638 | =item OpenCL::wait_for_events $wait_events... |
670 | =item OpenCL::wait_for_events $wait_events... |
639 | |
671 | |
… | |
… | |
775 | =over 4 |
807 | =over 4 |
776 | |
808 | |
777 | =item $packed_value = $device->info ($name) |
809 | =item $packed_value = $device->info ($name) |
778 | |
810 | |
779 | See C<< $platform->info >> for details. |
811 | See C<< $platform->info >> for details. |
|
|
812 | |
|
|
813 | type: OpenCL::DEVICE_TYPE_DEFAULT, OpenCL::DEVICE_TYPE_CPU, |
|
|
814 | OpenCL::DEVICE_TYPE_GPU, OpenCL::DEVICE_TYPE_ACCELERATOR, |
|
|
815 | OpenCL::DEVICE_TYPE_CUSTOM, OpenCL::DEVICE_TYPE_ALL. |
|
|
816 | |
|
|
817 | fp_config: OpenCL::FP_DENORM, OpenCL::FP_INF_NAN, OpenCL::FP_ROUND_TO_NEAREST, |
|
|
818 | OpenCL::FP_ROUND_TO_ZERO, OpenCL::FP_ROUND_TO_INF, OpenCL::FP_FMA, |
|
|
819 | OpenCL::FP_SOFT_FLOAT, OpenCL::FP_CORRECTLY_ROUNDED_DIVIDE_SQRT. |
|
|
820 | |
|
|
821 | mem_cache_type: OpenCL::NONE, OpenCL::READ_ONLY_CACHE, OpenCL::READ_WRITE_CACHE. |
|
|
822 | |
|
|
823 | local_mem_type: OpenCL::LOCAL, OpenCL::GLOBAL. |
|
|
824 | |
|
|
825 | exec_capabilities: OpenCL::EXEC_KERNEL, OpenCL::EXEC_NATIVE_KERNEL. |
|
|
826 | |
|
|
827 | command_queue_properties: OpenCL::QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, |
|
|
828 | OpenCL::QUEUE_PROFILING_ENABLE. |
|
|
829 | |
|
|
830 | partition_properties: OpenCL::DEVICE_PARTITION_EQUALLY, |
|
|
831 | OpenCL::DEVICE_PARTITION_BY_COUNTS, OpenCL::DEVICE_PARTITION_BY_COUNTS_LIST_END, |
|
|
832 | OpenCL::DEVICE_PARTITION_BY_AFFINITY_DOMAIN. |
|
|
833 | |
|
|
834 | affinity_domain: OpenCL::DEVICE_AFFINITY_DOMAIN_NUMA, |
|
|
835 | OpenCL::DEVICE_AFFINITY_DOMAIN_L4_CACHE, OpenCL::DEVICE_AFFINITY_DOMAIN_L3_CACHE, |
|
|
836 | OpenCL::DEVICE_AFFINITY_DOMAIN_L2_CACHE, OpenCL::DEVICE_AFFINITY_DOMAIN_L1_CACHE, |
|
|
837 | OpenCL::DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE. |
780 | |
838 | |
781 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetDeviceInfo.html> |
839 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetDeviceInfo.html> |
782 | |
840 | |
783 | =item @devices = $device->sub_devices (\@properties) |
841 | =item @devices = $device->sub_devices (\@properties) |
784 | |
842 | |
… | |
… | |
1163 | channel_type: OpenCL::SNORM_INT8, OpenCL::SNORM_INT16, OpenCL::UNORM_INT8, |
1221 | channel_type: OpenCL::SNORM_INT8, OpenCL::SNORM_INT16, OpenCL::UNORM_INT8, |
1164 | OpenCL::UNORM_INT16, OpenCL::UNORM_SHORT_565, OpenCL::UNORM_SHORT_555, |
1222 | OpenCL::UNORM_INT16, OpenCL::UNORM_SHORT_565, OpenCL::UNORM_SHORT_555, |
1165 | OpenCL::UNORM_INT_101010, OpenCL::SIGNED_INT8, OpenCL::SIGNED_INT16, |
1223 | OpenCL::UNORM_INT_101010, OpenCL::SIGNED_INT8, OpenCL::SIGNED_INT16, |
1166 | OpenCL::SIGNED_INT32, OpenCL::UNSIGNED_INT8, OpenCL::UNSIGNED_INT16, |
1224 | OpenCL::SIGNED_INT32, OpenCL::UNSIGNED_INT8, OpenCL::UNSIGNED_INT16, |
1167 | OpenCL::UNSIGNED_INT32, OpenCL::HALF_FLOAT, OpenCL::FLOAT. |
1225 | OpenCL::UNSIGNED_INT32, OpenCL::HALF_FLOAT, OpenCL::FLOAT. |
1168 | |
|
|
1169 | |
1226 | |
1170 | type: OpenCL::MEM_OBJECT_BUFFER, OpenCL::MEM_OBJECT_IMAGE2D, |
1227 | type: OpenCL::MEM_OBJECT_BUFFER, OpenCL::MEM_OBJECT_IMAGE2D, |
1171 | OpenCL::MEM_OBJECT_IMAGE3D, OpenCL::MEM_OBJECT_IMAGE2D_ARRAY, |
1228 | OpenCL::MEM_OBJECT_IMAGE3D, OpenCL::MEM_OBJECT_IMAGE2D_ARRAY, |
1172 | OpenCL::MEM_OBJECT_IMAGE1D, OpenCL::MEM_OBJECT_IMAGE1D_ARRAY, |
1229 | OpenCL::MEM_OBJECT_IMAGE1D, OpenCL::MEM_OBJECT_IMAGE1D_ARRAY, |
1173 | OpenCL::MEM_OBJECT_IMAGE1D_BUFFER. |
1230 | OpenCL::MEM_OBJECT_IMAGE1D_BUFFER. |
… | |
… | |
1802 | |
1859 | |
1803 | =item $packed_value = $program->build_info ($device, $name) |
1860 | =item $packed_value = $program->build_info ($device, $name) |
1804 | |
1861 | |
1805 | Similar to C<< $platform->info >>, but returns build info for a previous |
1862 | Similar to C<< $platform->info >>, but returns build info for a previous |
1806 | build attempt for the given device. |
1863 | build attempt for the given device. |
|
|
1864 | |
|
|
1865 | binary_type: OpenCL::PROGRAM_BINARY_TYPE_NONE, |
|
|
1866 | OpenCL::PROGRAM_BINARY_TYPE_COMPILED_OBJECT, |
|
|
1867 | OpenCL::PROGRAM_BINARY_TYPE_LIBRARY, |
|
|
1868 | OpenCL::PROGRAM_BINARY_TYPE_EXECUTABLE. |
1807 | |
1869 | |
1808 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetBuildInfo.html> |
1870 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetBuildInfo.html> |
1809 | |
1871 | |
1810 | =item $kernel = $program->kernel ($function_name) |
1872 | =item $kernel = $program->kernel ($function_name) |
1811 | |
1873 | |