Skip to content

Commit 44e85b5

Browse files
committed
Test file, tests and kernels renamed
1 parent 50aa5a5 commit 44e85b5

3 files changed

Lines changed: 22 additions & 18 deletions

File tree

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

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -407,13 +407,13 @@ module COOMatrix =
407407
if i < totalSum then
408408
expandedNnzPerRow.[nonZeroRowsIndices.[i] + 1] <- nnzPerRowSparse.[i] @>
409409

410-
let kernelCHSR =
410+
let kernelCalcHyperSparseRows =
411411
clContext.CreateClKernel calcHyperSparseRows
412412

413-
let kernelCNPRS =
413+
let kernelCalcNnzPerRowSparse =
414414
clContext.CreateClKernel calcNnzPerRowSparse
415415

416-
let kernelENPR = clContext.CreateClKernel expandNnzPerRow
416+
let kernelExpandNnzPerRow = clContext.CreateClKernel expandNnzPerRow
417417

418418
let getUniqueBitmap = ClArray.getUniqueBitmap clContext
419419

@@ -445,7 +445,7 @@ module COOMatrix =
445445
processor.Post(
446446
Msg.MsgSetArguments
447447
(fun () ->
448-
kernelCHSR.SetArguments
448+
kernelCalcHyperSparseRows.SetArguments
449449
ndRangeCHSR
450450
rowIndices
451451
bitmap
@@ -455,7 +455,7 @@ module COOMatrix =
455455
nnz)
456456
)
457457

458-
processor.Post(Msg.CreateRunMsg<_, _> kernelCHSR)
458+
processor.Post(Msg.CreateRunMsg<_, _> kernelCalcHyperSparseRows)
459459

460460
let nnzPerRowSparse = clContext.CreateClArray totalSum
461461

@@ -465,26 +465,30 @@ module COOMatrix =
465465
processor.Post(
466466
Msg.MsgSetArguments
467467
(fun () ->
468-
kernelCNPRS.SetArguments ndRangeCNPRSandENPR nonZeroRowsPointers nnzPerRowSparse totalSum)
468+
kernelCalcNnzPerRowSparse.SetArguments
469+
ndRangeCNPRSandENPR
470+
nonZeroRowsPointers
471+
nnzPerRowSparse
472+
totalSum)
469473
)
470474

471-
processor.Post(Msg.CreateRunMsg<_, _> kernelCNPRS)
475+
processor.Post(Msg.CreateRunMsg<_, _> kernelCalcNnzPerRowSparse)
472476

473477
let expandedNnzPerRow =
474478
clContext.CreateClArray(Array.zeroCreate rowCount)
475479

476480
processor.Post(
477481
Msg.MsgSetArguments
478482
(fun () ->
479-
kernelENPR.SetArguments
483+
kernelExpandNnzPerRow.SetArguments
480484
ndRangeCNPRSandENPR
481485
totalSum
482486
nnzPerRowSparse
483487
nonZeroRowsIndices
484488
expandedNnzPerRow)
485489
)
486490

487-
processor.Post(Msg.CreateRunMsg<_, _> kernelENPR)
491+
processor.Post(Msg.CreateRunMsg<_, _> kernelExpandNnzPerRow)
488492

489493
let rowPointers, _ =
490494
getRowPointers processor expandedNnzPerRow

tests/GraphBLAS-sharp.Tests/BackendCommonTests/COOMatrixEwiseAddTests.fs renamed to tests/GraphBLAS-sharp.Tests/BackendCommonTests/MatrixEwiseAddTests.fs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,28 +218,28 @@ let testCases =
218218

219219
| _ -> failwith "No other types of matrices tested yet."
220220

221-
[ testProperty "Correctness test on random int arrays COO"
221+
[ testProperty "Correctness test on random int matrices COO"
222222
<| (fun size -> makeTest context (PairOfSparseMatricesOfEqualSize.IntType()) size COO (+) <@ (+) @> 0)
223223

224-
testProperty "Correctness test on random bool arrays COO"
224+
testProperty "Correctness test on random bool matrices COO"
225225
<| (fun size -> makeTest context (PairOfSparseMatricesOfEqualSize.BoolType()) size COO (||) <@ (||) @> false)
226226

227-
testProperty "Correctness test on random float arrays COO"
227+
testProperty "Correctness test on random float matrices COO"
228228
<| (fun size -> makeTest context (PairOfSparseMatricesOfEqualSize.FloatType()) size COO (+) <@ (+) @> 0.0)
229229

230-
testProperty "Correctness test on random byte arrays COO"
230+
testProperty "Correctness test on random byte matrices COO"
231231
<| (fun size -> makeTest context (PairOfSparseMatricesOfEqualSize.ByteType()) size COO (+) <@ (+) @> 0uy)
232232

233-
testProperty "Correctness test on random int arrays CSR"
233+
testProperty "Correctness test on random int matrices CSR"
234234
<| (fun size -> makeTest context (PairOfSparseMatricesOfEqualSize.IntType()) size CSR (+) <@ (+) @> 0)
235235

236-
testProperty "Correctness test on random boll arrays CSR"
236+
testProperty "Correctness test on random bool matrices CSR"
237237
<| (fun size -> makeTest context (PairOfSparseMatricesOfEqualSize.BoolType()) size CSR (||) <@ (||) @> false)
238238

239-
testProperty "Correctness test on random float arrays CSR"
239+
testProperty "Correctness test on random float matrices CSR"
240240
<| (fun size -> makeTest context (PairOfSparseMatricesOfEqualSize.FloatType()) size CSR (+) <@ (+) @> 0.0)
241241

242-
testProperty "Correctness test on random byte arrays CSR"
242+
testProperty "Correctness test on random byte matrices CSR"
243243
<| (fun size -> makeTest context (PairOfSparseMatricesOfEqualSize.ByteType()) size CSR (+) <@ (+) @> 0uy) ]
244244

245245
let tests =

tests/GraphBLAS-sharp.Tests/GraphBLAS-sharp.Tests.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<Compile Include="BackendCommonTests/RemoveDuplicatesTests.fs" />
1717
<Compile Include="BackendCommonTests/CopyTests.fs" />
1818
<Compile Include="BackendCommonTests/ReplicateTests.fs" />
19-
<Compile Include="BackendCommonTests/COOMatrixEwiseAddTests.fs" />
19+
<Compile Include="BackendCommonTests/MatrixEwiseAddTests.fs" />
2020
<!--Compile Include="MatrixOperationsTests/GetTuplesTests.fs" /-->
2121
<!--Compile Include="MatrixOperationsTests/MxmTests.fs" /-->
2222
<!--Compile Include="MatrixOperationsTests/MxvTests.fs" /-->

0 commit comments

Comments
 (0)