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
Invalid uniqueness simplification on trivial program #1271
Comments
I'm not even sure this should be type correct. |
The program should work, but we need to stop pretending the intrinsic |
The root of the problem is this: our implementation strategy for |
Wouldn't an alternative be to have two kinds of zip: one that takes two
unique arrays and returns a unique array and one that returns a non-unique
array?
man. 15. mar. 2021 kl. 22.52 skrev Troels Henriksen <
***@***.***>:
… The program should work, but we need to stop pretending the intrinsic zip
doesn't need to copy its input - it does. (Although in many cases this copy
can be simplified away later.) I just need to figure out whether the
problem is rooted in this intrinsic, or whether it can be provoked without
using any dubiously typed intrinsics.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1271 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAI5DOYMONRLK3X3DNOTYATTDZ6TFANCNFSM4ZHJ737Q>
.
|
I guess that besides from zip and zipU, we would also need a zipC that
returns a unique array by copying...
tir. 16. mar. 2021 kl. 14.17 skrev Martin Elsman ***@***.***>:
… Wouldn't an alternative be to have two kinds of zip: one that takes two
unique arrays and returns a unique array and one that returns a non-unique
array?
man. 15. mar. 2021 kl. 22.52 skrev Troels Henriksen <
***@***.***>:
> The program should work, but we need to stop pretending the intrinsic zip
> doesn't need to copy its input - it does. (Although in many cases this copy
> can be simplified away later.) I just need to figure out whether the
> problem is rooted in this intrinsic, or whether it can be provoked without
> using any dubiously typed intrinsics.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#1271 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAI5DOYMONRLK3X3DNOTYATTDZ6TFANCNFSM4ZHJ737Q>
> .
>
|
No, because uniqueness in Futhark isn't really uniqueness. If you have a function In Futhark, uniqueness only matters across function calls (so in function types essentially), and plays two roles:
(There's a few more rules; e.g. inside a function you cannot consume anything that is free in the function.) |
Somewhat surprisingly, the compiler messes this up:
The text was updated successfully, but these errors were encountered: