-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: main
Are you sure you want to change the base?
Generalized domains #698
Conversation
d42ad0e
to
b18c085
Compare
9196b14
to
5d8ac57
Compare
f17f86f
to
bc58e5c
Compare
b734484
to
e2b02c6
Compare
@@ -129,26 +122,16 @@ class ChunkCommon<ElementType, DiscreteDomain<DDims...>, LayoutStridedPolicy> | |||
private: | |||
template <class Mapping = mapping_type> | |||
static KOKKOS_FUNCTION constexpr std:: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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()( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 | |||
{ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification.
e2b02c6
to
6b779a1
Compare
6b779a1
to
adaa00b
Compare
PoC for #438
Steps:
Chunk
andChunkSpan
withSupportType
being a customization pointStridedDiscreteDomain
StorageDiscreteDomain
Not clear if we should define an equivalent of the slice operator taking a
DiscreteDomain
cc @science-enthusiast