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

Changed meaning of .+= in Julia 0.5 #109

Closed stevengj closed 8 years ago

stevengj commented 8 years ago

Your code uses x .+= y, so you should know that in Julia 0.5 this has changed meaning to be equivalent to broadcast!(identity, x, x .+ y), so that it mutates the x array (see JuliaLang/julia#17510 … in Julia 0.6 the whole operation will occur in-place without temporaries). So .+ should only be used if the left-hand side is a mutable array, and you don't mind mutating it.

At first glance, it looks like you may need to revise some code. In your process_node function, ref_assign_map is used to rewrite x .+= y to x = x .+ y, whereas in Julia 0.5 this is now x .= x .+ y and mutates the x array.

ninegua commented 8 years ago

Thanks for pointing out this difference. I've provided a fix in latest commit, as well as two test cases.