File tree Expand file tree Collapse file tree 3 files changed +9
-15
lines changed
src/GraphBLAS-sharp.Backend Expand file tree Collapse file tree 3 files changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,8 @@ module internal MSBFS =
119
119
let vertexCount = matrix.RowCount
120
120
let sourceVertexCount = source.Length
121
121
122
+ let source = source |> List.sort
123
+
122
124
let startMatrix =
123
125
source |> List.mapi ( fun i vertex -> i, vertex, 1 )
124
126
@@ -185,8 +187,6 @@ module internal MSBFS =
185
187
186
188
let copyIndices = ClArray.copyTo clContext workGroupSize
187
189
188
- // let copyMatrix = Matrix.copy clContext workGroupSize
189
-
190
190
fun ( queue : MailboxProcessor < Msg >) allocationMode ( front : ClMatrix.COO < _ >) ( parents : ClMatrix.COO < _ >) ->
191
191
192
192
// Find intersection of levels and front indices.
@@ -214,8 +214,8 @@ module internal MSBFS =
214
214
215
215
let spGeMM =
216
216
Operations.SpGeMM.COO.expand
217
- ( ArithmeticOperations.min - 1 )
218
- ( ArithmeticOperations.fst - 1 )
217
+ ( ArithmeticOperations.min)
218
+ ( ArithmeticOperations.fst)
219
219
clContext
220
220
workGroupSize
221
221
@@ -226,6 +226,8 @@ module internal MSBFS =
226
226
let vertexCount = inputMatrix.RowCount
227
227
let sourceVertexCount = source.Length
228
228
229
+ let source = source |> List.sort
230
+
229
231
let matrix =
230
232
match inputMatrix with
231
233
| ClMatrix.CSR m ->
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ module ClArray =
133
133
let i = ndRange.GlobalID0
134
134
135
135
if i < inputArrayLength then
136
- source .[ i] <- destination .[ i] @>
136
+ destination .[ i] <- source .[ i] @>
137
137
138
138
let program = clContext.Compile( copy)
139
139
Original file line number Diff line number Diff line change @@ -255,17 +255,9 @@ module ArithmeticOperations =
255
255
| None, Some y -> Some y
256
256
| _ -> None @>
257
257
258
- let min zero =
259
- <@ fun x y ->
260
- let result = min x y
258
+ let min < 'a when 'a : comparison > = <@ fun ( x : 'a ) ( y : 'a ) -> Some ( min x y) @>
261
259
262
- if result = zero then
263
- None
264
- else
265
- Some result @>
266
-
267
- let fst zero =
268
- <@ fun x _ -> if x = zero then None else Some x @>
260
+ let fst < 'a > = <@ fun ( x : 'a ) ( _ : 'a ) -> Some x @>
269
261
270
262
//PageRank specific
271
263
let squareOfDifference =
You can’t perform that action at this time.
0 commit comments