Skip to content

Commit ec970fe

Browse files
committed
refactor: Predicates.isSome
1 parent 7316c58 commit ec970fe

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/GraphBLAS-sharp.Backend/Algorithms/BFS.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module BFS =
3333
DenseVector.standardFillSubVectorTo<int, int> clContext workGroupSize
3434

3535
let containsNonZero =
36-
ClArray.exists clContext workGroupSize Predicates.containsNonZero
36+
ClArray.exists clContext workGroupSize Predicates.isSome
3737

3838
fun (queue: MailboxProcessor<Msg>) (matrix: ClMatrix.CSR<'a>) (source: int) ->
3939
let vertexCount = matrix.RowCount

src/GraphBLAS-sharp.Backend/Quotes/Predicates.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace GraphBLAS.FSharp.Backend.Quotes
22

33
module Predicates =
4-
let containsNonZero<'a> =
4+
let isSome<'a> =
55
<@ fun (item: 'a option) ->
66
match item with
77
| Some _ -> true

tests/GraphBLAS-sharp.Tests/Common/Exists.fs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,49 +47,49 @@ let testFixtures =
4747
sprintf "Correctness on %s, %A" datatype Dense
4848

4949
[ let containsNonZeroInt =
50-
ClArray.exists context wgSize Predicates.containsNonZero
50+
ClArray.exists context wgSize Predicates.isSome
5151

5252
correctnessGenericTest<int> ((=) 0) containsNonZeroInt
5353
|> testPropertyWithConfig config (getCorrectnessTestName "int")
5454

5555
let containsNonZeroByte =
56-
ClArray.exists context wgSize Predicates.containsNonZero
56+
ClArray.exists context wgSize Predicates.isSome
5757

5858
correctnessGenericTest<byte> ((=) 0uy) containsNonZeroByte
5959
|> testPropertyWithConfig config (getCorrectnessTestName "byte")
6060

6161
let containsNonZeroFloat =
62-
ClArray.exists context wgSize Predicates.containsNonZero
62+
ClArray.exists context wgSize Predicates.isSome
6363

6464
correctnessGenericTest<float> ((=) 0.0) containsNonZeroFloat
6565
|> testPropertyWithConfig config (getCorrectnessTestName "float")
6666

6767
let containsNonZeroBool =
68-
ClArray.exists context wgSize Predicates.containsNonZero
68+
ClArray.exists context wgSize Predicates.isSome
6969

7070
correctnessGenericTest<bool> ((=) false) containsNonZeroBool
7171
|> testPropertyWithConfig config (getCorrectnessTestName "bool")
7272

7373
let containsNonZeroInt =
74-
ClArray.exists context wgSize Predicates.containsNonZero
74+
ClArray.exists context wgSize Predicates.isSome
7575

7676
correctnessGenericTest<int> ((=) 0) containsNonZeroInt (Array.create 1000 0)
7777
|> testPropertyWithConfig config (getCorrectnessTestName "int zeros")
7878

7979
let containsNonZeroByte =
80-
ClArray.exists context wgSize Predicates.containsNonZero
80+
ClArray.exists context wgSize Predicates.isSome
8181

8282
correctnessGenericTest<byte> ((=) 0uy) containsNonZeroByte (Array.create 1000 0uy)
8383
|> testPropertyWithConfig config (getCorrectnessTestName "byte zeros")
8484

8585
let containsNonZeroFloat =
86-
ClArray.exists context wgSize Predicates.containsNonZero
86+
ClArray.exists context wgSize Predicates.isSome
8787

8888
correctnessGenericTest<float> ((=) 0.0) containsNonZeroFloat (Array.create 1000 0.0)
8989
|> testPropertyWithConfig config (getCorrectnessTestName "float zeros")
9090

9191
let containsNonZeroBool =
92-
ClArray.exists context wgSize Predicates.containsNonZero
92+
ClArray.exists context wgSize Predicates.isSome
9393

9494
correctnessGenericTest<bool> ((=) false) containsNonZeroBool (Array.create 1000 false)
9595
|> testPropertyWithConfig config (getCorrectnessTestName "bool zeros") ]

0 commit comments

Comments
 (0)