You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unhandled exception. System.Exception: Unexpected argument: Case1
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1448.Invoke(String message)
at Microsoft.FSharp.Core.PrintfModule.gprintf[a,TState,TResidue,TResult,TPrinter](FSharpFunc`2 envf, PrintfFormat`4 format) in D:\a\_work\1\s\src\FSharp.Core\printf.fs:line 1398
at Brahma.FSharp.ClProgram`2.setupArgument(Kernel kernel, Int32 index, Object arg)
at lambda_method3(Closure, Kernel, Int32, Object)
at Microsoft.FSharp.Collections.ArrayModule.IterateIndexed[T](FSharpFunc`2 action, T[] array) in D:\a\_work\1\s\src\FSharp.Core\array.fs:line 437
at lambda_method4(Closure, FSharpFunc`2, Object[])
at [email protected](g g, h h, i i, j j)
at [email protected](Unit unitVar0) in /home/dxd/ImageProcessing/src/ImageProcessing/Main.fs:line 38
at <StartupCode$Brahma-FSharp-OpenCL-Core>[email protected](Unit unitVar)
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[T,TResult](AsyncActivation`1 ctxt, TResult result1, FSharpFunc`2 part2) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 510
at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 112
--- End of stack trace from previous location ---
at [email protected](ExceptionDispatchInfo edi) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1174
at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 112
at <StartupCode$FSharp-Core>[email protected](Object o) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 195
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
To Reproduce
Steps to reproduce the behavior:
Using the final version of the example code from the "Basic examples"
Create a DU type:
typeMyDU=| Case1
| Case2
| Case3
Modify the kernel so it utilizes pattern matching over the DU:
letintArraySum= arrayMap2 <@(+)@> context 64 Case1
letboolArraySum= arrayMap2 <@(&&)@> context 64 Case2
letarrayMask= arrayMap2 <@fun x y ->if y then x else0@> context 64 Case3
Observe the error. Final version of the code looks like this:
Desktop (please complete the following information):
OS: Ubuntu 22.04
Additional context
Brahma.FSharp 2.0.1
OpenCL 2.0
The text was updated successfully, but these errors were encountered:
artem-burashnikov
changed the title
Unexpected argument error on DU case construction inside kernel
Unexpected argument error on DU case pattern matching inside kernel
Mar 22, 2023
Describe the bug
To Reproduce
Steps to reproduce the behavior:
Using the final version of the example code from the "Basic examples"
Create a DU type:
Expected behavior
The code should work.
Actual behavior
It doesn't.
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: