Skip to content

Commit

Permalink
Merge 2d260f0 into 4b6e4c9
Browse files Browse the repository at this point in the history
  • Loading branch information
aurianer authored May 9, 2023
2 parents 4b6e4c9 + 2d260f0 commit 1b5ba38
Show file tree
Hide file tree
Showing 18 changed files with 77 additions and 134 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
2 changes: 1 addition & 1 deletion libs/pika/async_cuda/tests/performance/synchronize.cu
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ int pika_main(pika::program_options::variables_map& vm)

// The compilation of this loop unrolling with llvm-amdgpu's
// Clang 5.3.3 is hanging.
#if !(defined(PIKA_HAVE_STDEXEC) || defined(PIKA_HAVE_HIP))
#if !defined(PIKA_HAVE_HIP)
{
cu::enable_user_polling poll("default");

Expand Down
6 changes: 0 additions & 6 deletions libs/pika/async_cuda/tests/unit/cublas_matmul.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,6 @@ void matrixMultiply(pika::cuda::experimental::cuda_scheduler& cuda_sched, sMatri

// See https://github.com/brycelelbach/wg21_p2300_std_execution/issues/466
// for details.
#if defined(PIKA_HAVE_STDEXEC)
std::cout << "skipping remainder of test because the stdexec implementation of split does not "
"yet support move-only senders"
<< std::endl;
#else
pika::chrono::detail::high_resolution_timer t2;

// This loop is currently inefficient. Because of the type-erasure with
Expand Down Expand Up @@ -259,7 +254,6 @@ void matrixMultiply(pika::cuda::experimental::cuda_scheduler& cuda_sched, sMatri
});

tt::sync_wait(std::move(all_done));
#endif
whip::free(d_A);
whip::free(d_B);
whip::free(d_C);
Expand Down
3 changes: 0 additions & 3 deletions libs/pika/async_cuda/tests/unit/cuda_bulk.cu
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ int pika_main()
}
}

// The reference implementation does not support ranges as the shape
#if !defined(PIKA_HAVE_STDEXEC)
// Range
for (element_type n : {1, 42, 10007})
{
Expand Down Expand Up @@ -105,7 +103,6 @@ int pika_main()
PIKA_TEST_EQ(host_vector[i], i);
}
}
#endif

return pika::finalize();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ 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 +71,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
}
}
3 changes: 0 additions & 3 deletions libs/pika/execution_base/tests/unit/any_sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,11 +625,8 @@ struct wait_globals

void test_globals()
{
// TODO: No ensure_started implementation in reference implementation.
#if !defined(PIKA_HAVE_STDEXEC)
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
}

void test_empty_any_sender()
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 @@ -82,12 +82,20 @@ namespace pika::thread_pool_bulk_detail {
thread_pool_bulk_sender& operator=(thread_pool_bulk_sender&&) = default;
thread_pool_bulk_sender& operator=(thread_pool_bulk_sender const&) = default;

template <typename Tuple>
struct value_types_helper
{
using type = pika::util::detail::transform_t<Tuple, std::decay>;
};

#if defined(PIKA_HAVE_STDEXEC)
using is_sender = void;

template <template <typename...> class Tuple, template <typename...> class Variant>
using value_types = pika::execution::experimental::value_types_of_t<Sender,
pika::execution::experimental::empty_env, Tuple, Variant>;
using value_types = pika::util::detail::transform_t<
pika::execution::experimental::value_types_of_t<Sender,
pika::execution::experimental::empty_env, Tuple, Variant>,
value_types_helper>;

template <template <typename...> class Variant>
using error_types = pika::util::detail::unique_t<
Expand All @@ -102,8 +110,10 @@ namespace pika::thread_pool_bulk_detail {
pika::execution::experimental::set_error_t(std::exception_ptr)>>;
#else
template <template <typename...> class Tuple, template <typename...> class Variant>
using value_types = typename pika::execution::experimental::sender_traits<
Sender>::template value_types<Tuple, Variant>;
using value_types =
pika::util::detail::transform_t<typename pika::execution::experimental::sender_traits<
Sender>::template value_types<Tuple, Variant>,
value_types_helper>;

template <template <typename...> class Variant>
using error_types = pika::util::detail::unique_t<
Expand Down Expand Up @@ -402,7 +412,8 @@ 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<std::decay_t<Ts>...>>(
PIKA_FORWARD(Ts, ts)...);

// Initialize the queues for all worker threads so that
// worker threads can start stealing immediately when
Expand Down
Loading

0 comments on commit 1b5ba38

Please sign in to comment.