diff --git a/include/beman/execution/detail/parallel_scheduler.hpp b/include/beman/execution/detail/parallel_scheduler.hpp new file mode 100644 index 00000000..0394734f --- /dev/null +++ b/include/beman/execution/detail/parallel_scheduler.hpp @@ -0,0 +1,61 @@ +// include/beman/execution/detail/parallel_scheduler.hpp -*-C++-*- +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef INCLUDED_BEMAN_EXECUTION_DETAIL_PARALLEL_SCHEDULER +#define INCLUDED_BEMAN_EXECUTION_DETAIL_PARALLEL_SCHEDULER + +#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#include +#include +#include +#include +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.completion_signatures; +import beman.execution.detail.get_completion_scheduler; +import beman.execution.detail.get_forward_progress_guarantee; +import beman.execution.detail.operation_state; +import beman.execution.detail.receiver; +import beman.execution.detail.scheduler; +import beman.execution.detail.scheduler_t; +import beman.execution.detail.sender; +import beman.execution.detail.set_error; +import beman.execution.detail.set_stopped; +import beman.execution.detail.set_value; +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +// ---------------------------------------------------------------------------- + +namespace beman::execution { + +class parallel_scheduler { + // TODO(P2079R10): add scheduler state and operations. +}; + +// TODO(P2079R10): implement using system_context_replaceability::query_parallel_scheduler_backend(). +auto get_parallel_scheduler() -> parallel_scheduler; + +} // namespace beman::execution + +// ---------------------------------------------------------------------------- + +#endif // INCLUDED_BEMAN_EXECUTION_DETAIL_PARALLEL_SCHEDULER diff --git a/include/beman/execution/execution.hpp b/include/beman/execution/execution.hpp index 5f526386..914a5115 100644 --- a/include/beman/execution/execution.hpp +++ b/include/beman/execution/execution.hpp @@ -39,6 +39,7 @@ import beman.execution.detail.let; import beman.execution.detail.matching_sig; import beman.execution.detail.on; import beman.execution.detail.operation_state; +import beman.execution.detail.parallel_scheduler; import beman.execution.detail.prop; import beman.execution.detail.read_env; import beman.execution.detail.receiver; @@ -101,6 +102,7 @@ import beman.execution.detail.write_env; #include #include #include +#include #include #include #include diff --git a/src/beman/execution/CMakeLists.txt b/src/beman/execution/CMakeLists.txt index 674d52c5..e663edb8 100644 --- a/src/beman/execution/CMakeLists.txt +++ b/src/beman/execution/CMakeLists.txt @@ -133,6 +133,7 @@ target_sources( ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/on_stop_request.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/operation_state.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/operation_state_task.hpp + ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/parallel_scheduler.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/product_type.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/prop.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/query_with_default.hpp @@ -327,6 +328,7 @@ if(BEMAN_USE_MODULES) on.cppm operation_state_task.cppm operation_state.cppm + parallel_scheduler.cppm product_type.cppm prop.cppm query_with_default.cppm diff --git a/src/beman/execution/execution-detail.cppm b/src/beman/execution/execution-detail.cppm index 568be1bb..6d8a0ad4 100644 --- a/src/beman/execution/execution-detail.cppm +++ b/src/beman/execution/execution-detail.cppm @@ -59,6 +59,7 @@ export import beman.execution.detail.non_assignable; export import beman.execution.detail.nothrow_callable; export import beman.execution.detail.notify; export import beman.execution.detail.operation_state_task; +export import beman.execution.detail.parallel_scheduler; export import beman.execution.detail.product_type; export import beman.execution.detail.query_with_default; export import beman.execution.detail.queryable; diff --git a/src/beman/execution/execution.cppm b/src/beman/execution/execution.cppm index 3de60d3c..c6e4b9d4 100644 --- a/src/beman/execution/execution.cppm +++ b/src/beman/execution/execution.cppm @@ -43,6 +43,7 @@ import beman.execution.detail.never_stop_token; import beman.execution.detail.nostopstate; import beman.execution.detail.on; export import beman.execution.detail.operation_state; // [exec.opstate], operation states +import beman.execution.detail.parallel_scheduler; import beman.execution.detail.prop; import beman.execution.detail.read_env; import beman.execution.detail.run_loop; @@ -237,6 +238,10 @@ export using ::beman::execution::stopped_as_error; // [exec.run.loop], run_loop export using ::beman::execution::run_loop; +// [exec.parallel.scheduler], parallel scheduler +export using ::beman::execution::parallel_scheduler; +export using ::beman::execution::get_parallel_scheduler; + // [exec.consumers], consumers export using ::beman::execution::sync_wait_t; export using ::beman::execution::sync_wait_with_variant_t; diff --git a/src/beman/execution/parallel_scheduler.cppm b/src/beman/execution/parallel_scheduler.cppm new file mode 100644 index 00000000..14076f84 --- /dev/null +++ b/src/beman/execution/parallel_scheduler.cppm @@ -0,0 +1,12 @@ +module; +// src/beman/execution/parallel_scheduler.cppm -*-C++-*- +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +export module beman.execution.detail.parallel_scheduler; + +namespace beman::execution { +export using beman::execution::parallel_scheduler; +export using beman::execution::get_parallel_scheduler; +} // namespace beman::execution