Skip to content

Commit

Permalink
make adl isolation of static_thread_pool consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
ericniebler committed Jan 5, 2024
1 parent a21547c commit 6467e29
Show file tree
Hide file tree
Showing 9 changed files with 1,276 additions and 1,226 deletions.
4 changes: 2 additions & 2 deletions examples/benchmark/static_thread_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct RunThread {
pmr::monotonic_buffer_resource resource{
buffer.data(), buffer.size(), pmr::null_memory_resource()};
pmr::polymorphic_allocator<char> alloc(&resource);
auto [start, end] = exec::even_share(total_scheds, tid, pool.available_parallelism());
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
std::size_t scheds = end - start;
std::atomic<std::size_t> counter{scheds};
auto env = exec::make_env(exec::with(stdexec::get_allocator, alloc));
Expand All @@ -62,7 +62,7 @@ struct RunThread {
--scheds;
}
#else
auto [start, end] = exec::even_share(total_scheds, tid, pool.available_parallelism());
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
std::size_t scheds = end - start;
std::atomic<std::size_t> counter{scheds};
while (scheds) {
Expand Down
4 changes: 2 additions & 2 deletions examples/benchmark/static_thread_pool_bulk_enqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ struct RunThread {
pmr::monotonic_buffer_resource rsrc{buffer.data(), buffer.size()};
pmr::polymorphic_allocator<char> alloc{&rsrc};
auto env = exec::make_env(exec::with(stdexec::get_allocator, alloc));
auto [start, end] = exec::even_share(total_scheds, tid, pool.available_parallelism());
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
auto iterate = exec::schedule_all(pool, std::views::iota(start, end))
| exec::ignore_all_values() | exec::write(env);
#else
auto [start, end] = exec::even_share(total_scheds, tid, pool.available_parallelism());
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
auto iterate = exec::schedule_all(pool, std::views::iota(start, end))
| exec::ignore_all_values();
#endif
Expand Down
4 changes: 2 additions & 2 deletions examples/benchmark/static_thread_pool_bulk_enqueue_nested.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ struct RunThread {
pmr::monotonic_buffer_resource rsrc{buffer.data(), buffer.size()};
pmr::polymorphic_allocator<char> alloc{&rsrc};
auto env = exec::make_env(exec::with(stdexec::get_allocator, alloc));
auto [start, end] = exec::even_share(total_scheds, tid, pool.available_parallelism());
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
auto iterate = exec::iterate(std::views::iota(start, end)) | exec::ignore_all_values()
| exec::write(env);
#else
auto [start, end] = exec::even_share(total_scheds, tid, pool.available_parallelism());
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
auto iterate = exec::iterate(std::views::iota(start, end)) | exec::ignore_all_values();
#endif
stdexec::sync_wait(stdexec::on(scheduler, iterate));
Expand Down
4 changes: 2 additions & 2 deletions examples/benchmark/static_thread_pool_nested.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct RunThread {
pmr::monotonic_buffer_resource resource{
buffer.data(), buffer.size(), pmr::null_memory_resource()};
pmr::polymorphic_allocator<char> alloc(&resource);
auto [start, end] = exec::even_share(total_scheds, tid, pool.available_parallelism());
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
std::size_t scheds = end - start;
std::atomic<std::size_t> counter{scheds};
auto env = exec::make_env(exec::with(stdexec::get_allocator, alloc));
Expand All @@ -65,7 +65,7 @@ struct RunThread {
}
}));
#else
auto [start, end] = exec::even_share(total_scheds, tid, pool.available_parallelism());
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
std::size_t scheds = end - start;
std::atomic<std::size_t> counter{scheds};
stdexec::sync_wait(
Expand Down
4 changes: 2 additions & 2 deletions examples/benchmark/tbb_thread_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct RunThread {
pmr::monotonic_buffer_resource resource{
buffer.data(), buffer.size(), pmr::null_memory_resource()};
pmr::polymorphic_allocator<char> alloc(&resource);
auto [start, end] = exec::even_share(total_scheds, tid, pool.available_parallelism());
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
std::size_t scheds = end - start;
std::atomic<std::size_t> counter{scheds};
auto env = exec::make_env(exec::with(stdexec::get_allocator, alloc));
Expand All @@ -60,7 +60,7 @@ struct RunThread {
--scheds;
}
#else
auto [start, end] = exec::even_share(total_scheds, tid, pool.available_parallelism());
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
std::size_t scheds = end - start;
std::atomic<std::size_t> counter{scheds};
while (scheds) {
Expand Down
2 changes: 1 addition & 1 deletion examples/benchmark/tbb_thread_pool_nested.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct RunThread {
if (stop.load()) {
break;
}
auto [start, end] = exec::even_share(total_scheds, tid, pool.available_parallelism());
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
std::size_t scheds = end - start;
tbb::task_group tg{};
stdexec::sync_wait( //
Expand Down
Loading

0 comments on commit 6467e29

Please sign in to comment.