IntelLabs / ParallelAccelerator.jl

The ParallelAccelerator package, part of the High Performance Scripting project at Intel Labs
BSD 2-Clause "Simplified" License
294 stars 32 forks source link

Pi example broken #50

Closed ehsantn closed 8 years ago

ehsantn commented 8 years ago

I added a simple example that calculates Pi. It used to work but now it's broken probably because of recent changes in reductions. Also, the allocations used to be optimized out but now they are still there.

$julia pi.jl 
points= 10000000
/tmp/tmpQuttoR/cgen_output0.cpp(81): error: initial value of reference to non-const must be an lvalue
            bool &parallel_ir_reduction_output_6 = parallel_ir_reduction_output_6_vec[rds_init_loop_var];
ninegua commented 8 years ago

The issue about reduction is fixed.

I don't seem to recall we had optimized the allocation of rand arrays away. Which commit did it?

ehsantn commented 8 years ago

It is not just rand arrays. I implemented a pass after ParallelIR that removes extra allocations e132da2ecab1a27c1ab1f5d1324d80a0be577592. I can take a look.

ehsantn commented 8 years ago

@ninegua have you checked in your fix for reduction?

ninegua commented 8 years ago

Sorry, forgot to push. Just checked in.

ehsantn commented 8 years ago

The problem with removing extra allocation is caused by an issue with liveness analysis since the arrays are returned as defs.

ehsantn commented 8 years ago

7d759b6713612d6865a0413a66b0290863105388 fixes the bug in removing extra allocation.