Struct blaze_rs::context::RawContext
source · #[repr(transparent)]pub struct RawContext(_);
Expand description
A raw OpenCL context
Implementations§
source§impl RawContext
impl RawContext
pub fn new(props: ContextProperties, devices: &[RawDevice]) -> Result<Self>
pub fn with_logger<F: 'static + Fn(&CStr) + Send>( props: ContextProperties, devices: &[RawDevice], loger: F ) -> Result<Self>
Available on crate feature
cl3
only.pub fn from_type(props: ContextProperties, ty: DeviceType) -> Result<Self>
pub const unsafe fn from_id_unchecked(v: cl_context) -> Self
pub const unsafe fn from_id(v: cl_context) -> Option<Self>
pub const fn id(&self) -> cl_context
pub unsafe fn retain(&self) -> Result<()>
sourcepub fn reference_count(&self) -> Result<u32>
pub fn reference_count(&self) -> Result<u32>
Return the context reference count.
sourcepub fn num_devices(&self) -> Result<u32>
pub fn num_devices(&self) -> Result<u32>
Return the number of devices in context.
sourcepub fn devices(&self) -> Result<Vec<RawDevice>>
pub fn devices(&self) -> Result<Vec<RawDevice>>
Return the list of devices and sub-devices in context.
sourcepub fn greatest_common_version(&self) -> Result<Version>
pub fn greatest_common_version(&self) -> Result<Version>
Returns the greatest common OpenCL version of this context’s devices.
sourcepub fn properties(&self) -> Result<ContextProperties>
pub fn properties(&self) -> Result<ContextProperties>
Return the properties argument specified in creation
source§impl RawContext
impl RawContext
pub fn on_destruct(&self, f: impl 'static + FnOnce() + Send) -> Result<()>
Available on crate feature
cl3
only.pub unsafe fn on_destruct_raw( &self, f: unsafe extern "C" fn(context: cl_context, user_data: *mut c_void), user_data: *mut c_void ) -> Result<()>
Available on crate feature
cl3
only.Trait Implementations§
source§impl Clone for RawContext
impl Clone for RawContext
source§impl Debug for RawContext
impl Debug for RawContext
source§impl Drop for RawContext
impl Drop for RawContext
source§impl Hash for RawContext
impl Hash for RawContext
source§impl PartialEq<RawContext> for RawContext
impl PartialEq<RawContext> for RawContext
source§fn eq(&self, other: &RawContext) -> bool
fn eq(&self, other: &RawContext) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for RawContext
impl Send for RawContext
impl StructuralEq for RawContext
impl StructuralPartialEq for RawContext
impl Sync for RawContext
Auto Trait Implementations§
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more