-
-
Notifications
You must be signed in to change notification settings - Fork 440
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
[P2300] Added fundamental coroutine_traits for S/R #5945
Conversation
c414088
to
4d5056b
Compare
libs/core/execution_base/include/hpx/execution_base/traits/coroutine_traits.hpp
Outdated
Show resolved
Hide resolved
libs/core/execution_base/include/hpx/execution_base/traits/coroutine_traits.hpp
Outdated
Show resolved
Hide resolved
libs/core/execution_base/include/hpx/execution_base/traits/coroutine_traits.hpp
Outdated
Show resolved
Hide resolved
libs/core/execution_base/include/hpx/execution_base/traits/coroutine_traits.hpp
Show resolved
Hide resolved
libs/core/execution_base/include/hpx/execution_base/traits/coroutine_traits.hpp
Outdated
Show resolved
Hide resolved
libs/core/execution_base/include/hpx/execution_base/traits/coroutine_traits.hpp
Outdated
Show resolved
Hide resolved
libs/core/execution_base/include/hpx/execution_base/traits/coroutine_traits.hpp
Outdated
Show resolved
Hide resolved
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.
Very nice! Thanks!
58219b7
to
a644c9b
Compare
Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>
- Change `class` to `typename` for consistency - use `_v` for variable postfix - `inline constexpr` where ever possible - `inline constexpr bool` maintains consistency - using `HPX_FORWARD` which uses `static_cast` - `void` is the default type for `std::enable_if_t` Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>
- The awaitable concept simply checks whether the type supports applying the co_await operator to avalue of that type. - If the object has either a member or non-member operator co_await() then its return value must satisfy the Awaiter concept. Otherwise, the Awaitable object must satisfy the Awaiter concept itself. Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>
Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>
- Await transform concept was accepting universal value arguments Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>
c903892
to
8849834
Compare
Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>
libs/core/futures/include/hpx/futures/traits/detail/future_await_traits.hpp
Outdated
Show resolved
Hide resolved
libs/core/execution_base/include/hpx/execution_base/traits/coroutine_traits.hpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>
e4db1fb
to
8413017
Compare
- `hpx::coro` is now defined under certain conditions - `__has_include` is found and either of the coroutine std headers are found Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>
8413017
to
8e63d93
Compare
@SAtacker I think you need to wrap the new configuration header in an #if defined(...) to circumvent the build errors. There is also some inspect errors that needs fixing. |
8e63d93#diff-c87c94ab3db419c43094f1852b046cd3200ae0bfb7a66a482f51be42bf76803bR36-R38 |
https://github.com/STEllAR-GROUP/hpx/runs/7414352657?check_suite_focus=true#step:6:230 the coroutine test itself is failing |
What I meant is that you either have to avoid #including the new coroutine_traits.hpp if coroutines support is not detected or wrap the content of the header in a corresponding #ifdef/#endif. |
The second option seems to be better, however. |
Did you mean https://github.com/STEllAR-GROUP/hpx/pull/5945/files#diff-73bb5d75ca22afdf27a16580a7a5a51d476e49c6b4357c8e591fb1485397b094R38-R40 ? |
I meant adding a wrapper here: libs/core/config/include/hpx/config/coroutines_support.hpp |
Then diff --git a/libs/core/config/include/hpx/config/coroutines_support.hpp b/libs/core/config/include/hpx/config/coroutines_support.hpp
index fb7be8d728..08b1adb20a 100644
--- a/libs/core/config/include/hpx/config/coroutines_support.hpp
+++ b/libs/core/config/include/hpx/config/coroutines_support.hpp
@@ -6,6 +6,8 @@
#pragma once
+#if defined(HPX_HAVE_CXX20_COROUTINES)
+
#if defined(__has_include)
#if __has_include(<coroutine>)
#include <coroutine>
@@ -25,3 +27,5 @@ namespace hpx { namespace coro {
#define HPX_COROUTINE_NAMESPACE_STD std::experimental
#endif
#endif
+
+#endif // HPX_HAVE_CXX20_COROUTINES
\ No newline at end of file |
I know it is supposed to work, but building systems always make it harder to believe. |
You need to add a |
- Add #ifdef guards around the namespace include file Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>
libs/core/execution_base/include/hpx/execution_base/traits/coroutine_traits.hpp
Outdated
Show resolved
Hide resolved
libs/core/execution_base/include/hpx/execution_base/traits/coroutine_traits.hpp
Outdated
Show resolved
Hide resolved
libs/core/execution_base/include/hpx/execution_base/traits/coroutine_traits.hpp
Outdated
Show resolved
Hide resolved
libs/core/execution_base/include/hpx/execution_base/traits/coroutine_traits.hpp
Outdated
Show resolved
Hide resolved
libs/core/execution_base/include/hpx/execution_base/traits/coroutine_traits.hpp
Outdated
Show resolved
Hide resolved
libs/core/futures/include/hpx/futures/traits/detail/future_await_traits.hpp
Show resolved
Hide resolved
- `#if defined` not needed - Change `#pragma` location - Include `config` header instead of including separately - Prefer to check coroutine support first and then include the required headers Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>
- await_suspend() accepts an argument of type coroutine_handle<void> Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>
a7da48b
to
ff0ba76
Compare
- Remove additional parentheses - Missing EOL Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>
ff0ba76
to
c2117dd
Compare
Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>
Performance test reportHPX PerformanceComparison
Info
Comparison
Info
Comparison
Info
Explanation of Symbols
|
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.
LGTM, thanks!
bors merge |
Build succeeded: |
Signed-off-by: Shreyas Atre shreyasatre16@gmail.com
Proposed Changes
get_awaiter
Checklist