I am opening another thread as the parallel autodiff v3 one seems long enough already. This one is oriented towards trying to add stanc3 support for reduce_sum. I am far from a stanc3 guru, but love to learn new stuff, especially with a real task like this.
I took the model from https://github.com/stan-dev/math/wiki/Parallel-reduce_sum-project-page and trimmed it down to a basic example https://gist.github.com/rok-cesnovar/832f9752fc2a8ba7ae7b3da3eb5f2743 (EDIT: see revision 1)
So the first request would be to someone to double check that I trimmed it correctly. Is this how this was intended for use?
For now I managed to get stanc3 to output the following hpp file https://gist.github.com/rok-cesnovar/3fd4f2326a667cd9e31c7e14a6ee32f5 (EDIT: see revision 1)
I havent setup cmdstan with the reduce_sum branch yet to try if it compiles and all (will do that tomorrow).
If someone skimms through the hpp to let me know if this is close to what was expected or if I completely missed the point.
Thanks.
cc @wds15, @bbbales2, @stevebronder