Download src/core_workers.h from Sariel00/Ling-3.0-tiny-RKNN: direct link, hf CLI and curl.
- Browser
- Download file 965 Bytes
-
https://huggingface.co/Sariel00/Ling-3.0-tiny-RKNN/resolve/main/src/core_workers.h
- Command line
-
hf download hf://Sariel00/Ling-3.0-tiny-RKNN/src/core_workers.h
-
curl -L -o core_workers.h https://huggingface.co/Sariel00/Ling-3.0-tiny-RKNN/resolve/main/src/core_workers.h
965 Bytes
| namespace ling3 { | |
| class CoreWorkers { | |
| public: | |
| static CoreWorkers & Instance(); | |
| CoreWorkers(const CoreWorkers &) = delete; | |
| CoreWorkers & operator=(const CoreWorkers &) = delete; | |
| void Run(std::span<const int> cores, const std::function<void(int)> & task); | |
| private: | |
| CoreWorkers(); | |
| ~CoreWorkers(); | |
| void Worker(int core); | |
| std::array<std::thread, 4> workers_; | |
| std::array<bool, 4> active_ {}; | |
| std::array<std::exception_ptr, 4> errors_ {}; | |
| std::function<void(int)> task_; | |
| std::mutex run_mutex_; | |
| std::mutex state_mutex_; | |
| std::condition_variable start_; | |
| std::condition_variable done_; | |
| std::size_t generation_ = 0; | |
| std::size_t active_count_ = 0; | |
| std::size_t completed_ = 0; | |
| bool stop_ = false; | |
| }; | |
| } // namespace ling3 | |