Closed ehsantn closed 8 years ago
A lot of the issues for this example seem to be related to #44. After making the constants explicit float values, it works.
However, the extra allocations are still there.
The allocations come with rand(n)
. The allocated array is an input to inplace mmap, and is no longer needed after fusion. @DrTodd13 do you think it is possible to get rid of this allocation?
I think we could add a pass of removing allocations after fusion and allocation hoisting is done in top_level_from_exprs()
. Any thoughts?
Removing allocations is implemented now.
The simple program below for calculating Pi fails. CGen chokes on allocations for some reason.
More importantly, the AST coming from ParallelIR is not optimized properly. It has array allocations but no array should be allocated here. Also, the loops are not fused.