11
2- open System
3- open GraphBLAS.FSharp
4-
52open Brahma.OpenCL
63open Brahma.FSharp .OpenCL .Core
74open Brahma.FSharp .OpenCL .Extensions
8- open GlobalContext
9- open Helpers
105open FSharp.Quotations .Evaluator
116open Brahma.FSharp .OpenCL .WorkflowBuilder .Basic
127open Brahma.FSharp .OpenCL .WorkflowBuilder .Evaluation
8+ open GraphBLAS.FSharp
139open GraphBLAS.FSharp .Predefined
1410
1511[<EntryPoint>]
1612let main argv =
17- let fstMatrix = COOMatrix( 100 , 100 , [| 0 ; 1 ; 2 ; 5 |], [| 4 ; 1 ; 2 ; 5 |], [| 1.0 ; 2.0 ; 3.0 ; 6.0 |])
18- let sndMatrix = COOMatrix( 100 , 100 , [| 0 ; 1 ; 2 ; 5 |], [| 4 ; 2 ; 3 ; 5 |], [|- 0.8 ; 2.0 ; 3.0 ; 6.0 |])
13+ let fstMatrix = COOMatrix( 100 , 100 , [| 0 ; 1 ; 1 ; 2 ; 5 |], [| 4 ; 1 ; 50 ; 2 ; 5 |], [| 1.0 ; 2.0 ; 76 .0; 3.0 ; 6.0 |])
14+ let sndMatrix = COOMatrix( 100 , 100 , [| 0 ; 1 ; 1 ; 2 ; 5 |], [| 4 ; 2 ; 50 ; 3 ; 5 |], [|- 0.8 ; 2.0 ;- 76 .0; 3.0 ; 6.0 |])
1915 let workflow =
2016 opencl {
2117 let! result = fstMatrix.EWiseAdd sndMatrix None FloatSemiring.addMult
@@ -25,8 +21,13 @@ let main argv =
2521 let res : COOMatrix < float > = downcast oclContext.RunSync workflow
2622
2723 let indices = res.Indices
24+ // let rows = res.Rows
25+ // let columns = res.Columns
2826 let values = res.Values
2927
28+ // for i in 0 .. rows.Length - 1 do
29+ // printfn "(%i, %i, %A)" rows.[i] columns.[i] values.[i]
30+
3031 for i in 0 .. indices.Length - 1 do
3132 let index = indices.[ i]
3233 let a = int ( index >>> 32 )
0 commit comments