File tree Expand file tree Collapse file tree
benchmarks/GraphBLAS-sharp.Benchmarks
src/GraphBLAS-sharp.Backend Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1-
2- Gpu
3- 32
4-
51NVIDIA*
62Gpu
7332
Original file line number Diff line number Diff line change @@ -4,8 +4,7 @@ open BenchmarkDotNet.Running
44[<EntryPoint>]
55let main argv =
66 let benchmarks =
7- BenchmarkSwitcher [| typeof< Algorithms.BFS.BFSWithoutTransferBenchmarkInt32>
8- typeof< Matrix.SpGeMM.Expand.WithoutTransfer.Float32> |]
7+ BenchmarkSwitcher [| typeof< Algorithms.BFS.BFSWithoutTransferBenchmarkInt32> |]
98
109 benchmarks.Run argv |> ignore
1110 0
Original file line number Diff line number Diff line change @@ -132,12 +132,14 @@ module Matrix =
132132 |> Seq.map
133133 ( fun ( first , second ) ->
134134 lazy
135- ( if second - first > 0 then
136- let values = getChunkValues first second
137- let columns = getChunkIndices first second
135+ ( let count = second - first
136+
137+ if count > 0 then
138+ let values = getChunkValues first count
139+ let columns = getChunkIndices first count
138140
139141 Some <| creatSparseVector values columns
140- else
142+ else
141143 None))
142144
143145 let byRows ( clContext : ClContext ) workGroupSize =
Original file line number Diff line number Diff line change @@ -301,15 +301,21 @@ module Expand =
301301 runRow processor allocationMode rightMatrix rightMatrixRowsLengths
302302
303303 split processor allocationMode leftMatrix
304- |> Seq.map ( fun lazyRow -> Option.bind runRow lazyRow.Value)
304+ |> Seq.map ( fun lazyRow ->
305+ Option.bind ( fun row ->
306+ let result = runRow row
307+ row.Dispose processor
308+
309+ result
310+ ) lazyRow.Value)
305311 |> Seq.toArray
306312 |> fun rows ->
307313 rightMatrixRowsLengths.Free processor
308314
309315 // compute nnz
310316 let nnz =
311317 rows
312- |> Array .fold
318+ |> Seq .fold
313319 ( fun count ->
314320 function
315321 | Some row -> count + row.Size
Original file line number Diff line number Diff line change @@ -92,8 +92,8 @@ module ClMatrix =
9292 interface IDeviceMemObject with
9393 member this.Dispose q =
9494 this.Rows
95- |> Array .choose id
96- |> Array .iter ( fun vector -> vector.Dispose q)
95+ |> Seq .choose id
96+ |> Seq .iter ( fun vector -> vector.Dispose q)
9797
9898 type Tuple < 'elem when 'elem: struct > =
9999 { Context: ClContext
You can’t perform that action at this time.
0 commit comments