pub struct CudaDeviceInner { /* private fields */ }Implementations§
Source§impl CudaDeviceInner
impl CudaDeviceInner
pub fn stream(&self) -> &Arc<CudaStream>
pub fn has_func(&self, module_name: &str, func_name: &str) -> bool
pub fn get_func( &self, module_name: &str, func_name: &str, ) -> Option<CudaFunction>
pub fn load_file( &self, path: &Path, module_name: &str, kernels: &[&str], ) -> Result<(), DriverError>
pub fn load_ptx( &self, ptx: Ptx, module_name: &str, kernels: &[&str], ) -> Result<(), DriverError>
Sourcepub unsafe fn alloc<T: DeviceRepr>(
&self,
len: usize,
) -> Result<CudaSlice<T>, DriverError>
pub unsafe fn alloc<T: DeviceRepr>( &self, len: usize, ) -> Result<CudaSlice<T>, DriverError>
Allocate an uninitialized device slice on this device stream.
§Safety
The caller must initialize the returned allocation before any device or host read observes its contents.
pub fn alloc_zeros<T: DeviceRepr + ValidAsZeroBits>( &self, len: usize, ) -> Result<CudaSlice<T>, DriverError>
pub fn memset_zeros<T: DeviceRepr + ValidAsZeroBits, Dst: DevicePtrMut<T>>( &self, dst: &mut Dst, ) -> Result<(), DriverError>
pub fn htod_sync_copy_into<T: DeviceRepr, Dst: DevicePtrMut<T>, Src: HostSlice<T> + ?Sized>( &self, src: &Src, dst: &mut Dst, ) -> Result<(), DriverError>
pub fn dtoh_sync_copy_into<T: DeviceRepr, Src: DevicePtr<T>, Dst: HostSlice<T> + ?Sized>( &self, src: &Src, dst: &mut Dst, ) -> Result<(), DriverError>
pub fn htod_sync_copy<T: DeviceRepr, Src: HostSlice<T> + ?Sized>( &self, src: &Src, ) -> Result<CudaSlice<T>, DriverError>
pub fn dtoh_sync_copy<T: DeviceRepr, Src: DevicePtr<T>>( &self, src: &Src, ) -> Result<Vec<T>, DriverError>
pub fn dtod_copy<T, Src: DevicePtr<T>, Dst: DevicePtrMut<T>>( &self, src: &Src, dst: &mut Dst, ) -> Result<(), DriverError>
Sourcepub unsafe fn upgrade_device_ptr<T>(
&self,
cu_device_ptr: CUdeviceptr,
len: usize,
) -> CudaSlice<T>
pub unsafe fn upgrade_device_ptr<T>( &self, cu_device_ptr: CUdeviceptr, len: usize, ) -> CudaSlice<T>
Wrap an existing CUDA device pointer in a typed cudarc slice.
§Safety
cu_device_ptr must point to a live allocation containing at least
len * size_of::<T>() bytes, and the resulting wrapper must not outlive
the allocation or alias another owner that will free it independently.
pub fn attribute(&self, attrib: CUdevice_attribute) -> Result<i32, DriverError>
pub fn synchronize(&self) -> Result<(), DriverError>
pub fn ordinal(&self) -> usize
Trait Implementations§
Source§impl Debug for CudaDeviceInner
impl Debug for CudaDeviceInner
Auto Trait Implementations§
impl !Freeze for CudaDeviceInner
impl RefUnwindSafe for CudaDeviceInner
impl Send for CudaDeviceInner
impl Sync for CudaDeviceInner
impl Unpin for CudaDeviceInner
impl UnsafeUnpin for CudaDeviceInner
impl UnwindSafe for CudaDeviceInner
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