… | |
… | |
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 |
… | |
… | |
398 | |
398 | |
399 | =head2 CONSTANTS |
399 | =head2 CONSTANTS |
400 | |
400 | |
401 | All C<CL_xxx> constants that this module supports are always available |
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_> |
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 heaer files used during |
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>. |
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>. |
405 | |
408 | |
406 | =head2 OPENCL 1.1 VS. OPENCL 1.2 |
409 | =head2 OPENCL 1.1 VS. OPENCL 1.2 |
407 | |
410 | |
408 | This module supports both OpenCL version 1.1 and 1.2, although the OpenCL |
411 | This module supports both OpenCL version 1.1 and 1.2, although the OpenCL |
409 | 1.2 interface hasn't been tested much for lack of availability of an |
412 | 1.2 interface hasn't been tested much for lack of availability of an |
… | |
… | |
413 | particular OpenCL function has a link to the its C manual page. |
416 | particular OpenCL function has a link to the its C manual page. |
414 | |
417 | |
415 | If the link contains a F<1.1>, then this function is an OpenCL 1.1 |
418 | If the link contains a F<1.1>, then this function is an OpenCL 1.1 |
416 | function. Most but not all also exist in OpenCL 1.2, and this module |
419 | function. Most but not all also exist in OpenCL 1.2, and this module |
417 | tries to emulate the missing ones for you, when told to do so at |
420 | tries to emulate the missing ones for you, when told to do so at |
418 | compiletime. You cna check whether a function was removed in OpenCL 1.2 by |
421 | compiletime. You can check whether a function was removed in OpenCL 1.2 by |
419 | replacing the F<1.1> component in the URL by F<1.2>. |
422 | replacing the F<1.1> component in the URL by F<1.2>. |
420 | |
423 | |
421 | If the link contains a F<1.2>, then this is a OpenCL 1.2-only |
424 | If the link contains a F<1.2>, then this is a OpenCL 1.2-only |
422 | function. Even if the module was compiled with OpenCL 1.2 header files |
425 | function. Even if the module was compiled with OpenCL 1.2 header files |
423 | and has an 1.2 OpenCL library, calling such a function on a platform that |
426 | and has an 1.2 OpenCL library, calling such a function on a platform that |
… | |
… | |
638 | 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 |
639 | and before calling another OpenCL function. |
642 | and before calling another OpenCL function. |
640 | |
643 | |
641 | =item $str = OpenCL::err2str [$errval] |
644 | =item $str = OpenCL::err2str [$errval] |
642 | |
645 | |
643 | 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 |
644 | 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>. |
645 | |
651 | |
646 | =item $str = OpenCL::enum2str $enum |
652 | =item $str = OpenCL::enum2str $enum |
647 | |
653 | |
648 | Converts most enum values (of parameter names, image format constants, |
654 | Converts most enum values (of parameter names, image format constants, |
649 | object types, addressing and filter modes, command types etc.) into a |
655 | object types, addressing and filter modes, command types etc.) into a |
650 | 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 |
651 | 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 |
652 | string out of it. |
658 | string out of it. |
|
|
659 | |
|
|
660 | The latest version of this module knows the enumaration constants |
|
|
661 | listed in L<http://cvs.schmorp.de/OpenCL/errstr.h>. |
653 | |
662 | |
654 | =item @platforms = OpenCL::platforms |
663 | =item @platforms = OpenCL::platforms |
655 | |
664 | |
656 | Returns all available OpenCL::Platform objects. |
665 | Returns all available OpenCL::Platform objects. |
657 | |
666 | |