Skip to content

Commit

Permalink
Merge pull request kokkos#49 from janciesko/fix_record_m_desroy
Browse files Browse the repository at this point in the history
  • Loading branch information
Rombur authored Aug 1, 2022
2 parents 35f4cb5 + dcb9065 commit 7ca76e0
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/core/Kokkos_RemoteSpaces_ViewMapping.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1218,8 +1218,19 @@ class ViewMapping<Traits, Kokkos::Experimental::RemoteSpaceSpecializeTag> {
// 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<Kokkos::Impl::ViewCtorProp<void, std::string> 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<Kokkos::Impl::ViewCtorProp<void, execution_space> const
&>(arg_prop)
.value,
(value_type *)m_handle.ptr, m_offset.span(), alloc_name);
}

return record;
Expand Down

0 comments on commit 7ca76e0

Please sign in to comment.