Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
fnrizzi committed Aug 3, 2023
1 parent 9d13d3b commit e7593a7
Show file tree
Hide file tree
Showing 10 changed files with 143 additions and 193 deletions.
11 changes: 4 additions & 7 deletions algorithms/src/std_algorithms/Kokkos_Copy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,17 @@ namespace Experimental {
// overload set accepting execution space
//
template <
typename ExecutionSpace, typename InputIterator, typename OutputIterator,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
typename ExecutionSpace, typename InputIterator, typename OutputIterator,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
OutputIterator copy(const ExecutionSpace& ex, InputIterator first,
InputIterator last, OutputIterator d_first)
{
InputIterator last, OutputIterator d_first) {
return Impl::copy_exespace_impl("Kokkos::copy_iterator_api_default", ex,
first, last, d_first);
}

template <
typename ExecutionSpace, typename InputIterator, typename OutputIterator,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
OutputIterator copy(const std::string& label, const ExecutionSpace& ex,
InputIterator first, InputIterator last,
OutputIterator d_first) {
Expand Down
13 changes: 5 additions & 8 deletions algorithms/src/std_algorithms/Kokkos_CopyBackward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ IteratorType2 copy_backward(const ExecutionSpace& ex, IteratorType1 first,
"Kokkos::copy_backward_iterator_api_default", ex, first, last, d_last);
}

template <typename ExecutionSpace, typename IteratorType1,
typename IteratorType2,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
template <
typename ExecutionSpace, typename IteratorType1, typename IteratorType2,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
IteratorType2 copy_backward(const std::string& label, const ExecutionSpace& ex,
IteratorType1 first, IteratorType1 last,
IteratorType2 d_last) {
Expand Down Expand Up @@ -79,8 +78,7 @@ auto copy_backward(const std::string& label, const ExecutionSpace& ex,
//
template <typename TeamHandleType, typename IteratorType1,
typename IteratorType2,
std::enable_if_t<::Kokkos::is_team_handle_v<TeamHandleType>, int> = 0
>
std::enable_if_t<::Kokkos::is_team_handle_v<TeamHandleType>, int> = 0>
KOKKOS_FUNCTION IteratorType2 copy_backward(const TeamHandleType& teamHandle,
IteratorType1 first,
IteratorType1 last,
Expand All @@ -90,8 +88,7 @@ KOKKOS_FUNCTION IteratorType2 copy_backward(const TeamHandleType& teamHandle,

template <typename TeamHandleType, typename DataType1, typename... Properties1,
typename DataType2, typename... Properties2,
std::enable_if_t<::Kokkos::is_team_handle_v<TeamHandleType>, int> = 0
>
std::enable_if_t<::Kokkos::is_team_handle_v<TeamHandleType>, int> = 0>
KOKKOS_FUNCTION auto copy_backward(
const TeamHandleType& teamHandle,
const ::Kokkos::View<DataType1, Properties1...>& source,
Expand Down
31 changes: 13 additions & 18 deletions algorithms/src/std_algorithms/Kokkos_CopyN.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,21 @@ namespace Experimental {
// overload set accepting execution space
//
template <
typename ExecutionSpace, typename InputIterator, typename Size,
typename OutputIterator,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
OutputIterator copy_n(const ExecutionSpace& ex, InputIterator first,
Size count, OutputIterator result) {
typename ExecutionSpace, typename InputIterator, typename Size,
typename OutputIterator,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
OutputIterator copy_n(const ExecutionSpace& ex, InputIterator first, Size count,
OutputIterator result) {
return Impl::copy_n_exespace_impl("Kokkos::copy_n_iterator_api_default", ex,
first, count, result);
}

template <
typename ExecutionSpace, typename InputIterator, typename Size,
typename OutputIterator,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
OutputIterator copy_n(const std::string& label,
const ExecutionSpace& ex, InputIterator first,
Size count, OutputIterator result) {
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
OutputIterator copy_n(const std::string& label, const ExecutionSpace& ex,
InputIterator first, Size count, OutputIterator result) {
return Impl::copy_n_exespace_impl(label, ex, first, count, result);
}

Expand Down Expand Up @@ -83,18 +80,16 @@ auto copy_n(const std::string& label, const ExecutionSpace& ex,
//
template <typename TeamHandleType, typename InputIterator, typename Size,
typename OutputIterator,
std::enable_if_t<::Kokkos::is_team_handle_v<TeamHandleType>, int> = 0
>
KOKKOS_FUNCTION OutputIterator copy_n(const TeamHandleType& teamHandle, InputIterator first,
Size count, OutputIterator result)
{
std::enable_if_t<::Kokkos::is_team_handle_v<TeamHandleType>, int> = 0>
KOKKOS_FUNCTION OutputIterator copy_n(const TeamHandleType& teamHandle,
InputIterator first, Size count,
OutputIterator result) {
return Impl::copy_n_team_impl(teamHandle, first, count, result);
}

template <typename TeamHandleType, typename DataType1, typename... Properties1,
typename Size, typename DataType2, typename... Properties2,
std::enable_if_t<::Kokkos::is_team_handle_v<TeamHandleType>, int> = 0
>
std::enable_if_t<::Kokkos::is_team_handle_v<TeamHandleType>, int> = 0>
KOKKOS_FUNCTION auto copy_n(
const TeamHandleType& teamHandle,
const ::Kokkos::View<DataType1, Properties1...>& source, Size count,
Expand Down
17 changes: 7 additions & 10 deletions algorithms/src/std_algorithms/Kokkos_Count.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ namespace Experimental {
//
template <
typename ExecutionSpace, typename IteratorType, typename T,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
typename IteratorType::difference_type count(const ExecutionSpace& ex,
IteratorType first,
IteratorType last,
const T& value)
{
const T& value) {
return Impl::count_exespace_impl("Kokkos::count_iterator_api_default", ex,
first, last, value);
}
Expand All @@ -51,10 +49,9 @@ typename IteratorType::difference_type count(const std::string& label,
}

template <
typename ExecutionSpace, typename DataType,
typename... Properties, typename T,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
typename ExecutionSpace, typename DataType, typename... Properties,
typename T,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
auto count(const ExecutionSpace& ex,
const ::Kokkos::View<DataType, Properties...>& v, const T& value) {
Impl::static_assert_is_admissible_to_kokkos_std_algorithms(v);
Expand All @@ -66,8 +63,8 @@ auto count(const ExecutionSpace& ex,

template <
typename ExecutionSpace, typename DataType, typename... Properties,
typename T, std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
typename T,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
auto count(const std::string& label, const ExecutionSpace& ex,
const ::Kokkos::View<DataType, Properties...>& v, const T& value) {
Impl::static_assert_is_admissible_to_kokkos_std_algorithms(v);
Expand Down
53 changes: 22 additions & 31 deletions algorithms/src/std_algorithms/Kokkos_CountIf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,32 @@ namespace Experimental {
// overload set accepting execution space
//
template <
typename ExecutionSpace, typename IteratorType, typename Predicate,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
typename IteratorType::difference_type
count_if(const ExecutionSpace& ex, IteratorType first,
IteratorType last, Predicate predicate)
{
typename ExecutionSpace, typename IteratorType, typename Predicate,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
typename IteratorType::difference_type count_if(const ExecutionSpace& ex,
IteratorType first,
IteratorType last,
Predicate predicate) {
return Impl::count_if_exespace_impl("Kokkos::count_if_iterator_api_default",
ex, first, last, std::move(predicate));
}

template <
typename ExecutionSpace, typename IteratorType, typename Predicate,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
typename IteratorType::difference_type
count_if(const std::string& label, const ExecutionSpace& ex,
IteratorType first, IteratorType last,
Predicate predicate)
{
typename ExecutionSpace, typename IteratorType, typename Predicate,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
typename IteratorType::difference_type count_if(const std::string& label,
const ExecutionSpace& ex,
IteratorType first,
IteratorType last,
Predicate predicate) {
return Impl::count_if_exespace_impl(label, ex, first, last,
std::move(predicate));
}

template <
typename ExecutionSpace, typename DataType, typename... Properties,
typename Predicate,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
auto count_if(const ExecutionSpace& ex,
const ::Kokkos::View<DataType, Properties...>& v,
Predicate predicate) {
Expand Down Expand Up @@ -84,26 +81,20 @@ auto count_if(const std::string& label, const ExecutionSpace& ex,
//
// overload set accepting team handle
//
template <
typename ExecutionSpace, typename IteratorType, typename Predicate,
std::enable_if_t<::Kokkos::is_team_handle_v<ExecutionSpace>, int> = 0
>
template <typename ExecutionSpace, typename IteratorType, typename Predicate,
std::enable_if_t<::Kokkos::is_team_handle_v<ExecutionSpace>, int> = 0>
KOKKOS_FUNCTION typename IteratorType::difference_type count_if(
const ExecutionSpace& ex, IteratorType first,
IteratorType last, Predicate predicate)
{
const ExecutionSpace& ex, IteratorType first, IteratorType last,
Predicate predicate) {
return Impl::count_if_team_impl(ex, first, last, std::move(predicate));
}

template <
typename ExecutionSpace, typename DataType, typename... Properties,
typename Predicate,
std::enable_if_t<::Kokkos::is_team_handle_v<ExecutionSpace>, int> = 0
>
template <typename ExecutionSpace, typename DataType, typename... Properties,
typename Predicate,
std::enable_if_t<::Kokkos::is_team_handle_v<ExecutionSpace>, int> = 0>
KOKKOS_FUNCTION auto count_if(const ExecutionSpace& ex,
const ::Kokkos::View<DataType, Properties...>& v,
Predicate predicate)
{
Predicate predicate) {
Impl::static_assert_is_admissible_to_kokkos_std_algorithms(v);

namespace KE = ::Kokkos::Experimental;
Expand Down
17 changes: 7 additions & 10 deletions algorithms/src/std_algorithms/Kokkos_Remove.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,18 @@ namespace Experimental {
//
template <
typename ExecutionSpace, typename Iterator, typename ValueType,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
Iterator remove(const ExecutionSpace& ex, Iterator first, Iterator last,
const ValueType& value) {
const ValueType& value) {
return Impl::remove_exespace_impl("Kokkos::remove_iterator_api_default", ex,
first, last, value);
}

template <
typename ExecutionSpace, typename Iterator, typename ValueType,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
Iterator remove(const std::string& label, const ExecutionSpace& ex,
Iterator first, Iterator last, const ValueType& value) {
Iterator first, Iterator last, const ValueType& value) {
return Impl::remove_exespace_impl(label, ex, first, last, value);
}

Expand Down Expand Up @@ -77,11 +75,10 @@ auto remove(const std::string& label, const ExecutionSpace& ex,
// since they cause issues on device because of the string allocation.
//
template <typename TeamHandleType, typename Iterator, typename ValueType,
std::enable_if_t<::Kokkos::is_team_handle_v<TeamHandleType>, int> = 0
>
std::enable_if_t<::Kokkos::is_team_handle_v<TeamHandleType>, int> = 0>
KOKKOS_FUNCTION Iterator remove(const TeamHandleType& teamHandle,
Iterator first, Iterator last,
const ValueType& value) {
Iterator first, Iterator last,
const ValueType& value) {
return Impl::remove_team_impl(teamHandle, first, last, value);
}

Expand Down
33 changes: 14 additions & 19 deletions algorithms/src/std_algorithms/Kokkos_RemoveCopy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ namespace Experimental {
template <
typename ExecutionSpace, typename InputIterator, typename OutputIterator,
typename ValueType,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
OutputIterator remove_copy(
const ExecutionSpace& ex, InputIterator first_from,
InputIterator last_from, OutputIterator first_dest,
const ValueType& value) {
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
OutputIterator remove_copy(const ExecutionSpace& ex, InputIterator first_from,
InputIterator last_from, OutputIterator first_dest,
const ValueType& value) {
return Impl::remove_copy_exespace_impl(
"Kokkos::remove_copy_iterator_api_default", ex, first_from, last_from,
first_dest, value);
Expand All @@ -43,12 +41,10 @@ template <
template <
typename ExecutionSpace, typename InputIterator, typename OutputIterator,
typename ValueType,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
OutputIterator remove_copy(
const std::string& label, const ExecutionSpace& ex,
InputIterator first_from, InputIterator last_from,
OutputIterator first_dest, const ValueType& value) {
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
OutputIterator remove_copy(const std::string& label, const ExecutionSpace& ex,
InputIterator first_from, InputIterator last_from,
OutputIterator first_dest, const ValueType& value) {
return Impl::remove_copy_exespace_impl(label, ex, first_from, last_from,
first_dest, value);
}
Expand Down Expand Up @@ -95,13 +91,12 @@ auto remove_copy(const std::string& label, const ExecutionSpace& ex,
//
template <typename TeamHandleType, typename InputIterator,
typename OutputIterator, typename ValueType,
std::enable_if_t<::Kokkos::is_team_handle_v<TeamHandleType>, int> = 0
>
KOKKOS_FUNCTION OutputIterator remove_copy(
const TeamHandleType& teamHandle, InputIterator first_from,
InputIterator last_from, OutputIterator first_dest,
const ValueType& value)
{
std::enable_if_t<::Kokkos::is_team_handle_v<TeamHandleType>, int> = 0>
KOKKOS_FUNCTION OutputIterator remove_copy(const TeamHandleType& teamHandle,
InputIterator first_from,
InputIterator last_from,
OutputIterator first_dest,
const ValueType& value) {
return Impl::remove_copy_team_impl(teamHandle, first_from, last_from,
first_dest, value);
}
Expand Down
35 changes: 17 additions & 18 deletions algorithms/src/std_algorithms/Kokkos_RemoveCopyIf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ namespace Experimental {
template <
typename ExecutionSpace, typename InputIterator, typename OutputIterator,
typename UnaryPredicate,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
OutputIterator remove_copy_if(
const ExecutionSpace& ex, InputIterator first_from,
InputIterator last_from, OutputIterator first_dest,
const UnaryPredicate& pred) {
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
OutputIterator remove_copy_if(const ExecutionSpace& ex,
InputIterator first_from, InputIterator last_from,
OutputIterator first_dest,
const UnaryPredicate& pred) {
return Impl::remove_copy_if_exespace_impl(
"Kokkos::remove_copy_if_iterator_api_default", ex, first_from, last_from,
first_dest, pred);
Expand All @@ -43,12 +42,12 @@ OutputIterator remove_copy_if(
template <
typename ExecutionSpace, typename InputIterator, typename OutputIterator,
typename UnaryPredicate,
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0
>
OutputIterator remove_copy_if(
const std::string& label, const ExecutionSpace& ex,
InputIterator first_from, InputIterator last_from,
OutputIterator first_dest, const UnaryPredicate& pred) {
std::enable_if_t<::Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
OutputIterator remove_copy_if(const std::string& label,
const ExecutionSpace& ex,
InputIterator first_from, InputIterator last_from,
OutputIterator first_dest,
const UnaryPredicate& pred) {
return Impl::remove_copy_if_exespace_impl(label, ex, first_from, last_from,
first_dest, pred);
}
Expand Down Expand Up @@ -95,12 +94,12 @@ auto remove_copy_if(const std::string& label, const ExecutionSpace& ex,
//
template <typename TeamHandleType, typename InputIterator,
typename OutputIterator, typename UnaryPredicate,
std::enable_if_t<::Kokkos::is_team_handle_v<TeamHandleType>, int> = 0
>
KOKKOS_FUNCTION OutputIterator remove_copy_if(
const TeamHandleType& teamHandle, InputIterator first_from,
InputIterator last_from, OutputIterator first_dest,
const UnaryPredicate& pred) {
std::enable_if_t<::Kokkos::is_team_handle_v<TeamHandleType>, int> = 0>
KOKKOS_FUNCTION OutputIterator remove_copy_if(const TeamHandleType& teamHandle,
InputIterator first_from,
InputIterator last_from,
OutputIterator first_dest,
const UnaryPredicate& pred) {
return Impl::remove_copy_if_team_impl(teamHandle, first_from, last_from,
first_dest, pred);
}
Expand Down

0 comments on commit e7593a7

Please sign in to comment.