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

Commit

Permalink
Add ThreadPool::ScheduleToAllThreads
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Dubtsov committed Aug 6, 2019
1 parent c94f406 commit fd04008
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tensorflow/core/lib/core/threadpool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ void ThreadPool::ScheduleWithHint(std::function<void()> fn, int start,
impl_->ScheduleWithHint(std::move(fn), start, limit);
}

void ThreadPool::ScheduleToAllThreads(const std::function<void(int)>& fn) {
impl_->ScheduleToAllThreads(fn);
}

void ThreadPool::SetStealPartitions(
const std::vector<std::pair<unsigned, unsigned>>& partitions) {
impl_->SetStealPartitions(partitions);
Expand Down
1 change: 1 addition & 0 deletions tensorflow/core/lib/core/threadpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class ThreadPool {
const std::vector<std::pair<unsigned, unsigned>>& partitions);

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

0 comments on commit fd04008

Please sign in to comment.