pub struct Context<'comm> { /* private fields */ }Implementations§
Source§impl<'comm> Context<'comm>
impl<'comm> Context<'comm>
pub fn create( communicator: &'comm Communicator, local_device_id: i32, stream: StreamBinding, ) -> Result<Self>
Sourcepub unsafe fn from_raw(
handle: cutensorMpHandle_t,
cuda_ctx: Arc<CudaContext>,
local_device_id: i32,
stream: StreamBinding,
) -> Result<Self>
pub unsafe fn from_raw( handle: cutensorMpHandle_t, cuda_ctx: Arc<CudaContext>, local_device_id: i32, stream: StreamBinding, ) -> Result<Self>
Wraps an existing cuTENSORMp handle.
§Safety
handle must be a valid cuTENSORMp handle associated with cuda_ctx,
local_device_id, and stream. The returned context takes ownership
of handle and destroys it when the last clone is dropped.
pub fn cuda_context(&self) -> &Arc<CudaContext>
pub fn bind(&self) -> Result<()>
pub fn local_device_id(&self) -> i32
pub fn stream(&self) -> &StreamBinding
pub fn as_raw(&self) -> cutensorMpHandle_t
Sourcepub fn into_raw(self) -> Result<cutensorMpHandle_t>
pub fn into_raw(self) -> Result<cutensorMpHandle_t>
Consumes this context and returns the owned raw cuTENSORMp handle.
§Errors
Returns Error::HandleShared if cloned contexts or context references
still point at the same handle.
Trait Implementations§
impl Send for Context<'_>
Auto Trait Implementations§
impl<'comm> Freeze for Context<'comm>
impl<'comm> RefUnwindSafe for Context<'comm>
impl<'comm> Sync for Context<'comm>
impl<'comm> Unpin for Context<'comm>
impl<'comm> UnsafeUnpin for Context<'comm>
impl<'comm> UnwindSafe for Context<'comm>
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