Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read/write dependencies out of order #34

Open
asujeeth opened this issue Sep 24, 2013 · 0 comments
Open

Read/write dependencies out of order #34

asujeeth opened this issue Sep 24, 2013 · 0 comments
Labels

Comments

@asujeeth
Copy link
Contributor

The following OptiML code triggers this bug:

val ipiv = DenseVector(5,7,10,8,8,9,10,9,10,10)
val P_indices = (0::10).mutable
println("P_indices before: " )
P_indices.pprint
var i = 0
while (i < ipiv.length) {
  val swap = P_indices(i)
  P_indices(i) = P_indices(ipiv(i)-1)
  P_indices(ipiv(i)-1) = swap
  i += 1
}
println("P_indices after: " )
P_indices.pprint

The P_indices value will not be correctly updated unless there is an effect inside the while loop body like println(P_indices(i)) or changing "val swap" to "var swap". I tried various other things, like disabling fusion and SoA, and trying to hide the structness of P_indices (to see if struct rewrites were the problem), but nothing else worked.

Anyone have any idea what's going on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant