diff --git a/libs/pika/algorithms/CMakeLists.txt b/libs/pika/algorithms/CMakeLists.txt index e1d3bf74f1..8dd34e943f 100644 --- a/libs/pika/algorithms/CMakeLists.txt +++ b/libs/pika/algorithms/CMakeLists.txt @@ -175,6 +175,12 @@ set(algorithms_headers pika/parallel/util/detail/scoped_executor_parameters.hpp pika/parallel/util/detail/select_partitioner.hpp pika/parallel/util/detail/sender_util.hpp + pika/parallel/util/detail/simd/vector_pack_alignment_size.hpp + pika/parallel/util/detail/simd/vector_pack_all_any_none.hpp + pika/parallel/util/detail/simd/vector_pack_count_bits.hpp + pika/parallel/util/detail/simd/vector_pack_find.hpp + pika/parallel/util/detail/simd/vector_pack_load_store.hpp + pika/parallel/util/detail/simd/vector_pack_type.hpp pika/parallel/util/foreach_partitioner.hpp pika/parallel/util/invoke_projected.hpp pika/parallel/util/loop.hpp @@ -192,6 +198,12 @@ set(algorithms_headers pika/parallel/util/scan_partitioner.hpp pika/parallel/util/transfer.hpp pika/parallel/util/transform_loop.hpp + pika/parallel/util/vector_pack_alignment_size.hpp + pika/parallel/util/vector_pack_all_any_none.hpp + pika/parallel/util/vector_pack_count_bits.hpp + pika/parallel/util/vector_pack_find.hpp + pika/parallel/util/vector_pack_load_store.hpp + pika/parallel/util/vector_pack_type.hpp pika/parallel/util/zip_iterator.hpp ) diff --git a/libs/pika/algorithms/include/pika/algorithms/traits/projected.hpp b/libs/pika/algorithms/include/pika/algorithms/traits/projected.hpp index 6048cc9837..237566939d 100644 --- a/libs/pika/algorithms/include/pika/algorithms/traits/projected.hpp +++ b/libs/pika/algorithms/include/pika/algorithms/traits/projected.hpp @@ -8,11 +8,11 @@ #include #include -#include -#include #include #include #include +#include +#include #include #include diff --git a/libs/pika/algorithms/include/pika/parallel/algorithms/count.hpp b/libs/pika/algorithms/include/pika/parallel/algorithms/count.hpp index c8f19e4ffa..0f93cd1eef 100644 --- a/libs/pika/algorithms/include/pika/parallel/algorithms/count.hpp +++ b/libs/pika/algorithms/include/pika/parallel/algorithms/count.hpp @@ -162,7 +162,6 @@ namespace pika { #include #include -#include #include #include #include @@ -170,6 +169,7 @@ namespace pika { #include #include #include +#include #include #include diff --git a/libs/pika/algorithms/include/pika/parallel/datapar/find.hpp b/libs/pika/algorithms/include/pika/parallel/datapar/find.hpp index 1784322ca7..f2d52d22fe 100644 --- a/libs/pika/algorithms/include/pika/parallel/datapar/find.hpp +++ b/libs/pika/algorithms/include/pika/parallel/datapar/find.hpp @@ -10,14 +10,14 @@ #if defined(PIKA_HAVE_DATAPAR) #include -#include -#include #include #include #include #include #include #include +#include +#include #include #include diff --git a/libs/pika/algorithms/include/pika/parallel/datapar/generate.hpp b/libs/pika/algorithms/include/pika/parallel/datapar/generate.hpp index 7a26670b89..24ff077379 100644 --- a/libs/pika/algorithms/include/pika/parallel/datapar/generate.hpp +++ b/libs/pika/algorithms/include/pika/parallel/datapar/generate.hpp @@ -10,13 +10,13 @@ #if defined(PIKA_HAVE_DATAPAR) #include -#include -#include #include #include #include #include #include +#include +#include #include #include diff --git a/libs/pika/algorithms/include/pika/parallel/datapar/iterator_helpers.hpp b/libs/pika/algorithms/include/pika/parallel/datapar/iterator_helpers.hpp index b948dfb33f..b6b09dd311 100644 --- a/libs/pika/algorithms/include/pika/parallel/datapar/iterator_helpers.hpp +++ b/libs/pika/algorithms/include/pika/parallel/datapar/iterator_helpers.hpp @@ -10,12 +10,12 @@ #if defined(PIKA_HAVE_DATAPAR) #include -#include -#include -#include #include #include #include +#include +#include +#include #include #include diff --git a/libs/pika/algorithms/include/pika/parallel/datapar/loop.hpp b/libs/pika/algorithms/include/pika/parallel/datapar/loop.hpp index 40d844f920..553aa99532 100644 --- a/libs/pika/algorithms/include/pika/parallel/datapar/loop.hpp +++ b/libs/pika/algorithms/include/pika/parallel/datapar/loop.hpp @@ -10,15 +10,15 @@ #if defined(PIKA_HAVE_DATAPAR) #include -#include -#include -#include #include #include #include #include #include #include +#include +#include +#include #include #include diff --git a/libs/pika/algorithms/include/pika/parallel/datapar/zip_iterator.hpp b/libs/pika/algorithms/include/pika/parallel/datapar/zip_iterator.hpp index 893e0f86b8..8fe597dbfb 100644 --- a/libs/pika/algorithms/include/pika/parallel/datapar/zip_iterator.hpp +++ b/libs/pika/algorithms/include/pika/parallel/datapar/zip_iterator.hpp @@ -14,10 +14,10 @@ #include #include -#include -#include -#include #include +#include +#include +#include #include #include diff --git a/libs/pika/execution/include/pika/execution/traits/vector_pack_alignment_size.hpp b/libs/pika/algorithms/include/pika/parallel/util/vector_pack_alignment_size.hpp similarity index 96% rename from libs/pika/execution/include/pika/execution/traits/vector_pack_alignment_size.hpp rename to libs/pika/algorithms/include/pika/parallel/util/vector_pack_alignment_size.hpp index 858073994f..ef4e189da8 100644 --- a/libs/pika/execution/include/pika/execution/traits/vector_pack_alignment_size.hpp +++ b/libs/pika/algorithms/include/pika/parallel/util/vector_pack_alignment_size.hpp @@ -67,7 +67,7 @@ namespace pika::parallel::traits::detail { } // namespace pika::parallel::traits::detail #if !defined(__CUDACC__) -#include +#include #endif #endif diff --git a/libs/pika/execution/include/pika/execution/traits/vector_pack_all_any_none.hpp b/libs/pika/algorithms/include/pika/parallel/util/vector_pack_all_any_none.hpp similarity index 82% rename from libs/pika/execution/include/pika/execution/traits/vector_pack_all_any_none.hpp rename to libs/pika/algorithms/include/pika/parallel/util/vector_pack_all_any_none.hpp index 9dbbad4559..87f156b179 100644 --- a/libs/pika/execution/include/pika/execution/traits/vector_pack_all_any_none.hpp +++ b/libs/pika/algorithms/include/pika/parallel/util/vector_pack_all_any_none.hpp @@ -11,7 +11,7 @@ #if defined(PIKA_HAVE_DATAPAR) #if !defined(__CUDACC__) -#include +#include #endif #endif diff --git a/libs/pika/execution/include/pika/execution/traits/vector_pack_count_bits.hpp b/libs/pika/algorithms/include/pika/parallel/util/vector_pack_count_bits.hpp similarity index 90% rename from libs/pika/execution/include/pika/execution/traits/vector_pack_count_bits.hpp rename to libs/pika/algorithms/include/pika/parallel/util/vector_pack_count_bits.hpp index 504f96ec76..0fa546e2c8 100644 --- a/libs/pika/execution/include/pika/execution/traits/vector_pack_count_bits.hpp +++ b/libs/pika/algorithms/include/pika/parallel/util/vector_pack_count_bits.hpp @@ -21,7 +21,7 @@ namespace pika::parallel::traits::detail { #if defined(PIKA_HAVE_DATAPAR) #if !defined(__CUDACC__) -#include +#include #endif #endif diff --git a/libs/pika/execution/include/pika/execution/traits/vector_pack_find.hpp b/libs/pika/algorithms/include/pika/parallel/util/vector_pack_find.hpp similarity index 84% rename from libs/pika/execution/include/pika/execution/traits/vector_pack_find.hpp rename to libs/pika/algorithms/include/pika/parallel/util/vector_pack_find.hpp index e2596ce3b9..b8dcfc3ac1 100644 --- a/libs/pika/execution/include/pika/execution/traits/vector_pack_find.hpp +++ b/libs/pika/algorithms/include/pika/parallel/util/vector_pack_find.hpp @@ -11,7 +11,7 @@ #if defined(PIKA_HAVE_DATAPAR) #if !defined(__CUDACC__) -#include +#include #endif #endif diff --git a/libs/pika/execution/include/pika/execution/traits/vector_pack_load_store.hpp b/libs/pika/algorithms/include/pika/parallel/util/vector_pack_load_store.hpp similarity index 91% rename from libs/pika/execution/include/pika/execution/traits/vector_pack_load_store.hpp rename to libs/pika/algorithms/include/pika/parallel/util/vector_pack_load_store.hpp index 106b644e5c..65548d6551 100644 --- a/libs/pika/execution/include/pika/execution/traits/vector_pack_load_store.hpp +++ b/libs/pika/algorithms/include/pika/parallel/util/vector_pack_load_store.hpp @@ -23,7 +23,7 @@ namespace pika::parallel::traits::detail { } // namespace pika::parallel::traits::detail #if !defined(__CUDACC__) -#include +#include #endif #endif diff --git a/libs/pika/execution/include/pika/execution/traits/vector_pack_type.hpp b/libs/pika/algorithms/include/pika/parallel/util/vector_pack_type.hpp similarity index 93% rename from libs/pika/execution/include/pika/execution/traits/vector_pack_type.hpp rename to libs/pika/algorithms/include/pika/parallel/util/vector_pack_type.hpp index 94cae43c57..0c84b7f03c 100644 --- a/libs/pika/execution/include/pika/execution/traits/vector_pack_type.hpp +++ b/libs/pika/algorithms/include/pika/parallel/util/vector_pack_type.hpp @@ -32,7 +32,7 @@ namespace pika::parallel::traits::detail { } // namespace pika::parallel::traits::detail #if !defined(__CUDACC__) -#include +#include #endif #endif diff --git a/libs/pika/algorithms/tests/unit/datapar_algorithms/generate_tests.hpp b/libs/pika/algorithms/tests/unit/datapar_algorithms/generate_tests.hpp index 9041b2bfcf..6943b09db9 100644 --- a/libs/pika/algorithms/tests/unit/datapar_algorithms/generate_tests.hpp +++ b/libs/pika/algorithms/tests/unit/datapar_algorithms/generate_tests.hpp @@ -8,10 +8,10 @@ #pragma once -#include #include #include #include +#include #include #include diff --git a/libs/pika/algorithms/tests/unit/datapar_algorithms/generaten_tests.hpp b/libs/pika/algorithms/tests/unit/datapar_algorithms/generaten_tests.hpp index 7d75155bd5..8dd26606a7 100644 --- a/libs/pika/algorithms/tests/unit/datapar_algorithms/generaten_tests.hpp +++ b/libs/pika/algorithms/tests/unit/datapar_algorithms/generaten_tests.hpp @@ -7,10 +7,10 @@ #pragma once -#include #include #include #include +#include #include #include diff --git a/libs/pika/execution/CMakeLists.txt b/libs/pika/execution/CMakeLists.txt index 1692ace86b..1591b365ed 100644 --- a/libs/pika/execution/CMakeLists.txt +++ b/libs/pika/execution/CMakeLists.txt @@ -46,21 +46,9 @@ set(execution_headers pika/execution/executors/rebind_executor.hpp pika/execution/executors/static_chunk_size.hpp pika/execution/scheduler_queries.hpp - pika/execution/traits/detail/simd/vector_pack_alignment_size.hpp - pika/execution/traits/detail/simd/vector_pack_all_any_none.hpp - pika/execution/traits/detail/simd/vector_pack_count_bits.hpp - pika/execution/traits/detail/simd/vector_pack_find.hpp - pika/execution/traits/detail/simd/vector_pack_load_store.hpp - pika/execution/traits/detail/simd/vector_pack_type.hpp pika/execution/traits/executor_traits.hpp pika/execution/traits/future_then_result_exec.hpp pika/execution/traits/is_execution_policy.hpp - pika/execution/traits/vector_pack_alignment_size.hpp - pika/execution/traits/vector_pack_all_any_none.hpp - pika/execution/traits/vector_pack_count_bits.hpp - pika/execution/traits/vector_pack_find.hpp - pika/execution/traits/vector_pack_load_store.hpp - pika/execution/traits/vector_pack_type.hpp ) set(execution_sources execution_parameter_callbacks.cpp) diff --git a/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_alignment_size.hpp b/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_alignment_size.hpp deleted file mode 100644 index 233d84210d..0000000000 --- a/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_alignment_size.hpp +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) 2021 Srinivas Yadav -// Copyright (c) 2016-2017 Hartmut Kaiser -// -// SPDX-License-Identifier: BSL-1.0 -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#pragma once - -#include - -#if defined(PIKA_HAVE_CXX20_EXPERIMENTAL_SIMD) -#include -#include - -#include - -namespace pika::parallel::traits::detail { - template - struct is_vector_pack> : std::true_type - { - }; - - template - struct is_vector_pack< - std::experimental::simd>> - : std::false_type - { - }; - - template - struct is_vector_pack< - std::experimental::simd> - : std::false_type - { - }; - - /////////////////////////////////////////////////////////////////////////// - template - struct is_scalar_vector_pack> - : std::false_type - { - }; - - template - struct is_scalar_vector_pack< - std::experimental::simd>> - : std::true_type - { - }; - - template - struct is_scalar_vector_pack< - std::experimental::simd> - : std::true_type - { - }; - - /////////////////////////////////////////////////////////////////////////// - template - struct vector_pack_alignment - { - static std::size_t const value = std::experimental::memory_alignment_v< - std::experimental::native_simd>; - }; - - template - struct vector_pack_alignment> - { - static std::size_t const value = std::experimental::memory_alignment_v< - std::experimental::simd>; - }; - - template - struct vector_pack_alignment< - std::experimental::simd> - { - static std::size_t const value = std::experimental::memory_alignment_v< - std::experimental::simd>; - }; - - template - struct vector_pack_alignment< - std::experimental::simd>> - { - static std::size_t const value = - std::experimental::memory_alignment_v>>; - }; - - /////////////////////////////////////////////////////////////////////////// - template - struct vector_pack_size - { - static std::size_t const value = - std::experimental::native_simd::size(); - }; - - template - struct vector_pack_size> - { - static std::size_t const value = - std::experimental::simd::size(); - }; - - template - struct vector_pack_size< - std::experimental::simd> - { - static std::size_t const value = std::experimental::simd::size(); - }; - - template - struct vector_pack_size< - std::experimental::simd>> - { - static std::size_t const value = std::experimental::simd>::size(); - }; -} // namespace pika::parallel::traits::detail - -#endif diff --git a/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_all_any_none.hpp b/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_all_any_none.hpp deleted file mode 100644 index 51a12e1cca..0000000000 --- a/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_all_any_none.hpp +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2021 Srinivas Yadav -// -// SPDX-License-Identifier: BSL-1.0 -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#pragma once - -#include - -#if defined(PIKA_HAVE_CXX20_EXPERIMENTAL_SIMD) -#include - -#include - -namespace pika::parallel::traits::detail { - template - PIKA_HOST_DEVICE PIKA_FORCEINLINE std::size_t - all_of(std::experimental::simd_mask const& msk) - { - return std::experimental::all_of(msk); - } - - /////////////////////////////////////////////////////////////////////// - template - PIKA_HOST_DEVICE PIKA_FORCEINLINE std::size_t - any_of(std::experimental::simd_mask const& msk) - { - return std::experimental::any_of(msk); - } - - /////////////////////////////////////////////////////////////////////// - template - PIKA_HOST_DEVICE PIKA_FORCEINLINE std::size_t - none_of(std::experimental::simd_mask const& msk) - { - return std::experimental::none_of(msk); - } -} // namespace pika::parallel::traits::detail - -#endif diff --git a/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_count_bits.hpp b/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_count_bits.hpp deleted file mode 100644 index d82b2dc4e7..0000000000 --- a/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_count_bits.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021 Srinivas Yadav -// Copyright (c) 2016-2017 Hartmut Kaiser -// -// SPDX-License-Identifier: BSL-1.0 -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#pragma once - -#include - -#if defined(PIKA_HAVE_CXX20_EXPERIMENTAL_SIMD) -#include - -#include - -namespace pika::parallel::traits::detail { - template - PIKA_HOST_DEVICE PIKA_FORCEINLINE std::size_t - count_bits(std::experimental::simd_mask const& mask) - { - return std::experimental::popcount(mask); - } -} // namespace pika::parallel::traits::detail - -#endif diff --git a/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_find.hpp b/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_find.hpp deleted file mode 100644 index a511b9839e..0000000000 --- a/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_find.hpp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2021 Srinivas Yadav -// -// SPDX-License-Identifier: BSL-1.0 -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#pragma once - -#include - -#if defined(PIKA_HAVE_CXX20_EXPERIMENTAL_SIMD) -#include - -#include - -namespace pika::parallel::traits::detail { - template - PIKA_HOST_DEVICE PIKA_FORCEINLINE int - find_first_of(std::experimental::simd_mask const& msk) - { - if (std::experimental::any_of(msk)) - { - return std::experimental::find_first_set(msk); - } - return -1; - } -} // namespace pika::parallel::traits::detail - -#endif diff --git a/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_load_store.hpp b/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_load_store.hpp deleted file mode 100644 index 1e31d8f56f..0000000000 --- a/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_load_store.hpp +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2021 Srinivas Yadav -// Copyright (c) 2016-2017 Hartmut Kaiser -// -// SPDX-License-Identifier: BSL-1.0 -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#pragma once - -#include - -#if defined(PIKA_HAVE_CXX20_EXPERIMENTAL_SIMD) -#include -#include -#include - -#include - -namespace pika::parallel::traits::detail { - template - struct vector_pack_load - { - template - static V aligned(Iter const& iter) - { - return V(std::addressof(*iter), std::experimental::vector_aligned); - } - - template - static V unaligned(Iter const& iter) - { - return V(std::addressof(*iter), std::experimental::element_aligned); - } - }; - - /////////////////////////////////////////////////////////////////////////// - template - struct vector_pack_store - { - template - static void aligned(V& value, Iter const& iter) - { - value.copy_to( - std::addressof(*iter), std::experimental::vector_aligned); - } - - template - static void unaligned(V& value, Iter const& iter) - { - value.copy_to( - std::addressof(*iter), std::experimental::element_aligned); - } - }; -} // namespace pika::parallel::traits::detail - -#endif diff --git a/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_type.hpp b/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_type.hpp deleted file mode 100644 index 95b0450f91..0000000000 --- a/libs/pika/execution/include/pika/execution/traits/detail/simd/vector_pack_type.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2021 Srinivas Yadav -// Copyright (c) 2016-2017 Hartmut Kaiser -// -// SPDX-License-Identifier: BSL-1.0 -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#pragma once - -#include - -#if defined(PIKA_HAVE_CXX20_EXPERIMENTAL_SIMD) - -#include - -#include -#include - -namespace pika::parallel::traits::detail { - template - struct vector_pack_type_impl - { - using type = std::experimental::fixed_size_simd; - }; - - template - struct vector_pack_type_impl - { - typedef typename std::conditional::value, - std::experimental::simd_abi::native, Abi>::type abi_type; - - using type = std::experimental::simd; - }; - - template - struct vector_pack_type_impl - { - typedef std::experimental::simd - type; - }; - - /////////////////////////////////////////////////////////////////////////// - template - struct vector_pack_type : vector_pack_type_impl - { - }; -} // namespace pika::parallel::traits::detail - -#endif