@@ -100,14 +100,15 @@ let addTestFixtures case =
100100 |> correctnessGenericTest (=) 0 (+) intAddFun intToDense
101101 |> testPropertyWithConfig config ( getCorrectnessTestName case " int" " int" " int" )
102102
103- let floatAddFun =
104- Vector.map2 context ArithmeticOperations.floatSum wgSize
103+ if Utils.isFloat64Available context.ClDevice then
104+ let floatAddFun =
105+ Vector.map2 context ArithmeticOperations.floatSum wgSize
105106
106- let floatToDense = Vector.toDense context wgSize
107+ let floatToDense = Vector.toDense context wgSize
107108
108- case
109- |> correctnessGenericTest Utils.floatIsEqual 0.0 (+) floatAddFun floatToDense
110- |> testPropertyWithConfig config ( getCorrectnessTestName case " float" " float" " float" )
109+ case
110+ |> correctnessGenericTest Utils.floatIsEqual 0.0 (+) floatAddFun floatToDense
111+ |> testPropertyWithConfig config ( getCorrectnessTestName case " float" " float" " float" )
111112
112113 let boolAddFun =
113114 Vector.map2 context ArithmeticOperations.boolSum wgSize
@@ -144,17 +145,18 @@ let mulTestFixtures case =
144145 |> correctnessGenericTest (=) 0 (*) intMulFun intToDense
145146 |> testPropertyWithConfig config ( getCorrectnessTestName case " int" " int" " int" )
146147
147- let floatMulFun =
148- Vector.map2 context ArithmeticOperations.floatMul wgSize
148+ if Utils.isFloat64Available context.ClDevice then
149+ let floatMulFun =
150+ Vector.map2 context ArithmeticOperations.floatMul wgSize
149151
150- let floatIsEqual =
151- fun x y -> abs ( x - y) < Accuracy.medium.absolute || x = y
152+ let floatIsEqual =
153+ fun x y -> abs ( x - y) < Accuracy.medium.absolute || x = y
152154
153- let floatToDense = Vector.toDense context wgSize
155+ let floatToDense = Vector.toDense context wgSize
154156
155- case
156- |> correctnessGenericTest floatIsEqual 0.0 (*) floatMulFun floatToDense
157- |> testPropertyWithConfig config ( getCorrectnessTestName case " float" " float" " float" )
157+ case
158+ |> correctnessGenericTest floatIsEqual 0.0 (*) floatMulFun floatToDense
159+ |> testPropertyWithConfig config ( getCorrectnessTestName case " float" " float" " float" )
158160
159161 let boolMulFun =
160162 Vector.map2 context ArithmeticOperations.boolMul wgSize
@@ -195,14 +197,15 @@ let addAtLeastOneTestFixtures case =
195197 |> correctnessGenericTest (=) 0 (+) intAddFun toCoo
196198 |> testPropertyWithConfig config ( getCorrectnessTestName " int" " int" " int" )
197199
198- let floatToCoo = Vector.toSparse context wgSize
200+ if Utils.isFloat64Available context.ClDevice then
201+ let floatToCoo = Vector.toSparse context wgSize
199202
200- let floatAddFun =
201- Vector.map2AtLeastOne context ArithmeticOperations.floatSumAtLeastOne wgSize
203+ let floatAddFun =
204+ Vector.map2AtLeastOne context ArithmeticOperations.floatSumAtLeastOne wgSize
202205
203- case
204- |> correctnessGenericTest Utils.floatIsEqual 0.0 (+) floatAddFun floatToCoo
205- |> testPropertyWithConfig config ( getCorrectnessTestName " float" " float" " float" )
206+ case
207+ |> correctnessGenericTest Utils.floatIsEqual 0.0 (+) floatAddFun floatToCoo
208+ |> testPropertyWithConfig config ( getCorrectnessTestName " float" " float" " float" )
206209
207210 let boolToCoo = Vector.toSparse context wgSize
208211
@@ -242,17 +245,18 @@ let mulAtLeastOneTestFixtures case =
242245 |> correctnessGenericTest (=) 0 (*) intMulFun toCoo
243246 |> testPropertyWithConfig config ( getCorrectnessTestName " int" " int" " int" )
244247
245- let floatToCoo = Vector.toSparse context wgSize
248+ if Utils.isFloat64Available context.ClDevice then
249+ let floatToCoo = Vector.toSparse context wgSize
246250
247- let floatMulFun =
248- Vector.map2AtLeastOne context ArithmeticOperations.floatMulAtLeastOne wgSize
251+ let floatMulFun =
252+ Vector.map2AtLeastOne context ArithmeticOperations.floatMulAtLeastOne wgSize
249253
250- let fIsEqual =
251- fun x y -> abs ( x - y) < Accuracy.medium.absolute || x = y
254+ let fIsEqual =
255+ fun x y -> abs ( x - y) < Accuracy.medium.absolute || x = y
252256
253- case
254- |> correctnessGenericTest fIsEqual 0.0 (*) floatMulFun floatToCoo
255- |> testPropertyWithConfig config ( getCorrectnessTestName " float" " float" " float" )
257+ case
258+ |> correctnessGenericTest fIsEqual 0.0 (*) floatMulFun floatToCoo
259+ |> testPropertyWithConfig config ( getCorrectnessTestName " float" " float" " float" )
256260
257261 let boolToCoo = Vector.toSparse context wgSize
258262
0 commit comments