pub struct CudaMemoryBackend { /* private fields */ }Expand description
CUDA memory backend implementation
Implementations§
Source§impl CudaMemoryBackend
impl CudaMemoryBackend
Sourcepub fn new(config: CudaConfig) -> Result<Self, CudaError>
pub fn new(config: CudaConfig) -> Result<Self, CudaError>
Create new CUDA backend
Sourcepub fn allocate(
&mut self,
size: usize,
memory_type: CudaMemoryType,
) -> Result<*mut c_void, CudaError>
pub fn allocate( &mut self, size: usize, memory_type: CudaMemoryType, ) -> Result<*mut c_void, CudaError>
Allocate device memory
Sourcepub fn free(
&mut self,
ptr: *mut c_void,
memory_type: CudaMemoryType,
) -> Result<(), CudaError>
pub fn free( &mut self, ptr: *mut c_void, memory_type: CudaMemoryType, ) -> Result<(), CudaError>
Free device memory
Sourcepub fn memcpy(
&mut self,
dst: *mut c_void,
src: *const c_void,
size: usize,
kind: CudaMemcpyKind,
) -> Result<(), CudaError>
pub fn memcpy( &mut self, dst: *mut c_void, src: *const c_void, size: usize, kind: CudaMemcpyKind, ) -> Result<(), CudaError>
Copy memory
Sourcepub fn memcpy_async(
&mut self,
dst: *mut c_void,
src: *const c_void,
size: usize,
kind: CudaMemcpyKind,
stream_id: u32,
) -> Result<(), CudaError>
pub fn memcpy_async( &mut self, dst: *mut c_void, src: *const c_void, size: usize, kind: CudaMemcpyKind, stream_id: u32, ) -> Result<(), CudaError>
Asynchronous memory copy
Sourcepub fn create_context(
&mut self,
flags: CudaContextFlags,
) -> Result<u32, CudaError>
pub fn create_context( &mut self, flags: CudaContextFlags, ) -> Result<u32, CudaError>
Create CUDA context
Sourcepub fn get_device_properties(&self) -> &CudaDeviceProperties
pub fn get_device_properties(&self) -> &CudaDeviceProperties
Get device properties
Sourcepub fn device_synchronize(&mut self) -> Result<(), CudaError>
pub fn device_synchronize(&mut self) -> Result<(), CudaError>
Synchronize device
Trait Implementations§
impl Send for CudaMemoryBackend
impl Sync for CudaMemoryBackend
Auto Trait Implementations§
impl Freeze for CudaMemoryBackend
impl RefUnwindSafe for CudaMemoryBackend
impl Unpin for CudaMemoryBackend
impl UnsafeUnpin for CudaMemoryBackend
impl UnwindSafe for CudaMemoryBackend
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> 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