pub struct DeviceBuffer<T: Copy> {
pub num_elements: usize,
/* private fields */
}
Expand description
Synchronous implementation of crate::DeviceBuffer
.
Refer to crate::DeviceBuffer
for documentation.
Fields§
§num_elements: usize
Implementations§
Source§impl<T: Copy> DeviceBuffer<T>
impl<T: Copy> DeviceBuffer<T>
pub fn new(num_elements: usize, stream: &Stream) -> Self
pub fn from_slice(slice: &[T], stream: &Stream) -> Result<Self, Error>
Sourcepub unsafe fn copy_from_async(
&mut self,
other: &HostBuffer<T>,
stream: &Stream,
) -> Result<(), Error>
pub unsafe fn copy_from_async( &mut self, other: &HostBuffer<T>, stream: &Stream, ) -> Result<(), Error>
Copy from host buffer.
§Safety
This function is marked unsafe because it does not synchronize and the operation might not have completed when it returns.
Sourcepub unsafe fn copy_to_async(
&self,
other: &mut HostBuffer<T>,
stream: &Stream,
) -> Result<(), Error>
pub unsafe fn copy_to_async( &self, other: &mut HostBuffer<T>, stream: &Stream, ) -> Result<(), Error>
Copy to host buffer.
§Safety
This function is marked unsafe because it does not synchronize and the operation might not have completed when it returns.
Sourcepub fn fill_with_byte(
&mut self,
value: u8,
stream: &Stream,
) -> Result<(), Error>
pub fn fill_with_byte( &mut self, value: u8, stream: &Stream, ) -> Result<(), Error>
Fill buffer with byte value.
Sourcepub fn as_internal(&self) -> &DevicePtr
pub fn as_internal(&self) -> &DevicePtr
Get readonly reference to internal DevicePtr
.
Sourcepub fn as_mut_internal(&mut self) -> &mut DevicePtr
pub fn as_mut_internal(&mut self) -> &mut DevicePtr
Get mutable reference to internal DevicePtr
.
Trait Implementations§
Source§impl<T: Copy> Drop for DeviceBuffer<T>
impl<T: Copy> Drop for DeviceBuffer<T>
impl<T: Copy> Send for DeviceBuffer<T>
Implements Send
for DeviceBuffer
.
§Safety
This property is inherited from the CUDA API, which is thread-safe.
impl<T: Copy> Sync for DeviceBuffer<T>
Implements Sync
for DeviceBuffer
.
§Safety
This property is inherited from the CUDA API, which is thread-safe.
Auto Trait Implementations§
impl<T> Freeze for DeviceBuffer<T>
impl<T> RefUnwindSafe for DeviceBuffer<T>where
T: RefUnwindSafe,
impl<T> Unpin for DeviceBuffer<T>where
T: Unpin,
impl<T> UnwindSafe for DeviceBuffer<T>where
T: UnwindSafe,
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