File tree Expand file tree Collapse file tree
benchmarks/GraphBLAS-sharp.Benchmarks
src/GraphBLAS-sharp/Backend/CSRMatrix Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,23 +13,7 @@ open OpenCL.Net
1313open GraphBLAS.FSharp .IO
1414open QuickGraph
1515
16- type BFSConfig () =
17- inherit ManualConfig()
18-
19- do
20- base .AddColumn(
21- MatrixShapeColumn( " RowCount" , fun mtxReader -> mtxReader.ReadMatrixShape() .RowCount) :> IColumn,
22- MatrixShapeColumn( " ColumnCount" , fun mtxReader -> mtxReader.ReadMatrixShape() .ColumnCount) :> IColumn,
23- MatrixShapeColumn( " NNZ" , fun mtxReader -> mtxReader.ReadMatrixShape() .Nnz) :> IColumn,
24- TEPSColumn() :> IColumn,
25- StatisticColumn.Min,
26- StatisticColumn.Max
27- ) |> ignore
28-
29- [<IterationCount( 10 ) >]
30- [<WarmupCount( 3 ) >]
31- [<InvocationCount( 3 ) >]
32- [<Config( typeof< BFSConfig>) >]
16+ [<Config( typeof< CommonConfig>) >]
3317type BFSBenchmarks () =
3418 let random = Random()
3519
Original file line number Diff line number Diff line change @@ -7,23 +7,7 @@ open BenchmarkDotNet.Columns
77open System.IO
88open GraphBLAS.FSharp .IO
99
10- type MxvConfig () =
11- inherit ManualConfig()
12-
13- do
14- base .AddColumn(
15- MatrixShapeColumn( " RowCount" , fun mtxReader -> mtxReader.ReadMatrixShape() .RowCount) :> IColumn,
16- MatrixShapeColumn( " ColumnCount" , fun mtxReader -> mtxReader.ReadMatrixShape() .ColumnCount) :> IColumn,
17- MatrixShapeColumn( " NNZ" , fun mtxReader -> mtxReader.ReadMatrixShape() .Nnz) :> IColumn,
18- TEPSColumn() :> IColumn,
19- StatisticColumn.Min,
20- StatisticColumn.Max
21- ) |> ignore
22-
23- [<IterationCount( 10 ) >]
24- [<WarmupCount( 3 ) >]
25- [<InvocationCount( 3 ) >]
26- [<Config( typeof< MxvConfig>) >]
10+ [<Config( typeof< CommonConfig>) >]
2711type MxvBenchmarks () =
2812 let rand = System.Random()
2913
Original file line number Diff line number Diff line change @@ -12,23 +12,7 @@ open Brahma.FSharp.OpenCL.WorkflowBuilder.Evaluation
1212open OpenCL.Net
1313open GraphBLAS.FSharp .IO
1414
15- type TransposeConfig () =
16- inherit ManualConfig()
17-
18- do
19- base .AddColumn(
20- MatrixShapeColumn( " RowCount" , fun mtxReader -> mtxReader.ReadMatrixShape() .RowCount) :> IColumn,
21- MatrixShapeColumn( " ColumnCount" , fun mtxReader -> mtxReader.ReadMatrixShape() .ColumnCount) :> IColumn,
22- MatrixShapeColumn( " NNZ" , fun mtxReader -> mtxReader.ReadMatrixShape() .Nnz) :> IColumn,
23- TEPSColumn() :> IColumn,
24- StatisticColumn.Min,
25- StatisticColumn.Max
26- ) |> ignore
27-
28- [<IterationCount( 10 ) >]
29- [<WarmupCount( 3 ) >]
30- [<InvocationCount( 3 ) >]
31- [<Config( typeof< MxvConfig>) >]
15+ [<Config( typeof< CommonConfig>) >]
3216type TransposeBenchmarks () =
3317 let mutable matrix = Unchecked.defaultof< Matrix< float>>
3418
Original file line number Diff line number Diff line change 1- namespace GraphBLAS.FSharp.Benchmarks
1+ namespace rec GraphBLAS.FSharp.Benchmarks
22
33open BenchmarkDotNet.Columns
44open BenchmarkDotNet.Reports
@@ -8,6 +8,28 @@ open OpenCL.Net
88open GraphBLAS.FSharp .IO
99open System.IO
1010open System.Text .RegularExpressions
11+ open BenchmarkDotNet.Configs
12+ open BenchmarkDotNet.Jobs
13+
14+ type CommonConfig () =
15+ inherit ManualConfig()
16+
17+ do
18+ base .AddColumn(
19+ MatrixShapeColumn( " RowCount" , fun mtxReader -> mtxReader.ReadMatrixShape() .RowCount) :> IColumn,
20+ MatrixShapeColumn( " ColumnCount" , fun mtxReader -> mtxReader.ReadMatrixShape() .ColumnCount) :> IColumn,
21+ MatrixShapeColumn( " NNZ" , fun mtxReader -> mtxReader.ReadMatrixShape() .Nnz) :> IColumn,
22+ TEPSColumn() :> IColumn,
23+ StatisticColumn.Min,
24+ StatisticColumn.Max
25+ ) |> ignore
26+
27+ base .AddJob(
28+ Job.Dry
29+ .WithWarmupCount( 3 )
30+ .WithIterationCount( 10 )
31+ .WithInvocationCount( 3 )
32+ ) |> ignore
1133
1234type ClContext = ClContext of OpenCLEvaluationContext
1335with
Original file line number Diff line number Diff line change @@ -110,12 +110,12 @@ module internal rec Convert =
110110 fun ( ndRange : _1D )
111111 ( nnzPerRowSparse : int [])
112112 ( nonZeroRowsIndices : int [])
113- ( off2 : int []) ->
113+ ( expandedNnzPerRow : int []) ->
114114
115115 let gid = ndRange.GlobalID0
116116
117117 if gid < totalSum then
118- off2 .[ nonZeroRowsIndices.[ gid] + 1 ] <- nnzPerRowSparse.[ gid]
118+ expandedNnzPerRow .[ nonZeroRowsIndices.[ gid] + 1 ] <- nnzPerRowSparse.[ gid]
119119 @>
120120
121121 let expandedNnzPerRow = Array.zeroCreate ( rowCount + 1 )
You can’t perform that action at this time.
0 commit comments