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

Passing local arrays to injected quotes #151

Open IgorErin opened 1 year ago

IgorErin commented 1 year ago

Describe the bug Passing local data to integrated quotes causes a compilation error. passing '__local int *' to parameter of type 'int *' changes address space of pointer int buff = buffUnitFunc (resultLocalBuffer) ;

To Reproduce Compile this:

let someFun someOp =
        <@ fun (localBuffer: int []) ->
            let buff = (%someOp)  localBuffer.[0] localBuffer.[0]
            () @>

let kernel =
    <@ fun (ndRange: Range1D) ->
        let array = localArray<int> workGroupSize
        (%someFun <@ (+) @>) localArray @>

Expected behavior Compilation is success.

Desktop (please complete the following information):