Module ocl_core::types::abs
[−]
[src]
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
CommandQueue |
cl_command_queue |
Context |
cl_context |
DeviceId |
cl_device_id |
Event |
cl_event |
EventList |
List of |
EventRefWrapper |
Wrapper used by |
Kernel |
cl_kernel |
Mem |
cl_mem |
PlatformId |
cl_platform_id |
Program |
cl_program |
Sampler |
cl_sampler |
Traits
ClDeviceIdPtr |
Types with a reference to a raw device_id pointer. |
ClEventPtrNew |
Types with a mutable pointer to a new, null raw event pointer. |
ClEventRef |
Types with a reference to a raw event pointer. |
ClPlatformIdPtr |
Types with a reference to a raw platform_id pointer. |
ClVersions |
Types with a fixed set of associated devices and an associated platform. |
ClWaitList |
Types with a reference to a raw event array and an associated element count. |