--- OpenCL/OpenCL.pm 2012/05/04 15:04:51 1.74 +++ OpenCL/OpenCL.pm 2012/05/05 12:54:03 1.77 @@ -99,6 +99,37 @@ Enqueue buffer reads for your output buffer to read results. +=head1 OPENCL 1.1 VS. OPENCL 1.2 + +This module supports both OpenCL version 1.1 and 1.2, although the OpenCL +1.2 interface hasn't been tested much for lack of availability of an +actual implementation. + +Every function or method in this manual page that interfaces to a +particular OpenCL function has a link to the its C manual page. + +If the link contains a F<1.1>, then this function is an OpenCL 1.1 +function. Most but not all also exist in OpenCL 1.2, and this module +tries to emulate the missing ones for you, when told to do so at +compiletime. You cna check whether a function was removed in OpenCL 1.2 by +replacing the F<1.1> component in the URL by F<1.2>. + +If the link contains a F<1.2>, then this is a OpenCL 1.2-only +function. Even if the module was compiled with OpenCL 1.2 header files +and has an 1.2 OpenCL library, calling such a function on a platform that +doesn't implement 1.2 causes undefined behaviour, usually a crash (But +this is not guaranteed). + +You can find out whether this module was compiled to prefer 1.1 +functionality by ooking at C - if it is true, then +1.1 functions generally are implemented using 1.1 OpenCL functions. If it +is false, then 1.1 functions missing from 1.2 are emulated by calling 1.2 +fucntions. + +This is a somewhat sorry state of affairs, but the Khronos group choose to +make every release of OpenCL source and binary incompatible with previous +releases. + =head1 EXAMPLES =head2 Enumerate all devices and get contexts for them. @@ -622,6 +653,7 @@ =item $ctx = OpenCL::context_from_type $properties, $type = OpenCL::DEVICE_TYPE_DEFAULT, $callback->($err, $pvt) = $print_stderr Tries to create a context from a default device and platform type - never worked for me. +Consider using C<< $platform->context_from_type >> instead. type: OpenCL::DEVICE_TYPE_DEFAULT, OpenCL::DEVICE_TYPE_CPU, OpenCL::DEVICE_TYPE_GPU, OpenCL::DEVICE_TYPE_ACCELERATOR, OpenCL::DEVICE_TYPE_CUSTOM, OpenCL::DEVICE_TYPE_ALL. @@ -630,8 +662,8 @@ =item $ctx = OpenCL::context $properties, \@devices, $callback->($err, $pvt) = $print_stderr) -Create a new OpenCL::Context object using the given device object(s). This -function isn't implemented yet, use C<< $platform->context >> instead. +Create a new OpenCL::Context object using the given device object(s). +Consider using C<< $platform->context >> instead. L @@ -1273,6 +1305,13 @@ L +=item $program = $ctx->link_program (\@devices, $options, \@programs, $cb->($program) = undef) + +Links all (already compiled) program objects specified in C<@programs> +together and returns a new OpenCL::Program object with the result. + +L + =item $packed_value = $ctx->info ($name) See C<< $platform->info >> for details. @@ -1775,6 +1814,9 @@ C<-w>, C<-Werror>, C<-cl-std=CL1.1/CL1.2>, C<-cl-kernel-arg-info>, C<-create-library>, C<-enable-link-options>. +build_status: OpenCL::BUILD_SUCCESS, OpenCL::BUILD_NONE, +OpenCL::BUILD_ERROR, OpenCL::BUILD_IN_PROGRESS. + L =item $program->build_async (\@devices = undef, $options = "", $cb->($program) = undef) @@ -1782,8 +1824,13 @@ Similar to C<< ->build >>, except it starts a thread, and never fails (you need to check the compilation status form the callback, or by polling). -build_status: OpenCL::BUILD_SUCCESS, OpenCL::BUILD_NONE, -OpenCL::BUILD_ERROR, OpenCL::BUILD_IN_PROGRESS. +=item $program->compile (\@devices = undef, $options = "", \%headers = undef, $cb->($program) = undef) + +Compiles the given program for the given devices (or all devices if +undef). If C<$headers> is given, it must be a hashref with include name => +OpenCL::Program pairs. + +L =item $packed_value = $program->build_info ($device, $name)