Struct opencl3::command_queue::CommandQueue
source · pub struct CommandQueue { /* private fields */ }
Expand description
An OpenCL command-queue.
Operations on OpenCL memory and kernel objects are performed using a
command-queue.
Implementations§
source§impl CommandQueue
impl CommandQueue
sourcepub fn get(&self) -> cl_command_queue
pub fn get(&self) -> cl_command_queue
Get the underlying OpenCL cl_command_queue.
sourcepub fn max_work_item_dimensions(&self) -> cl_uint
pub fn max_work_item_dimensions(&self) -> cl_uint
Get the max_work_item_dimensions for the device that the underlying OpenCL device.
sourcepub unsafe fn create(
context: &Context,
device_id: cl_device_id,
properties: cl_command_queue_properties
) -> Result<CommandQueue>
👎Deprecated since 0.1.0: From CL_VERSION_2_0 use create_command_queue_with_properties
pub unsafe fn create( context: &Context, device_id: cl_device_id, properties: cl_command_queue_properties ) -> Result<CommandQueue>
Create an OpenCL command-queue on a specific device.
Queries the device the max_work_item_dimensions.
Deprecated in CL_VERSION_2_0 by create_command_queue_with_properties.
context
- a valid OpenCL context.device_id
- a device or sub-device associated with context.properties
- a list of properties for the command-queue, see cl_command_queue_properties.
returns a Result containing the new CommandQueue or the error code from the OpenCL C API function.
Safety
This is unsafe when a device is not a member of context.
sourcepub fn create_default(
context: &Context,
properties: cl_command_queue_properties
) -> Result<CommandQueue>
👎Deprecated since 0.1.0: From CL_VERSION_2_0 use create_command_queue_with_properties
pub fn create_default( context: &Context, properties: cl_command_queue_properties ) -> Result<CommandQueue>
Create an OpenCL command-queue on the context default device.
Queries the device the max_work_item_dimensions.
Deprecated in CL_VERSION_2_0 by create_command_queue_with_properties.
context
- a valid OpenCL context.properties
- a list of properties for the command-queue, see cl_command_queue_properties.
returns a Result containing the new CommandQueue or the error code from the OpenCL C API function.
sourcepub unsafe fn create_with_properties(
context: &Context,
device_id: cl_device_id,
properties: cl_command_queue_properties,
queue_size: cl_uint
) -> Result<CommandQueue>
pub unsafe fn create_with_properties( context: &Context, device_id: cl_device_id, properties: cl_command_queue_properties, queue_size: cl_uint ) -> Result<CommandQueue>
Create an OpenCL command-queue on a specific device.
Queries the device the max_work_item_dimensions.
CL_VERSION_2_0 onwards.
context
- a valid OpenCL context.device_id
- a device or sub-device associated with context.properties
- a null terminated list of properties for the command-queue, see cl_queue_properties.
returns a Result containing the new CommandQueue or the error code from the OpenCL C API function.
Safety
This is unsafe when a device is not a member of context.
sourcepub fn create_default_with_properties(
context: &Context,
properties: cl_command_queue_properties,
queue_size: cl_uint
) -> Result<CommandQueue>
pub fn create_default_with_properties( context: &Context, properties: cl_command_queue_properties, queue_size: cl_uint ) -> Result<CommandQueue>
Create an OpenCL command-queue on the default device.
Queries the device the max_work_item_dimensions.
CL_VERSION_2_0 onwards.
context
- a valid OpenCL context.properties
- a null terminated list of properties for the command-queue, see cl_queue_properties.
returns a Result containing the new CommandQueue or the error code from the OpenCL C API function.
sourcepub fn flush(&self) -> Result<()>
pub fn flush(&self) -> Result<()>
Flush commands to a device.
returns an empty Result or the error code from the OpenCL C API function.
sourcepub fn finish(&self) -> Result<()>
pub fn finish(&self) -> Result<()>
Wait for completion of commands on a device.
returns an empty Result or the error code from the OpenCL C API function.
pub unsafe fn enqueue_read_buffer<T>( &self, buffer: &Buffer<T>, blocking_read: cl_bool, offset: size_t, data: &mut [T], event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_read_buffer_rect<T>( &self, buffer: &Buffer<T>, blocking_read: cl_bool, buffer_origin: *const size_t, host_origin: *const size_t, region: *const size_t, buffer_row_pitch: size_t, buffer_slice_pitch: size_t, host_row_pitch: size_t, host_slice_pitch: size_t, ptr: *mut c_void, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_write_buffer<T>( &self, buffer: &mut Buffer<T>, blocking_write: cl_bool, offset: size_t, data: &[T], event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_write_buffer_rect<T>( &self, buffer: &mut Buffer<T>, blocking_write: cl_bool, buffer_origin: *const size_t, host_origin: *const size_t, region: *const size_t, buffer_row_pitch: size_t, buffer_slice_pitch: size_t, host_row_pitch: size_t, host_slice_pitch: size_t, ptr: *mut c_void, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_fill_buffer<T>( &self, buffer: &mut Buffer<T>, pattern: &[T], offset: size_t, size: size_t, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_copy_buffer<T>( &self, src_buffer: &Buffer<T>, dst_buffer: &mut Buffer<T>, src_offset: size_t, dst_offset: size_t, size: size_t, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_copy_buffer_rect<T>( &self, src_buffer: &Buffer<T>, dst_buffer: &mut Buffer<T>, src_origin: *const size_t, dst_origin: *const size_t, region: *const size_t, src_row_pitch: size_t, src_slice_pitch: size_t, dst_row_pitch: size_t, dst_slice_pitch: size_t, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_read_image( &self, image: &Image, blocking_read: cl_bool, origin: *const size_t, region: *const size_t, row_pitch: size_t, slice_pitch: size_t, ptr: *mut c_void, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_write_image( &self, image: &mut Image, blocking_write: cl_bool, origin: *const size_t, region: *const size_t, row_pitch: size_t, slice_pitch: size_t, ptr: *mut c_void, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_fill_image( &self, image: &mut Image, fill_color: *const c_void, origin: *const size_t, region: *const size_t, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_copy_image( &self, src_image: &Image, dst_image: &mut Image, src_origin: *const size_t, dst_origin: *const size_t, region: *const size_t, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_copy_image_to_buffer<T>( &self, src_image: &Image, dst_buffer: &mut Buffer<T>, src_origin: *const size_t, region: *const size_t, dst_offset: size_t, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_copy_buffer_to_image<T>( &self, src_buffer: &Buffer<T>, dst_image: &mut Image, src_offset: size_t, dst_origin: *const size_t, region: *const size_t, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_map_buffer<T>( &self, buffer: &Buffer<T>, blocking_map: cl_bool, map_flags: cl_map_flags, offset: size_t, size: size_t, buffer_ptr: &mut cl_mem, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_map_image( &self, image: &Image, blocking_map: cl_bool, map_flags: cl_map_flags, origin: *const size_t, region: *const size_t, image_row_pitch: *mut size_t, image_slice_pitch: *mut size_t, image_ptr: &mut cl_mem, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_unmap_mem_object( &self, memobj: cl_mem, mapped_ptr: *mut c_void, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_migrate_mem_object( &self, num_mem_objects: cl_uint, mem_objects: *const cl_mem, flags: cl_mem_migration_flags, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_nd_range_kernel( &self, kernel: cl_kernel, work_dim: cl_uint, global_work_offsets: *const size_t, global_work_sizes: *const size_t, local_work_sizes: *const size_t, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_task( &self, kernel: cl_kernel, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_native_kernel( &self, user_func: Option<unsafe extern "C" fn(_: *mut c_void)>, args: &[*mut c_void], mem_list: &[cl_mem], args_mem_loc: &[*const c_void], event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_marker_with_wait_list( &self, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_barrier_with_wait_list( &self, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_svm_free( &self, svm_pointers: &[*const c_void], pfn_free_func: Option<unsafe extern "C" fn(queue: cl_command_queue, num_svm_pointers: cl_uint, svm_pointers: *mut *mut c_void, user_data: *mut c_void)>, user_data: *mut c_void, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_svm_mem_cpy( &self, blocking_copy: cl_bool, dst_ptr: *mut c_void, src_ptr: *const c_void, size: size_t, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_svm_mem_fill<T>( &self, svm_ptr: *mut c_void, pattern: &[T], size: size_t, event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_svm_map<T>( &self, blocking_map: cl_bool, flags: cl_map_flags, svm: &mut [T], event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_svm_unmap<T>( &self, svm: &[T], event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_acquire_gl_objects( &self, mem_objects: &[*const c_void], event_wait_list: &[cl_event] ) -> Result<Event>
pub unsafe fn enqueue_release_gl_objects( &self, mem_objects: &[*const c_void], event_wait_list: &[cl_event] ) -> Result<Event>
pub fn context(&self) -> Result<cl_context>
pub fn device(&self) -> Result<cl_device_id>
pub fn reference_count(&self) -> Result<cl_uint>
pub fn properties(&self) -> Result<cl_ulong>
sourcepub fn device_default(&self) -> Result<cl_device_id>
pub fn device_default(&self) -> Result<cl_device_id>
CL_VERSION_2_1
sourcepub fn properties_array(&self) -> Result<Vec<cl_ulong>>
pub fn properties_array(&self) -> Result<Vec<cl_ulong>>
CL_VERSION_3_0