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
produces the following output when compiled with futhark cuda or futhark opencl:
Internal compiler error. Please report this:
https://github.com/diku-dk/futhark/issues
Type error after pass 'simplify':
In function entry_problem
When checking function body
In expression of statement
{defunc_0_reduce_by_index_res_5267 : ({}, [n_5216]i64)}
Type error:
Variable arr_5217 referenced after being consumed.
futhark c works fine.
Tested on a recent nightly (0.26.0 (prerelease), git: 07fa0b447debb1501c3bc9593a4f0975685bc8eb) as well as 0.25.9.
I originally came across this working on the 2nd weekly assignment for DPP'23, the example above is what I reduced it to. Cosmin proposed in the lab that the copy was incorrectly eliminated by some optimization and suggested using something like map (+ (opaque 0)) arr instead of copy arr as a workaround, which does work.
The text was updated successfully, but these errors were encountered:
I suspected this might be my fault, but the following change makes it fail also on v0.22.6. (Just reporting this in case it's useful for pinpointing the problem.)
entry problem [n] (arr: *[n]i64) : [n]i64 =
let arr2 = copy arr
in reduce_by_index arr (+) 0 (iota n) arr2
A prettier workaround for you would be to copy first, I think.
This code
produces the following output when compiled with
futhark cuda
orfuthark opencl
:futhark c
works fine.Tested on a recent nightly (
0.26.0 (prerelease), git: 07fa0b447debb1501c3bc9593a4f0975685bc8eb
) as well as 0.25.9.I originally came across this working on the 2nd weekly assignment for DPP'23, the example above is what I reduced it to. Cosmin proposed in the lab that the
copy
was incorrectly eliminated by some optimization and suggested using something likemap (+ (opaque 0)) arr
instead ofcopy arr
as a workaround, which does work.The text was updated successfully, but these errors were encountered: