File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed
src/GraphBLAS-sharp.Backend Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -489,5 +489,3 @@ module ClArray =
489489 processor.Post( Msg.MsgSetArguments( fun () -> kernel.KernelFunc ndRange firstPosition ( firstPosition + count) value targetArray))
490490
491491 processor.Post( Msg.CreateRunMsg<_, _>( kernel))
492-
493- ()
Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ module Map =
2222 | Some _ -> 1
2323 | None -> 0 @>
2424
25+ let choose2Bitmap < 'a , 'b , 'c > ( map : Expr < 'a -> 'b -> 'c option >) =
26+ <@ fun ( leftItem : 'a ) ( rightItem : 'b ) ->
27+ match (% map) leftItem rightItem with
28+ | Some _ -> 1
29+ | None -> 0 @>
30+
2531 let fst () = <@ fun fst _ -> fst @>
2632
2733 let snd () = <@ fun _ snd -> snd @>
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ open GraphBLAS.FSharp.Backend.Objects.ClContext
88open GraphBLAS.FSharp .Backend .Quotes
99open FSharp.Quotations
1010open GraphBLAS.FSharp .Backend .Objects .ArraysExtensions
11+ open GraphBLAS.FSharp .Backend .Common
1112
1213module internal Map =
1314 let preparePositions < 'a , 'b > ( clContext : ClContext ) workGroupSize opAdd =
@@ -97,3 +98,16 @@ module internal Map =
9798 Size = vector.Size }
9899
99100 module AtLeastOne =
101+ let run ( clContext : ClContext ) workGroupSize op =
102+
103+ let getOptionBitmap =
104+ ClArray.map2 clContext workGroupSize
105+ <| Map.choose2Bitmap op
106+
107+ let prefixSum = PrefixSum.standardExcludeInplace clContext workGroupSize
108+
109+ let scatter = Scatter.runInplace clContext workGroupSize
110+
111+ fun ( processor : MailboxProcessor < _ >) ->
112+
113+ ()
You can’t perform that action at this time.
0 commit comments