MCPcopy Create free account
hub / github.com/Rust-GPU/rust-cuda / as_2d_array

Method as_2d_array

crates/cust/src/util.rs:84–91  ·  view source on GitHub ↗
(&self, width: usize, height: usize)

Source from the content-addressed store, hash-verified

82 }
83
84 fn as_2d_array(&self, width: usize, height: usize) -> CudaResult<ArrayObject>
85 where
86 T: ArrayPrimitive,
87 {
88 let mut arr = ArrayObject::new_2d([width, height], T::array_format(), 1)?;
89 arr.copy_from(self)?;
90 Ok(arr)
91 }
92}
93
94impl<T: DeviceCopy, const N: usize> SliceExt<T> for [T; N] {

Callers 2

as_2d_textureMethod · 0.80
as_2d_surfaceMethod · 0.80

Calls 1

copy_fromMethod · 0.45

Tested by

no test coverage detected