stanc3
stanc3 copied to clipboard
See if we can do map_rect data transfers in stanc3 and get rid of call_id template parameter
Right now map_rect asks the compiler to emit a call_id integer as a template parameter to basically allow some caching to happen in the Math library. As we did with the GPU functions, this logic would better live in the compiler both for code sanity reasons but also because I believe the current caching scheme is subtly wrong.
It can be improved...yes...and you are right in that it probably lives a better life in some higher level parts of Stan.
Sorry, hope that didn't sound too critical! Let me remove the word "hack," I felt like it was okay because I was definitely involved and complicit in its creation, haha. I also thought we had discovered there was some way in which map_rect caching was actually wrong but I forgot what the way was. Inside for loops maybe?