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

source

pub fn get(&self) -> cl_command_queue

Get the underlying OpenCL cl_command_queue.

source

pub fn max_work_item_dimensions(&self) -> cl_uint

Get the max_work_item_dimensions for the device that the underlying OpenCL device.

source

pub 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

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.

source

pub 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

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.

returns a Result containing the new CommandQueue or the error code from the OpenCL C API function.

source

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.

source

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.

source

pub fn flush(&self) -> Result<()>

Flush commands to a device.
returns an empty Result or the error code from the OpenCL C API function.

source

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.

source

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>

source

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>

source

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>

source

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>

source

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>

source

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>

source

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>

source

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>

source

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>

source

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>

source

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>

source

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>

source

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>

source

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>

source

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>

source

pub unsafe fn enqueue_unmap_mem_object( &self, memobj: cl_mem, mapped_ptr: *mut c_void, event_wait_list: &[cl_event] ) -> Result<Event>

source

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>

source

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>

source

pub unsafe fn enqueue_task( &self, kernel: cl_kernel, event_wait_list: &[cl_event] ) -> Result<Event>

👎Deprecated since 0.1.0: From CL_VERSION_2_0 use enqueue_nd_range_kernel
source

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>

source

pub unsafe fn enqueue_marker_with_wait_list( &self, event_wait_list: &[cl_event] ) -> Result<Event>

source

pub unsafe fn enqueue_barrier_with_wait_list( &self, event_wait_list: &[cl_event] ) -> Result<Event>

source

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>

source

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>

source

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>

source

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>

source

pub unsafe fn enqueue_svm_unmap<T>( &self, svm: &[T], event_wait_list: &[cl_event] ) -> Result<Event>

source

pub unsafe fn enqueue_acquire_gl_objects( &self, mem_objects: &[*const c_void], event_wait_list: &[cl_event] ) -> Result<Event>

source

pub unsafe fn enqueue_release_gl_objects( &self, mem_objects: &[*const c_void], event_wait_list: &[cl_event] ) -> Result<Event>

source

pub fn context(&self) -> Result<cl_context>

source

pub fn device(&self) -> Result<cl_device_id>

source

pub fn reference_count(&self) -> Result<cl_uint>

source

pub fn properties(&self) -> Result<cl_ulong>

source

pub fn size(&self) -> Result<cl_uint>

CL_VERSION_2_0

source

pub fn device_default(&self) -> Result<cl_device_id>

CL_VERSION_2_1

source

pub fn properties_array(&self) -> Result<Vec<cl_ulong>>

CL_VERSION_3_0

source

pub fn get_data(&self, param_name: cl_command_queue_info) -> Result<Vec<u8>>

Get data about an OpenCL command-queue. Calls clGetCommandQueueInfo to get the desired data about the command-queue.

Trait Implementations§

source§

impl Debug for CommandQueue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for CommandQueue

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<CommandQueue> for cl_command_queue

source§

fn from(value: CommandQueue) -> Self

Converts to this type from the input type.
source§

impl Send for CommandQueue

source§

impl Sync for CommandQueue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.