[][src]Trait accel::memory::Allocatable

pub trait Allocatable: Contexted + Memory + Sized {
    type Shape: Zero;
    unsafe fn uninitialized(ctx: &Context, shape: Self::Shape) -> Self;

    fn from_elem(ctx: &Context, shape: Self::Shape, elem: Self::Elem) -> Self { ... }
fn zeros(ctx: &Context, shape: Self::Shape) -> Self { ... } }

Allocatable memories with CUDA context

Associated Types

type Shape: Zero

Shape for initialization

Loading content...

Required methods

unsafe fn uninitialized(ctx: &Context, shape: Self::Shape) -> Self

Allocate a memory without initialization

Safety

  • Cause undefined behavior when read before write

Panic

  • if shape is zero
Loading content...

Provided methods

fn from_elem(ctx: &Context, shape: Self::Shape, elem: Self::Elem) -> Self

uniformly initialized

Panic

  • if shape is zero

fn zeros(ctx: &Context, shape: Self::Shape) -> Self

uniformly initialized by zero

Panic

  • if shape is zero
Loading content...

Implementors

impl<T: Scalar> Allocatable for DeviceMemory<T>[src]

type Shape = usize

impl<T: Scalar> Allocatable for PageLockedMemory<T>[src]

type Shape = usize

impl<T: Scalar, Dim: Dimension> Allocatable for Array<T, Dim>[src]

type Shape = Dim

Loading content...