@@ -206,14 +206,50 @@ function CaccumAxB_allbyrow(S, G, nthreads, sizerhs)
206206 end
207207end
208208
209+ function CaccumAxB_CRC (S, G, nthreads, sizerhs)
210+ printstyled (" \n Full_bycol += CSR * Full_bycol\n " , color= :green )
211+ GC. gc ()
212+ m = rand (size (S, 2 ), sizerhs)
213+ m2 = GBMatrix (m)
214+ println (" Size of dense matrix is $(size (m)) " )
215+
216+ gbset (m2, :format , :bycol )
217+ gbset (G, :format , :byrow )
218+
219+ printstyled (" \n SparseMatrixCSC:\n " , bold= true )
220+ A = @benchmark $ S * $ m
221+ show (stdout , MIME (" text/plain" ), A)
222+ gbset (:burble , true )
223+ C = GBMatrix (size (G, 1 ), size (m2, 2 ), 0.0 )
224+ gbset (C, :sparsity_control , :full )
225+ gbset (C, :format , :bycol )
226+
227+ printstyled (" \n GBMatrix:\n " , bold= true )
228+ # print burble for checking
229+ gbset (:burble , false )
230+ for n ∈ nthreads
231+ printstyled (" \n F += S' * F with $n threads: \n " , bold= true , color= :green )
232+ gbset (:nthreads , n)
233+ gbset (:burble , true )
234+ mul! (C, G, m2; accum= + )
235+ gbset (:burble , false )
236+ B = @benchmark mul! ($ C, $ G, $ m2; accum= + )
237+ show (stdout , MIME (" text/plain" ), B)
238+ tratio = ratio (median (A), median (B))
239+ color = tratio. time >= 1.0 ? :green : :red
240+ printstyled (" \n Median speedup over SparseArrays using $n threads is: $(string (tratio)) \n " ; bold= true , color)
241+ end
242+ end
243+
209244# OPTIONS SET 2:
210245# run these functions for benchmarking:
211- const functorun = [AxB_allbycol, AxB_ColxRow, CaccumAxB_allbycol, CaccumAxB_allbyrow]
246+ const functorun = [AxB_allbycol, AxB_ColxRow, CaccumAxB_allbycol, CaccumAxB_allbyrow, CaccumAxB_CRC ]
212247#= The choices are:
213248AxB_allbycol - S * F
214249AxB_ColxRow - S' * F
215250CaccumAxB_allbycol - F += S * F
216251CaccumAxB_allbyrow - F' += S' * F'
252+ CaccumAxB_CRC - F += S' * F
217253Please open an issue or message me for further functions to add here.
218254=#
219255
0 commit comments