Class: OpenCL::CommandQueue

Inherits:
FFI::ManagedStruct
  • Object
show all
Defined in:
lib/opencl_ruby_ffi/CommandQueue.rb,
lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb,
lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb

Overview

Maps the cl_command_queue object of OpenCL

Defined Under Namespace

Classes: Properties

Constant Summary collapse

OUT_OF_ORDER_EXEC_MODE_ENABLE =

:stopdoc:

(1 << 0)
PROFILING_ENABLE =
(1 << 1)
ON_DEVICE =
(1 << 2)
ON_DEVICE_DEFAULT =
(1 << 3)
CONTEXT =
0x1090
DEVICE =
0x1091
REFERENCE_COUNT =
0x1092
PROPERTIES =
0x1093
SIZE =
0x1094

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ptr, retain = true) ⇒ CommandQueue

Creates a new CommandQueue and retains it if specified and aplicable



1141
1142
1143
1144
1145
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 1141

def initialize(ptr, retain = true)
  super(ptr)
  OpenCL.clRetainCommandQueue(ptr) if retain
  #STDERR.puts "Allocating CommandQueue: #{ptr}"
end

Class Method Details

.release(ptr) ⇒ Object

method called at CommandQueue deletion, releases the object if aplicable



1156
1157
1158
1159
1160
1161
1162
1163
1164
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 1156

def self.release(ptr)
  #STDERR.puts "Releasing CommandQueue: #{ptr}"
  #ref_count = FFI::MemoryPointer::new( :cl_uint ) 
  #OpenCL.clGetCommandQueueInfo(ptr, OpenCL::CommandQueue::REFERENCE_COUNT, ref_count.size, ref_count, nil)
  #STDERR.puts "reference counter: #{ref_count.read_cl_uint}"
  error = OpenCL.clReleaseCommandQueue(ptr)
  #STDERR.puts "Object released! #{error}"
  OpenCL.error_check( error )
end

Instance Method Details

#contextObject

Returns the Context associated to the CommandQueue



1045
1046
1047
1048
1049
1050
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1045

def context
  ptr = FFI::MemoryPointer::new( OpenCL::Context )
  error = OpenCL.clGetCommandQueueInfo(self, OpenCL::CommandQueue::CONTEXT, Context.size, ptr, nil)
  OpenCL.error_check(error)
  return OpenCL::Context::new( ptr.read_pointer )
end

#deviceObject

Returns the Device associated to the CommandQueue



1053
1054
1055
1056
1057
1058
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1053

def device
  ptr = FFI::MemoryPointer::new( OpenCL::Device )
  error = OpenCL.clGetCommandQueueInfo(self, OpenCL::CommandQueue::DEVICE, Device.size, ptr, nil)
  OpenCL.error_check(error)
  return OpenCL::Device::new( ptr.read_pointer )
end

#enqueue_acquire_GL_object(mem_objects, options = {}) ⇒ Object

Acquire OpenCL Mem objects that have been created from OpenGL objects using the CommandQueue

Attributes

  • mem_objects - a single or an Array of Mem objects

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

Returns

the Event associated with the command



1495
1496
1497
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1495

def enqueue_acquire_GL_object( mem_objects, options = {} )
  return OpenCL.enqueue_acquire_GL_object( self, mem_objects, options )
end

#enqueue_barrier(events) ⇒ Object

Enqueues a barrier on a list of envents using the CommandQueue

Attributes

  • events - a single or an Array of Event to wait upon before the barrier is considered finished

Returns

an Event if implementation version is >= 1.2, nil otherwise



1292
1293
1294
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1292

def enqueue_barrier( events )
  return OpenCL.enqueue_barrier( self, events )
end

#enqueue_copy_buffer(src_buffer, dst_buffer, options = {}) ⇒ Object

Enqueues a command to copy data from a Buffer object into another Buffer object using the CommandQueue

Attributes

  • src_buffer - the Buffer to be read from

  • dst_buffer - the Buffer to be written to

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :src_offset - if provided indicates the offset inside the src Buffer of the area to copy, else 0

  • :dst_offset - if provided indicates the offset inside the dst Buffer of the area to write to, else 0

  • :size - if provided indicates the size of data to copy, else the maximum possible is copied

Returns

the Event associated with the command



1253
1254
1255
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1253

def enqueue_copy_buffer( src_buffer, dst_buffer, options = {} )
  return OpenCL.enqueue_copy_buffer( self, src_buffer, dst_buffer, options )
end

#enqueue_copy_buffer_rect(src_buffer, dst_buffer, region, options = {}) ⇒ Object

Enqueues a command to copy a rectangular region into a Buffer object from another Buffer object using the CommandQueue

Attributes

  • src_buffer - the Buffer to be read from

  • dst_buffer - the Buffer to be written to

  • region - the region to write in the Buffer

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :src_origin - if provided indicates the origin inside the src Buffer of the area to copy, else [0, 0, 0]

  • :dst_origin - if provided indicates the origin inside the dst Buffer of the area to write to, else [0, 0, 0]

  • :src_row_pitch - if provided indicates the row pitch inside the src Buffer, else 0

  • :src_slice_pitch - if provided indicates the slice pitch inside the src Buffer, else 0

  • :dst_row_pitch - if provided indicates the row pitch inside the dst Buffer, else 0

  • :dst_slice_pitch - if provided indicates the slice pitch inside the dst Buffer area, else 0

Returns

the Event associated with the command



1279
1280
1281
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1279

def enqueue_copy_buffer_rect( src_buffer, dst_buffer, region, options = {} )
  return OpenCL.enqueue_copy_buffer_rect( self, src_buffer, dst_buffer, region, options )
end

#enqueue_copy_buffer_to_image(src_buffer, dst_image, options = {}) ⇒ Object

Enqueues a command to copy a Buffer into an Image using the CommandQueue

Attributes

  • src_buffer - the Buffer to be read from

  • dst_image - the Image to be written to

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :dst_origin - if provided indicates the origin of the region to write into the Image, else [0, 0, 0]

  • :region - if provided indicates the dimension of the region to copy, else the maximum region is copied

  • :src_offset - if provided indicates the offset inside the Buffer, else 0

Returns

the Event associated with the command



1412
1413
1414
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1412

def enqueue_copy_buffer_to_image( src_buffer, dst_image, options = {} )
  return OpenCL.enqueue_copy_buffer_to_image( self, src_buffer, dst_image, options )
end

#enqueue_copy_image(src_image, dst_image, options = {}) ⇒ Object

Enqueues a command to copy from an Image into an Image using the CommandQueue

Attributes

  • src_image - the Image to be written to

  • dst_image - the Image to be written to

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :src_origin - if provided indicates the origin of the region to read into the src Image, else [0, 0, 0]

  • :dst_origin - if provided indicates the origin of the region to write into the dst Image, else [0, 0, 0]

  • :region - if provided indicates the dimension of the region to copy, else the maximum region is copied

Returns

the Event associated with the command



1390
1391
1392
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1390

def enqueue_copy_image( src_image, dst_image, options = {} )
  return OpenCL.enqueue_copy_image( self, src_image, dst_image, options )
end

#enqueue_copy_image_to_buffer(src_image, dst_buffer, options = {}) ⇒ Object

Enqueues a command to copy an Image into a Buffer using the CommandQueue

Attributes

  • src_image - the Image to be read from

  • dst_buffer - the Buffer to be written to

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :src_origin - if provided indicates the origin of the region to copy from the Image, else [0, 0, 0]

  • :region - if provided indicates the dimension of the region to copy, else the maximum region is copied

  • :dst_offset - if provided indicates the offset inside the Buffer, else 0

Returns

the Event associated with the command



1434
1435
1436
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1434

def enqueue_copy_image_to_buffer( src_image, dst_buffer, options = {} )
  return OpenCL.enqueue_copy_image_to_buffer( self, src_image, dst_buffer, options )
end

#enqueue_fill_buffer(buffer, pattern, options = {}) ⇒ Object

Enqueues a command to fill a Buffer with the given pattern using the CommandQueue

Attributes

  • buffer - a Buffer object to be filled

  • pattern - the Pointer (or convertible to Pointer using to_ptr) to the memory area where the pattern is stored

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :offset - if provided indicates the offset inside the Buffer of the area to be filled, else 0

  • :size - if provided indicates the size of data to fill, else the maximum size is filled

  • :pattern_size - if provided indicates the size of the pattern, else the maximum pattern data is used

Returns

the Event associated with the command



1477
1478
1479
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1477

def enqueue_fill_buffer( buffer, pattern, options = {} )
  return OpenCL.enqueue_fill_buffer( self, buffer, pattern, options )
end

#enqueue_fill_image(image, fill_color, options = {}) ⇒ Object

Enqueues a command to fill an Image with the given color using the CommandQueue

Attributes

  • image - an Image object to be filled

  • fill_color - the Pointer (or convertible to Pointer using to_ptr) to the memory area where the color is stored

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :origin - if provided indicates the origin of the region to fill inside the Image, else [0, 0, 0]

  • :region - if provided indicates the dimension of the region to fill, else the maximum region is filled

Returns

the Event associated with the command



1455
1456
1457
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1455

def enqueue_fill_image( image, fill_color, options = {} )
  return OpenCL.enqueue_fill_image( self, image, fill_color, options )
end

#enqueue_map_buffer(buffer, map_flags, options = {}) ⇒ Object

Enqueues a command to map a Buffer into host memory using the CommandQueue

Attributes

  • buffer - the Buffer object to map

  • map_flags - a single or an Array of :cl_map_flags flags

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :blocking_map - if provided indicates if the command blocks until the region is mapped

  • :blocking - if provided indicates if the command blocks until the region is mapped

  • :offset - if provided the offset inside the Buffer region to map, else 0

  • :size - if provided the size of the region in the Buffer to map, else the largest possible size is used

Returns

an Array composed of [event, pointer] where:

  • event - the Event associated with the command

  • pointer - a Pointer to the mapped memory region



1538
1539
1540
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1538

def enqueue_map_buffer( buffer, map_flags, options = {} )
  return OpenCL.enqueue_map_buffer( self, buffer, map_flags, options )
end

#enqueue_map_image(image, map_flags, options = {}) ⇒ Object

Enqueues a command to map an Image into host memory using the CommandQueue

Attributes

  • image - the Image object to map

  • map_flags - a single or an Array of :cl_map_flags flags

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :blocking_map - if provided indicates if the command blocks until the region is mapped

  • :blocking - if provided indicates if the command blocks until the region is mapped

  • :origin - if provided the origin in the Image of the region to map, else [0, 0, 0]

  • :region - if provided the region in the image to map, else the largest possible area is used

Returns

an Array composed of [event, pointer, image_row_pitch, image_slice_pitch] where:

  • event - the Event associated with the command

  • pointer - a Pointer to the mapped memory region

  • image_row_pitch - the row pitch of the mapped region

  • image_slice_pitch - the slice pitch of the mapped region



1565
1566
1567
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1565

def enqueue_map_image( image, map_flags, options = {} )
  return OpenCL.enqueue_map_image( self, image, map_flags, options )
end

#enqueue_marker(events = []) ⇒ Object

Enqueues a marker using the CommandQueue

Attributes

  • events - an optional single or Array of Event to wait upon before the marker is considered finished, if not provided all previous command are waited for before the marker is considered finished (unavailable if implementation version < 1.2 )

Returns

an Event



1305
1306
1307
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1305

def enqueue_marker( events = [] )
  return OpenCL.enqueue_marker( self, events )
end

#enqueue_migrate_mem_objects(mem_objects, options = {}) ⇒ Object

Enqueues a command to indicate which device a set of memory objects should be migrated to using the CommandQueue

Attributes

  • mem_objects - the Mem objects to migrate

  • options - a hash containing named options

Options

  • :flags - a single or an Array of :cl_mem_migration flags

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

Returns

the Event associated with the command



1603
1604
1605
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1603

def enqueue_migrate_mem_objects( mem_objects, options = {} )
  return OpenCL.enqueue_migrate_mem_objects( self, mem_objects, options )
end

#enqueue_native_kernel(options = {}, &func) ⇒ Object

Enqueues a native kernel in the CommandQueue

Attributes

  • options - a hash containing named options

  • func - a Proc object to execute

Options

  • :args - if provided, a list of arguments to pass to the kernel. Arguments should have a size method and be convertible to Pointer with to_ptr

  • :mem_list - if provided, a hash containing Buffer objects and their index inside the argument list.

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

Returns

the Event associated with the command



1090
1091
1092
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1090

def enqueue_native_kernel( options = {}, &func )
  return OpenCL.enqueue_native_kernel( self, options, &func )
end

#enqueue_NDrange_kernel(kernel, global_work_size, options = {}) ⇒ Object

Enqueues a kernel as a NDrange using the CommandQueue

Attributes

  • kernel - a Kernel object to execute

  • global_work_size - dimensions of the work

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :local_work_size - if provided, dimensions of the local work group size

  • :global_work_offset - if provided, offset inside the global work size

Returns

the Event associated with the command



1129
1130
1131
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1129

def enqueue_NDrange_kernel( kernel, global_work_size, options = {} )
  return OpenCL.enqueue_NDrange_kernel( self, kernel, global_work_size, options )
end

#enqueue_read_buffer(buffer, ptr, options = {}) ⇒ Object

Enqueues a command to read from a Buffer object to host memory using the CommandQueue

Attributes

  • buffer - the Buffer to be read from

  • ptr - the Pointer (or convertible to Pointer using to_ptr) to the memory area to use

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :blocking_read - if provided indicates if the command blocks until the region is read

  • :blocking - if provided indicates if the command blocks until the region is read

  • :offset - if provided indicates the offset inside the Buffer of the area to read from, else 0

  • :size - if provided indicates the size of data to copy, else the maximum data is copied

Returns

the Event associated with the command



1203
1204
1205
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1203

def enqueue_read_buffer( buffer, ptr, options = {} )
  return OpenCL.enqueue_read_buffer( self, buffer, ptr, options)
end

#enqueue_read_buffer_rect(buffer, ptr, region, options = {}) ⇒ Object

Enqueues a command to read from a rectangular region from a Buffer object to host memory using the CommandQueue

Attributes

  • buffer - the Buffer to be read from

  • ptr - the Pointer (or convertible to Pointer using to_ptr) to the memory area to use

  • region - the region in the Buffer to copy

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :blocking_read - if provided indicates if the command blocks until the region is read

  • :blocking - if provided indicates if the command blocks until the region is read

  • :buffer_origin - if provided indicates the origin inside the buffer of the area to copy, else [0, 0, 0]

  • :host_origin - if provided indicates the origin inside the target host area, else [0, 0, 0]

  • :buffer_row_pitch - if provided indicates the row pitch inside the buffer, else 0

  • :buffer_slice_pitch - if provided indicates the slice pitch inside the buffer, else 0

  • :host_row_pitch - if provided indicates the row pitch inside the host area, else 0

  • :host_slice_pitch - if provided indicates the slice pitch inside the host area, else 0

Returns

the Event associated with the command



1231
1232
1233
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1231

def enqueue_read_buffer_rect( buffer, ptr, region, options = {} )
  return OpenCL.enqueue_read_buffer_rect( self, buffer, ptr, region, options )
end

#enqueue_read_image(image, ptr, options = {}) ⇒ Object

Enqueues a command to copy from an Image into host memory using the CommandQueue

Attributes

  • image - the Image to be written to

  • ptr - the Pointer (or convertible to Pointer using to_ptr) to the memory area to use

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :blocking_read - if provided indicates if the command blocks until the region is read.

  • :blocking - if provided indicates if the command blocks until the region is read

  • :origin - if provided indicates the origin of the region to read from the Image, else [0, 0, 0]

  • :region - if provided indicates the dimension of the region to copy, else the maximum region is copied

  • :row_pitch - if provided indicates the row pitch inside the host area, else 0

  • :slice_pitch - if provided indicates the slice pitch inside the host area, else 0

Returns

the Event associated with the command



1368
1369
1370
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1368

def enqueue_read_image( image, ptr, options = {} )
  return OpenCL.enqueue_read_image( self, image, ptr, options )
end

#enqueue_release_GL_object(mem_objects, options = {}) ⇒ Object

Release OpenCL Mem objects that have been created from OpenGL objects and previously acquired using the CommandQueue

Attributes

  • mem_objects - a single or an Array of Mem objects

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

Returns

the Event associated with the command



1513
1514
1515
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1513

def enqueue_release_GL_object( mem_objects, options = {} )
  return OpenCL.enqueue_release_GL_object( self, mem_objects, options )
end

#enqueue_svm_fill(command_queue, svm_ptr, pattern, size, options = {}) ⇒ Object

Enqueues a command to fill a an SVM memory area using the CommandQueue

Attributes

  • svm_ptr - the SVMPointer to the area to fill

  • pattern - the Pointer (or convertible to Pointer using to_ptr) to the memory area where the pattern is stored

  • size - the size of the area to fill

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :pattern_size - if provided indicates the size of the pattern, else the maximum pattern data is used

Returns

the Event associated with the command



1695
1696
1697
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1695

def enqueue_svm_fill(command_queue, svm_ptr, pattern, size, options = {})
  return OpenCL.enqueue_svm_fill(self, svm_ptr, pattern, size, options)
end

#enqueue_svm_free(svm_pointers, options = {}, &block) ⇒ Object

Enqueues a command that frees SVMPointers (or Pointers using a callback) using the CommandQueue

Attributes

  • svm_pointer - a single or an Array of SVMPointer (or Pointer)

  • options - a hash containing named options

  • block - if provided, a callback invoked to free the pointers. Signature of the callback is { |CommandQueue, num_pointers, FFI::Pointer to an array of num_pointers Pointers, FFI::Pointer to user_data| … }

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :user_data - if provided, a Pointer (or convertible to using to_ptr) that will be passed to the callback

Returns

the Event associated with the command



1675
1676
1677
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1675

def enqueue_svm_free(svm_pointers, options = {}, &block)
  return OpenCL.enqueue_svm_free(self, svm_pointers, options, &block)
end

#enqueue_svm_map(svm_ptr, size, map_flags, options = {}) ⇒ Object

Enqueues a command to map an Image into host memory using the CommandQueue

Attributes

  • svm_ptr - the SVMPointer to the area to map

  • size - the size of the region to map

  • map_flags - a single or an Array of :cl_map_flags flags

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :blocking_map - if provided indicates if the command blocks until the region is mapped

  • :blocking - if provided indicates if the command blocks until the region is mapped

Returns

the Event associated with the command



1717
1718
1719
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1717

def enqueue_svm_map( svm_ptr, size, map_flags, options = {} )
  return OpenCL.enqueue_svm_map( self, svm_ptr, size, map_flags, options )
end

#enqueue_svm_memcpy(dst_ptr, src_ptr, size, options = {}) ⇒ Object

Enqueues a command to copy from or to an SVMPointer using the CommandQueue

Attributes

  • dst_ptr - the Pointer (or convertible to Pointer using to_ptr) or SVMPointer to be written to

  • src_ptr - the Pointer (or convertible to Pointer using to_ptr) or SVMPointer to be read from

  • size - the size of data to copy

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :blocking_copy - if provided indicates if the command blocks until the copy finishes

  • :blocking - if provided indicates if the command blocks until the copy finishes

Returns

the Event associated with the command



1655
1656
1657
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1655

def enqueue_svm_memcpy( dst_ptr, src_ptr, size, options = {})
  return OpenCL.enqueue_svm_memcpy(self, dst_ptr, src_ptr, size, options)
end

#enqueue_svm_unmap(svm_ptr, options = {}) ⇒ Object

Enqueues a command to unmap a previously mapped SVM memory area using the CommandQueue

Attributes

  • svm_ptr - the SVMPointer of the area to be unmapped

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

Returns

the Event associated with the command



1735
1736
1737
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1735

def enqueue_svm_unmap( svm_ptr, options = {} )
  return OpenCL.enqueue_svm_unmap( self, svm_ptr, options )
end

#enqueue_task(kernel, options = {}) ⇒ Object

Enqueues a kernel as a task using the CommandQueue

Attributes

  • kernel - a Kernel object to execute

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

Returns

the Event associated with the command



1108
1109
1110
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1108

def enqueue_task( kernel, options = {} )
  return OpenCL.enqueue_task( self, kernel, options )
end

#enqueue_unmap_mem_object(command_queue, mem_obj, mapped_ptr, options = {}) ⇒ Object

Enqueues a command to unmap a previously mapped region of a memory object using the CommandQueue

Attributes

  • mem_obj - the Mem object that was previously mapped

  • mapped_ptr - the Pointer previously returned by a map command

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

Returns

the Event associated with the command



1584
1585
1586
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1584

def enqueue_unmap_mem_object( command_queue, mem_obj, mapped_ptr, options = {} )
  return OpenCL.enqueue_unmap_mem_object( self, mem_obj, mapped_ptr, options )
end

#enqueue_wait_for_events(events = []) ⇒ Object

Enqueues a barrier on a list of envents using the CommandQueue

Attributes

  • events - a single or an Array of Event to wait upon before the barrier is considered finished

Returns

an Event if implementation version is >= 1.2, nil otherwise



1318
1319
1320
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1318

def enqueue_wait_for_events( events = [] )
  return OpenCL.enqueue_wait_for_events( self, events )
end

#enqueue_write_buffer(buffer, ptr, options = {}) ⇒ Object

Enqueues a command to write to a Buffer object from host memory using the CommandQueue

Attributes

  • buffer - the Buffer to be written to

  • ptr - the Pointer (or convertible to Pointer using to_ptr) to the memory area to use

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :blocking_write - if provided indicates if the command blocks until the region is written.

  • :blocking - if provided indicates if the command blocks until the region is written

  • :offset - if provided indicates the offset inside the Buffer of the area to read from, else 0

  • :size - if provided indicates the size of data to copy, else the maximum data is copied

Returns

the Event associated with the command



1152
1153
1154
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1152

def enqueue_write_buffer( buffer, ptr, options = {} )
  return OpenCL.enqueue_write_buffer( self, buffer, ptr, options )
end

#enqueue_write_buffer_rect(buffer, ptr, region, options = {}) ⇒ Object

Enqueues a command to write to a rectangular region in a Buffer object from host memory using the CommandQueue

Attributes

  • buffer - the Buffer to be written to

  • ptr - the Pointer (or convertible to Pointer using to_ptr) to the memory area to use

  • region - the region to write in the Buffer

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :blocking_write - if provided indicates if the command blocks until the region is written

  • :blocking - if provided indicates if the command blocks until the region is written

  • :buffer_origin - if provided indicates the origin inside the buffer of the area to copy, else [0, 0, 0]

  • :host_origin - if provided indicates the origin inside the target host area, else [0, 0, 0]

  • :buffer_row_pitch - if provided indicates the row pitch inside the buffer, else 0

  • :buffer_slice_pitch - if provided indicates the slice pitch inside the buffer, else 0

  • :host_row_pitch - if provided indicates the row pitch inside the host area, else 0

  • :host_slice_pitch - if provided indicates the slice pitch inside the host area, else 0

Returns

the Event associated with the command



1180
1181
1182
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1180

def enqueue_write_buffer_rect( buffer, ptr, region, options = {} )
  return OpenCL.enqueue_write_buffer_rect( self, buffer, ptr, region, options )
end

#enqueue_write_image(image, ptr, options = {}) ⇒ Object

Enqueues a command to copy from host memory into an Image using the CommandQueue

Attributes

  • image - the Image to be written to

  • ptr - the Pointer (or convertible to Pointer using to_ptr) to the memory area to use

  • options - a hash containing named options

Options

  • :event_wait_list - if provided, a list of Event to wait upon before executing the command

  • :blocking_write - if provided indicates if the command blocks until the region is written.

  • :blocking - if provided indicates if the command blocks until the region is written

  • :origin - if provided indicates the origin of the region to write into the Image, else [0, 0, 0]

  • :region - if provided indicates the dimension of the region to copy, else the maximum region is copied

  • :input_row_pitch - if provided indicates the row pitch inside the host area, else 0

  • :input_slice_pitch - if provided indicates the slice pitch inside the host area, else 0

Returns

the Event associated with the command



1343
1344
1345
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1343

def enqueue_write_image( image, ptr, options = {} )
  return OpenCL.enqueue_write_image( self, image, ptr, options )
end

#finishObject

Blocks until all the commands in the CommandQueue have completed



1628
1629
1630
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1628

def finish
  return OpenCL.finish(self)
end

#flushObject

Issues all the commands in a CommandQueue to the Device



1633
1634
1635
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1633

def flush
  return OpenCL.flush( self )
end

#get_infoObject

:method: properties Returns the :cl_command_queue_properties used to create the CommandQueue



1063
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1063

eval OpenCL.get_info("CommandQueue", :cl_uint, "REFERENCE_COUNT")

#to_sObject



1147
1148
1149
1150
1151
1152
1153
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 1147

def to_s
  if self.respond_to?(:name) then
    return self.name
  else
    return super
  end
end