Skip to content

Commit

Permalink
Try #678:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored May 9, 2023
2 parents b8d0ffc + b257ae3 commit 3e92571
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 96 deletions.
2 changes: 1 addition & 1 deletion .jenkins/cscs-ault/env-hipcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ hip_version="5.3.3"
hwloc_version="2.6.0"
spack_compiler="gcc@${gcc_version}"
spack_arch="linux-centos8-zen"
stdexec_version="6510f5bd69cc03b24668f26eda3dd3cca7e81bb2"
stdexec_version="7a47a4aa411c1ca9adfcb152c28cc3dd7b156b4d"

# The xnack- architectures are not supported by rocblas@5.3.3
spack_spec="pika@main+rocm+stdexec amdgpu_target='gfx906:xnack-' arch=${spack_arch} %${spack_compiler} malloc=system cxxstd=${cxx_std} ^boost@${boost_version} ^hwloc@${hwloc_version} ^hip@${hip_version} ^whip amdgpu_target='gfx906:xnack-' ^stdexec@${stdexec_version}"
Expand Down
2 changes: 1 addition & 1 deletion .jenkins/cscs/env-clang-13.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ boost_version="1.79.0"
hwloc_version="2.6.0"
spack_compiler="clang@${clang_version}"
spack_arch="cray-cnl7-broadwell"
stdexec_version="6510f5bd69cc03b24668f26eda3dd3cca7e81bb2"
stdexec_version="7a47a4aa411c1ca9adfcb152c28cc3dd7b156b4d"

spack_spec="pika@main arch=${spack_arch} %${spack_compiler} cxxflags=-stdlib=libc++ malloc=system cxxstd=${cxx_std} +stdexec ^boost@${boost_version} ^hwloc@${hwloc_version} ^fmt cxxflags=-stdlib=libc++ ^stdexec@${stdexec_version}"

Expand Down
2 changes: 1 addition & 1 deletion .jenkins/cscs/env-clang-14-cuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ hwloc_version="2.7.0"
cuda_version="11.5.0"
spack_compiler="clang@${clang_version}"
spack_arch="cray-cnl7-haswell"
stdexec_version="6510f5bd69cc03b24668f26eda3dd3cca7e81bb2"
stdexec_version="7a47a4aa411c1ca9adfcb152c28cc3dd7b156b4d"

spack_spec="pika@main arch=${spack_arch} %${spack_compiler} +cuda malloc=system cxxstd=${cxx_std} +stdexec ^boost@${boost_version} ^cuda@${cuda_version} +allow-unsupported-compilers ^hwloc@${hwloc_version} ^stdexec@${stdexec_version}"

Expand Down
2 changes: 1 addition & 1 deletion .jenkins/cscs/env-nvhpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
cxx_std="20"
boost_version="1.78.0"
hwloc_version="2.7.0"
stdexec_version="6510f5bd69cc03b24668f26eda3dd3cca7e81bb2"
stdexec_version="7a47a4aa411c1ca9adfcb152c28cc3dd7b156b4d"
nvhpc_version="22.11"
spack_compiler="nvhpc@${nvhpc_version}"
spack_arch="cray-cnl7-haswell"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ namespace pika::sync_wait_detail {
#if defined(PIKA_HAVE_STDEXEC)
// value and error_types of the predecessor sender
template <template <typename...> class Tuple, template <typename...> class Variant>
using predecessor_value_types = pika::execution::experimental::value_types_of_t<Sender,
pika::execution::experimental::empty_env, Tuple, Variant>;
using predecessor_value_types = pika::util::detail::unique_t<pika::execution::experimental::value_types_of_t<Sender,
pika::execution::experimental::empty_env, Tuple, Variant>>;

template <template <typename...> class Variant>
using predecessor_error_types = pika::execution::experimental::error_types_of_t<Sender,
Expand All @@ -70,7 +70,7 @@ namespace pika::sync_wait_detail {
// there are multiple variants or multiple values sync_wait will
// fail to compile.
using result_type = std::decay_t<pika::execution::experimental::detail::single_result_t<
predecessor_value_types<pika::util::detail::pack, pika::util::detail::pack>>>;
predecessor_value_types<pika::util::detail::decayed_pack, pika::util::detail::pack>>>;

// Constant to indicate if the type of the result from the
// predecessor sender is void or not
Expand Down
4 changes: 0 additions & 4 deletions libs/pika/execution/tests/unit/algorithm_ensure_started.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ int main()
PIKA_TEST(set_value_called);
}

// stdexec still requires copyable senders (see issue
// https://github.com/NVIDIA/stdexec/issues/641).
#if !defined(PIKA_HAVE_STDEXEC)
{
std::atomic<bool> set_value_called{false};
std::atomic<bool> started{false};
Expand Down Expand Up @@ -107,7 +104,6 @@ int main()
ex::start(os);
PIKA_TEST(set_value_called);
}
#endif

// operator| overload
{
Expand Down
3 changes: 0 additions & 3 deletions libs/pika/execution/tests/unit/algorithm_just.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,7 @@ int main()
PIKA_TEST(set_value_called);
}

// TODO: The reference implementation does not ADL-isolate the just-sender.
#if !defined(PIKA_HAVE_STDEXEC)
test_adl_isolation(ex::just(my_namespace::my_type{}));
#endif

return 0;
}
3 changes: 0 additions & 3 deletions libs/pika/execution/tests/unit/algorithm_start_detached.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ int main()
PIKA_TEST(!tag_invoke_overload_called);
}

// Piping into start_detached is not allowed according to the specification.
#if !defined(PIKA_HAVE_STDEXEC)
// operator| overload
{
std::atomic<bool> start_called{false};
Expand All @@ -89,7 +87,6 @@ int main()
PIKA_TEST(connect_called);
PIKA_TEST(!tag_invoke_overload_called);
}
#endif

// tag_invoke overload
{
Expand Down
12 changes: 12 additions & 0 deletions libs/pika/execution/tests/unit/scheduler_queries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ struct customized_scheduler : uncustomized_scheduler
inline constexpr struct custom_scheduler_query_t
{
friend constexpr bool tag_invoke(
#if defined(PIKA_HAVE_STDEXEC)
ex::forwarding_query_t, custom_scheduler_query_t const&) noexcept
#else
ex::forwarding_scheduler_query_t, custom_scheduler_query_t const&) noexcept
#endif
{
return true;
}
Expand All @@ -92,11 +96,19 @@ int main()

// get_forward_progress_guarantee is not a forwarding query
{
#if defined(PIKA_HAVE_STDEXEC)
static_assert(!ex::forwarding_query(ex::get_forward_progress_guarantee));
#else
static_assert(!ex::forwarding_scheduler_query(ex::get_forward_progress_guarantee));
#endif
}

// The custom query is a forwarding query
{
#if defined(PIKA_HAVE_STDEXEC)
static_assert(ex::forwarding_query(custom_scheduler_query));
#else
static_assert(ex::forwarding_scheduler_query(custom_scheduler_query));
#endif
}
}
6 changes: 4 additions & 2 deletions libs/pika/execution_base/tests/unit/any_sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,10 @@ struct wait_globals

void test_globals()
{
// TODO: No ensure_started implementation in reference implementation.
#if !defined(PIKA_HAVE_STDEXEC)
// No implementation of unique_any_sender in stdexec
#if defined(PIKA_HAVE_STDEXEC)
global_any_sender = std::move(global_any_sender) | ex::ensure_started() | ex::split();
#else
global_unique_any_sender = std::move(global_unique_any_sender) | ex::ensure_started();
global_any_sender = std::move(global_any_sender) | ex::ensure_started() | ex::split();
#endif
Expand Down
10 changes: 10 additions & 0 deletions libs/pika/execution_base/tests/unit/basic_operation_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,22 @@ int main()
{
static_assert(!pika::execution::experimental::is_operation_state_v<mylib::state_1>,
"mylib::state_1 is not an operation state");
#if defined(PIKA_HAVE_STDEXEC)
static_assert(pika::execution::experimental::is_operation_state_v<mylib::state_2>,
"mylib::state_2 is an operation state");
#else
static_assert(!pika::execution::experimental::is_operation_state_v<mylib::state_2>,
"mylib::state_2 is not an operation state");
#endif
static_assert(pika::execution::experimental::is_operation_state_v<mylib::state_3>,
"mylib::state_3 is an operation state");
#if defined(PIKA_HAVE_STDEXEC)
static_assert(pika::execution::experimental::is_operation_state_v<mylib::state_4>,
"mylib::state_4 is an operation state");
#else
static_assert(!pika::execution::experimental::is_operation_state_v<mylib::state_4>,
"mylib::state_4 is not an operation state");
#endif
static_assert(pika::execution::experimental::is_operation_state_v<mylib::state_5>,
"mylib::state_5 is an operation state");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ namespace pika::thread_pool_bulk_detail {
auto const num_chunks = (n + chunk_size - 1) / chunk_size;

// Store sent values in the operation state
r.op_state->ts.template emplace<std::tuple<Ts...>>(PIKA_FORWARD(Ts, ts)...);
r.op_state->ts.template emplace<std::tuple<Ts&&...>>(PIKA_FORWARD(Ts, ts)...);

// Initialize the queues for all worker threads so that
// worker threads can start stealing immediately when
Expand Down
49 changes: 7 additions & 42 deletions libs/pika/executors/tests/unit/std_thread_scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,14 +556,8 @@ void test_when_all_vector()

auto when1 = ex::when_all_vector(std::move(senders));

#if !defined(PIKA_HAVE_STDEXEC)
bool executed{false};
#endif
tt::sync_wait(std::move(when1)
// TODO: ADL issues? Uncommenting instantiates set_value with the
// sync_wait_receiver from when_all_vector_receiver, i.e. then is
// "skipped".
#if !defined(PIKA_HAVE_STDEXEC)
| ex::then([parent_id, &executed](std::vector<double> v) {
PIKA_TEST_NEQ(parent_id, std::this_thread::get_id());
PIKA_TEST_EQ(v.size(), std::size_t(3));
Expand All @@ -572,11 +566,8 @@ void test_when_all_vector()
PIKA_TEST_EQ(v[2], 3.14);
executed = true;
})
#endif
);
#if !defined(PIKA_HAVE_STDEXEC)
PIKA_TEST(executed);
#endif
}

{
Expand All @@ -601,14 +592,8 @@ void test_when_all_vector()

try
{
tt::sync_wait(ex::when_all_vector(std::move(senders))
// TODO: ADL issues? Uncommenting instantiates set_value with the
// sync_wait_receiver from when_all_vector_receiver, i.e. then is
// "skipped".
#if !defined(PIKA_HAVE_STDEXEC)
| ex::then([](std::vector<int>) { PIKA_TEST(false); })
#endif
);
tt::sync_wait(ex::when_all_vector(std::move(senders)) |
ex::then([](std::vector<int>) { PIKA_TEST(false); }));
PIKA_TEST(false);
}
catch (std::runtime_error const& e)
Expand Down Expand Up @@ -642,14 +627,8 @@ void test_when_all_vector()

try
{
tt::sync_wait(ex::when_all_vector(std::move(senders))
// TODO: ADL issues? Uncommenting instantiates set_value with the
// sync_wait_receiver from when_all_vector_receiver, i.e. then is
// "skipped".
#if !defined(PIKA_HAVE_STDEXEC)
| ex::then([](std::vector<int>) { PIKA_TEST(false); })
#endif
);
tt::sync_wait(ex::when_all_vector(std::move(senders)) |
ex::then([](std::vector<int>) { PIKA_TEST(false); }));
PIKA_TEST(false);
}
catch (std::runtime_error const& e)
Expand Down Expand Up @@ -680,16 +659,13 @@ void test_ensure_started()
PIKA_TEST_EQ(tt::sync_wait(std::move(s)), 42);
}

// TODO: The split sender in stdexec is not copyable.
#if !defined(PIKA_HAVE_STDEXEC)
{
auto s = ex::transfer_just(sched, 42) | ex::ensure_started() | ex::split();
PIKA_TEST_EQ(tt::sync_wait(s), 42);
PIKA_TEST_EQ(tt::sync_wait(s), 42);
PIKA_TEST_EQ(tt::sync_wait(s), 42);
PIKA_TEST_EQ(tt::sync_wait(std::move(s)), 42);
}
#endif

// It's allowed to discard the sender from ensure_started
{
Expand All @@ -699,8 +675,6 @@ void test_ensure_started()

void test_ensure_started_when_all()
{
// TODO: The split sender in stdexec is not copyable.
#if !defined(PIKA_HAVE_STDEXEC)
ex::std_thread_scheduler sched{};

{
Expand Down Expand Up @@ -801,13 +775,10 @@ void test_ensure_started_when_all()
PIKA_TEST_EQ(first_task_calls, std::size_t(1));
PIKA_TEST_EQ(successor_task_calls, std::size_t(2));
}
#endif
}

void test_split()
{
// TODO: No default implementation in stdexec.
#if !defined(PIKA_HAVE_STDEXEC)
ex::std_thread_scheduler sched{};

{
Expand All @@ -831,13 +802,10 @@ void test_split()
PIKA_TEST_EQ(tt::sync_wait(s), 42);
PIKA_TEST_EQ(tt::sync_wait(std::move(s)), 42);
}
#endif
}

void test_split_when_all()
{
// TODO: No default implementation in stdexec.
#if !defined(PIKA_HAVE_STDEXEC)
ex::std_thread_scheduler sched{};

{
Expand Down Expand Up @@ -902,7 +870,6 @@ void test_split_when_all()
PIKA_TEST_EQ(first_task_calls, std::size_t(1));
PIKA_TEST_EQ(successor_task_calls, std::size_t(2));
}
#endif
}

void test_let_value()
Expand Down Expand Up @@ -1150,8 +1117,6 @@ void test_detach()

void test_bulk()
{
// TODO: No default implementation in stdexec.
#if !defined(PIKA_HAVE_STDEXEC)
std::vector<int> const ns = {0, 1, 10, 43};

for (int n : ns)
Expand Down Expand Up @@ -1187,6 +1152,8 @@ void test_bulk()
}
}

// The specification only allows integral shapes
#if !defined(PIKA_HAVE_STDEXEC)
{
std::unordered_set<std::string> string_map;
std::vector<std::string> v = {"hello", "brave", "new", "world"};
Expand All @@ -1205,6 +1172,7 @@ void test_bulk()
PIKA_TEST(string_map.find(s) != string_map.end());
}
}
#endif

for (auto n : ns)
{
Expand Down Expand Up @@ -1250,7 +1218,6 @@ void test_bulk()
}
}
}
#endif
}

void test_completion_scheduler()
Expand Down Expand Up @@ -1282,7 +1249,6 @@ void test_completion_scheduler()
"the completion scheduler should be a std_thread_scheduler");
}

#if !defined(PIKA_HAVE_STDEXEC)
{
auto sender = ex::bulk(ex::schedule(ex::std_thread_scheduler{}), 10, [](int) {});
auto completion_scheduler =
Expand Down Expand Up @@ -1313,7 +1279,6 @@ void test_completion_scheduler()
std::is_same_v<std::decay_t<decltype(completion_scheduler)>, ex::std_thread_scheduler>,
"the completion scheduler should be a std_thread_scheduler");
}
#endif
}

void test_scheduler_queries()
Expand Down
Loading

0 comments on commit 3e92571

Please sign in to comment.