CudaMemoryPoolPtr

Struct CudaMemoryPoolPtr 

Source
pub struct CudaMemoryPoolPtr<T> { /* private fields */ }
Expand description

Cuda memory object allocated from the memory pool

Implementations§

Source§

impl<T> CudaMemoryPoolPtr<T>

Source

pub fn new( size: usize, memory_pool: &Arc<Mutex<MemoryPool>>, ) -> Result<CudaMemoryPoolPtr<T>, CudaError>

Create an instance of CudaMemoryPoolPtr

§Arguments
  • size- Number of value elements to be allocated
  • memory_pool - memory pool object
§Errors

This function may return the following errors

Source§

impl<T> CudaMemoryPoolPtr<T>
where T: Default + Debug,

Source

pub fn with_initializer<I: FnMut() -> T>( size: usize, memory_pool: &Arc<Mutex<MemoryPool>>, initializer: I, ) -> Result<CudaMemoryPoolPtr<T>, CudaError>

Create an instance of CudaMemoryPoolPtr

§Arguments
  • size- Number of value elements to be allocated
  • memory_pool - memory pool object
  • initializer - Repeatedly called function to initialize each element
§Errors

This function may return the following errors

Trait Implementations§

Source§

impl<T> AsMutPtr<T> for CudaMemoryPoolPtr<T>

Source§

fn as_mut_ptr(&mut self) -> *mut T

Source§

impl<T> AsMutVoidPtr for CudaMemoryPoolPtr<T>

Source§

impl<T> AsPtr<T> for CudaMemoryPoolPtr<T>

Source§

impl<T> AsVoidPtr for CudaMemoryPoolPtr<T>

Source§

impl<T> Debug for CudaMemoryPoolPtr<T>

Source§

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

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

impl<T> Drop for CudaMemoryPoolPtr<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'a, T, const N: usize> From<&'a CudaTensor1dPtr<T, N>> for &'a CudaMemoryPoolPtr<T>
where T: Default + Debug,

Source§

fn from(value: &'a CudaTensor1dPtr<T, N>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T, const N1: usize, const N2: usize> From<&'a CudaTensor2dPtr<T, N1, N2>> for &'a CudaMemoryPoolPtr<T>
where T: Default + Debug,

Source§

fn from(value: &'a CudaTensor2dPtr<T, N1, N2>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T, const N1: usize, const N2: usize, const N3: usize> From<&'a CudaTensor3dPtr<T, N1, N2, N3>> for &'a CudaMemoryPoolPtr<T>
where T: Default + Debug,

Source§

fn from(value: &'a CudaTensor3dPtr<T, N1, N2, N3>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T, const N1: usize, const N2: usize, const N3: usize, const N4: usize> From<&'a CudaTensor4dPtr<T, N1, N2, N3, N4>> for &'a CudaMemoryPoolPtr<T>
where T: Default + Debug,

Source§

fn from(value: &'a CudaTensor4dPtr<T, N1, N2, N3, N4>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T, const N: usize> From<&'a mut CudaTensor1dPtr<T, N>> for &'a mut CudaMemoryPoolPtr<T>
where T: Default + Debug,

Source§

fn from(value: &'a mut CudaTensor1dPtr<T, N>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T, const N1: usize, const N2: usize> From<&'a mut CudaTensor2dPtr<T, N1, N2>> for &'a mut CudaMemoryPoolPtr<T>
where T: Default + Debug,

Source§

fn from(value: &'a mut CudaTensor2dPtr<T, N1, N2>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T, const N1: usize, const N2: usize, const N3: usize> From<&'a mut CudaTensor3dPtr<T, N1, N2, N3>> for &'a mut CudaMemoryPoolPtr<T>
where T: Default + Debug,

Source§

fn from(value: &'a mut CudaTensor3dPtr<T, N1, N2, N3>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T, const N1: usize, const N2: usize, const N3: usize, const N4: usize> From<&'a mut CudaTensor4dPtr<T, N1, N2, N3, N4>> for &'a mut CudaMemoryPoolPtr<T>
where T: Default + Debug,

Source§

fn from(value: &'a mut CudaTensor4dPtr<T, N1, N2, N3, N4>) -> Self

Converts to this type from the input type.
Source§

impl<U, T> From<CudaVecConverter<U, T>> for CudaMemoryPoolPtr<U>

Source§

fn from(value: CudaVecConverter<U, T>) -> Self

Converts to this type from the input type.
Source§

impl<CP> MemoryMoveTo<<CP as PointerElement>::Element, CudaMemoryPoolPtr<<CP as PointerElement>::Element>> for CP

Source§

fn memcpy_to( &self, dst: &mut CudaMemoryPoolPtr<<CP as PointerElement>::Element>, len: usize, ) -> Result<usize, Error>

Memory Copy To Read more
Source§

impl<T: Default + Debug> MemoryMoveTo<T, CudaHostPtr<T>> for CudaMemoryPoolPtr<T>

Source§

fn memcpy_to( &self, dst: &mut CudaHostPtr<T>, len: usize, ) -> Result<usize, Error>

Memory Copy To Read more
Source§

impl<T: Default + Debug> MemoryMoveTo<T, CudaMemoryPoolPtr<T>> for CudaHostPtr<T>

Source§

fn memcpy_to( &self, dst: &mut CudaMemoryPoolPtr<T>, len: usize, ) -> Result<usize, Error>

Memory Copy To Read more
Source§

impl<T: Default + Debug> MemoryMoveTo<T, CudaMemoryPoolPtr<T>> for CudaMemoryPoolPtr<T>

Source§

fn memcpy_to( &self, dst: &mut CudaMemoryPoolPtr<T>, len: usize, ) -> Result<usize, Error>

Memory Copy To Read more
Source§

impl<T: Default + Debug> MemoryMoveTo<T, CudaMemoryPoolPtr<T>> for CudaPtr<T>

Source§

fn memcpy_to( &self, dst: &mut CudaMemoryPoolPtr<T>, len: usize, ) -> Result<usize, Error>

Memory Copy To Read more
Source§

impl<T: Default + Debug> MemoryMoveTo<T, CudaPtr<T>> for CudaMemoryPoolPtr<T>

Source§

fn memcpy_to(&self, dst: &mut CudaPtr<T>, len: usize) -> Result<usize, Error>

Memory Copy To Read more
Source§

impl<CP> MemoryMoveToAsync<<CP as PointerElement>::Element, CudaMemoryPoolPtr<<CP as PointerElement>::Element>> for CP

Source§

fn memcpy_to_async( &self, dst: &mut CudaMemoryPoolPtr<<CP as PointerElement>::Element>, len: usize, stream: cudaStream_t, ) -> Result<usize, Error>

Memory Copy To Read more
Source§

impl<T: Default + Debug> MemoryMoveToAsync<T, CudaMemoryPoolPtr<T>> for CudaHostPtr<T>

Source§

fn memcpy_to_async( &self, dst: &mut CudaMemoryPoolPtr<T>, len: usize, stream: cudaStream_t, ) -> Result<usize, Error>

Memory Copy To Read more
Source§

impl<T: Default + Debug> PointerElement for CudaMemoryPoolPtr<T>

Source§

impl<T: Default + Debug> ReadMemory<T> for CudaMemoryPoolPtr<T>

Source§

fn read_to_vec(&self) -> Result<Vec<T>, Error>

Errors Read more
Source§

fn read_to_vec_with_size(&self, size: usize) -> Result<Vec<T>, Error>

Read memory as Vec with size specified Read more
Source§

impl<T: Default + Debug> WriteMemory<T> for CudaMemoryPoolPtr<T>

Source§

fn memcpy(&mut self, p: *const T, len: usize) -> Result<usize, Error>

Memory Copy Read more
Source§

fn memcpy_repeat( &mut self, p: *const T, len: usize, count: usize, ) -> Result<usize, Error>

Repeatedly copy the contents of memory 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<T> AsConstKernelPtr for T
where T: AsConstKernelPtrBase,

Source§

impl<T> AsKernelPtr for T
where T: AsKernelPtrBase,

Source§

impl<T> AsMutKernelPtr for T
where T: AsMutKernelPtrBase,