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

OpenMPTarget Index range fix for MDRange. #5089

Merged
merged 2 commits into from
Jun 6, 2022

Conversation

rgayatri23
Copy link
Contributor

This fixes the inconsistency in the OpenMPTarget backend observed here #4912

Copy link
Member

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

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

I think we should update

#else
const ptrdiff_t begin_0 = offset[0];
ptrdiff_t end_0 = begin_0 + policy.m_tile[0];
end_0 = end_0 < policy.m_upper[0] ? end_0 : policy.m_upper[0];
const ptrdiff_t begin_1 = offset[1];
ptrdiff_t end_1 = begin_1 + policy.m_tile[1];
end_1 = end_1 < policy.m_upper[1] ? end_1 : policy.m_upper[1];
#pragma omp for collapse(2)
for (ptrdiff_t i0 = begin_0; i0 < end_0; ++i0)
for (ptrdiff_t i1 = begin_1; i1 < end_1; ++i1) {
if constexpr (std::is_void<typename Policy::work_tag>::value)
functor(i0, i1);
else
functor(typename Policy::work_tag(), i0, i1);
}
#endif

and alike also (code path guarded by #ifndef KOKKOS_IMPL_MDRANGE_USE_NO_TILES )

@dalg24
Copy link
Member

dalg24 commented Jun 6, 2022

Is this

// WORKAROUND OPENMPTARGET: sometimes tile sizes don't make it correctly,
// this was tracked down to a bug in clang with regards of mapping structs
// with arrays of long in it. Arrays of int might be fine though ...
#define KOKKOS_IMPL_MDRANGE_USE_NO_TILES // undef EOF

still an issue?

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.

This is progress.

@dalg24
Copy link
Member

dalg24 commented Jun 6, 2022

This is progress.

Agreed. OK I'll merge as is and we can fix the alternate code path as a follow-up.

@dalg24 dalg24 merged commit ecbfc2f into kokkos:develop Jun 6, 2022
@rgayatri23 rgayatri23 deleted the OpenMPTarget_MDRAnge_Index_Fix branch March 24, 2023 21:59
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