--- OpenCL/OpenCL.pm 2012/04/20 08:57:09 1.41 +++ OpenCL/OpenCL.pm 2012/04/21 19:48:58 1.47 @@ -162,7 +162,7 @@ my $prog = $ctx->program_with_source ($src); # build croaks on compile errors, so catch it and print the compile errors - eval { $prog->build ($dev); 1 } + eval { $prog->build ($dev, "-cl-fast-relaxed-math"); 1 } or die $prog->build_log; my $kernel = $prog->kernel ("squareit"); @@ -338,7 +338,9 @@ =item * When enqueuing commands, the wait list is specified by adding extra arguments to the function - anywhere a C<$wait_events...> argument -is documented this can be any number of event objects. +is documented this can be any number of event objects. As an extsnion +implemented by this module, C values will be ignored in the event +list. =item * When enqueuing commands, if the enqueue method is called in void context, no event is created. In all other contexts an event is returned @@ -750,7 +752,7 @@ Calls C with C and returns the result. -=item $uint = $device->reference_count_ext +=item $uint = $device->reference_count_ext Calls C with C and returns the result. @@ -772,6 +774,10 @@ L +Example: create an out-of-order queue. + + $queue = $ctx->queue ($device, OpenCL::QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE); + =item $ev = $ctx->user_event Creates a new OpenCL::UserEvent object. @@ -811,14 +817,21 @@ http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateFromGLBuffer.html -=item $ctx->gl_texture2d ($flags, $target, $miplevel, $texture) +=item $img = $ctx->gl_texture ($flags, $target, $miplevel, $texture) + +Creates a new OpenCL::Image object that refers to the given OpenGL +texture object or buffer. + +http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clCreateFromGLTexture.html + +=item $img = $ctx->gl_texture2d ($flags, $target, $miplevel, $texture) Creates a new OpenCL::Image2D object that refers to the given OpenGL 2D texture object. http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateFromGLTexture2D.html -=item $ctx->gl_texture3d ($flags, $target, $miplevel, $texture) +=item $img = $ctx->gl_texture3d ($flags, $target, $miplevel, $texture) Creates a new OpenCL::Image3D object that refers to the given OpenGL 3D texture object. @@ -891,11 +904,17 @@ They also allow you to specify any number of other event objects that this request has to wait for before it starts executing, by simply passing the -event objects as extra parameters to the enqueue methods. +event objects as extra parameters to the enqueue methods. To simplify +program design, this module ignores any C values in the list of +events. This makes it possible to code operations such as this, without +having to put a valid event object into C<$event> first: + + $event = $queue->enqueue_xxx (..., $event); Queues execute in-order by default, without any parallelism, so in most cases (i.e. you use only one queue) it's not necessary to wait for or -create event objects. +create event objects, althoguh an our of order queue is often a bit +faster. =over 4 @@ -971,10 +990,6 @@ L -=item $ev = $queue->enqueue_marker ($wait_events...) - -L - =item $ev = $queue->enqueue_acquire_gl_objects ([object, ...], $wait_events...) Enqueues a list (an array-ref of OpenCL::Memory objects) to be acquired @@ -993,9 +1008,13 @@ L -=item $queue->enqueue_barrier +=item $ev = $queue->enqueue_marker ($wait_events...) + +L + +=item $ev = $queue->enqueue_barrier ($wait_events...) -L +L =item $queue->flush @@ -1120,7 +1139,9 @@ =head2 THE OpenCL::Image CLASS -This is the superclass of all image objects - OpenCL::Image2D and OpenCL::Image3D. +This is the superclass of all image objects - OpenCL::Image1D, +OpenCL::Image1DArray, OpenCL::Image1DBuffer, OpenCL::Image2D, +OpenCL::Image2DArray and OpenCL::Image3D. =over 4 @@ -1476,20 +1497,24 @@ use common::sense; BEGIN { - our $VERSION = '0.95'; + our $VERSION = '0.96'; require XSLoader; XSLoader::load (__PACKAGE__, $VERSION); - @OpenCL::Buffer::ISA = - @OpenCL::Image::ISA = OpenCL::Memory::; + @OpenCL::Buffer::ISA = + @OpenCL::Image::ISA = OpenCL::Memory::; - @OpenCL::BufferObj::ISA = OpenCL::Buffer::; + @OpenCL::BufferObj::ISA = OpenCL::Buffer::; - @OpenCL::Image2D::ISA = - @OpenCL::Image3D::ISA = OpenCL::Image::; + @OpenCL::Image2D::ISA = + @OpenCL::Image3D::ISA = + @OpenCL::Image2DArray::ISA = + @OpenCL::Image1D::ISA = + @OpenCL::Image1DArray::ISA = + @OpenCL::Image1DBuffer::ISA = OpenCL::Image::; - @OpenCL::UserEvent::ISA = OpenCL::Event::; + @OpenCL::UserEvent::ISA = OpenCL::Event::; } 1;