Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit fd04008

Browse files
author
Roman Dubtsov
committed
Add ThreadPool::ScheduleToAllThreads
1 parent c94f406 commit fd04008

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

tensorflow/core/lib/core/threadpool.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ void ThreadPool::ScheduleWithHint(std::function<void()> fn, int start,
204204
impl_->ScheduleWithHint(std::move(fn), start, limit);
205205
}
206206

207+
void ThreadPool::ScheduleToAllThreads(const std::function<void(int)>& fn) {
208+
impl_->ScheduleToAllThreads(fn);
209+
}
210+
207211
void ThreadPool::SetStealPartitions(
208212
const std::vector<std::pair<unsigned, unsigned>>& partitions) {
209213
impl_->SetStealPartitions(partitions);

tensorflow/core/lib/core/threadpool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class ThreadPool {
6969
const std::vector<std::pair<unsigned, unsigned>>& partitions);
7070

7171
void ScheduleWithHint(std::function<void()> fn, int start, int limit);
72+
void ScheduleToAllThreads(const std::function<void(int)>& fn);
7273
// Requires 0 < block_size <= total.
7374
// Spawns k threads and calls fn(i*block_size, (i+1)*block_size) from the
7475
// ith thread (i>=0). When (i+1)*block_size > total, fn(i*block_size, total)

0 commit comments

Comments
 (0)