Skip to content

Commit

Permalink
kokkos(unique): fix allocation of temporary view to enfore using the …
Browse files Browse the repository at this point in the history
…provided space instance
  • Loading branch information
romintomasetti committed Nov 14, 2023
1 parent 2f5723b commit 61b93ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion algorithms/src/std_algorithms/impl/Kokkos_Unique.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ IteratorType unique_exespace_impl(const std::string& label,
// using the same algorithm used for unique_copy but we now move things
using value_type = typename IteratorType::value_type;
using tmp_view_type = Kokkos::View<value_type*, ExecutionSpace>;
tmp_view_type tmp_view("std_unique_tmp_view", num_elements_to_explore);
tmp_view_type tmp_view(Kokkos::view_alloc(ex, Kokkos::WithoutInitializing,
"std_unique_tmp_view"),
num_elements_to_explore);

// scan extent is: num_elements_to_explore - 1
// for same reason as the one explained in unique_copy
Expand Down

0 comments on commit 61b93ec

Please sign in to comment.