1#ifndef STAN_MATH_REV_CORE_INIT_CHAINABLESTACK_HPP
2#define STAN_MATH_REV_CORE_INIT_CHAINABLESTACK_HPP
6#include <tbb/task_scheduler_observer.h>
9#include <unordered_map>
29 using ad_map = std::unordered_map<std::thread::id, stack_ptr>;
41 const std::thread::id thread_id = std::this_thread::get_id();
43 ad_map::iterator insert_elem;
45 std::tie(insert_elem, status)
47 insert_elem->second = std::make_unique<ChainableStack>();
void on_scheduler_exit(bool worker)
std::unordered_map< std::thread::id, stack_ptr > ad_map
std::unique_ptr< ChainableStack > stack_ptr
std::mutex thread_tape_map_mutex_
void on_scheduler_entry(bool worker)
TBB observer object which is a callback hook called whenever the TBB scheduler adds a new thread to t...
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...