# Crate ocl [−] [src]

# | GitHub

Rust implementation of the OpenCL™ API.

Some versions of this documentation are built from development branches and may differ slightly between what is on crates.io and the master branch. See the repo page for links to both versions.

Please report unclear documentation or places where examples would be appreciated by filing an issue.

## Foundations

For lower level interfaces and to use OpenCL features that have not yet been implemented on the `standard` (high-level) interface types, see the `ocl-core` and `cl-sys` crates.

## Help Wanted

Please request or help complete any functionality you may need by filing an issue or creating a pull request.

Keep an eye out for places where examples would be useful and let us know!

## Feedback appreciated

Suggestions and nitpicks are most welcome. Don't hesitate to file an issue just to offer constructive criticism.

“`OpenCL` and the `OpenCL` logo are trademarks of Apple Inc. used by permission by Khronos.”

## Re-exports

`pub extern crate ocl_core as core;`
`pub use error::Error;`
`pub use error::Result;`
`pub use core::ffi;`
`pub use core::util;`
`pub use core::OclPrm;`
`pub use core::OclScl;`
`pub use core::OclVec;`
`pub use core::DeviceType;`
`pub use core::CommandQueueProperties;`
`pub use core::MemFlags;`
`pub use core::MapFlags;`

## Modules

async | Types related to futures and asynchrony.
builders | Builders and associated settings-related types.
enums | Enumerators for settings and information requests.
error | Standard error type for ocl futures.
flags | Bitflags for various parameter types.
prm | OpenCL scalar and vector primitive types.
traits | Commonly used traits.

## Structs

Buffer | A chunk of memory physically located on a device, such as a GPU.
Context | A context for a particular platform and set of device types.
Device | An individual device identifier (an OpenCL device_id).
Event | An event representing a command or user created event.
EventArray | A list of events for coordinating enqueued commands.
EventList | A list of events for coordinating enqueued commands.
Extensions | Extensions of a platform.
FutureMemMap | A future which resolves to a `MemMap` as soon as its creating command completes.
Image | A section of device memory which represents one or many images.
Kernel | A kernel which represents a 'procedure'.
MemMap | A view of memory mapped by `clEnqueueMap{...}`.
Platform | A platform identifier.
ProQue | An all-in-one chimera of the `Program`, `Queue`, `Context` and (optionally) `SpatialDims` types.
Program | A program from which kernels can be created from.
Queue | A command queue which manages all actions taken on kernels, buffers, and images.
ReadGuard | Allows access to the data contained within a lock just like a mutex guard.
RwVec | A locking `Vec` which interoperates with OpenCL events and Rust futures to provide exclusive access to data.
Sampler | An image sampler used to process images.
WriteGuard | Allows access to the data contained within just like a mutex guard.

## Enums

BufferCmdError | A buffer command error.
SpatialDims | Specifies a size or offset in up to three dimensions.

## Type Definitions

FutureReadGuard |
FutureWriteGuard |

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)