Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/benchmark/asio_thread_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct RunThread
buffer.size(),
pmr::null_memory_resource()};
pmr::polymorphic_allocator<char> alloc(&resource);
auto [start, end] = exec::_pool_::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 = stdexec::prop{stdexec::get_allocator, alloc};
Expand All @@ -68,7 +68,7 @@ struct RunThread
--scheds;
}
#else
auto [start, end] = exec::_pool_::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
6 changes: 3 additions & 3 deletions examples/benchmark/static_thread_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct RunThread
buffer.size(),
pmr::null_memory_resource()};
pmr::polymorphic_allocator<char> alloc(&resource);
auto [start, end] = exec::_pool_::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 = stdexec::prop{stdexec::get_allocator, alloc};
Expand All @@ -70,7 +70,7 @@ struct RunThread
--scheds;
}
#else
auto [start, end] = exec::_pool_::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 Expand Up @@ -110,4 +110,4 @@ auto main(int argc, char** argv) -> int
{
my_numa_distribution numa{};
my_main<exec::static_thread_pool, RunThread>(argc, argv, numa);
}
}
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 @@ -45,11 +45,11 @@ struct RunThread
pmr::monotonic_buffer_resource rsrc{buffer.data(), buffer.size()};
pmr::polymorphic_allocator<char> alloc{&rsrc};
auto env = stdexec::prop{stdexec::get_allocator, alloc};
auto [start, end] = exec::_pool_::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() | stdexec::write_env(env);
#else
auto [start, end] = exec::_pool_::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 @@ -46,11 +46,11 @@ struct RunThread
pmr::monotonic_buffer_resource rsrc{buffer.data(), buffer.size()};
pmr::polymorphic_allocator<char> alloc{&rsrc};
auto env = stdexec::prop{stdexec::get_allocator, alloc};
auto [start, end] = exec::_pool_::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()
| stdexec::write_env(env);
#else
auto [start, end] = exec::_pool_::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::starts_on(scheduler, iterate));
Expand Down
6 changes: 3 additions & 3 deletions examples/benchmark/static_thread_pool_nested.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct RunThread
buffer.size(),
pmr::null_memory_resource()};
pmr::polymorphic_allocator<char> alloc(&resource);
auto [start, end] = exec::_pool_::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 = stdexec::prop{stdexec::get_allocator, alloc};
Expand All @@ -74,7 +74,7 @@ struct RunThread
}
}));
#else
auto [start, end] = exec::_pool_::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(stdexec::schedule(scheduler)
Expand Down Expand Up @@ -110,4 +110,4 @@ struct RunThread
auto main(int argc, char** argv) -> int
{
my_main<exec::static_thread_pool, RunThread>(argc, argv);
}
}
4 changes: 2 additions & 2 deletions examples/benchmark/taskflow_thread_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct RunThread
buffer.size(),
pmr::null_memory_resource()};
pmr::polymorphic_allocator<char> alloc(&resource);
auto [start, end] = exec::_pool_::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 = stdexec::prop{stdexec::get_allocator, alloc};
Expand All @@ -68,7 +68,7 @@ struct RunThread
--scheds;
}
#else
auto [start, end] = exec::_pool_::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/tbb_thread_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct RunThread
buffer.size(),
pmr::null_memory_resource()};
pmr::polymorphic_allocator<char> alloc(&resource);
auto [start, end] = exec::_pool_::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 = stdexec::prop{stdexec::get_allocator, alloc};
Expand All @@ -68,7 +68,7 @@ struct RunThread
--scheds;
}
#else
auto [start, end] = exec::_pool_::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 @@ -41,7 +41,7 @@ struct RunThread
{
break;
}
auto [start, end] = exec::_pool_::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(stdexec::schedule(scheduler)
Expand Down
4 changes: 2 additions & 2 deletions examples/nvexec/maxwell/std.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <vector>

template <class Shape>
auto even_share(Shape n, std::size_t rank, std::size_t size) noexcept -> std::pair<Shape, Shape>
auto _even_share(Shape n, std::size_t rank, std::size_t size) noexcept -> std::pair<Shape, Shape>
{
auto const avg_per_thread = n / size;
auto const n_big_share = avg_per_thread + 1;
Expand Down Expand Up @@ -64,7 +64,7 @@ void run_std(float dt,
auto e_updater = update_e(time.get(), dt, accessor);
auto initializer = grid_initializer(dt, accessor);

auto [begin, end] = even_share(accessor.cells, tid, n_threads);
auto [begin, end] = _even_share(accessor.cells, tid, n_threads);

for (std::size_t i = begin; i < end; i++)
{
Expand Down
4 changes: 2 additions & 2 deletions examples/nvexec/maxwell_distributed.cu
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# include <mpi.h>
# include <vector>

static auto even_share(std::size_t n, std::size_t rank, std::size_t size) noexcept
static auto _even_share(std::size_t n, std::size_t rank, std::size_t size) noexcept
-> std::pair<std::size_t, std::size_t>
{
auto const avg_per_thread = n / size;
Expand Down Expand Up @@ -457,7 +457,7 @@ auto main(int argc, char *argv[]) -> int
bool const write_wtk = value(params, "write-vtk");
std::size_t const n_iterations = value(params, "iterations", 1000);
std::size_t const N = value(params, "N", 512);
auto const [row_begin, row_end] = even_share(N, rank, size);
auto const [row_begin, row_end] = _even_share(N, rank, size);
std::size_t const rank_begin = row_begin * N;
std::size_t const rank_end = row_end * N;
distributed::grid_t grid{N, rank_begin, rank_end};
Expand Down
2 changes: 1 addition & 1 deletion examples/problem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct receiver_t
template <class Domain>
void check_if_pool_domain()
{
using pool_domain = exec::_pool_::_static_thread_pool::domain;
using pool_domain = exec::_pool::_static_thread_pool::domain;
static_assert(std::is_same_v<Domain, pool_domain>);
}

Expand Down
6 changes: 2 additions & 4 deletions include/exec/asio/asio_thread_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,15 @@ namespace experimental::execution::asio

private:
friend struct ::exec::thread_pool_base<asio_thread_pool>;

template <class PoolType, class Receiver>
friend struct exec::_pool_::opstate;
friend struct ::exec::thread_pool_access;

[[nodiscard]]
static constexpr auto forward_progress_guarantee() -> STDEXEC::forward_progress_guarantee
{
return STDEXEC::forward_progress_guarantee::parallel;
}

void enqueue(exec::_pool_::task_base* task, std::uint32_t tid = 0) noexcept
void enqueue(exec::_pool::_task_base* task, std::uint32_t tid = 0) noexcept
{
asio_impl::post(pool_, [task, tid] { task->execute_(task, /*tid=*/tid); });
}
Expand Down
16 changes: 8 additions & 8 deletions include/exec/libdispatch_queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ namespace experimental::execution

namespace __libdispatch
{
struct task_base
struct _task_base
{
void (*execute)(task_base *) noexcept;
void (*execute)(_task_base *) noexcept;
};

template <class Receiver>
Expand Down Expand Up @@ -224,7 +224,7 @@ namespace experimental::execution
{
bool operator==(libdispatch_queue const &) const = default;

void submit(__libdispatch::task_base *f)
void submit(__libdispatch::_task_base *f)
{
auto queue = dispatch_get_global_queue(priority, 0);
dispatch_async_f(queue, f, reinterpret_cast<void (*)(void *) noexcept>(f->execute));
Expand All @@ -241,7 +241,7 @@ namespace experimental::execution
namespace __libdispatch
{
template <typename Receiver>
struct operation : task_base
struct operation : _task_base
{
libdispatch_queue &queue;
Receiver receiver;
Expand All @@ -250,7 +250,7 @@ namespace experimental::execution
: queue(*queue_arg)
, receiver(std::move(rcvr))
{
this->execute = [](task_base *t) noexcept
this->execute = [](_task_base *t) noexcept
{
auto &op = *static_cast<operation *>(t);
auto stoken = STDEXEC::get_stop_token(STDEXEC::get_env(op.receiver));
Expand All @@ -269,7 +269,7 @@ namespace experimental::execution
};
}

void enqueue(task_base *op) const
void enqueue(_task_base *op) const
{
queue.submit(op);
}
Expand Down Expand Up @@ -366,7 +366,7 @@ namespace experimental::execution
template <class CvSender, class Receiver, class Shape, class Fun, bool MayThrow>
struct bulk_shared_state
{
struct bulk_task : task_base
struct bulk_task : _task_base
{
bulk_shared_state *sh_state_;
Shape task_id_;
Expand All @@ -375,7 +375,7 @@ namespace experimental::execution
: sh_state_(sh_state_arg)
, task_id_(task_id_arg)
{
this->execute = [](task_base *t) noexcept
this->execute = [](_task_base *t) noexcept
{
auto &sh_state = *static_cast<bulk_task *>(t)->sh_state_;
auto task_id = static_cast<bulk_task *>(t)->task_id_;
Expand Down
Loading
Loading