pub trait SliceExt<T: DeviceCopy> {
fn as_dbuf(&self) -> CudaResult<DeviceBuffer<T>>;
fn as_unified_buf(&self) -> CudaResult<UnifiedBuffer<T>>;
fn as_1d_array(&self) -> CudaResult<ArrayObject>
where
T: ArrayPrimitive;
fn as_2d_array(
&self,
width: usize,
height: usize
) -> CudaResult<ArrayObject>
where
T: ArrayPrimitive;
fn as_1d_texture(&self) -> CudaResult<Texture>
where
T: ArrayPrimitive,
{ ... }
fn as_2d_texture(&self, width: usize, height: usize) -> CudaResult<Texture>
where
T: ArrayPrimitive,
{ ... }
fn as_1d_surface(&self) -> CudaResult<Surface>
where
T: ArrayPrimitive,
{ ... }
fn as_2d_surface(&self, width: usize, height: usize) -> CudaResult<Surface>
where
T: ArrayPrimitive,
{ ... }
}
Expand description
Utilities for slices and slice-like things such as arrays.
Required methods
fn as_dbuf(&self) -> CudaResult<DeviceBuffer<T>>
fn as_dbuf(&self) -> CudaResult<DeviceBuffer<T>>
Allocate memory on the GPU and convert this slice into a DBuffer.
fn as_unified_buf(&self) -> CudaResult<UnifiedBuffer<T>>
fn as_unified_buf(&self) -> CudaResult<UnifiedBuffer<T>>
Convert this slice to a UnifiedBuffer
which can be accessed from the CPU and GPU
without conversions back and forth.