[−][src]Struct fil_ocl::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]
pub fn builder() -> ContextBuilder
[src]
Returns a ContextBuilder
.
This is the preferred way to create a Context.
pub fn new(
properties: Option<ContextProperties>,
device_spec: Option<DeviceSpecifier>,
pfn_notify: Option<CreateContextCallbackFn>,
user_data: Option<UserDataPtr>
) -> OclResult<Context>
[src]
properties: Option<ContextProperties>,
device_spec: Option<DeviceSpecifier>,
pfn_notify: Option<CreateContextCallbackFn>,
user_data: Option<UserDataPtr>
) -> OclResult<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.
pub fn resolve_wrapping_device_idxs(&self, idxs: &[usize]) -> Vec<Device>
[src]
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.
pub fn get_device_by_wrapping_index(&self, index: usize) -> Device
[src]
Returns a device by its ordinal count within this context.
Round-robins (%) to the next valid device.
pub fn platform_info(
&self,
info_kind: PlatformInfo
) -> OclResult<PlatformInfoResult>
[src]
&self,
info_kind: PlatformInfo
) -> OclResult<PlatformInfoResult>
Returns info about the platform associated with the context.
pub fn device_info(
&self,
index: usize,
info_kind: DeviceInfo
) -> OclResult<DeviceInfoResult>
[src]
&self,
index: usize,
info_kind: DeviceInfo
) -> OclResult<DeviceInfoResult>
Returns info about the device indexed by index
associated with this
context.
pub fn info(&self, info_kind: ContextInfo) -> OclResult<ContextInfoResult>
[src]
Returns info about the context.
pub fn as_core(&self) -> &ContextCore
[src]
Returns a reference to the core pointer wrapper, usable by functions in
the core
module.
pub fn devices(&self) -> Vec<Device>
[src]
Returns the list of devices associated with this context.
Panics upon any OpenCL error.
pub fn device_versions(&self) -> OclResult<Vec<OpenclVersion>>
[src]
Returns the list of device versions associated with this context.
pub fn platform(&self) -> OclResult<Option<Platform>>
[src]
Returns the platform this context is associated with.
Methods from Deref<Target = ContextCore>
pub fn as_ptr(&self) -> *mut c_void
[src]
Returns a pointer, do not store it.
pub fn devices(&self) -> Result<Vec<DeviceId>, Error>
[src]
Returns the devices associated with this context.
pub fn platform(&self) -> Result<Option<PlatformId>, Error>
[src]
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 From<Context> for Context
[src]
fn from(c: ContextCore) -> Context
[src]
impl Clone for Context
[src]
impl Display for Context
[src]
impl Debug for Context
[src]
impl Deref for Context
[src]
type Target = ContextCore
The resulting type after dereferencing.
fn deref(&self) -> &ContextCore
[src]
impl DerefMut for Context
[src]
fn deref_mut(&mut self) -> &mut ContextCore
[src]
impl<'a> ClContextPtr for &'a Context
[src]
impl ClVersions for Context
[src]
fn device_versions(&self) -> OclCoreResult<Vec<OpenclVersion>>
[src]
fn platform_version(&self) -> OclCoreResult<OpenclVersion>
[src]
fn verify_device_versions(
&self,
required_version: [u16; 2]
) -> Result<(), Error>
[src]
&self,
required_version: [u16; 2]
) -> Result<(), Error>
fn verify_platform_version(
&self,
required_version: [u16; 2]
) -> Result<(), Error>
[src]
&self,
required_version: [u16; 2]
) -> Result<(), Error>
impl<'a> ClVersions for &'a Context
[src]
fn device_versions(&self) -> OclCoreResult<Vec<OpenclVersion>>
[src]
fn platform_version(&self) -> OclCoreResult<OpenclVersion>
[src]
fn verify_device_versions(
&self,
required_version: [u16; 2]
) -> Result<(), Error>
[src]
&self,
required_version: [u16; 2]
) -> Result<(), Error>
fn verify_platform_version(
&self,
required_version: [u16; 2]
) -> Result<(), Error>
[src]
&self,
required_version: [u16; 2]
) -> Result<(), Error>
Auto Trait Implementations
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
impl RefUnwindSafe for Context
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,