|
Grok 20.3.2
|
Manages TFSingleton instance. More...
#include <TFSingleton.h>
Static Public Member Functions | |
| static void | create (size_t numThreads) |
| Creates singleton instance. | |
| static tf::Executor & | get (void) |
| Gets current instance of the Singleton (creates with full hardware concurrency if null). | |
| static size_t | num_threads () |
| Gets total number of threads (including driver thread). | |
| static void | destroy () |
| Destroys TFSingleton. | |
| static uint32_t | workerId (void) |
| Gets worker id for current worker. | |
Private Member Functions | |
| TFSingleton (const TFSingleton &)=delete | |
| TFSingleton & | operator= (const TFSingleton &)=delete |
| TFSingleton ()=default | |
| Constructs an TFSingleton. | |
Static Private Attributes | |
| static std::unique_ptr< tf::Executor > | instance_ = nullptr |
| Taskflow Executor instance. | |
| static std::mutex | mutex_ |
| std::mutex to control access to instance_ | |
| static size_t | numThreads_ |
| total number of threads | |
Manages TFSingleton instance.
|
privatedelete |
References TFSingleton().
Referenced by operator=(), and TFSingleton().
|
privatedefault |
Constructs an TFSingleton.
|
inlinestatic |
Creates singleton instance.
| numThreads | total number of threads including main thread i.e. number of taskflow worker threads |
References instance_, mutex_, and numThreads_.
Referenced by grk_initialize().
|
inlinestatic |
Destroys TFSingleton.
References instance_, and mutex_.
Referenced by grk_deinitialize(), and GrkCleanup::~GrkCleanup().
|
inlinestatic |
Gets current instance of the Singleton (creates with full hardware concurrency if null).
References instance_, mutex_, and numThreads_.
Referenced by grk::CodeStreamCompress::compress(), grk::HWY_NAMESPACE::encode(), grk::HWY_NAMESPACE::encode_53_16(), grk::HWY_NAMESPACE::encode_97_16(), grk_thread_pool(), grk::TileProcessorCompress::pcrdBisectFeasible(), grk::TileProcessorCompress::pcrdBisectSimple(), grk::CompressScheduler::populateT1Flow(), grk::CodecScheduler::run(), grk::TileProcessor::scheduleAndRunDecompress(), grk::CodeStreamDecompress::scheduleSwathCopy(), grk::CompressScheduler::scheduleT1(), grk::DecompressScheduler::scheduleT1(), grk::DecompressSchedulerExcalibur::scheduleT1(), grk::TileProcessorCompress::submitCompressDAG(), grk::HWY_NAMESPACE::vscheduler(), grk::HWY_NAMESPACE::vscheduler16(), workerId(), and grk::CodeStreamDecompress::~CodeStreamDecompress().
|
inlinestatic |
Gets total number of threads (including driver thread).
References mutex_, and numThreads_.
Referenced by grk::WaveletPoolData::alloc(), grk::CodeStreamDecompress::CodeStreamDecompress(), grk::HWY_NAMESPACE::encode(), grk::HWY_NAMESPACE::encode_53_16(), grk::HWY_NAMESPACE::encode_97_16(), grk::CodeStreamDecompress::fetchByTile(), grk_num_workers(), grk::WaveletReverse::partial_tile(), grk::TileProcessorCompress::pcrdBisectFeasible(), grk::TileProcessorCompress::pcrdBisectSimple(), grk::CompressScheduler::populateT1Flow(), grk::CodeStreamDecompress::readHeader(), grk::HWY_NAMESPACE::schedule_encode(), grk::CompressScheduler::scheduleT1(), grk::DecompressScheduler::scheduleT1(), grk::DecompressSchedulerExcalibur::scheduleT1(), grk::CodeStreamDecompress::sequentialParseAndSchedule(), and grk::TileProcessor::TileProcessor().
|
privatedelete |
References TFSingleton().
|
inlinestatic |
Gets worker id for current worker.
References get().
Referenced by grk_worker_id(), grk::TileProcessor::parseTilePart(), grk::TileProcessor::readPLT(), and grk::TileProcessor::setProcessors().
|
staticprivate |
|
staticprivate |
std::mutex to control access to instance_
Referenced by create(), destroy(), get(), and num_threads().
|
staticprivate |
total number of threads
Referenced by create(), get(), and num_threads().