@@ -115,20 +115,12 @@ let testFixturesMapAdd case =
115115 let q = case.TestContext.Queue
116116 q.Error.Add( fun e -> failwithf " %A " e)
117117
118- let addFloat64Q =
119- ArithmeticOperations.mkUnaryOp 0.0 <@ fun x -> x + 10.0 @>
120-
121- let addFloat32Q =
122- ArithmeticOperations.mkUnaryOp 0.0 f <@ fun x -> x + 10.0 f @>
123-
124- let addByte =
125- ArithmeticOperations.mkUnaryOp 0 uy <@ fun x -> x + 10 uy @>
126-
127118 if Utils.isFloat64Available context.ClDevice then
128- createTestMap case 0.0 ((+) 10.0 ) Utils.floatIsEqual addFloat64Q Matrix.map
119+ createTestMap case 0.0 ((+) 10.0 ) Utils.floatIsEqual ( ArithmeticOperations.addLeftConst 0.0 10.0 ) Matrix.map
120+
121+ createTestMap case 0.0 f ((+) 10.0 f) Utils.float32IsEqual ( ArithmeticOperations.addLeftConst 0.0 f 10.0 f) Matrix.map
129122
130- createTestMap case 0.0 f ((+) 10.0 f) Utils.float32IsEqual addFloat32Q Matrix.map
131- createTestMap case 0 uy ((+) 10 uy) (=) addByte Matrix.map ]
123+ createTestMap case 0 uy ((+) 10 uy) (=) ( ArithmeticOperations.addLeftConst 0 uy 10 uy) Matrix.map ]
132124
133125let addTests =
134126 operationGPUTests " Backend.Matrix.map add tests" testFixturesMapAdd
@@ -138,20 +130,12 @@ let testFixturesMapMul case =
138130 let q = case.TestContext.Queue
139131 q.Error.Add( fun e -> failwithf " %A " e)
140132
141- let mulFloat64Q =
142- ArithmeticOperations.mkUnaryOp 0.0 <@ fun x -> x * 10.0 @>
143-
144- let mulFloat32Q =
145- ArithmeticOperations.mkUnaryOp 0.0 f <@ fun x -> x * 10.0 f @>
146-
147- let mulByte =
148- ArithmeticOperations.mkUnaryOp 0 uy <@ fun x -> x * 10 uy @>
149-
150133 if Utils.isFloat64Available context.ClDevice then
151- createTestMap case 0.0 ((*) 10.0 ) Utils.floatIsEqual mulFloat64Q Matrix.map
134+ createTestMap case 0.0 ((*) 10.0 ) Utils.floatIsEqual ( ArithmeticOperations.mulLeftConst 0.0 10.0 ) Matrix.map
135+
136+ createTestMap case 0.0 f ((*) 10.0 f) Utils.float32IsEqual ( ArithmeticOperations.mulLeftConst 0.0 f 10.0 f) Matrix.map
152137
153- createTestMap case 0.0 f ((*) 10.0 f) Utils.float32IsEqual mulFloat32Q Matrix.map
154- createTestMap case 0 uy ((*) 10 uy) (=) mulByte Matrix.map ]
138+ createTestMap case 0 uy ((*) 10 uy) (=) ( ArithmeticOperations.mulLeftConst 0 uy 10 uy) Matrix.map ]
155139
156140let mulTests =
157141 operationGPUTests " Backend.Matrix.map mul tests" testFixturesMapMul
0 commit comments