Closed jamesxu2 closed 1 month ago
I can clarify my statement about "tim::storage
File src: source\lib\omnitrace\library\thread_data.hpp
// Generic Template, which is being called and returns a pointer to uninitialized structure
template <typename Tp, typename Tag, size_t MaxThreads>
unique_ptr_t<thread_data<std::optional<Tp>, Tag, MaxThreads>>&
thread_data<std::optional<Tp>, Tag, MaxThreads>::instance()
{
static auto _v = unique_ptr_t<this_type>{};
return _v;
}
// Specialized Template, which you want to call but is not used. Returns a pointer to the singleton
template <typename Tp, typename Tag, size_t MaxThreads>
unique_ptr_t<Tp>&
thread_data<Tp, Tag, MaxThreads>::instance()
{
return instances().at(threading::get_id());
}
tim::storage<comp::roctracer_data>::instance()
returns the instance of the storage singleton if it exists, but rather creates an empty unique_ptr to the storage type