Skip to content

Commit

Permalink
fix syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
fnrizzi committed Aug 8, 2023
1 parent c46aa09 commit f5dde3d
Show file tree
Hide file tree
Showing 4 changed files with 269 additions and 225 deletions.
95 changes: 50 additions & 45 deletions algorithms/src/std_algorithms/Kokkos_AdjacentDifference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ namespace Experimental {
//
// overload set accepting execution space
//
template <class ExecutionSpace, class InputIteratorType,
class OutputIteratorType>
std::enable_if_t<!::Kokkos::is_view<InputIteratorType>::value &&
::Kokkos::is_execution_space<ExecutionSpace>::value,
OutputIteratorType>
adjacent_difference(const ExecutionSpace& ex, InputIteratorType first_from,
template <
typename ExecutionSpace, typename InputIteratorType,
typename OutputIteratorType,
std::enable_if_t<!::Kokkos::is_view<InputIteratorType>::value &&
::Kokkos::is_execution_space<ExecutionSpace>::value, int > = 0
>
OutputIteratorType adjacent_difference(const ExecutionSpace& ex, InputIteratorType first_from,
InputIteratorType last_from,
OutputIteratorType first_dest) {
using value_type1 = typename InputIteratorType::value_type;
Expand All @@ -44,11 +45,12 @@ adjacent_difference(const ExecutionSpace& ex, InputIteratorType first_from,
first_dest, binary_op());
}

template <class ExecutionSpace, class InputIteratorType,
class OutputIteratorType, class BinaryOp>
std::enable_if_t<!::Kokkos::is_view<InputIteratorType>::value &&
::Kokkos::is_execution_space<ExecutionSpace>::value,
OutputIteratorType>
template <typename ExecutionSpace, typename InputIteratorType,
typename OutputIteratorType, typename BinaryOp,
std::enable_if_t<!::Kokkos::is_view<InputIteratorType>::value &&
::Kokkos::is_execution_space<ExecutionSpace>::value, int > = 0
>
OutputIteratorType
adjacent_difference(const ExecutionSpace& ex, InputIteratorType first_from,
InputIteratorType last_from, OutputIteratorType first_dest,
BinaryOp bin_op) {
Expand All @@ -57,11 +59,12 @@ adjacent_difference(const ExecutionSpace& ex, InputIteratorType first_from,
first_dest, bin_op);
}

template <class ExecutionSpace, class InputIteratorType,
class OutputIteratorType>
std::enable_if_t<!::Kokkos::is_view<InputIteratorType>::value &&
::Kokkos::is_execution_space<ExecutionSpace>::value,
OutputIteratorType>
template <typename ExecutionSpace, typename InputIteratorType,
typename OutputIteratorType,
std::enable_if_t<!::Kokkos::is_view<InputIteratorType>::value &&
::Kokkos::is_execution_space<ExecutionSpace>::value, int > = 0
>
OutputIteratorType
adjacent_difference(const std::string& label, const ExecutionSpace& ex,
InputIteratorType first_from, InputIteratorType last_from,
OutputIteratorType first_dest) {
Expand All @@ -74,20 +77,21 @@ adjacent_difference(const std::string& label, const ExecutionSpace& ex,
label, ex, first_from, last_from, first_dest, binary_op());
}

template <class ExecutionSpace, class InputIteratorType,
class OutputIteratorType, class BinaryOp>
std::enable_if_t<!::Kokkos::is_view<InputIteratorType>::value &&
::Kokkos::is_execution_space<ExecutionSpace>::value,
OutputIteratorType>
template <typename ExecutionSpace, typename InputIteratorType,
typename OutputIteratorType, typename BinaryOp,
std::enable_if_t<!::Kokkos::is_view<InputIteratorType>::value &&
::Kokkos::is_execution_space<ExecutionSpace>::value, int > = 0
>
OutputIteratorType
adjacent_difference(const std::string& label, const ExecutionSpace& ex,
InputIteratorType first_from, InputIteratorType last_from,
OutputIteratorType first_dest, BinaryOp bin_op) {
return Impl::adjacent_difference_exespace_impl(label, ex, first_from,
last_from, first_dest, bin_op);
}

template <class ExecutionSpace, class DataType1, class... Properties1,
class DataType2, class... Properties2,
template <typename ExecutionSpace, typename DataType1, typename... Properties1,
typename DataType2, typename... Properties2,
std::enable_if_t<::Kokkos::is_execution_space<ExecutionSpace>::value,
int> = 0>
auto adjacent_difference(
Expand All @@ -110,8 +114,8 @@ auto adjacent_difference(
KE::cend(view_from), KE::begin(view_dest), binary_op());
}

template <class ExecutionSpace, class DataType1, class... Properties1,
class DataType2, class... Properties2, class BinaryOp,
template <typename ExecutionSpace, typename DataType1, typename... Properties1,
typename DataType2, typename... Properties2, typename BinaryOp,
std::enable_if_t<::Kokkos::is_execution_space<ExecutionSpace>::value,
int> = 0>
auto adjacent_difference(
Expand All @@ -127,8 +131,8 @@ auto adjacent_difference(
KE::cend(view_from), KE::begin(view_dest), bin_op);
}

template <class ExecutionSpace, class DataType1, class... Properties1,
class DataType2, class... Properties2,
template <typename ExecutionSpace, typename DataType1, typename... Properties1,
typename DataType2, typename... Properties2,
std::enable_if_t<::Kokkos::is_execution_space<ExecutionSpace>::value,
int> = 0>
auto adjacent_difference(
Expand All @@ -152,8 +156,8 @@ auto adjacent_difference(
KE::begin(view_dest), binary_op());
}

template <class ExecutionSpace, class DataType1, class... Properties1,
class DataType2, class... Properties2, class BinaryOp,
template <typename ExecutionSpace, typename DataType1, typename... Properties1,
typename DataType2, typename... Properties2, typename BinaryOp,
std::enable_if_t<::Kokkos::is_execution_space<ExecutionSpace>::value,
int> = 0>
auto adjacent_difference(
Expand All @@ -174,13 +178,14 @@ auto adjacent_difference(
// Note: for now omit the overloads accepting a label
// since they cause issues on device because of the string allocation.
//
template <class TeamHandleType, class InputIteratorType,
class OutputIteratorType>
template <
typename TeamHandleType, typename InputIteratorType,
typename OutputIteratorType,
std::enable_if_t<!::Kokkos::is_view<InputIteratorType>::value &&
::Kokkos::is_team_handle<TeamHandleType>::value, int > = 0
>
KOKKOS_FUNCTION
std::enable_if_t<!::Kokkos::is_view<InputIteratorType>::value &&
::Kokkos::is_team_handle<TeamHandleType>::value,
OutputIteratorType>
adjacent_difference(const TeamHandleType& teamHandle,
OutputIteratorType adjacent_difference(const TeamHandleType& teamHandle,
InputIteratorType first_from,
InputIteratorType last_from,
OutputIteratorType first_dest) {
Expand All @@ -193,13 +198,13 @@ KOKKOS_FUNCTION
first_dest, binary_op());
}

template <class TeamHandleType, class InputIteratorType,
class OutputIteratorType, class BinaryOp>
template <typename TeamHandleType, typename InputIteratorType,
typename OutputIteratorType, typename BinaryOp,
std::enable_if_t<!::Kokkos::is_view<InputIteratorType>::value &&
::Kokkos::is_team_handle<TeamHandleType>::value, int > = 0
>
KOKKOS_FUNCTION
std::enable_if_t<!::Kokkos::is_view<InputIteratorType>::value &&
::Kokkos::is_team_handle<TeamHandleType>::value,
OutputIteratorType>
adjacent_difference(const TeamHandleType& teamHandle,
OutputIteratorType adjacent_difference(const TeamHandleType& teamHandle,
InputIteratorType first_from,
InputIteratorType last_from,
OutputIteratorType first_dest, BinaryOp bin_op) {
Expand All @@ -208,8 +213,8 @@ KOKKOS_FUNCTION
}

template <
class TeamHandleType, class DataType1, class... Properties1,
class DataType2, class... Properties2,
typename TeamHandleType, typename DataType1, typename... Properties1,
typename DataType2, typename... Properties2,
std::enable_if_t<::Kokkos::is_team_handle<TeamHandleType>::value, int> = 0>
KOKKOS_FUNCTION auto adjacent_difference(
const TeamHandleType& teamHandle,
Expand All @@ -232,8 +237,8 @@ KOKKOS_FUNCTION auto adjacent_difference(
}

template <
class TeamHandleType, class DataType1, class... Properties1,
class DataType2, class... Properties2, class BinaryOp,
typename TeamHandleType, typename DataType1, typename... Properties1,
typename DataType2, typename... Properties2, typename BinaryOp,
std::enable_if_t<::Kokkos::is_team_handle<TeamHandleType>::value, int> = 0>
KOKKOS_FUNCTION auto adjacent_difference(
const TeamHandleType& teamHandle,
Expand Down

0 comments on commit f5dde3d

Please sign in to comment.