@@ -14,6 +14,7 @@ open GraphBLAS.FSharp.Objects
1414open GraphBLAS.FSharp .Backend .Objects
1515open GraphBLAS.FSharp .Tests .Backend
1616open GraphBLAS.FSharp .Objects .MatrixExtensions
17+ open GraphBLAS.FSharp .Backend .Objects .ClContext
1718
1819let logger = Log.create " Elementwise.Tests"
1920
@@ -102,36 +103,36 @@ let testFixturesEWiseAdd case =
102103 q.Error.Add( fun e -> failwithf " %A " e)
103104
104105 let boolAdd =
105- Matrix.elementwise context ArithmeticOperations.boolSum wgSize
106+ Matrix.elementwise context ArithmeticOperations.boolSum wgSize CPUInterop
106107
107- let boolToCOO = Matrix.toCOO context wgSize
108+ let boolToCOO = Matrix.toCOO context wgSize CPUInterop
108109
109110 case
110111 |> correctnessGenericTest false (||) boolAdd boolToCOO (=) q
111112 |> testPropertyWithConfig config ( getCorrectnessTestName " bool" )
112113
113114 let intAdd =
114- Matrix.elementwise context ArithmeticOperations.intSum wgSize
115+ Matrix.elementwise context ArithmeticOperations.intSum wgSize CPUInterop
115116
116- let intToCOO = Matrix.toCOO context wgSize
117+ let intToCOO = Matrix.toCOO context wgSize CPUInterop
117118
118119 case
119120 |> correctnessGenericTest 0 (+) intAdd intToCOO (=) q
120121 |> testPropertyWithConfig config ( getCorrectnessTestName " int" )
121122
122123 let floatAdd =
123- Matrix.elementwise context ArithmeticOperations.floatSum wgSize
124+ Matrix.elementwise context ArithmeticOperations.floatSum wgSize CPUInterop
124125
125- let floatToCOO = Matrix.toCOO context wgSize
126+ let floatToCOO = Matrix.toCOO context wgSize CPUInterop
126127
127128 case
128129 |> correctnessGenericTest 0.0 (+) floatAdd floatToCOO ( fun x y -> abs ( x - y) < Accuracy.medium.absolute) q
129130 |> testPropertyWithConfig config ( getCorrectnessTestName " float" )
130131
131132 let byteAdd =
132- Matrix.elementwise context ArithmeticOperations.byteSum wgSize
133+ Matrix.elementwise context ArithmeticOperations.byteSum wgSize CPUInterop
133134
134- let byteToCOO = Matrix.toCOO context wgSize
135+ let byteToCOO = Matrix.toCOO context wgSize CPUInterop
135136
136137 case
137138 |> correctnessGenericTest 0 uy (+) byteAdd byteToCOO (=) q
@@ -152,36 +153,36 @@ let testFixturesEWiseAddAtLeastOne case =
152153 q.Error.Add( fun e -> failwithf " %A " e)
153154
154155 let boolAdd =
155- Matrix.elementwiseAtLeastOne context ArithmeticOperations.boolSumAtLeastOne wgSize
156+ Matrix.elementwiseAtLeastOne context ArithmeticOperations.boolSumAtLeastOne wgSize CPUInterop
156157
157- let boolToCOO = Matrix.toCOO context wgSize
158+ let boolToCOO = Matrix.toCOO context wgSize CPUInterop
158159
159160 case
160161 |> correctnessGenericTest false (||) boolAdd boolToCOO (=) q
161162 |> testPropertyWithConfig config ( getCorrectnessTestName " bool" )
162163
163164 let intAdd =
164- Matrix.elementwiseAtLeastOne context ArithmeticOperations.intSumAtLeastOne wgSize
165+ Matrix.elementwiseAtLeastOne context ArithmeticOperations.intSumAtLeastOne wgSize CPUInterop
165166
166- let intToCOO = Matrix.toCOO context wgSize
167+ let intToCOO = Matrix.toCOO context wgSize CPUInterop
167168
168169 case
169170 |> correctnessGenericTest 0 (+) intAdd intToCOO (=) q
170171 |> testPropertyWithConfig config ( getCorrectnessTestName " int" )
171172
172173 let floatAdd =
173- Matrix.elementwiseAtLeastOne context ArithmeticOperations.floatSumAtLeastOne wgSize
174+ Matrix.elementwiseAtLeastOne context ArithmeticOperations.floatSumAtLeastOne wgSize CPUInterop
174175
175- let floatToCOO = Matrix.toCOO context wgSize
176+ let floatToCOO = Matrix.toCOO context wgSize CPUInterop
176177
177178 case
178179 |> correctnessGenericTest 0.0 (+) floatAdd floatToCOO ( fun x y -> abs ( x - y) < Accuracy.medium.absolute) q
179180 |> testPropertyWithConfig config ( getCorrectnessTestName " float" )
180181
181182 let byteAdd =
182- Matrix.elementwiseAtLeastOne context ArithmeticOperations.byteSumAtLeastOne wgSize
183+ Matrix.elementwiseAtLeastOne context ArithmeticOperations.byteSumAtLeastOne wgSize CPUInterop
183184
184- let byteToCOO = Matrix.toCOO context wgSize
185+ let byteToCOO = Matrix.toCOO context wgSize CPUInterop
185186
186187 case
187188 |> correctnessGenericTest 0 uy (+) byteAdd byteToCOO (=) q
@@ -202,36 +203,36 @@ let testFixturesEWiseAddAtLeastOneToCOO case =
202203 q.Error.Add( fun e -> failwithf " %A " e)
203204
204205 let boolAdd =
205- Matrix.elementwiseAtLeastOneToCOO context ArithmeticOperations.boolSumAtLeastOne wgSize
206+ Matrix.elementwiseAtLeastOneToCOO context ArithmeticOperations.boolSumAtLeastOne wgSize CPUInterop
206207
207- let boolToCOO = Matrix.toCOO context wgSize
208+ let boolToCOO = Matrix.toCOO context wgSize CPUInterop
208209
209210 case
210211 |> correctnessGenericTest false (||) boolAdd boolToCOO (=) q
211212 |> testPropertyWithConfig config ( getCorrectnessTestName " bool" )
212213
213214 let intAdd =
214- Matrix.elementwiseAtLeastOneToCOO context ArithmeticOperations.intSumAtLeastOne wgSize
215+ Matrix.elementwiseAtLeastOneToCOO context ArithmeticOperations.intSumAtLeastOne wgSize CPUInterop
215216
216- let intToCOO = Matrix.toCOO context wgSize
217+ let intToCOO = Matrix.toCOO context wgSize CPUInterop
217218
218219 case
219220 |> correctnessGenericTest 0 (+) intAdd intToCOO (=) q
220221 |> testPropertyWithConfig config ( getCorrectnessTestName " int" )
221222
222223 let floatAdd =
223- Matrix.elementwiseAtLeastOneToCOO context ArithmeticOperations.floatSumAtLeastOne wgSize
224+ Matrix.elementwiseAtLeastOneToCOO context ArithmeticOperations.floatSumAtLeastOne wgSize CPUInterop
224225
225- let floatToCOO = Matrix.toCOO context wgSize
226+ let floatToCOO = Matrix.toCOO context wgSize CPUInterop
226227
227228 case
228229 |> correctnessGenericTest 0.0 (+) floatAdd floatToCOO ( fun x y -> abs ( x - y) < Accuracy.medium.absolute) q
229230 |> testPropertyWithConfig config ( getCorrectnessTestName " float" )
230231
231232 let byteAdd =
232- Matrix.elementwiseAtLeastOneToCOO context ArithmeticOperations.byteSumAtLeastOne wgSize
233+ Matrix.elementwiseAtLeastOneToCOO context ArithmeticOperations.byteSumAtLeastOne wgSize CPUInterop
233234
234- let byteToCOO = Matrix.toCOO context wgSize
235+ let byteToCOO = Matrix.toCOO context wgSize CPUInterop
235236
236237 case
237238 |> correctnessGenericTest 0 uy (+) byteAdd byteToCOO (=) q
@@ -252,36 +253,36 @@ let testFixturesEWiseMulAtLeastOne case =
252253 q.Error.Add( fun e -> failwithf " %A " e)
253254
254255 let boolMul =
255- Matrix.elementwiseAtLeastOne context ArithmeticOperations.boolMulAtLeastOne wgSize
256+ Matrix.elementwiseAtLeastOne context ArithmeticOperations.boolMulAtLeastOne wgSize CPUInterop
256257
257- let boolToCOO = Matrix.toCOO context wgSize
258+ let boolToCOO = Matrix.toCOO context wgSize CPUInterop
258259
259260 case
260261 |> correctnessGenericTest false (&&) boolMul boolToCOO (=) q
261262 |> testPropertyWithConfig config ( getCorrectnessTestName " bool" )
262263
263264 let intAdd =
264- Matrix.elementwiseAtLeastOne context ArithmeticOperations.intMulAtLeastOne wgSize
265+ Matrix.elementwiseAtLeastOne context ArithmeticOperations.intMulAtLeastOne wgSize CPUInterop
265266
266- let intToCOO = Matrix.toCOO context wgSize
267+ let intToCOO = Matrix.toCOO context wgSize CPUInterop
267268
268269 case
269270 |> correctnessGenericTest 0 (*) intAdd intToCOO (=) q
270271 |> testPropertyWithConfig config ( getCorrectnessTestName " int" )
271272
272273 let floatAdd =
273- Matrix.elementwiseAtLeastOne context ArithmeticOperations.floatMulAtLeastOne wgSize
274+ Matrix.elementwiseAtLeastOne context ArithmeticOperations.floatMulAtLeastOne wgSize CPUInterop
274275
275- let floatToCOO = Matrix.toCOO context wgSize
276+ let floatToCOO = Matrix.toCOO context wgSize CPUInterop
276277
277278 case
278279 |> correctnessGenericTest 0.0 (*) floatAdd floatToCOO ( fun x y -> abs ( x - y) < Accuracy.medium.absolute) q
279280 |> testPropertyWithConfig config ( getCorrectnessTestName " float" )
280281
281282 let byteAdd =
282- Matrix.elementwiseAtLeastOne context ArithmeticOperations.byteMulAtLeastOne wgSize
283+ Matrix.elementwiseAtLeastOne context ArithmeticOperations.byteMulAtLeastOne wgSize CPUInterop
283284
284- let byteToCOO = Matrix.toCOO context wgSize
285+ let byteToCOO = Matrix.toCOO context wgSize CPUInterop
285286
286287 case
287288 |> correctnessGenericTest 0 uy (*) byteAdd byteToCOO (=) q
0 commit comments