Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fnrizzi committed Sep 7, 2023
1 parent 8a3ec1b commit afac778
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ OutputIteratorType adjacent_difference_exespace_impl(
Kokkos::Experimental::distance(first_from, last_from);
::Kokkos::parallel_for(
label, RangePolicy<ExecutionSpace>(ex, 0, num_elements),
// use CTAD
StdAdjacentDiffFunctor(first_from, first_dest, bin_op));
ex.fence("Kokkos::adjacent_difference: fence after operation");

Expand Down Expand Up @@ -120,7 +119,6 @@ KOKKOS_FUNCTION OutputIteratorType adjacent_difference_team_impl(
Kokkos::Experimental::distance(first_from, last_from);
::Kokkos::parallel_for(
TeamThreadRange(teamHandle, 0, num_elements),
// use CTAD
StdAdjacentDiffFunctor(first_from, first_dest, bin_op));
teamHandle.team_barrier();

Expand Down
2 changes: 0 additions & 2 deletions algorithms/src/std_algorithms/impl/Kokkos_Reduce.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ ValueType reduce_custom_functors_exespace_impl(
const auto num_elements = Kokkos::Experimental::distance(first, last);
::Kokkos::parallel_reduce(label,
RangePolicy<ExecutionSpace>(ex, 0, num_elements),
// Use CTAD
StdReduceFunctor(first, reducer), reducer);

// fence not needed since reducing into scalar
Expand Down Expand Up @@ -184,7 +183,6 @@ KOKKOS_FUNCTION ValueType reduce_custom_functors_team_impl(
reducer_type reducer(result, joiner);
const auto num_elements = Kokkos::Experimental::distance(first, last);
::Kokkos::parallel_reduce(TeamThreadRange(teamHandle, 0, num_elements),
// Use CTAD
StdReduceFunctor(first, reducer), reducer);

teamHandle.team_barrier();
Expand Down
3 changes: 1 addition & 2 deletions algorithms/src/std_algorithms/impl/Kokkos_Unique.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ IteratorType unique_exespace_impl(const std::string& label,
index_type count = 0;
::Kokkos::parallel_scan(
label, RangePolicy<ExecutionSpace>(ex, 0, scan_size),
// use CTAD
StdUniqueFunctor(it_found, last, tmp_first, pred), count);

// move last element too, for the same reason as the unique_copy
Expand Down Expand Up @@ -177,7 +176,7 @@ KOKKOS_FUNCTION IteratorType unique_team_impl(const TeamHandleType& teamHandle,
} else if (num_elements == 1) {
return last;
} else {
// for the execution-space-based impl we used an auxiliary allocation,
// FIXME: for the execution-space-based impl we used an auxiliary allocation,
// but for the team level we cannot do the same, so do this serially
// for now and later figure out if this can be done in parallel

Expand Down
1 change: 1 addition & 0 deletions algorithms/unit_tests/TestStdAlgorithmsTeamReduce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ void test_A(std::size_t numTeams, std::size_t numCols, int apiId) {
const auto rowFromEnd = KE::cend(rowFrom);
const auto initVal = reductionInitValuesView_h(i);

// GCC 8 does not have reduce so guard against this
#if defined(__GNUC__) && __GNUC__ == 8
#define reduce testing_reduce
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ void test_A(std::size_t numTeams, std::size_t numCols, int apiId) {

const auto initVal = initValuesView_h(i);

// GCC 8 does not have transform_reduce so guard against this
#if defined(__GNUC__) && __GNUC__ == 8
#define transform_reduce testing_transform_reduce
#else
Expand Down

0 comments on commit afac778

Please sign in to comment.