Skip to main content

CudaDeviceInner

Struct CudaDeviceInner 

Source
pub struct CudaDeviceInner { /* private fields */ }

Implementations§

Source§

impl CudaDeviceInner

Source

pub fn stream(&self) -> &Arc<CudaStream>

Source

pub fn has_func(&self, module_name: &str, func_name: &str) -> bool

Source

pub fn get_func( &self, module_name: &str, func_name: &str, ) -> Option<CudaFunction>

Source

pub fn load_file( &self, path: &Path, module_name: &str, kernels: &[&str], ) -> Result<(), DriverError>

Source

pub fn load_ptx( &self, ptx: Ptx, module_name: &str, kernels: &[&str], ) -> Result<(), DriverError>

Source

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.

Source

pub fn alloc_zeros<T: DeviceRepr + ValidAsZeroBits>( &self, len: usize, ) -> Result<CudaSlice<T>, DriverError>

Source

pub fn memset_zeros<T: DeviceRepr + ValidAsZeroBits, Dst: DevicePtrMut<T>>( &self, dst: &mut Dst, ) -> Result<(), DriverError>

Source

pub fn htod_sync_copy_into<T: DeviceRepr, Dst: DevicePtrMut<T>, Src: HostSlice<T> + ?Sized>( &self, src: &Src, dst: &mut Dst, ) -> Result<(), DriverError>

Source

pub fn dtoh_sync_copy_into<T: DeviceRepr, Src: DevicePtr<T>, Dst: HostSlice<T> + ?Sized>( &self, src: &Src, dst: &mut Dst, ) -> Result<(), DriverError>

Source

pub fn htod_sync_copy<T: DeviceRepr, Src: HostSlice<T> + ?Sized>( &self, src: &Src, ) -> Result<CudaSlice<T>, DriverError>

Source

pub fn dtoh_sync_copy<T: DeviceRepr, Src: DevicePtr<T>>( &self, src: &Src, ) -> Result<Vec<T>, DriverError>

Source

pub fn dtod_copy<T, Src: DevicePtr<T>, Dst: DevicePtrMut<T>>( &self, src: &Src, dst: &mut Dst, ) -> Result<(), DriverError>

Source

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.

Source

pub fn attribute(&self, attrib: CUdevice_attribute) -> Result<i32, DriverError>

Source

pub fn synchronize(&self) -> Result<(), DriverError>

Source

pub fn ordinal(&self) -> usize

Trait Implementations§

Source§

impl Debug for CudaDeviceInner

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for CudaDeviceInner

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,