--- OpenCL/OpenCL.pm 2012/04/28 13:31:40 1.61 +++ OpenCL/OpenCL.pm 2012/04/29 18:24:35 1.63 @@ -495,12 +495,13 @@ package OpenCL; use common::sense; +use Carp (); use Async::Interrupt (); our $POLL_FUNC; # set by XS BEGIN { - our $VERSION = '0.97'; + our $VERSION = '0.98'; require XSLoader; XSLoader::load (__PACKAGE__, $VERSION); @@ -1005,20 +1006,19 @@ sub OpenCL::Context::build_program { my ($self, $prog, $options) = @_; - require Carp; - $prog = $self->program_with_source ($prog) unless ref $prog; eval { $prog->build (undef, $options); 1 } or errno == BUILD_PROGRAM_FAILURE + or errno == INVALID_BINARY # workaround nvidia bug or Carp::croak "OpenCL::Context->build_program: " . err2str; # we check status for all devices for my $dev ($self->devices) { $prog->build_status ($dev) == BUILD_SUCCESS - or Carp::croak ("Building OpenCL program for device '" . $dev->name . "' failed:\n" - . $prog->build_log ($dev)); + or Carp::croak "Building OpenCL program for device '" . $dev->name . "' failed:\n" + . $prog->build_log ($dev); } $prog @@ -1531,11 +1531,14 @@ compiling whether you use a callback or not. See C if you want to make sure the build is done in the background. -Note that some OpenCL implementations atc up badly, and don't call the +Note that some OpenCL implementations act up badly, and don't call the callback in some error cases (but call it in others). This implementation assumes the callback will always be called, and leaks memory if this is not so. So best make sure you don't pass in invalid values. +Some implementations fail with C when the +compilation state is successful but some later stage fails. + L =item $program->build_async (\@devices = undef, $options = "", $cb->($program) = undef)