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

Avoid duplicated code in ScratchMemorySpace #3793

Merged

Conversation

masterleinad
Copy link
Contributor

It turns out that the code for get_shmem and get_shmem_aligned can be combined relatively easy avoiding code duplication also for level0/level1.

@masterleinad masterleinad force-pushed the remove_duplicate_scratch_memory_space branch from 7d1e9da to 2aace23 Compare February 10, 2021 23:05
}

template <bool aligned, typename IntType>
KOKKOS_INLINE_FUNCTION void* get_shmem_common(const IntType& size,
Copy link
Member

Choose a reason for hiding this comment

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

Actually make that guy private or prefix with impl_

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@dalg24 dalg24 merged commit 6af5e5e into kokkos:develop Feb 25, 2021
ndellingwood added a commit to ndellingwood/kokkos that referenced this pull request Apr 22, 2021
Some changes of PR kokkos#3793 that removed code duplication in scratch
memory resulted in seg faults (when compiled with intel/18 compilers)
of executables utilizing hierarchical parallelism when the
team handle was passed by value rather than by reference and
accessing/writing to views within the lambda body

This PR reverts the changes that replaced
m_iter_L0, m_iter_L1, m_end_L0, m_iter_L1 by arrays
m_iter_L and m_end_L and adds a unit test that reproduced the issue
ndellingwood added a commit to ndellingwood/kokkos that referenced this pull request Apr 22, 2021
Some changes of PR kokkos#3793 that removed code duplication in scratch
memory resulted in seg faults (when compiled with intel/18 compilers)
of executables utilizing hierarchical parallelism when the
team handle was passed by value rather than by reference and
accessing/writing to views within the lambda body

This PR reverts the changes that replaced
m_iter_L0, m_iter_L1, m_end_L0, m_iter_L1 by arrays
m_iter_L and m_end_L and adds a unit test that reproduced the issue
ndellingwood added a commit to ndellingwood/kokkos that referenced this pull request Apr 22, 2021
Some changes of PR kokkos#3793 that removed code duplication in scratch
memory resulted in seg faults (when compiled with intel/18 compilers)
of executables utilizing hierarchical parallelism when the
team handle was passed by value rather than by reference and
accessing/writing to views within the lambda body

This PR reverts the changes that replaced
m_iter_L0, m_iter_L1, m_end_L0, m_iter_L1 by arrays
m_iter_L and m_end_L and adds a unit test that reproduced the issue
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

3 participants