@@ -12,6 +12,7 @@ use ndarray::linalg::general_mat_vec_mul;
12
12
use ndarray:: Order ;
13
13
use ndarray:: { Data , Ix , LinalgScalar } ;
14
14
use ndarray_gen:: array_builder:: ArrayBuilder ;
15
+ use ndarray_gen:: array_builder:: ElementGenerator ;
15
16
16
17
use approx:: assert_relative_eq;
17
18
use defmac:: defmac;
@@ -230,7 +231,6 @@ fn gen_mat_mul()
230
231
let sizes = vec ! [
231
232
( 4 , 4 , 4 ) ,
232
233
( 8 , 8 , 8 ) ,
233
- ( 10 , 10 , 10 ) ,
234
234
( 8 , 8 , 1 ) ,
235
235
( 1 , 10 , 10 ) ,
236
236
( 10 , 1 , 10 ) ,
@@ -241,19 +241,23 @@ fn gen_mat_mul()
241
241
( 4 , 17 , 3 ) ,
242
242
( 17 , 3 , 22 ) ,
243
243
( 19 , 18 , 2 ) ,
244
- ( 16 , 17 , 15 ) ,
245
244
( 15 , 16 , 17 ) ,
246
- ( 67 , 63 , 62 ) ,
245
+ ( 67 , 50 , 62 ) ,
247
246
] ;
248
247
let strides = & [ 1 , 2 , -1 , -2 ] ;
249
248
let cf_order = [ Order :: C , Order :: F ] ;
249
+ let generator = [ ElementGenerator :: Sequential , ElementGenerator :: Checkerboard ] ;
250
250
251
251
// test different strides and memory orders
252
- for ( & s1, & s2) in iproduct ! ( strides, strides) {
252
+ for ( & s1, & s2, & gen ) in iproduct ! ( strides, strides, & generator ) {
253
253
for & ( m, k, n) in & sizes {
254
254
for ( ord1, ord2, ord3) in iproduct ! ( cf_order, cf_order, cf_order) {
255
- println ! ( "Case s1={}, s2={}, orders={:?}, {:?}, {:?}" , s1, s2, ord1, ord2, ord3) ;
256
- let a = ArrayBuilder :: new ( ( m, k) ) . memory_order ( ord1) . build ( ) * 0.5 ;
255
+ println ! ( "Case s1={}, s2={}, gen={:?}, orders={:?}, {:?}, {:?}" , s1, s2, gen , ord1, ord2, ord3) ;
256
+ let a = ArrayBuilder :: new ( ( m, k) )
257
+ . memory_order ( ord1)
258
+ . generator ( gen)
259
+ . build ( )
260
+ * 0.5 ;
257
261
let b = ArrayBuilder :: new ( ( k, n) ) . memory_order ( ord2) . build ( ) ;
258
262
let mut c = ArrayBuilder :: new ( ( m, n) ) . memory_order ( ord3) . build ( ) ;
259
263
0 commit comments