pub struct CudaBuffer<T> { /* private fields */ }Expand description
Owned GPU memory buffer holding len elements of type T.
When pool_fn is Some, dropping returns the inner CudaSlice to the
global pool (crate::pool) instead of freeing GPU memory.
alloc_len is the rounded allocation size used as the pool key.
len is the logical element count visible to callers.
Implementations§
Source§impl<T> CudaBuffer<T>
impl<T> CudaBuffer<T>
Sourcepub fn alloc_len(&self) -> usize
pub fn alloc_len(&self) -> usize
Rounded allocation length used as the pool key.
For pooled buffers, this is round_len(len). For non-pooled
buffers, this equals len. Stats (hits, misses, returns) use
len consistently within the allocator for user-facing reporting;
alloc_len is an internal detail for pool key stability.
Sourcepub fn device_ordinal(&self) -> usize
pub fn device_ordinal(&self) -> usize
The ordinal of the device that owns this memory.
Trait Implementations§
Source§impl<T> Debug for CudaBuffer<T>
Available on crate feature cuda only.
impl<T> Debug for CudaBuffer<T>
Available on crate feature
cuda only.Auto Trait Implementations§
impl<T> Freeze for CudaBuffer<T>
impl<T> RefUnwindSafe for CudaBuffer<T>where
T: RefUnwindSafe,
impl<T> Send for CudaBuffer<T>
impl<T> Sync for CudaBuffer<T>
impl<T> Unpin for CudaBuffer<T>
impl<T> UnsafeUnpin for CudaBuffer<T>
impl<T> UnwindSafe for CudaBuffer<T>where
T: RefUnwindSafe,
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
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more