@@ -20,9 +20,12 @@ let context = Context.defaultContext.ClContext
2020
2121let processor = Context.defaultContext.Queue
2222
23+ processor.Error.Add( fun e -> failwithf " %A " e)
24+
2325let config =
2426 { Utils.defaultConfig with
25- arbitrary = [ typeof< Generators.VectorXMatrix> ] }
27+ arbitrary = [ typeof< Generators.VectorXMatrix>
28+ typeof< Generators.PairOfMatricesOfCompatibleSize> ] }
2629
2730let makeTest isZero testFun ( leftArray : 'a [], rightArray : 'a [,]) =
2831
@@ -228,6 +231,9 @@ let makeGeneralTest zero isEqual opMul opAdd testFun (leftArray: 'a [,], rightAr
228231 let ( clMatrixActual : ClMatrix < _ >) =
229232 testFun processor HostInterop clLeftMatrix clRightMatrix
230233
234+ clLeftMatrix.Dispose processor
235+ clRightMatrix.Dispose processor
236+
231237 let matrixActual = clMatrixActual.ToHostAndDispose processor
232238
233239 match matrixActual with
@@ -238,29 +244,27 @@ let makeGeneralTest zero isEqual opMul opAdd testFun (leftArray: 'a [,], rightAr
238244 | _ -> failwith " Matrix format are not matching"
239245
240246let createGeneralTest ( zero : 'a ) isEqual ( opAddQ , opAdd ) ( opMulQ , opMul ) testFun =
241-
242- let testFun =
243- testFun context Utils.defaultWorkGroupSize opAddQ opMulQ
244-
245- makeGeneralTest zero isEqual opMul opAdd testFun
246- |> testPropertyWithConfig config $" test on %A {typeof<'a>}"
247+ testFun context Utils.defaultWorkGroupSize opAddQ opMulQ
248+ |> makeGeneralTest zero isEqual opMul opAdd
249+ |> testPropertyWithConfig { config with endSize = 10 } $" test on %A {typeof<'a>}"
247250
248251let generalTests =
249252 [ createGeneralTest 0 (=) ArithmeticOperations.intAdd ArithmeticOperations.intMul Matrix.SpGeMM.expand
250253
251- if Utils.isFloat64Available context.ClDevice then
252- createGeneralTest
253- 0.0
254- Utils.floatIsEqual
255- ArithmeticOperations.floatAdd
256- ArithmeticOperations.floatMul
257- Matrix.SpGeMM.expand
258-
259- createGeneralTest
260- 0.0 f
261- Utils.float32IsEqual
262- ArithmeticOperations.float32Add
263- ArithmeticOperations.float32Mul
264- Matrix.SpGeMM.expand
265- createGeneralTest false (=) ArithmeticOperations.boolAdd ArithmeticOperations.boolMul Matrix.SpGeMM.expand ]
254+ // if Utils.isFloat64Available context.ClDevice then
255+ // createGeneralTest
256+ // 0.0
257+ // Utils.floatIsEqual
258+ // ArithmeticOperations.floatAdd
259+ // ArithmeticOperations.floatMul
260+ // Matrix.SpGeMM.expand
261+ //
262+ // createGeneralTest
263+ // 0.0f
264+ // Utils.float32IsEqual
265+ // ArithmeticOperations.float32Add
266+ // ArithmeticOperations.float32Mul
267+ // Matrix.SpGeMM.expand
268+ // createGeneralTest false (=) ArithmeticOperations.boolAdd ArithmeticOperations.boolMul Matrix.SpGeMM.expand ]
269+ ]
266270 |> testList " general"
0 commit comments