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