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

ScalaCLPlugin : tuple assignment in deconstructive assignment appears to be broken #80

Closed
ochafik opened this Issue Sep 1, 2011 · 1 comment

Comments

Projects
None yet
1 participant
@ochafik
Member

ochafik commented Sep 1, 2011

The pair @ alias is not properly handled anymore :
{{{
// mvn compile scala:run -DmainClass=scalacl.plugin.Compile "-DaddArgs=Test.scala|-cp|../ScalaCL/target/scalacl-0.3-SNAPSHOT-shaded.jar"
object Test {
import scalacl._
import scala.math._
implicit val context = Context.best
// prefer CPUs ? Context.best(CPU)
val array = (100 until 300).cl

val r2 =
array.map(v => {

def someFun(x: Int) = // becomes a top-level function inside the OpenCL kernel
  exp(x / 1000).toInt

val pair @ (init, foo) = { // tuples will be flattened in the OpenCL kernel
   val d = v - 10     // unless they match an OpenCL tuple type like int2
   (d * d, 1 / d)
}
var sum = init + 1.0
for (i <- 0 until 10; if (i % 2) != 0) {
   sum += cos(v) * i + someFun(pair._2 - foo)
}
(sum, foo)

})
println(r2)
}
}}}

Google Code Info:
Issue #: 78
Author: olivier.chafik
Created On: 2011-07-15T00:41:35.000Z
Closed On:

@ghost ghost assigned ochafik Sep 1, 2011

@ochafik

This comment has been minimized.

Show comment
Hide comment
@ochafik

ochafik Mar 16, 2015

Member

This issue was moved to nativelibs4java/ScalaCL#12

Member

ochafik commented Mar 16, 2015

This issue was moved to nativelibs4java/ScalaCL#12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment