Skip to content

Commit 300f027

Browse files
authored
Fix omp threading size (#172)
This PR fixes OMPThreadPool size bug, which previously calls `omp_get_num_threads` and always returned a value of one.
1 parent 4c88f0d commit 300f027

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/svs/lib/threads/threadpool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ class OMPThreadPool {
297297
public:
298298
explicit OMPThreadPool(size_t num_threads) { omp_set_num_threads(num_threads); }
299299

300-
size_t size() const { return omp_get_num_threads(); }
300+
size_t size() const { return omp_get_max_threads(); }
301301

302302
void parallel_for(std::function<void(size_t)> f, size_t n) {
303303
#pragma omp parallel for

0 commit comments

Comments
 (0)