Skip to content

Commit 5ca7d0d

Browse files
committed
OperationCase added to Helpers
1 parent 2fca550 commit 5ca7d0d

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ module Matrix =
4141
| MatrixCSR _ -> copy processor workGroupSize matrix
4242

4343
let toCOO (clContext: ClContext) workGroupSize =
44-
let toCOO = CSRMatrix.toCOO clContext
44+
let toCOO = CSRMatrix.toCOO clContext workGroupSize
4545
let copy = copy clContext
4646

4747
fun (processor: MailboxProcessor<_>) (matrix: Matrix<'a>) ->
4848
match matrix with
4949
| MatrixCOO _ -> copy processor workGroupSize matrix
50-
| MatrixCSR m -> toCOO workGroupSize processor m |> MatrixCOO
50+
| MatrixCSR m -> toCOO processor m |> MatrixCOO
5151

5252
let eWiseAdd (clContext: ClContext) (opAdd: Expr<'a -> 'a -> 'a>) workGroupSize =
5353
let COOeWiseAdd =

tests/GraphBLAS-sharp.Tests/Helpers.fs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,21 @@ module Utils =
426426

427427
Brahma.FSharp.OpenCL.ClContext(clPlatform, clDeviceType))
428428

429+
type OperationCase =
430+
{ ClContext: ClContext
431+
MatrixCase: MatrixFromat }
432+
433+
let testCases =
434+
[ avaliableContexts "" |> Seq.map box
435+
listOfUnionCases<MatrixFromat>
436+
|> Seq.map box ]
437+
|> List.map List.ofSeq
438+
|> cartesian
439+
|> List.map
440+
(fun list ->
441+
{ ClContext = unbox list.[0]
442+
MatrixCase = unbox list.[1] })
443+
429444
let createMatrixFromArray2D matrixCase array isZero =
430445
match matrixCase with
431446
| CSR -> MatrixCSR <| CSRMatrix.FromArray2D(array, isZero)

0 commit comments

Comments
 (0)