fortrangoingonforty/armfortas / abe82e5

Browse files

Update allocate_like test to canonical column-major stride expectation

Authored by espadonne
Committed by mfwolffe
SHA
abe82e54c71dac70594f4973658a1964936a5097
Parents
f523885
Tree
7c1c90a

1 changed file

StatusFile+-
M runtime/src/array.rs 7 1
runtime/src/array.rsmodified
@@ -1920,12 +1920,18 @@ mod tests {
19201920
         assert!(dest.is_allocated());
19211921
         assert_eq!(dest.elem_size, 8);
19221922
         assert_eq!(dest.rank, 2);
1923
+        // Bounds carry over from source. Strides are canonical
1924
+        // column-major (stride[0]=1, stride[k]=Π extent[0..k]) — see
1925
+        // matching note in afs_allocate_array. The previous flat-1
1926
+        // strides made downstream `afs_create_section` compute
1927
+        // colliding byte offsets for any rank-2 reshape.
19231928
         assert_eq!(dest.dims[0].lower_bound, -2);
19241929
         assert_eq!(dest.dims[0].upper_bound, 1);
19251930
         assert_eq!(dest.dims[0].stride, 1);
19261931
         assert_eq!(dest.dims[1].lower_bound, 4);
19271932
         assert_eq!(dest.dims[1].upper_bound, 6);
1928
-        assert_eq!(dest.dims[1].stride, 1);
1933
+        // dim[1].stride = extent[0] = 1-(-2)+1 = 4
1934
+        assert_eq!(dest.dims[1].stride, 4);
19291935
 
19301936
         afs_deallocate_array(&mut dest, ptr::null_mut());
19311937
     }