@@ -8,7 +8,7 @@ open GraphBLAS.FSharp.Tests.Utils
88open Context
99open Brahma.FSharp
1010open GraphBLAS.FSharp .Backend .Objects
11- open GraphBLAS.FSharp .Backend .Vector . Dense
11+ open GraphBLAS.FSharp .Backend .Quotes
1212
1313let logger =
1414 Log.create " Vector.containsNonZero.Tests"
@@ -38,12 +38,6 @@ let correctnessGenericTest<'a when 'a: struct and 'a: equality> isZero containsN
3838 $" The results should be the same, vector : {vector}"
3939 |> Expect.equal result ( Array.exists ( not << isZero) array)
4040
41- let predicate < 'a when 'a : struct > =
42- <@ fun ( item : 'a option ) ->
43- match item with
44- | Some _ -> true
45- | _ -> false @>
46-
4741let testFixtures =
4842 let config = defaultConfig
4943
@@ -52,42 +46,42 @@ let testFixtures =
5246 let getCorrectnessTestName datatype =
5347 sprintf " Correctness on %s , %A " datatype Dense
5448
55- [ let containsNonZeroInt = ClArray.exists context wgSize predicate
49+ [ let containsNonZeroInt = ClArray.exists context wgSize Predicates.containsNonZero
5650
5751 correctnessGenericTest< int> ((=) 0 ) containsNonZeroInt
5852 |> testPropertyWithConfig config ( getCorrectnessTestName " int" )
5953
60- let containsNonZeroByte = ClArray.exists context wgSize predicate
54+ let containsNonZeroByte = ClArray.exists context wgSize Predicates.containsNonZero
6155
6256 correctnessGenericTest< byte> ((=) 0 uy) containsNonZeroByte
6357 |> testPropertyWithConfig config ( getCorrectnessTestName " byte" )
6458
65- let containsNonZeroFloat = ClArray.exists context wgSize predicate
59+ let containsNonZeroFloat = ClArray.exists context wgSize Predicates.containsNonZero
6660
6761 correctnessGenericTest< float> ((=) 0.0 ) containsNonZeroFloat
6862 |> testPropertyWithConfig config ( getCorrectnessTestName " float" )
6963
70- let containsNonZeroBool = ClArray.exists context wgSize predicate
64+ let containsNonZeroBool = ClArray.exists context wgSize Predicates.containsNonZero
7165
7266 correctnessGenericTest< bool> ((=) false ) containsNonZeroBool
7367 |> testPropertyWithConfig config ( getCorrectnessTestName " bool" )
7468
75- let containsNonZeroInt = ClArray.exists context wgSize predicate
69+ let containsNonZeroInt = ClArray.exists context wgSize Predicates.containsNonZero
7670
7771 correctnessGenericTest< int> ((=) 0 ) containsNonZeroInt ( Array.create 1000 0 )
7872 |> testPropertyWithConfig config ( getCorrectnessTestName " int zeros" )
7973
80- let containsNonZeroByte = ClArray.exists context wgSize predicate
74+ let containsNonZeroByte = ClArray.exists context wgSize Predicates.containsNonZero
8175
8276 correctnessGenericTest< byte> ((=) 0 uy) containsNonZeroByte ( Array.create 1000 0 uy)
8377 |> testPropertyWithConfig config ( getCorrectnessTestName " byte zeros" )
8478
85- let containsNonZeroFloat = ClArray.exists context wgSize predicate
79+ let containsNonZeroFloat = ClArray.exists context wgSize Predicates.containsNonZero
8680
8781 correctnessGenericTest< float> ((=) 0.0 ) containsNonZeroFloat ( Array.create 1000 0.0 )
8882 |> testPropertyWithConfig config ( getCorrectnessTestName " float zeros" )
8983
90- let containsNonZeroBool = ClArray.exists context wgSize predicate
84+ let containsNonZeroBool = ClArray.exists context wgSize Predicates.containsNonZero
9185
9286 correctnessGenericTest< bool> ((=) false ) containsNonZeroBool ( Array.create 1000 false )
9387 |> testPropertyWithConfig config ( getCorrectnessTestName " bool zeros" ) ]
0 commit comments