-
Notifications
You must be signed in to change notification settings - Fork 51
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
Update concept for execution space instances #581
Changes from 5 commits
40a1726
5e0d0ba
891c8f3
3ef74f0
b2e84bf
0103497
6cd5bc7
cfb0c31
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,8 +102,7 @@ and ``OpenMPTarget``, the current state of the Kokkos |ExecutionSpaceTwo|_ conce | |
|
||
template <typename Ex> | ||
concept ExecutionSpace = | ||
CopyConstructible<Ex> && | ||
DefaultConstructible<Ex> && | ||
SemiRegular<Ex> && | ||
Destructible<Ex> && | ||
// Member type requirements: | ||
requires() { | ||
|
@@ -120,10 +119,11 @@ and ``OpenMPTarget``, the current state of the Kokkos |ExecutionSpaceTwo|_ conce | |
typename Ex::device_type; | ||
} && | ||
// Required methods: | ||
requires(Ex ex, std::ostream& ostr, bool detail) { | ||
{ ex.in_parallel() } -> bool; | ||
requires(Ex ex, std::string str, std::ostream& ostr, bool detail) { | ||
{ ex.fence(str) }; | ||
{ ex.fence() }; | ||
{ ex.name() } -> const char*; | ||
{ ex.concurrency() } -> int; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remind me, did we promise anything about the return type? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's how its implemented and how we describe it in all documentation so far. I don't know if there would be any motivation to change it to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I meant more returns an integral type or something that is convertible to int. |
||
{ ex.print_configuration(ostr) }; | ||
{ ex.print_configuration(ostr, detail) }; | ||
} && | ||
|
@@ -207,23 +207,6 @@ Support for ``UniqueToken`` adds the following requirements: | |
&& CopyConstructible<Experimental::UniqueToken<Ex, Experimental::UniqueTokenScope::Global>> | ||
&& DefaultConstructible<Experimental::UniqueToken<Ex, Experimental::UniqueTokenScope::Global>>; | ||
|
||
An Additional Concept for ``DeviceExecutionSpace``? | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
All the device execution spaces, in their current state, have two extra member functions, | ||
``sleep()`` and ``wake()``. It's unclear whether this is intended to be general, | ||
but if it is, there is an additional concept in the hierarchy: | ||
|
||
.. code-block:: cpp | ||
|
||
template <typename Ex> | ||
concept DeviceExecutionSpace = | ||
ExecutionSpace<Ex> && | ||
requires(Ex ex) { | ||
{ ex.sleep() }; | ||
{ ex.wake() }; | ||
} | ||
|
||
Some *de facto* Requirements | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
|
@@ -232,14 +215,6 @@ such as ``Impl::TeamPolicyInternal``. These also qualify as "requirements" on an | |
just like ``Impl::ParallelFor<...>``. In many of these cases, it would be nice if we could refactor | ||
some things to use a less "all-or-nothing" approach to customization than partial class template specialization. | ||
|
||
Design Thoughts | ||
~~~~~~~~~~~~~~~ | ||
|
||
The first thing that comes to mind is that ``CopyConstructible<T> && DefaultConstructible<T> && Destructible<T>`` | ||
is very close to ``SemiRegular<T>``; all we need to do is add ``operator==()``. | ||
|
||
TODO more here | ||
|
||
The ``MemorySpace`` Concept | ||
--------------------------- | ||
|
||
|
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.
kokkos/kokkos#5398 (Kokkos 4.0.00) introduced the comparison operator. I'm not sure if that's worth mentioning.