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 <ethanmoon@google.com>
This commit is contained in:
parent
3bda441305
commit
7ac4a47db1
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -49,6 +49,12 @@ DispatchQueue::setThreadCount(size_t thread_count)
|
|||
}
|
||||
}
|
||||
|
||||
size_t
|
||||
DispatchQueue::getThreadCount() const
|
||||
{
|
||||
return threads_.size();
|
||||
}
|
||||
|
||||
void
|
||||
DispatchQueue::finishTasks()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue