Skip to content

Commit 970ffa0

Browse files
committed
wip: SpGeMM
1 parent 5b1b3cd commit 970ffa0

6 files changed

Lines changed: 682 additions & 274 deletions

File tree

src/GraphBLAS-sharp.Backend/Matrix/COO/Matrix.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ open GraphBLAS.FSharp.Backend.Objects
88
open GraphBLAS.FSharp.Backend.Objects.ClMatrix
99
open GraphBLAS.FSharp.Backend.Objects.ClCell
1010
open GraphBLAS.FSharp.Backend.Objects.ArraysExtensions
11+
open GraphBLAS.FSharp.Backend.Objects.ClContext
1112

1213
module Matrix =
1314
let map = Map.run

src/GraphBLAS-sharp.Backend/Matrix/Matrix.fs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -405,19 +405,19 @@ module Matrix =
405405
| ClMatrix.CSR m1, ClMatrix.CSC m2, ClMatrix.COO mask -> runCSRnCSC queue m1 m2 mask |> ClMatrix.COO
406406
| _ -> failwith "Matrix formats are not matching"
407407

408-
// let expand
409-
// (opAdd: Expr<'c -> 'c -> 'c option>)
410-
// (opMul: Expr<'a -> 'b -> 'c option>)
411-
// (clContext: ClContext)
412-
// workGroupSize
413-
// =
414-
//
415-
// let run =
416-
// SpGeMM.Expand.run clContext workGroupSize opAdd opMul
417-
//
418-
// fun (processor: MailboxProcessor<_>) allocationMode (leftMatrix: ClMatrix<'a>) (rightMatrix: ClMatrix<'b>) ->
419-
// match leftMatrix, rightMatrix with
420-
// | ClMatrix.CSR leftMatrix, ClMatrix.CSR rightMatrix ->
421-
// ClMatrix.LIL
422-
// <| run processor allocationMode leftMatrix rightMatrix
423-
// | _ -> failwith "Matrix formats are not matching"
408+
let expand
409+
(opAdd: Expr<'c -> 'c -> 'c option>)
410+
(opMul: Expr<'a -> 'b -> 'c option>)
411+
(clContext: ClContext)
412+
workGroupSize
413+
=
414+
415+
let run =
416+
SpGeMM.Expand.run opAdd opMul clContext workGroupSize
417+
418+
fun (processor: MailboxProcessor<_>) allocationMode (leftMatrix: ClMatrix<'a>) (rightMatrix: ClMatrix<'b>) ->
419+
match leftMatrix, rightMatrix with
420+
| ClMatrix.CSR leftMatrix, ClMatrix.CSR rightMatrix ->
421+
// TODO(max alloc size)
422+
run processor allocationMode 1000 leftMatrix rightMatrix
423+
| _ -> failwith "Matrix formats are not matching"

0 commit comments

Comments
 (0)