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

selector dimension mismatch #68

Closed ninegua closed 8 years ago

ninegua commented 8 years ago

The following program gives wrong result. Inspecting the generated C code reveals that the LHS of A[:,i] = ... is only indexed with one integer instead of two. The same problem will not occur when we write A[i,:] instead.

using ParallelAccelerator

@acc function f(n)
  A = ones(Int, n, n)
  for i = 1:n
    A[:,i] = -A[:,i]
  end
  return A
end

println(f(3))
DrTodd13 commented 8 years ago

Fixed in 59fb108.