Struct ocl::Context[][src]

pub struct Context(_);

A context for a particular platform and set of device types.

Thread safety and destruction for any enclosed pointers are all handled automatically. Clone, store, and share between threads to your heart's content.

Methods

impl Context
[src]

Returns a ContextBuilder.

This is the preferred way to create a Context.

Returns a newly created context.

Prefer Context::builder()... instead of this method unless you know what you're doing. Please also immediately contact us if you do, in fact, know what you're doing so that you can be added to the development team as the one who does.

Defaults

  • The 'NULL' platform (which is not to be relied on but is generally the first avaliable).
  • All devices associated with the 'NULL' platform
  • No notify callback function or user data.

Don't rely on these defaults, instead rely on the ContextBuilder defaults. In other words, use: Context::builder().build().unwrap() rather than Context::new(None, None, None, None).unwrap().

Panics

[TEMPORARY] Passing a Some variant for pfn_notify or user_data is not yet supported. File an issue if you need this.

Important traits for Vec<u8>

Resolves a list of zero-based device indices into a list of Devices.

If any index is out of bounds it will wrap around zero (%) to the next valid device index.

Returns a device by its ordinal count within this context.

Round-robins (%) to the next valid device.

Returns info about the platform associated with the context.

Returns info about the device indexed by index associated with this context.

Returns info about the context.

Returns a reference to the core pointer wrapper, usable by functions in the core module.

Important traits for Vec<u8>

Returns the list of devices associated with this context.

Panics upon any OpenCL error.

Returns the list of device versions associated with this context.

Returns the platform this context is associated with.

Methods from Deref<Target = ContextCore>

Returns a pointer, do not store it.

Returns the devices associated with this context.

Returns the platform associated with this context, if any.

Errors upon the usual OpenCL errors.

Returns None if the context properties do not specify a platform.

Trait Implementations

impl Debug for Context
[src]

Formats the value using the given formatter. Read more

impl Clone for Context
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl From<ContextCore> for Context
[src]

Performs the conversion.

impl Display for Context
[src]

Formats the value using the given formatter. Read more

impl Deref for Context
[src]

The resulting type after dereferencing.

Dereferences the value.

impl DerefMut for Context
[src]

Mutably dereferences the value.

impl<'a> ClContextPtr for &'a Context
[src]

impl ClVersions for Context
[src]

impl<'a> ClVersions for &'a Context
[src]

Auto Trait Implementations

impl Send for Context

impl Sync for Context