@@ -264,10 +264,10 @@ module Matrix =
264264 fun ( processor : MailboxProcessor < _ >) allocationMode matrix ->
265265 match matrix with
266266 | ClMatrix.COO m -> mapCOO processor allocationMode m |> ClMatrix.COO
267- | ClMatrix.CSR m -> mapCSR processor allocationMode m |> ClMatrix.CSR
267+ | ClMatrix.CSR m -> mapCSR processor allocationMode m |> ClMatrix.COO
268268 | ClMatrix.CSC m ->
269- ( mapCSR processor allocationMode m.ToCSR) .ToCSC
270- |> ClMatrix.CSC
269+ ( mapCSR processor allocationMode m.ToCSR)
270+ |> ClMatrix.COO
271271 | _ -> failwith " Not yet implemented"
272272
273273 let map2 ( opAdd : Expr < 'a option -> 'b option -> 'c option >) ( clContext : ClContext ) workGroupSize =
@@ -292,47 +292,22 @@ module Matrix =
292292 | _ -> failwith " Matrix formats are not matching"
293293
294294 let map2AtLeastOne ( opAdd : Expr < AtLeastOne < 'a , 'b > -> 'c option >) ( clContext : ClContext ) workGroupSize =
295- let COOElementwise =
295+ let COOMap2 =
296296 COO.Matrix.map2AtLeastOne clContext opAdd workGroupSize
297297
298- let CSRElementwise =
298+ let CSRMap2 =
299299 CSR.Matrix.map2AtLeastOne clContext opAdd workGroupSize
300300
301301 fun ( processor : MailboxProcessor < _ >) allocationMode matrix1 matrix2 ->
302302 match matrix1, matrix2 with
303303 | ClMatrix.COO m1, ClMatrix.COO m2 ->
304- COOElementwise processor allocationMode m1 m2
305- |> ClMatrix.COO
306- | ClMatrix.CSR m1, ClMatrix.CSR m2 ->
307- CSRElementwise processor allocationMode m1 m2
308- |> ClMatrix.CSR
309- | ClMatrix.CSC m1, ClMatrix.CSC m2 ->
310- ( CSRElementwise processor allocationMode m1.ToCSR m2.ToCSR)
311- .ToCSC
312- |> ClMatrix.CSC
313- | _ -> failwith " Matrix formats are not matching"
314-
315- let map2AtLeastOneToCOO ( opAdd : Expr < AtLeastOne < 'a , 'b > -> 'c option >) ( clContext : ClContext ) workGroupSize =
316- let COOElementwise =
317- COO.Matrix.map2AtLeastOne clContext opAdd workGroupSize
318-
319- let CSRElementwise =
320- CSR.Matrix.map2AtLeastOneToCOO clContext opAdd workGroupSize
321-
322- let transposeCOOInPlace =
323- COO.Matrix.transposeInPlace clContext workGroupSize
324-
325- fun ( processor : MailboxProcessor < _ >) allocationMode matrix1 matrix2 ->
326- match matrix1, matrix2 with
327- | ClMatrix.COO m1, ClMatrix.COO m2 ->
328- COOElementwise processor allocationMode m1 m2
304+ COOMap2 processor allocationMode m1 m2
329305 |> ClMatrix.COO
330306 | ClMatrix.CSR m1, ClMatrix.CSR m2 ->
331- CSRElementwise processor allocationMode m1 m2
307+ CSRMap2 processor allocationMode m1 m2
332308 |> ClMatrix.COO
333309 | ClMatrix.CSC m1, ClMatrix.CSC m2 ->
334- CSRElementwise processor allocationMode m1.ToCSR m2.ToCSR
335- |> transposeCOOInPlace processor
310+ ( CSRMap2 processor allocationMode m1.ToCSR m2.ToCSR)
336311 |> ClMatrix.COO
337312 | _ -> failwith " Matrix formats are not matching"
338313
0 commit comments