You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was looking into whether ableC supports pragma directives, since as it's defined they are designed to be used to communicate with the compiler/pre-processor, and I noticed that they aren't defined in ableC at all. I was wondering whether there was a reason for this, since it seems like we could use pragma directives to allow programmers to communicate with extensions.
For instance, the tensor algebra extension can generate parallel code, and I'd like to have this controlled by the programmer using the extension. My current solution is using define's, with an ifdef in the tensor header file, so if the programmer specified the define to enable parallelism there is a global variable with a fully qualified name that we can lookup. If we supported pragma's (and had a way of accessing them from extensions) we could make this easier. I'm thinking this could also be useful for my current work on a parallel back-end, since it could allow the programmer to define behaviors for the parallel back-end or even the allocator. I'd guess there might be other applications as well.
I don't want to put this on someone else's plate, if this seems like something reasonable to add, I'd be willing to work on it, just wanted to bring it up as a question.
The text was updated successfully, but these errors were encountered:
First, the reason that pragmas were originally introduced was as a way of extending the C/C++ language, with the requirement of backwards-compatibility with all existing programs. We have much better ways of introducing language extensions with nicer syntax, so IMO trying to reuse pragmas for our own purposes is not a good idea. Is there any reason why you couldn't introduce some custom declaration that controls this?
On the other hand, we should at least support pragmas that already exist, if only by passing them through unchanged. Currently there is no way of using OpenMP in an ableC program, as the pragmas aren't parsed correctly. Also forwarding to code that uses OpenMP requires some awful hacks involving txtStmt since we don't represent these in abstract syntax at all.
I was looking into whether ableC supports pragma directives, since as it's defined they are designed to be used to communicate with the compiler/pre-processor, and I noticed that they aren't defined in ableC at all. I was wondering whether there was a reason for this, since it seems like we could use pragma directives to allow programmers to communicate with extensions.
For instance, the tensor algebra extension can generate parallel code, and I'd like to have this controlled by the programmer using the extension. My current solution is using define's, with an ifdef in the tensor header file, so if the programmer specified the define to enable parallelism there is a global variable with a fully qualified name that we can lookup. If we supported pragma's (and had a way of accessing them from extensions) we could make this easier. I'm thinking this could also be useful for my current work on a parallel back-end, since it could allow the programmer to define behaviors for the parallel back-end or even the allocator. I'd guess there might be other applications as well.
I don't want to put this on someone else's plate, if this seems like something reasonable to add, I'd be willing to work on it, just wanted to bring it up as a question.
The text was updated successfully, but these errors were encountered: