CudaTensor3dPtr

Struct CudaTensor3dPtr 

Source
pub struct CudaTensor3dPtr<T, const N1: usize, const N2: usize, const N3: usize>
where T: Default + Debug,
{ /* private fields */ }
Expand description

Cuda memory object representing a 3D array with dimension number as type parameter

Implementations§

Source§

impl<T, const N1: usize, const N2: usize, const N3: usize> CudaTensor3dPtr<T, N1, N2, N3>
where T: Default + Debug,

Source

pub fn new( memory_pool: &Arc<Mutex<MemoryPool>>, ) -> Result<CudaTensor3dPtr<T, N1, N2, N3>, CudaError>

Create an instance of CudaTensor1dPtr

§Arguments
  • memory_pool - memory pool object
§Errors

This function may return the following errors

Source

pub fn with_initializer<I: FnMut() -> T>( memory_pool: &Arc<Mutex<MemoryPool>>, initializer: I, ) -> Result<CudaTensor3dPtr<T, N1, N2, N3>, CudaError>

Create an instance of CudaMemoryPoolPtr

§Arguments
  • 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, const N1: usize, const N2: usize, const N3: usize> AsCudaMutPtr for CudaTensor3dPtr<T, N1, N2, N3>
where T: Default + Debug,

Source§

type Pointer = CudaMemoryPoolPtr<T>

Returned Cuda smart pointer type
Source§

fn as_cuda_mut_ptr<'a>(&'a mut self) -> CudaMutPtr<'a, Self::Pointer>

Source§

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

Source§

type Pointer = CudaMemoryPoolPtr<T>

Returned Cuda smart pointer type
Source§

fn as_cuda_ptr_ref(&self) -> &Self::Pointer

Source§

impl<T, const N1: usize, const N2: usize, const N3: usize> AsCudaPtrRef for CudaTensor3dPtr<T, N1, N2, N3>
where T: Default + Debug,

Source§

type Pointer = CudaMemoryPoolPtr<T>

Returned Cuda smart pointer type
Source§

fn as_cuda_ptr_ref(&self) -> &Self::Pointer

Source§

impl<T, const N1: usize, const N2: usize, const N3: usize> BatchDataType for CudaTensor3dPtr<T, N1, N2, N3>
where T: Default + Debug + UnitValue<T>,

Source§

type Type = CudaVec<T, CudaTensor3dPtr<T, N1, N2, N3>>

Source§

impl<T, const N1: usize, const N2: usize, const N3: usize> Debug for CudaTensor3dPtr<T, N1, N2, N3>
where T: Default + Debug + Debug,

Source§

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

Formats the value using the given formatter. Read more
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> From<&'a CudaTensor3dPtr<T, N1, N2, N3>> for CudaTensor3dPtrView<'a, T, N1, N2, N3>
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> 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<T, const N1: usize, const N2: usize, const N3: usize> MemorySize for CudaTensor3dPtr<T, N1, N2, N3>
where T: Default + Debug,

Source§

impl<T, const N1: usize, const N2: usize, const N3: usize> PointerElement for CudaTensor3dPtr<T, N1, N2, N3>
where T: Default + Debug,

Source§

impl<'a, T, const N1: usize, const N2: usize, const N3: usize> ToCuda<T> for &'a CudaTensor3dPtr<T, N1, N2, N3>
where T: UnitValue<T>,

Source§

type Output = CudaTensor3dPtrView<'a, T, N1, N2, N3>

Source§

fn to_cuda(self, _: &DeviceGpu<T>) -> Result<Self::Output, TypeConvertError>

Arguments Read more
Source§

impl<T, const N1: usize, const N2: usize, const N3: usize> ToCuda<T> for CudaTensor3dPtr<T, N1, N2, N3>
where T: UnitValue<T>,

Source§

type Output = CudaTensor3dPtr<T, N1, N2, N3>

Source§

fn to_cuda(self, _: &DeviceGpu<T>) -> Result<Self::Output, TypeConvertError>

Arguments Read more
Source§

impl<T, const N1: usize, const N2: usize, const N3: usize> TryClone for CudaTensor3dPtr<T, N1, N2, N3>
where T: Default + Debug,

Source§

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

Source§

type Error = CudaError

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

fn try_from( value: &'a CudaTensor3dPtrView<'a, T, N1, N2, N3>, ) -> Result<CudaTensor3dPtr<T, N1, N2, N3>, CudaError>

Performs the conversion.

Auto Trait Implementations§

§

impl<T, const N1: usize, const N2: usize, const N3: usize> Freeze for CudaTensor3dPtr<T, N1, N2, N3>

§

impl<T, const N1: usize, const N2: usize, const N3: usize> RefUnwindSafe for CudaTensor3dPtr<T, N1, N2, N3>
where T: RefUnwindSafe,

§

impl<T, const N1: usize, const N2: usize, const N3: usize> !Send for CudaTensor3dPtr<T, N1, N2, N3>

§

impl<T, const N1: usize, const N2: usize, const N3: usize> !Sync for CudaTensor3dPtr<T, N1, N2, N3>

§

impl<T, const N1: usize, const N2: usize, const N3: usize> Unpin for CudaTensor3dPtr<T, N1, N2, N3>

§

impl<T, const N1: usize, const N2: usize, const N3: usize> UnwindSafe for CudaTensor3dPtr<T, N1, N2, N3>
where T: RefUnwindSafe,

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,