Struct blaze_rs::context::SimpleContext
source · pub struct SimpleContext { /* private fields */ }Expand description
Simple Context
The SimpleContext type is the most basic implementation of a context. It contains a single command queue, so no complicated logic is required for it’s use, since next_queue will always return the same queue.
Implementations§
source§impl SimpleContext
impl SimpleContext
pub fn new( device: &RawDevice, ctx_props: ContextProperties, props: impl Into<QueueProperties> ) -> Result<Self>
pub fn with_logger( device: &RawDevice, ctx_props: ContextProperties, props: impl Into<QueueProperties>, loger: impl 'static + Fn(&CStr) + Send ) -> Result<Self>
Available on crate feature
cl3 only.pub fn default() -> Result<Self>
Methods from Deref<Target = RawContext>§
pub 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
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 SimpleContext
impl Clone for SimpleContext
source§fn clone(&self) -> SimpleContext
fn clone(&self) -> SimpleContext
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Context for SimpleContext
impl Context for SimpleContext
source§fn as_raw(&self) -> &RawContext
fn as_raw(&self) -> &RawContext
Returns a reference to the underlying
RawContextsource§fn queues(&self) -> &[CommandQueue]
fn queues(&self) -> &[CommandQueue]
Returns a slice with all of the
Context’s command queuessource§fn next_queue(&self) -> &CommandQueue
fn next_queue(&self) -> &CommandQueue
Returns the next
CommandQueue, as per context implementationsource§fn finish_all(&self) -> Result<()>
fn finish_all(&self) -> Result<()>
Finishes all the
CommandQueues in the context.Auto Trait Implementations§
impl RefUnwindSafe for SimpleContext
impl Send for SimpleContext
impl Sync for SimpleContext
impl Unpin for SimpleContext
impl UnwindSafe for SimpleContext
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