YaccConstructor / Brahma.FSharp

F# quotation to OpenCL translator and respective runtime to utilize GPGPUs in F# applications.
http://yaccconstructor.github.io/Brahma.FSharp
Eclipse Public License 1.0
74 stars 17 forks source link

Option methods support #159

Open kirillgarbar opened 8 months ago

kirillgarbar commented 8 months ago

Is your feature request related to a problem? Please describe. It might be useful to use option methods such as isNone or isSome inside kernels since option types are supported.

Additional context Use case example

let one =
    <@ fun (x: float32 option) (_: int option) ->
        let mutable res = 0
        match x with
        | Some _ -> res <- 1
        | None -> ()
        if res = 0 then None else Some res @>
let one =
    <@ fun (x: float32 option) (_: int option) ->
        if x.IsNone then None else Some 1 @>