ParallelAccelerator.jl icon indicating copy to clipboard operation
ParallelAccelerator.jl copied to clipboard

Translate the left division function properly in CGen

Open ninegua opened this issue 8 years ago • 0 comments

The following currently fails:

using ParallelAccelerator
@acc test_leftdiv(n) = eye(n, n) \ ones(n, n)
test_leftdiv(10)

The error right now is in the attempt to translate a typeof call in the implementation of \. But this is actually unnecessary because the the result of the typeof is never being used in the program. So it is an artifact left over in Julia's typed AST that creates trouble for CGen. We happen to do some cleanups in parallel IR that can get rid of statements like this, but CGen can not making use of it.

For obvious reasons, not every function is parallelizable and not every function should go through parallel IR translation. But the kind of cleanup jobs we current do in Parallel IR can help CGen translation. So it'll be good to separate this functionality out as a standalone utility.

Of course there will be more issues down the line before we can handle the above program.

ninegua avatar Dec 14 '15 20:12 ninegua