2
2
from scipy .sparse import random
3
3
import pytest
4
4
5
- def test_add_window (tacoBench ):
5
+ def bench_add_window (tacoBench ):
6
6
dim = 10000
7
7
matrix = random (dim , dim , format = "csr" ).todense ()
8
8
def bench ():
@@ -11,7 +11,7 @@ def bench():
11
11
tacoBench (bench )
12
12
13
13
@pytest .mark .parametrize ("dim" , [5000 , 10000 , 20000 ])
14
- def test_add_sparse_window (tacoBench , dim ):
14
+ def bench_add_sparse_window (tacoBench , dim ):
15
15
matrix = random (dim , dim , format = "csr" )
16
16
def bench ():
17
17
x = matrix [1 :(dim - 1 ), 1 :(dim - 1 )]
@@ -21,23 +21,23 @@ def bench():
21
21
tacoBench (bench )
22
22
23
23
@pytest .mark .parametrize ("dim" , [5000 , 10000 , 20000 ])
24
- def test_add_multiple_sparse_windows (tacoBench , dim ):
24
+ def bench_add_multiple_sparse_windows (tacoBench , dim ):
25
25
matrix1 = random (dim , dim , format = "csr" )
26
26
matrix2 = random (dim , dim , format = "csr" )
27
27
def bench ():
28
28
res = matrix1 [1 :(dim - 1 ), 1 :(dim - 1 )] + matrix2 [1 :(dim - 1 ), 1 :(dim - 1 )] + matrix1 [0 :(dim - 2 ), 0 :(dim - 2 )]
29
29
tacoBench (bench )
30
30
31
31
@pytest .mark .parametrize ("dim" , [5000 , 10000 , 20000 ])
32
- def test_add_sparse_strided_window (tacoBench , dim ):
32
+ def bench_add_sparse_strided_window (tacoBench , dim ):
33
33
matrix = random (dim , dim , format = "csr" )
34
34
def bench ():
35
35
x = matrix [1 :(dim - 1 ):2 , 1 :(dim - 1 ):2 ]
36
36
res = x + x
37
37
tacoBench (bench )
38
38
39
39
@pytest .mark .parametrize ("dim" , [5000 , 10000 , 20000 ])
40
- def test_add_sparse_index_set (tacoBench , dim ):
40
+ def bench_add_sparse_index_set (tacoBench , dim ):
41
41
indexes = [i * 2 for i in range (0 , dim // 2 )]
42
42
matrix = random (dim , dim , format = "csr" )
43
43
def bench ():
0 commit comments