Expand description
Abstract data type wrappers.
Reference
The following table describes abstract data types supported by OpenCL (from SDK):
- cl_platform_id: The ID for a platform.
- cl_device_id: The ID for a device.
- cl_context: A context.
- cl_command_queue: A command queue.
- cl_mem: A memory object.
- cl_program: A program.
- cl_kernel: A kernel.
- cl_event: An event.
- cl_sampler: A sampler.
The following new derived wrappers are also included in this module:
- cl_events: A list of events.
Who cares. Why bother?
These types ensure as best they can that stored pointers to any of the above objects will be valid until that pointer is dropped by the Rust runtime (which obviously is not a 100% guarantee).
What this means is that you can share, clone, store, and throw away these types, and any types that contain them, among multiple threads, for as long as you’d like, with an insignificant amount of overhead, without having to worry about the dangers of dereferencing those types later on. As good as the OpenCL library generally is about this, it fails in many cases to provide complete protection against segfaults due to dereferencing old pointers particularly on certain ahem platforms.
Structs
EventList
to send event pointers to core functions
cheaply.Traits
AsRef
with a type being carried along for convenience.::enqueue_...
functions as the
primary (ptr
) argument and can also be passed as kernel cl_mem
arguments.ptr
) argument value to
::enqueue_read_buffer
, ::enqueue_write_buffer
,
::enqueue_read_buffer_rect
, ::enqueue_write_buffer_rect
,
::enqueue_read_image
, or ::enqueue_write_image
.