Skip to content

Commit 2362e72

Browse files
committed
Move UseNewThreadPool to NewThreadPool.
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
1 parent e17be81 commit 2362e72

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

dali/pipeline/executor/executor2/exec2.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ namespace exec2 {
3131

3232
namespace {
3333

34-
35-
bool UseNewThreadPool() {
36-
static bool use_new_thread_pool = []() {
37-
const char *new_tp = getenv("DALI_USE_NEW_THREAD_POOL");
38-
return new_tp && atoi(new_tp);
39-
}();
40-
return use_new_thread_pool;
41-
}
42-
4334
void LimitBackendConcurrency(ExecGraph &graph, OpType backend, int max_concurrency = 1) {
4435
auto sem = std::make_shared<tasking::Semaphore>(max_concurrency);
4536
for (auto &n : graph.Nodes()) {

dali/pipeline/util/new_thread_pool.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,13 @@ std::vector<std::thread::id> ThreadPoolFacade::GetThreadIds() const {
121121
return tp_->GetThreadIds();
122122
}
123123

124+
bool UseNewThreadPool() {
125+
static bool use_new_thread_pool = []() {
126+
const char *new_tp = getenv("DALI_USE_NEW_THREAD_POOL");
127+
return new_tp && atoi(new_tp);
128+
}();
129+
return use_new_thread_pool;
130+
}
131+
132+
124133
} // namespace dali

dali/pipeline/util/new_thread_pool.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ class DLL_PUBLIC ThreadPoolFacade : public ThreadPool {
5656
std::optional<Job> job_;
5757
};
5858

59+
DLL_PUBLIC bool UseNewThreadPool();
60+
5961
} // namespace dali
6062

6163
#endif // DALI_PIPELINE_UTIL_NEW_THREAD_POOL_H_

0 commit comments

Comments
 (0)