- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Compiler plugin problems
Thu, 2009-07-30, 01:05
My vector math optimizer is having a little trouble with closures. Below
is a transformation it does.
The last lines of the transformed method will cause GenICode to fail with:
Exception in thread "main" java.lang.AssertionError: assertion failed:
REFERENCE(scala.runtime.FloatRef) is not a numeric or boolean type
[operation: method *]
I understand that the Float variables are later transformed to FloatRef,
but somehow in this case it will be erroneously done. Could it be that I
have some symbol owners or tree positions set wrongly? I haven't yet
figured out how to do all that correctly.
Anyway, I think I should avoid scalarizing vectors that get accessed
from closures since creating two FloatRefs will actually cost more than
creating a Vector.