A quick question, was
stan::math::ChainableStack::memalloc_.free_all() deprecated? I’m trying to build an Rcpp package I’m developing as part of my PhD. It works fine on my one Linux machine, using the StanHeaders version 2.17.2 package. On my other Linux machine, using the latest StanHeaders package, version 2.18.0, it throws an error about
memalloc_ not being a member of
If it was deprecated, what is the current alternative to stan::math::ChainableStack::memalloc_.free_all()`? Or is this no longer required? I remember previously that if I omitted:
after calculating gradients, then bad things would happen…
I think you can use like, ChainableStack::instance().memallloc should compile
Sorry for the late reply. The free_all() should be actually doing the memory freeing. We usually don’t do that until cleanup time given that our use case is MCMC or optimization and we wind up comput the same shaped log density function repeatedly, which can then reuse the allocated memory.
The two things to use ar
recover_memory() if you only ever do top-level calls, and
recover_memory_nested() if you’re doing nested autodiff (derivatives within derivatives, as we do, for example, in our ODE solvers).
free_all() function should still work. Can you send us the compiler dump if it’s failing to compile?
Apologies for my late reply! I’m a little swamped right now, and I’ve moved on to some more critical aspects of dissertation. For now, I’m just specifying that the user needs exactly version 2.17.2. But when I have some free time, I’ll try and see if I can’t slap together a minimal working example with a compiler dump. It won’t be this month though :-(