Closed diamog closed 5 years ago
OK. That's fine. Will the compiler error be obvious when unprotected commas are found?
Using for loops in the following block would help readability:
The compiler error isn't too obvious. For example:
Push.cpp:355:6: error: macro "PARALLEL_FOR_ELEMENTS" passed 5 arguments, but takes just 4 });
You would need to know about the unprotected commas being a problem to understand what this error means.
I was going to use for loops, but I unrolled them since its on the gpu at that point.
Closing this issue as we now have a functor/lambda based procedure to abstract these loops:
We are able to simply pass the code as an argument into the macros, but with one problem. The code cannot have any unprotected commas (protected commas appear within a set of parentheses () brackets, [] and {}, do not count). So with our current Push algorithm, the following lines cannot be done as they are currently inside the macro:
https://github.com/SCOREC/particle_structures/blob/master/algorithms/Push.cpp#L345-L350