@@ -56,11 +56,12 @@ def bench():
56
56
57
57
@pytest .mark .parametrize ("dim" , [5000 , 10000 , 20000 ])
58
58
@pytest .mark .parametrize ("format" , ['csr' , 'csc' ])
59
- def bench_add_sparse_strided_window (tacoBench , dim , format ):
60
- loader = ScipySparseTensorLoader (format )
59
+ @pytest .mark .parametrize ("strideWidth" , [2 , 4 , 8 ])
60
+ def bench_add_sparse_strided_window (tacoBench , dim , format , strideWidth ):
61
+ loader = RandomScipySparseTensorLoader (format )
61
62
matrix = loader .random ((dim , dim ), 0.01 )
62
63
def bench ():
63
- x = matrix [1 :( dim - 1 ): 4 , 1 :( dim - 1 ): 4 ]
64
+ x = matrix [0 : dim : strideWidth , 0 : dim : strideWidth ]
64
65
res = x + x
65
66
tacoBench (bench )
66
67
@@ -76,11 +77,12 @@ def bench():
76
77
tacoBench (bench )
77
78
78
79
@pytest .mark .parametrize ("dim" , [5000 , 10000 , 20000 ])
79
- def bench_add_pydata_sparse_strided_window (tacoBench , dim ):
80
+ @pytest .mark .parametrize ("strideWidth" , [2 , 4 , 8 ])
81
+ def bench_add_pydata_sparse_strided_window (tacoBench , dim , strideWidth ):
80
82
loader = RandomPydataSparseTensorLoader ()
81
83
matrix = loader .random ((dim , dim ), 0.01 )
82
84
def bench ():
83
- x = matrix [1 :( dim - 1 ): 4 , 1 :( dim - 1 ): 4 ]
85
+ x = matrix [0 : dim : strideWidth , 0 : dim : strideWidth ]
84
86
res = x + x
85
87
tacoBench (bench )
86
88
0 commit comments