From 7ac4a47db1deeab3b40adb87be4398cb031f95be Mon Sep 17 00:00:00 2001 From: Ethan Mahintorabi Date: Fri, 12 Dec 2025 15:49:22 -0800 Subject: [PATCH] util: Add method to get thread count from dispatch queue (#324) I'm looking to try to have unified thread pool with OpenSTA and OpenROAD and having this method would make it easier to understand how much parallelism is available in the pool. Signed-off-by: Ethan Mahintorabi --- include/sta/DispatchQueue.hh | 1 + util/DispatchQueue.cc | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/sta/DispatchQueue.hh b/include/sta/DispatchQueue.hh index a8f6d60e..f28d94c5 100644 --- a/include/sta/DispatchQueue.hh +++ b/include/sta/DispatchQueue.hh @@ -24,6 +24,7 @@ public: DispatchQueue(size_t thread_cnt); ~DispatchQueue(); void setThreadCount(size_t thread_count); + size_t getThreadCount() const; // Dispatch and copy. void dispatch(const fp_t& op); // Dispatch and move. diff --git a/util/DispatchQueue.cc b/util/DispatchQueue.cc index c5f85e62..4e828c23 100644 --- a/util/DispatchQueue.cc +++ b/util/DispatchQueue.cc @@ -49,6 +49,12 @@ DispatchQueue::setThreadCount(size_t thread_count) } } +size_t +DispatchQueue::getThreadCount() const +{ + return threads_.size(); +} + void DispatchQueue::finishTasks() {