pub struct DeviceScalar<T: DeviceRepr + ValidAsZeroBits + Copy> { /* private fields */ }Expand description
A single scalar value stored in GPU device memory.
Used for CUDA graph capture: the graph records the device pointer (fixed
address), and the caller updates the value via update
before each CapturedGraph::launch. The update is a 4-or-8 byte
cuMemcpyHtoDAsync — effectively zero cost.
Implementations§
Source§impl<T: DeviceRepr + ValidAsZeroBits + Copy> DeviceScalar<T>
impl<T: DeviceRepr + ValidAsZeroBits + Copy> DeviceScalar<T>
Sourcepub fn new(stream: &Arc<CudaStream>, initial: T) -> GpuResult<Self>
pub fn new(stream: &Arc<CudaStream>, initial: T) -> GpuResult<Self>
Allocate a device scalar with the given initial value.
Auto Trait Implementations§
impl<T> Freeze for DeviceScalar<T>
impl<T> RefUnwindSafe for DeviceScalar<T>where
T: RefUnwindSafe,
impl<T> Send for DeviceScalar<T>
impl<T> Sync for DeviceScalar<T>
impl<T> Unpin for DeviceScalar<T>
impl<T> UnsafeUnpin for DeviceScalar<T>
impl<T> UnwindSafe for DeviceScalar<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