Skip to content

Commit

Permalink
Fix DualView
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed May 7, 2024
1 parent 9b5d01a commit ac18ce2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions containers/src/Kokkos_DualView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -944,13 +944,13 @@ class DualView : public ViewTraits<DataType, Properties...> {

if (sizeMismatch) {
::Kokkos::realloc(arg_prop, d_view, n0, n1, n2, n3, n4, n5, n6, n7);
if (alloc_prop_input::initialize) {
if constexpr (alloc_prop_input::initialize) {
h_view = create_mirror_view(typename t_host::memory_space(), d_view);
} else {
h_view = create_mirror_view(Kokkos::WithoutInitializing,
typename t_host::memory_space(), d_view);
}
} else if (alloc_prop_input::initialize) {
} else if constexpr (alloc_prop_input::initialize) {
if constexpr (alloc_prop_input::has_execution_space) {
const auto& exec_space =
Impl::get_property<Impl::ExecutionSpaceTag>(arg_prop);
Expand Down Expand Up @@ -1038,7 +1038,7 @@ class DualView : public ViewTraits<DataType, Properties...> {
/* Resize on Device */
if (sizeMismatch) {
::Kokkos::resize(properties, d_view, n0, n1, n2, n3, n4, n5, n6, n7);
if (alloc_prop_input::initialize) {
if constexpr (alloc_prop_input::initialize) {
h_view = create_mirror_view(typename t_host::memory_space(), d_view);
} else {
h_view = create_mirror_view(Kokkos::WithoutInitializing,
Expand All @@ -1054,7 +1054,7 @@ class DualView : public ViewTraits<DataType, Properties...> {
/* Resize on Host */
if (sizeMismatch) {
::Kokkos::resize(properties, h_view, n0, n1, n2, n3, n4, n5, n6, n7);
if (alloc_prop_input::initialize) {
if constexpr (alloc_prop_input::initialize) {
d_view = create_mirror_view(typename t_dev::memory_space(), h_view);

} else {
Expand Down

0 comments on commit ac18ce2

Please sign in to comment.