Class: OpenCL::CommandQueue
- Inherits:
-
FFI::ManagedStruct
- Object
- FFI::ManagedStruct
- OpenCL::CommandQueue
- 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
-
.release(ptr) ⇒ Object
method called at CommandQueue deletion, releases the object if aplicable.
Instance Method Summary collapse
-
#context ⇒ Object
Returns the Context associated to the CommandQueue.
-
#device ⇒ Object
Returns the Device associated to the CommandQueue.
-
#enqueue_acquire_GL_object(mem_objects, options = {}) ⇒ Object
Acquire OpenCL Mem objects that have been created from OpenGL objects using the CommandQueue.
-
#enqueue_barrier(events) ⇒ Object
Enqueues a barrier on a list of envents using the CommandQueue.
-
#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.
-
#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.
-
#enqueue_copy_buffer_to_image(src_buffer, dst_image, options = {}) ⇒ Object
Enqueues a command to copy a Buffer into an Image using the CommandQueue.
-
#enqueue_copy_image(src_image, dst_image, options = {}) ⇒ Object
Enqueues a command to copy from an Image into an Image using the CommandQueue.
-
#enqueue_copy_image_to_buffer(src_image, dst_buffer, options = {}) ⇒ Object
Enqueues a command to copy an Image into a Buffer using the CommandQueue.
-
#enqueue_fill_buffer(buffer, pattern, options = {}) ⇒ Object
Enqueues a command to fill a Buffer with the given pattern using the CommandQueue.
-
#enqueue_fill_image(image, fill_color, options = {}) ⇒ Object
Enqueues a command to fill an Image with the given color using the CommandQueue.
-
#enqueue_map_buffer(buffer, map_flags, options = {}) ⇒ Object
Enqueues a command to map a Buffer into host memory using the CommandQueue.
-
#enqueue_map_image(image, map_flags, options = {}) ⇒ Object
Enqueues a command to map an Image into host memory using the CommandQueue.
-
#enqueue_marker(events = []) ⇒ Object
Enqueues a marker using the CommandQueue.
-
#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.
-
#enqueue_native_kernel(options = {}, &func) ⇒ Object
Enqueues a native kernel in the CommandQueue.
-
#enqueue_NDrange_kernel(kernel, global_work_size, options = {}) ⇒ Object
Enqueues a kernel as a NDrange using the CommandQueue.
-
#enqueue_read_buffer(buffer, ptr, options = {}) ⇒ Object
Enqueues a command to read from a Buffer object to host memory using the CommandQueue.
-
#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.
-
#enqueue_read_image(image, ptr, options = {}) ⇒ Object
Enqueues a command to copy from an Image into host memory using the CommandQueue.
-
#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.
-
#enqueue_svm_fill(command_queue, svm_ptr, pattern, size, options = {}) ⇒ Object
Enqueues a command to fill a an SVM memory area using the CommandQueue.
-
#enqueue_svm_free(svm_pointers, options = {}, &block) ⇒ Object
Enqueues a command that frees SVMPointers (or Pointers using a callback) using the CommandQueue.
-
#enqueue_svm_map(svm_ptr, size, map_flags, options = {}) ⇒ Object
Enqueues a command to map an Image into host memory using the CommandQueue.
-
#enqueue_svm_memcpy(dst_ptr, src_ptr, size, options = {}) ⇒ Object
Enqueues a command to copy from or to an SVMPointer using the CommandQueue.
-
#enqueue_svm_unmap(svm_ptr, options = {}) ⇒ Object
Enqueues a command to unmap a previously mapped SVM memory area using the CommandQueue.
-
#enqueue_task(kernel, options = {}) ⇒ Object
Enqueues a kernel as a task using the CommandQueue.
-
#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.
-
#enqueue_wait_for_events(events = []) ⇒ Object
Enqueues a barrier on a list of envents using the CommandQueue.
-
#enqueue_write_buffer(buffer, ptr, options = {}) ⇒ Object
Enqueues a command to write to a Buffer object from host memory using the CommandQueue.
-
#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.
-
#enqueue_write_image(image, ptr, options = {}) ⇒ Object
Enqueues a command to copy from host memory into an Image using the CommandQueue.
-
#finish ⇒ Object
Blocks until all the commands in the CommandQueue have completed.
-
#flush ⇒ Object
Issues all the commands in a CommandQueue to the Device.
-
#get_info ⇒ Object
:method: properties Returns the :cl_command_queue_properties used to create the CommandQueue.
-
#initialize(ptr, retain = true) ⇒ CommandQueue
constructor
Creates a new CommandQueue and retains it if specified and aplicable.
-
#to_s ⇒ Object
:startdoc:.
Constructor Details
#initialize(ptr, retain = true) ⇒ CommandQueue
Creates a new CommandQueue and retains it if specified and aplicable
2820 2821 2822 2823 2824 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 2820 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
2827 2828 2829 2830 2831 2832 2833 2834 2835 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 2827 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}" error_check( error ) end |
Instance Method Details
#context ⇒ Object
Returns the Context associated to the CommandQueue
1050 1051 1052 1053 1054 1055 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1050 def context ptr = FFI::MemoryPointer::new( Context ) error = OpenCL.clGetCommandQueueInfo(self, CONTEXT, Context.size, ptr, nil) error_check(error) return Context::new( ptr.read_pointer ) end |
#device ⇒ Object
Returns the Device associated to the CommandQueue
1058 1059 1060 1061 1062 1063 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1058 def device ptr = FFI::MemoryPointer::new( Device ) error = OpenCL.clGetCommandQueueInfo(self, DEVICE, Device.size, ptr, nil) error_check(error) return 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
1500 1501 1502 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1500 def enqueue_acquire_GL_object( mem_objects, = {} ) return OpenCL.enqueue_acquire_GL_object( self, mem_objects, ) 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
1297 1298 1299 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1297 def ( events ) return OpenCL.( 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
1258 1259 1260 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1258 def enqueue_copy_buffer( src_buffer, dst_buffer, = {} ) return OpenCL.enqueue_copy_buffer( self, src_buffer, dst_buffer, ) 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
1284 1285 1286 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1284 def enqueue_copy_buffer_rect( src_buffer, dst_buffer, region, = {} ) return OpenCL.enqueue_copy_buffer_rect( self, src_buffer, dst_buffer, region, ) 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
1417 1418 1419 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1417 def enqueue_copy_buffer_to_image( src_buffer, dst_image, = {} ) return OpenCL.enqueue_copy_buffer_to_image( self, src_buffer, dst_image, ) 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
1395 1396 1397 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1395 def enqueue_copy_image( src_image, dst_image, = {} ) return OpenCL.enqueue_copy_image( self, src_image, dst_image, ) 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
1439 1440 1441 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1439 def enqueue_copy_image_to_buffer( src_image, dst_buffer, = {} ) return OpenCL.enqueue_copy_image_to_buffer( self, src_image, dst_buffer, ) 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
1482 1483 1484 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1482 def enqueue_fill_buffer( buffer, pattern, = {} ) return OpenCL.enqueue_fill_buffer( self, buffer, pattern, ) 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
1460 1461 1462 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1460 def enqueue_fill_image( image, fill_color, = {} ) return OpenCL.enqueue_fill_image( self, image, fill_color, ) 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
1543 1544 1545 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1543 def enqueue_map_buffer( buffer, map_flags, = {} ) return OpenCL.enqueue_map_buffer( self, buffer, map_flags, ) 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
1570 1571 1572 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1570 def enqueue_map_image( image, map_flags, = {} ) return OpenCL.enqueue_map_image( self, image, map_flags, ) 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
1310 1311 1312 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1310 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
1608 1609 1610 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1608 def enqueue_migrate_mem_objects( mem_objects, = {} ) return OpenCL.enqueue_migrate_mem_objects( self, mem_objects, ) 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
1095 1096 1097 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1095 def enqueue_native_kernel( = {}, &func ) return OpenCL.enqueue_native_kernel( self, , &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
1134 1135 1136 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1134 def enqueue_NDrange_kernel( kernel, global_work_size, = {} ) return OpenCL.enqueue_NDrange_kernel( self, kernel, global_work_size, ) 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
1208 1209 1210 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1208 def enqueue_read_buffer( buffer, ptr, = {} ) return OpenCL.enqueue_read_buffer( self, buffer, ptr, ) 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
1236 1237 1238 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1236 def enqueue_read_buffer_rect( buffer, ptr, region, = {} ) return OpenCL.enqueue_read_buffer_rect( self, buffer, ptr, region, ) 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
1373 1374 1375 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1373 def enqueue_read_image( image, ptr, = {} ) return OpenCL.enqueue_read_image( self, image, ptr, ) 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
1518 1519 1520 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1518 def enqueue_release_GL_object( mem_objects, = {} ) return OpenCL.enqueue_release_GL_object( self, mem_objects, ) 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
1700 1701 1702 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1700 def enqueue_svm_fill(command_queue, svm_ptr, pattern, size, = {}) return OpenCL.enqueue_svm_fill(self, svm_ptr, pattern, size, ) 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
1680 1681 1682 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1680 def enqueue_svm_free(svm_pointers, = {}, &block) return OpenCL.enqueue_svm_free(self, svm_pointers, , &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
1722 1723 1724 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1722 def enqueue_svm_map( svm_ptr, size, map_flags, = {} ) return OpenCL.enqueue_svm_map( self, svm_ptr, size, map_flags, ) 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
1660 1661 1662 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1660 def enqueue_svm_memcpy( dst_ptr, src_ptr, size, = {}) return OpenCL.enqueue_svm_memcpy(self, dst_ptr, src_ptr, size, ) 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
1740 1741 1742 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1740 def enqueue_svm_unmap( svm_ptr, = {} ) return OpenCL.enqueue_svm_unmap( self, svm_ptr, ) 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
1113 1114 1115 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1113 def enqueue_task( kernel, = {} ) return OpenCL.enqueue_task( self, kernel, ) 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
1589 1590 1591 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1589 def enqueue_unmap_mem_object( command_queue, mem_obj, mapped_ptr, = {} ) return OpenCL.enqueue_unmap_mem_object( self, mem_obj, mapped_ptr, ) 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
1323 1324 1325 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1323 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
1157 1158 1159 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1157 def enqueue_write_buffer( buffer, ptr, = {} ) return OpenCL.enqueue_write_buffer( self, buffer, ptr, ) 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
1185 1186 1187 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1185 def enqueue_write_buffer_rect( buffer, ptr, region, = {} ) return OpenCL.enqueue_write_buffer_rect( self, buffer, ptr, region, ) 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
1348 1349 1350 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1348 def enqueue_write_image( image, ptr, = {} ) return OpenCL.enqueue_write_image( self, image, ptr, ) end |
#finish ⇒ Object
Blocks until all the commands in the CommandQueue have completed
1633 1634 1635 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1633 def finish return OpenCL.finish(self) end |
#flush ⇒ Object
Issues all the commands in a CommandQueue to the Device
1638 1639 1640 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1638 def flush return OpenCL.flush( self ) end |
#get_info ⇒ Object
:method: properties Returns the :cl_command_queue_properties used to create the CommandQueue
1068 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1068 eval get_info("CommandQueue", :cl_uint, "REFERENCE_COUNT") |
#to_s ⇒ Object
:startdoc:
2838 2839 2840 2841 2842 2843 2844 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 2838 def to_s if self.respond_to?(:name) then return self.name else return super end end |