threadpool_wrapper.hpp
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #pragma once
7 
8 #include <BS_thread_pool.hpp>
9 
10 namespace kvikio {
11 
12 template <typename pool_type>
13 class thread_pool_wrapper : public pool_type {
14  public:
20  thread_pool_wrapper(unsigned int nthreads) : pool_type{nthreads} {}
21 
27  void reset(unsigned int nthreads) { pool_type::reset(nthreads); }
28 };
29 
30 using BS_thread_pool = thread_pool_wrapper<BS::thread_pool>;
31 
32 } // namespace kvikio
thread_pool_wrapper(unsigned int nthreads)
Construct a new thread pool wrapper.
void reset(unsigned int nthreads)
Reset the number of threads in the thread pool.
KvikIO namespace.
Definition: batch.hpp:16