Constructs a new Array object from strided data The data pointed by the slice passed to this function can possibily be offseted using an additional `offset` parameter.
(slice: &[T], offset: i64, dims: Dim4, strides: Dim4)
| 241 | /// |
| 242 | /// The data pointed by the slice passed to this function can possibily be offseted using an additional `offset` parameter. |
| 243 | pub fn new_strided(slice: &[T], offset: i64, dims: Dim4, strides: Dim4) -> Self { |
| 244 | let aftype = T::get_af_dtype(); |
| 245 | unsafe { |
| 246 | let mut temp: af_array = std::ptr::null_mut(); |
| 247 | let err_val = af_create_strided_array( |
| 248 | &mut temp as *mut af_array, |
| 249 | slice.as_ptr() as *const c_void, |
| 250 | offset as dim_t, |
| 251 | dims.ndims() as c_uint, |
| 252 | dims.get().as_ptr() as *const c_longlong, |
| 253 | strides.get().as_ptr() as *const c_longlong, |
| 254 | aftype as c_uint, |
| 255 | 1 as c_uint, |
| 256 | ); |
| 257 | HANDLE_ERROR(AfError::from(err_val)); |
| 258 | temp.into() |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | /// Constructs a new Array object of specified dimensions and type |
| 263 | /// |
nothing calls this directly
no test coverage detected