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

Have a meaningful error message for if `@acc` is used not on a function or block #66

Closed lkuper closed 8 years ago

lkuper commented 8 years ago

@acc annotations should only be on function definitions, function calls, or begin ... end blocks. We should try to produce a reasonable error message when someone tries to put @acc on, say, an assignment, as happened in #64.

sarkar1 commented 8 years ago

It would be nice to have line numbers in warning messages as well.

DrTodd13 commented 8 years ago

We previously had a mechanism to catch exceptions and just run the regular Julia function but that only worked with the old direct call to "accelerate" rather than @acc. I've updated CompilerTools to catch exceptions from optimization passes and to print the failing function and optimization pass and then revert to the regular Julia function.

I've also added something to print a warning when @acc is used on an expression with no calls in it whatsoever but given that operators convert to functions this is likely never going to happen.

Yes, line numbers would be nice and we can work toward that but I think what I just checked in greatly improves the situation so I'm still going to close the ticket.