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

Generalized domains #698

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Generalized domains #698

wants to merge 7 commits into from

Conversation

tpadioleau
Copy link
Member

@tpadioleau tpadioleau commented Dec 5, 2024

PoC for #438

Steps:

  • remove internal_mdspan
  • implement Chunk and ChunkSpan with SupportType being a customization point
  • implement a StridedDiscreteDomain
  • implement a StorageDiscreteDomain
  • update algorithms

Not clear if we should define an equivalent of the slice operator taking a DiscreteDomain

cc @science-enthusiast

@tpadioleau tpadioleau self-assigned this Dec 5, 2024
@tpadioleau tpadioleau changed the title Remove optimization trick with mdspan Sliced domains Dec 5, 2024
@tpadioleau tpadioleau force-pushed the draft-sliced-domains branch from d42ad0e to b18c085 Compare December 5, 2024 21:48
@tpadioleau tpadioleau changed the title Sliced domains Generalized domains Dec 10, 2024
@tpadioleau tpadioleau force-pushed the draft-sliced-domains branch 3 times, most recently from 9196b14 to 5d8ac57 Compare December 13, 2024 19:40
@tpadioleau tpadioleau mentioned this pull request Dec 13, 2024
@tpadioleau tpadioleau force-pushed the draft-sliced-domains branch 2 times, most recently from f17f86f to bc58e5c Compare December 16, 2024 10:47
@tpadioleau tpadioleau force-pushed the draft-sliced-domains branch 4 times, most recently from b734484 to e2b02c6 Compare December 26, 2024 17:15
@@ -129,26 +122,16 @@ class ChunkCommon<ElementType, DiscreteDomain<DDims...>, LayoutStridedPolicy>
private:
template <class Mapping = mapping_type>
static KOKKOS_FUNCTION constexpr std::

Choose a reason for hiding this comment

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

the way std::enable_if_t is broken into two lines could be avoided for better formatting.

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you suggest ? Disabling automatic formatting for these lines ?

Choose a reason for hiding this comment

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

I see your point. If it is automatically formatted this way then nothing can be done.

@@ -174,6 +174,12 @@ class DiscreteDomain
return DiscreteDomain(front() + n1, extents() - n1 - n2);
}

KOKKOS_FUNCTION constexpr DiscreteElement<DDims...> operator()(

Choose a reason for hiding this comment

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

This looks like an essential operator. Till now, what did the user do to achieve same functionality?

Copy link
Member Author

@tpadioleau tpadioleau Dec 29, 2024

Choose a reason for hiding this comment

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

The user can still call discrete_domain.front() + dvect

@@ -187,6 +193,33 @@ class DiscreteDomain
DiscreteVector<DDims...>((get_or<DDims>(oextents, get<DDims>(myextents)))...));
}

template <class... DElems>
bool is_inside(DElems const&... delems) const noexcept
{
Copy link

@science-enthusiast science-enthusiast Dec 31, 2024

Choose a reason for hiding this comment

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

is_inside(...) is now available in DiscreteDomain, StridedDiscreteDomain and StorageDiscreteDomain. Is the function a feature request or is it going to be useful for implementing generalized domains? Right now, it is being called in a few tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is the precondition to call distance_from_front. There should be an assert is_inside in distance_from_front

Choose a reason for hiding this comment

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

Thanks for the clarification.

@tpadioleau tpadioleau force-pushed the draft-sliced-domains branch from e2b02c6 to 6b779a1 Compare January 2, 2025 13:11
@tpadioleau tpadioleau force-pushed the draft-sliced-domains branch from 6b779a1 to adaa00b Compare January 2, 2025 13:14
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.

2 participants