@@ -47,6 +47,7 @@ function mxm(A::SparseMatrixCSC, B)
47
47
printstyled (stdout , " \n C = A::SparseMatrixCSC($(size (A)) ) * B::$(typeof (B)) ($(size (B)) )\n " )
48
48
result = @bench A * B
49
49
println (stdout , result, " s" )
50
+ GC. gc ()
50
51
flush (stdout )
51
52
return result
52
53
end
@@ -65,10 +66,34 @@ function mxm(A::SuiteSparseGraphBLAS.GBArray, B::SuiteSparseGraphBLAS.GBArray; a
65
66
result = @gbbench mul! (C, A, B; accum= + )
66
67
end
67
68
println (stdout , result, " s" )
69
+ GC. gc ()
70
+ flush (stdout )
71
+ return result
72
+ end
73
+
74
+ function tpose (A:: SuiteSparseGraphBLAS.GBArray )
75
+ Ao = storageorder (A) == ColMajor () ? " C" : " R"
76
+ Bo = storageorder (B) == ColMajor () ? " C" : " R"
77
+ printstyled (stdout , " \n C::GBArray = transpose(A::GBArray($Ao , $(size (A)) ))\n " )
78
+ result = @gbbench copy (transpose (A))
79
+ println (stdout , result, " s" )
80
+ GC. gc ()
68
81
flush (stdout )
69
82
return result
70
83
end
71
84
85
+ function tpose (A:: SparseMatrixCSC )
86
+ printstyled (stdout , " \n C = transpose(A::SparseMatrixCSC($(size (A)) ))\n " )
87
+ result = @bench copy (transpose (A))
88
+ println (stdout , result, " s" )
89
+ GC. gc ()
90
+ flush (stdout )
91
+ return result
92
+ end
93
+
94
+ function spdbench (A)
95
+ end
96
+
72
97
function singlebench (pathornum)
73
98
x = tryparse (Int64, pathornum)
74
99
if x != = nothing
@@ -160,6 +185,26 @@ function singlebench(pathornum)
160
185
println (stdout , " A by col (1, 2, 16 thread): $gbresultsC " )
161
186
println (stdout , " SparseArrays: $SAresults " )
162
187
flush (stdout )
188
+
189
+ printstyled (stdout , " \n Sparse * Sparse'" ; bold= true )
190
+ println (stdout , " ################################" )
191
+ flush (stdout )
192
+ gbset (A, :format , SuiteSparseGraphBLAS. BYROW)
193
+ diag (A)
194
+ gbresultsR = runthreaded (A, transpose (A))
195
+ gbset (A, :format , SuiteSparseGraphBLAS. BYCOL)
196
+ diag (A)
197
+ gbresultsC = runthreaded (A, transpose (A))
198
+ A2 = SparseMatrixCSC (A)
199
+ SAresults = mxm (A2, transpose (A2))
200
+ println (stdout , )
201
+ printstyled (stdout , " \n RESULTS, Sparse * Sparse: \n " ; bold= true , color= :green )
202
+ println (stdout , " ################################" )
203
+ println (stdout , " A by row (1, 2, 16 thread): $gbresultsR " )
204
+ println (stdout , " A by col (1, 2, 16 thread): $gbresultsC " )
205
+ println (stdout , " SparseArrays: $SAresults " )
206
+ flush (stdout )
207
+
163
208
return nothing
164
209
end
165
210
0 commit comments