@@ -67,14 +67,14 @@ module internal BFS =
6767 levels
6868
6969 let singleSourceSparse
70- ( add : Expr < bool option -> bool option -> bool option >)
71- ( mul : Expr < bool option -> bool option -> bool option >)
70+ ( add : Expr < int option -> int option -> int option >)
71+ ( mul : Expr < 'a option -> int option -> int option >)
7272 ( clContext : ClContext )
7373 workGroupSize
7474 =
7575
7676 let spMSpV =
77- Operations.SpMSpVBool add mul clContext workGroupSize
77+ Operations.SpMSpV add mul clContext workGroupSize
7878
7979 let zeroCreate =
8080 Vector.zeroCreate clContext workGroupSize
@@ -87,14 +87,14 @@ module internal BFS =
8787 let fillSubVectorTo =
8888 Vector.assignByMaskInPlace Mask.assign clContext workGroupSize
8989
90- fun ( queue : MailboxProcessor < Msg >) ( matrix : ClMatrix < bool >) ( source : int ) ->
90+ fun ( queue : MailboxProcessor < Msg >) ( matrix : ClMatrix < 'a >) ( source : int ) ->
9191 let vertexCount = matrix.RowCount
9292
9393 let levels =
9494 zeroCreate queue DeviceOnly vertexCount Dense
9595
9696 let mutable front =
97- ofList queue DeviceOnly Sparse vertexCount [ source, true ]
97+ ofList queue DeviceOnly Sparse vertexCount [ source, 1 ]
9898
9999 let mutable level = 0
100100 let mutable stop = false
@@ -125,8 +125,8 @@ module internal BFS =
125125
126126
127127 let singleSourcePushPull
128- ( add : Expr < bool option -> bool option -> bool option >)
129- ( mul : Expr < bool option -> bool option -> bool option >)
128+ ( add : Expr < int option -> int option -> int option >)
129+ ( mul : Expr < 'a option -> int option -> int option >)
130130 ( clContext : ClContext )
131131 workGroupSize
132132 =
@@ -135,7 +135,7 @@ module internal BFS =
135135 Operations.SpMVInPlace add mul clContext workGroupSize
136136
137137 let spMSpV =
138- Operations.SpMSpVBool add mul clContext workGroupSize
138+ Operations.SpMSpV add mul clContext workGroupSize
139139
140140 let zeroCreate =
141141 Vector.zeroCreate clContext workGroupSize
@@ -149,7 +149,7 @@ module internal BFS =
149149 Vector.map2Sparse Mask.complementedOp clContext workGroupSize
150150
151151 let fillSubVectorInPlace =
152- Vector.assignByMaskInPlace ( Mask.assign) clContext workGroupSize
152+ Vector.assignByMaskInPlace Mask.assign clContext workGroupSize
153153
154154 let toSparse = Vector.toSparse clContext workGroupSize
155155
@@ -159,7 +159,7 @@ module internal BFS =
159159 ClArray.count Predicates.isSome clContext workGroupSize
160160
161161 //Push or pull functions
162- let getNNZ ( queue : MailboxProcessor < Msg >) ( v : ClVector < bool >) =
162+ let getNNZ ( queue : MailboxProcessor < Msg >) ( v : ClVector < int >) =
163163 match v with
164164 | ClVector.Sparse v -> v.NNZ
165165 | ClVector.Dense v -> countNNZ queue v
@@ -169,14 +169,14 @@ module internal BFS =
169169 let push nnz size =
170170 ( float32 nnz) / ( float32 size) <= SPARSITY
171171
172- fun ( queue : MailboxProcessor < Msg >) ( matrix : ClMatrix < bool >) ( source : int ) ->
172+ fun ( queue : MailboxProcessor < Msg >) ( matrix : ClMatrix < 'a >) ( source : int ) ->
173173 let vertexCount = matrix.RowCount
174174
175175 let levels =
176176 zeroCreate queue DeviceOnly vertexCount Dense
177177
178178 let mutable frontier =
179- ofList queue DeviceOnly Sparse vertexCount [ source, true ]
179+ ofList queue DeviceOnly Sparse vertexCount [ source, 1 ]
180180
181181 let mutable level = 0
182182 let mutable stop = false
0 commit comments