Skip to content

Commit a449754

Browse files
committed
add: host tests
1 parent acaa0c1 commit a449754

53 files changed

Lines changed: 361 additions & 74 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

benchmarks/GraphBLAS-sharp.Benchmarks/Configs.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ type Matrix2() =
1818
"NNZ",
1919
fun (matrix,_) ->
2020
match matrix.Format with
21-
| Coordinate -> matrix.ReadMatrixShape().Nnz
21+
| Coordinate -> matrix.ReadMatrixShape().NNZ
2222
| Array -> 0
2323
)
2424
:> IColumn,
2525
Matrix2Column(
2626
"SqrNNZ",
2727
fun (_,matrix) ->
2828
match matrix.Format with
29-
| Coordinate -> matrix.ReadMatrixShape().Nnz
29+
| Coordinate -> matrix.ReadMatrixShape().NNZ
3030
| Array -> 0
3131
)
3232
:> IColumn,
@@ -46,7 +46,7 @@ type Matrix() =
4646
"NNZ",
4747
fun matrix ->
4848
match matrix.Format with
49-
| Coordinate -> matrix.ReadMatrixShape().Nnz
49+
| Coordinate -> matrix.ReadMatrixShape().NNZ
5050
| Array -> 0
5151
)
5252
:> IColumn,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ module Matrix =
139139
let columns = getChunkIndices first count
140140

141141
Some <| creatSparseVector values columns
142-
else
142+
else
143143
None))
144144

145145
let byRows (clContext: ClContext) workGroupSize =

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,15 @@ module Expand =
301301
runRow processor allocationMode rightMatrix rightMatrixRowsLengths
302302

303303
split processor allocationMode leftMatrix
304-
|> Seq.map (fun lazyRow ->
305-
Option.bind (fun row ->
306-
let result = runRow row
307-
row.Dispose processor
308-
309-
result
310-
) lazyRow.Value)
304+
|> Seq.map
305+
(fun lazyRow ->
306+
Option.bind
307+
(fun row ->
308+
let result = runRow row
309+
row.Dispose processor
310+
311+
result)
312+
lazyRow.Value)
311313
|> Seq.toArray
312314
|> fun rows ->
313315
rightMatrixRowsLengths.Free processor

src/GraphBLAS-sharp/IO/MtxReader.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ type MtxReader(pathToFile: string) =
3434
streamReader.ReadLine().Split(' ')
3535
|> Array.map int
3636

37-
let nrows = size.[0]
38-
let ncols = size.[1]
37+
let rowsCount = size.[0]
38+
let columnsCount = size.[1]
3939
let nnz = size.[2]
4040

41-
{| RowCount = nrows
42-
ColumnCount = ncols
43-
Nnz = nnz |}
41+
{| RowCount = rowsCount
42+
ColumnCount = columnsCount
43+
NNZ = nnz |}
4444

4545
member this.ReadMatrix(converter: string -> 'a) : Matrix.COO<'a> =
4646
if object <> MtxMatrix then

src/GraphBLAS-sharp/Objects/Matrix.fs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ module Matrix =
2424
|> List.mapi (fun i x -> (x, i))
2525
|> List.filter (fun pair -> not <| isZero (fst pair)))
2626
|> List.fold
27-
(fun (rowPointers, valueInx) row -> ((rowPointers.Head + row.Length) :: rowPointers), valueInx @ row)
27+
(fun (rowPointers, valueInx) row ->
28+
((rowPointers.Head + row.Length) :: rowPointers), valueInx @ row)
2829
([ 0 ], [])
2930

3031
{ Values =
@@ -125,7 +126,8 @@ module Matrix =
125126
|> List.mapi (fun i x -> (x, i))
126127
|> List.filter (fun pair -> not <| isZero (fst pair)))
127128
|> List.fold
128-
(fun (colPointers, valueInx) col -> ((colPointers.Head + col.Length) :: colPointers), valueInx @ col)
129+
(fun (colPointers, valueInx) col ->
130+
((colPointers.Head + col.Length) :: colPointers), valueInx @ col)
129131
([ 0 ], [])
130132

131133
{ Values =
File renamed without changes.

tests/GraphBLAS-sharp.Tests/Common/ClArray/Blit.fs renamed to tests/GraphBLAS-sharp.Tests/Backend/Common/ClArray/Blit.fs

File renamed without changes.

tests/GraphBLAS-sharp.Tests/Common/ClArray/Choose.fs renamed to tests/GraphBLAS-sharp.Tests/Backend/Common/ClArray/Choose.fs

File renamed without changes.

tests/GraphBLAS-sharp.Tests/Common/ClArray/ChunkBySize.fs renamed to tests/GraphBLAS-sharp.Tests/Backend/Common/ClArray/ChunkBySize.fs

File renamed without changes.

tests/GraphBLAS-sharp.Tests/Common/ClArray/Concat.fs renamed to tests/GraphBLAS-sharp.Tests/Backend/Common/ClArray/Concat.fs

File renamed without changes.

0 commit comments

Comments
 (0)