-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected behavior with local array and match #144
Comments
Can it be caused by unexpected behaviour of overflow? If array |
This prints "AA" for me and the code does work properly, but doesn't without printing let op =
<@
fun x y ->
let mutable res = x * y
if res = 0uy then
printf "AA"
None
else
printf "BB"
(Some res)
@> |
Well...
Moreover, the following version demonstrates the same behevior.
So, local array is not to blame in incorrect behavior. |
And more simplified kernel:
For Intel Finally, I think that it is a sort of undefined behavior on unsigned char overflow. It should not be an undefined behavior formally, so I guess that actually it is a driver (compiler) bug. OpenCL kernel:
Host program:
Platforms (clinfo)
And
|
Can't reproduce with AMD and NVIDIA, |
Describe the bug
Unexpected behavior when using a local array and
match
expression.To Reproduce
The value
array.[1]
is always33
after starting this code. This may mean that the code is executed in two contradictorymatch
branches.The problem disappears if the line
la.[lid] <- false
is deleted.The problem disappears as well if the line
| _ -> ()
is replaced by| _ -> if i = 1 then array.[i] <- 0uy
in the firstmatch
expression.Expected behavior
The value
array.[1]
must be32
.The text was updated successfully, but these errors were encountered: