// Copyright Advanced Micro Devices, Inc., or its affiliates. // SPDX-License-Identifier: MIT #pragma once #include namespace rocRoller { template class LazySingleton { public: static std::shared_ptr getInstance() { if(!m_instance) { m_instance = std::make_shared(); } return m_instance; } static void reset() { m_instance = nullptr; } private: static std::shared_ptr m_instance; }; template std::shared_ptr LazySingleton::m_instance = nullptr; }