pub struct UserObject { /* private fields */ }Expand description
A refcounted user object.
Implementations§
Source§impl UserObject
impl UserObject
Sourcepub fn new<F>(destroy: F, initial_refcount: u32) -> Result<Self>
pub fn new<F>(destroy: F, initial_refcount: u32) -> Result<Self>
Create a user object whose destructor is destroy.
initial_refcount must be >= 1.
Sourcepub fn retain(&self, count: u32) -> Result<()>
pub fn retain(&self, count: u32) -> Result<()>
Safe wrapper for cudaUserObjectRetain. Add count references to
this user object.
Sourcepub fn release(&self, count: u32) -> Result<()>
pub fn release(&self, count: u32) -> Result<()>
Safe wrapper for cudaUserObjectRelease. Drop count references
from this user object; when the count reaches zero the destructor
supplied at creation runs.
Sourcepub fn as_raw(&self) -> cudaUserObject_t
pub fn as_raw(&self) -> cudaUserObject_t
Raw cudaUserObject_t handle. Use with care — owned by self.
Trait Implementations§
Source§impl Debug for UserObject
impl Debug for UserObject
Source§impl Drop for UserObject
impl Drop for UserObject
impl Send for UserObject
impl Sync for UserObject
Auto Trait Implementations§
impl Freeze for UserObject
impl RefUnwindSafe for UserObject
impl Unpin for UserObject
impl UnsafeUnpin for UserObject
impl UnwindSafe for UserObject
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