pub struct Context { /* private fields */ }Implementations§
Source§impl Context
impl Context
Sourcepub fn create(devices: &[i32]) -> Result<Self>
pub fn create(devices: &[i32]) -> Result<Self>
Creates a cuTENSORMg handle for the devices that may participate in later operations.
§Errors
Returns an error if the device count cannot be represented by cuTENSORMg, if cuTENSORMg cannot create a handle, or if it returns a null handle.
Sourcepub unsafe fn from_raw(
handle: cutensorMgHandle_t,
devices: Vec<i32>,
) -> Result<Self>
pub unsafe fn from_raw( handle: cutensorMgHandle_t, devices: Vec<i32>, ) -> Result<Self>
Wraps an existing cuTENSORMg handle.
§Safety
handle must be a valid cuTENSORMg handle for devices. The returned
context takes ownership of handle and destroys it when the last clone
is dropped.
pub fn devices(&self) -> &[i32]
pub fn device_count(&self) -> usize
pub fn as_raw(&self) -> cutensorMgHandle_t
Sourcepub fn into_raw(self) -> Result<cutensorMgHandle_t>
pub fn into_raw(self) -> Result<cutensorMgHandle_t>
Consumes this context and returns the owned raw cuTENSORMg handle.
§Errors
Returns Error::HandleShared if cloned contexts or context references
still point at the same handle.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl UnwindSafe for Context
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