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

Constructing Atomic Subviews #3810

Merged
merged 4 commits into from
Mar 17, 2021
Merged

Conversation

nliber
Copy link
Contributor

@nliber nliber commented Feb 24, 2021

Issue #3765

View<double*> a("a",10);
auto range = std::pair(0,4);
auto s3 = subview<MemoryTraits<Atomic>>(a, range);

We get to down to:
ViewDataHandle (specialized for MemoryTraits)::

template <class SrcHandleType>
KOKKOS_INLINE_FUNCTION static handle_type assign(
    const SrcHandleType& arg_handle, size_t offset) {
  return handle_type(arg_handle.ptr + offset);
}

arg_handle is already a pointer (double*), so .ptr is incorrect.

This fixes the compile time problem, but still needs run time test cases.

    View<double*> a("a",10);
    auto range = std::pair(0,4);
    auto s3 = subview<MemoryTraits<Atomic>>(a, range);

We get to down to:
ViewDataHandle (specialized for MemoryTraits<Atomic>)::

   template <class SrcHandleType>
   KOKKOS_INLINE_FUNCTION static handle_type assign(
       const SrcHandleType& arg_handle, size_t offset) {
     return handle_type(arg_handle.ptr + offset);
   }

arg_handle is already a pointer (double*), so .ptr is incorrect.
@masterleinad masterleinad marked this pull request as draft February 25, 2021 19:00
@nliber nliber changed the title WIP (Do Not Merge): Constructing Atomic Subviews Constructing Atomic Subviews Mar 3, 2021
@nliber nliber removed the [WIP] label Mar 3, 2021
@nliber nliber requested review from dalg24 and crtrott March 4, 2021 00:32
@nliber nliber marked this pull request as ready for review March 5, 2021 01:13
@dalg24
Copy link
Member

dalg24 commented Mar 15, 2021

Retest this please

@dalg24
Copy link
Member

dalg24 commented Mar 17, 2021

Retest this please

@crtrott crtrott merged commit 233fc53 into kokkos:develop Mar 17, 2021
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