Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup allocation headers with OpenMPTarget backend #4003

Merged
merged 1 commit into from
May 5, 2021

Conversation

dalg24
Copy link
Member

@dalg24 dalg24 commented May 5, 2021

Bug caught by one of ArborX unit tests that checks allocation prefixes.

The functionality is provided through inheritance by

template <class MemorySpace>
void* SharedAllocationRecordCommon<MemorySpace>::reallocate_tracked(
void* arg_alloc_ptr, size_t arg_alloc_size) {
derived_t* const r_old = derived_t::get_record(arg_alloc_ptr);
derived_t* const r_new =
allocate(r_old->m_space, r_old->get_label(), arg_alloc_size);
Kokkos::Impl::DeepCopy<MemorySpace, MemorySpace>(
r_new->data(), r_old->data(), std::min(r_old->size(), r_new->size()));
record_base_t::increment(r_new);
record_base_t::decrement(r_old);
return r_new->data();
}

@dalg24 dalg24 requested a review from rgayatri23 May 5, 2021 18:04
Copy link
Contributor

@masterleinad masterleinad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Copy link
Contributor

@rgayatri23 rgayatri23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dalg24 dalg24 merged commit d57dd3f into kokkos:develop May 5, 2021
@dalg24 dalg24 deleted the fixup_omp_shared_alloc branch May 5, 2021 20:02
crtrott added a commit that referenced this pull request May 12, 2021
[3.4.1] Take over #4003: Fixup allocation headers with OpenMPTarget backend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants