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
Describe the bug
Assigning value to the mutable variable using quotation injected method causes an exception in some cases. Looks like exception occures only then there are match statement in the method. Also, if variable is not mutable it works fine
To Reproduce
let op1 =
<@ fun (x: bool option) ->
let mutable res = None
match x with
| Some _ -> res <- Some true
| None -> ()
res
@>
let op2 =
<@ fun (x: bool option) ->
x
@>
let kernelEx =
<@ fun (ndRange: Range1D) ->
let mutable sum: bool option = None
sum <- (%op1) (Some true) @>
let kernelOK1 =
<@ fun (ndRange: Range1D) ->
let mutable sum: bool option = None
sum <- (%op2) (Some true) @>
let kernelOK2 =
<@ fun (ndRange: Range1D) ->
let mutable sum: bool option = None
let newSum = (%op1) (Some true)
sum <- newSum @>
context.Compile kernelOK1
context.Compile kernelOK2
context.Compile kernelEx
Expected behavior
All kernels should compile
Actual behavior
Only last 2 kernels compile. First kernel causes System.InvalidCastException: Unable to cast object of type 'Brahma.FSharp.OpenCL.AST.StatementBlock1[Brahma.FSharp.OpenCL.AST.Lang]' to type 'Brahma.FSharp.OpenCL.AST.Expression1[Brahma.FSharp.OpenCL.AST.Lang]'.
The text was updated successfully, but these errors were encountered:
Describe the bug
Assigning value to the mutable variable using quotation injected method causes an exception in some cases. Looks like exception occures only then there are match statement in the method. Also, if variable is not mutable it works fine
To Reproduce
Expected behavior
All kernels should compile
Actual behavior
Only last 2 kernels compile. First kernel causes
System.InvalidCastException: Unable to cast object of type 'Brahma.FSharp.OpenCL.AST.StatementBlock
1[Brahma.FSharp.OpenCL.AST.Lang]' to type 'Brahma.FSharp.OpenCL.AST.Expression1[Brahma.FSharp.OpenCL.AST.Lang]'.
The text was updated successfully, but these errors were encountered: