Skip to content

SpGeMM #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip: SpGeMM
  • Loading branch information
IgorErin committed May 2, 2023
commit 970ffa02860d905c472456f2f967760a97838034
1 change: 1 addition & 0 deletions src/GraphBLAS-sharp.Backend/Matrix/COO/Matrix.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ open GraphBLAS.FSharp.Backend.Objects
open GraphBLAS.FSharp.Backend.Objects.ClMatrix
open GraphBLAS.FSharp.Backend.Objects.ClCell
open GraphBLAS.FSharp.Backend.Objects.ArraysExtensions
open GraphBLAS.FSharp.Backend.Objects.ClContext

module Matrix =
let map = Map.run
Expand Down
32 changes: 16 additions & 16 deletions src/GraphBLAS-sharp.Backend/Matrix/Matrix.fs
Original file line number Diff line number Diff line change
Expand Up @@ -405,19 +405,19 @@ module Matrix =
| ClMatrix.CSR m1, ClMatrix.CSC m2, ClMatrix.COO mask -> runCSRnCSC queue m1 m2 mask |> ClMatrix.COO
| _ -> failwith "Matrix formats are not matching"

// let expand
// (opAdd: Expr<'c -> 'c -> 'c option>)
// (opMul: Expr<'a -> 'b -> 'c option>)
// (clContext: ClContext)
// workGroupSize
// =
//
// let run =
// SpGeMM.Expand.run clContext workGroupSize opAdd opMul
//
// fun (processor: MailboxProcessor<_>) allocationMode (leftMatrix: ClMatrix<'a>) (rightMatrix: ClMatrix<'b>) ->
// match leftMatrix, rightMatrix with
// | ClMatrix.CSR leftMatrix, ClMatrix.CSR rightMatrix ->
// ClMatrix.LIL
// <| run processor allocationMode leftMatrix rightMatrix
// | _ -> failwith "Matrix formats are not matching"
let expand
(opAdd: Expr<'c -> 'c -> 'c option>)
(opMul: Expr<'a -> 'b -> 'c option>)
(clContext: ClContext)
workGroupSize
=

let run =
SpGeMM.Expand.run opAdd opMul clContext workGroupSize

fun (processor: MailboxProcessor<_>) allocationMode (leftMatrix: ClMatrix<'a>) (rightMatrix: ClMatrix<'b>) ->
match leftMatrix, rightMatrix with
| ClMatrix.CSR leftMatrix, ClMatrix.CSR rightMatrix ->
// TODO(max alloc size)
run processor allocationMode 1000 leftMatrix rightMatrix
| _ -> failwith "Matrix formats are not matching"
Loading