diff --git a/src/core/Kokkos_RemoteSpaces_ViewMapping.hpp b/src/core/Kokkos_RemoteSpaces_ViewMapping.hpp index 689e6774..f0d80050 100644 --- a/src/core/Kokkos_RemoteSpaces_ViewMapping.hpp +++ b/src/core/Kokkos_RemoteSpaces_ViewMapping.hpp @@ -1218,8 +1218,19 @@ class ViewMapping { // Only initialize if the allocation is non-zero. // May be zero if one of the dimensions is zero. if (alloc_size && alloc_prop::initialize) { - // Construct values - record->m_destroy.construct_shared_allocation(); + const std::string &alloc_name = + static_cast const &>( + arg_prop) + .value; + + // Assume destruction is only required when construction is requested. + // The ViewValueFunctor has both value construction and destruction + // operators. + record->m_destroy = functor_type( + static_cast const + &>(arg_prop) + .value, + (value_type *)m_handle.ptr, m_offset.span(), alloc_name); } return record;