Skip to content

Commit

Permalink
Merge pull request #113 from cwpearson/enhancement/dont-extend-unmanaged
Browse files Browse the repository at this point in the history
Don't uselessly extend lifetimes of unmanaged views
  • Loading branch information
cwpearson authored Jul 12, 2024
2 parents e6b32ad + 56d6149 commit d34862d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/KokkosComm_request.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ class Req {
// keep a reference to this view around until wait() is called
template <typename View>
void keep_until_wait(const View &v) {
record_->until_waits_.push_back(std::make_shared<ViewHolder<View>>(v));
// unmanaged views don't own the underlying buffer, so no need to extend lifetime
if (v.use_count() != 0) {
record_->until_waits_.push_back(std::make_shared<ViewHolder<View>>(v));
}
}

private:
Expand Down

0 comments on commit d34862d

Please sign in to comment.