Skip to content

Commit 94fec78

Browse files
committed
fix: msbfs parents bug
1 parent f4016eb commit 94fec78

File tree

1 file changed

+6
-4
lines changed
  • src/GraphBLAS-sharp.Backend/Algorithms

1 file changed

+6
-4
lines changed

src/GraphBLAS-sharp.Backend/Algorithms/MSBFS.fs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ module internal MSBFS =
183183
let findIntersection =
184184
Intersect.findKeysIntersection clContext workGroupSize
185185

186+
let copyIndices = ClArray.copyTo clContext workGroupSize
187+
188+
// let copyMatrix = Matrix.copy clContext workGroupSize
189+
186190
fun (queue: MailboxProcessor<Msg>) allocationMode (front: ClMatrix.COO<_>) (parents: ClMatrix.COO<_>) ->
187191

188192
// Find intersection of levels and front indices.
@@ -197,14 +201,12 @@ module internal MSBFS =
197201

198202
match newFront with
199203
| Some f ->
200-
let resultFront = { f with Values = f.Columns }
201-
202204
// Update parents
203205
let newParents = mergeDisjoint queue parents f
204206

205-
f.Values.Free queue
207+
copyIndices queue f.Columns f.Values
206208

207-
newParents, Some resultFront
209+
newParents, Some f
208210

209211
| _ -> parents, None
210212

0 commit comments

Comments
 (0)