Skip to content

Commit cf10d92

Browse files
committed
fix: msbfs parents
1 parent 1538ad6 commit cf10d92

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

  • src/GraphBLAS-sharp.Backend/Algorithms

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,22 @@ module internal MSBFS =
169169

170170
let updateFrontAndLevels = updateFrontAndParents clContext workGroupSize
171171

172-
fun (queue: MailboxProcessor<Msg>) (matrix: ClMatrix<'a>) (source: int list) ->
173-
let vertexCount = matrix.RowCount
172+
fun (queue: MailboxProcessor<Msg>) (inputMatrix: ClMatrix<'a>) (source: int list) ->
173+
let vertexCount = inputMatrix.RowCount
174174
let sourceVertexCount = source.Length
175175

176+
let matrix =
177+
match inputMatrix with
178+
| ClMatrix.CSR m ->
179+
{ Context = clContext
180+
RowPointers = m.RowPointers
181+
Columns = m.Columns
182+
Values = m.Columns
183+
RowCount = m.RowCount
184+
ColumnCount = m.ColumnCount }
185+
|> ClMatrix.CSR
186+
| _ -> failwith "Incorrect format"
187+
176188
let mutable parents =
177189
source
178190
|> List.mapi (fun i vertex -> i, vertex, 0)
@@ -186,7 +198,6 @@ module internal MSBFS =
186198
let mutable stop = false
187199

188200
while not stop do
189-
190201
//Getting new frontier
191202
match spGeMM queue DeviceOnly (ClMatrix.COO front) matrix with
192203
| None ->

0 commit comments

Comments
 (0)