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

Revamp blocking_kind calculation #524

Merged
merged 1 commit into from
May 24, 2023
Merged

Revamp blocking_kind calculation #524

merged 1 commit into from
May 24, 2023

Conversation

ispeters
Copy link
Contributor

This diff promotes a Sender's "blocking kind" to a static property of the Sender's sender_traits named blocking, which replaces the cblocking<Sender>() function.

@ispeters ispeters requested a review from janondrusek May 24, 2023 04:22
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 24, 2023
@ispeters ispeters force-pushed the revamp_blocking_kind branch 5 times, most recently from 2701dde to 8c34e5d Compare May 24, 2023 05:31
This diff promotes a *Sender's* "blocking kind" to a static property of the
*Sender's* `sender_traits` named `blocking`, which replaces the
`cblocking<Sender>()` function.
@@ -350,6 +350,8 @@ class _sender<Source, Func>::type {
static constexpr bool sends_done =
sender_error_types_t<Source, sends_done_impl>::value;

// TODO: blocking and is_always_scheduler_affine; I don't have the brains to figure them out right now
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be addressed in #528.

@ispeters ispeters merged commit 93a73dc into main May 24, 2023
@ispeters ispeters deleted the revamp_blocking_kind branch May 24, 2023 17:02
}
friend constexpr blocking_kind tag_invoke(tag_t<unifex::blocking>, const type& sender) noexcept {
// get the runtime blocking_kind for the predecessor
blocking_kind pred = blocking(sender.pred_);
Copy link
Contributor

Choose a reason for hiding this comment

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

This must be blocking_kind pred = unifex::blocking(sender.pred_);. This also affects several other files. See also #555

Otherwise:

[build] C:\include\unifex/let_value.hpp(406): error C2064: term does not evaluate to a function taking 1 arguments
[build] C:\include\unifex/let_value.hpp(406): note: class does not define an 'operator()' or a user defined conversion operator to a pointer-to-function or reference-to-function that takes appropriate number of arguments
[build] C:\include\unifex/let_value.hpp(406): note: while trying to match the argument list '(const Predecessor)'
[build]         with
[build]         [
[build]             Predecessor=unifex::_just::_sender<>::type
[build]         ]
[build] C:\include\unifex/let_value.hpp(406): note: the template instantiation context (the oldest one first) is
[build] C:\main.cpp(5): note: while compiling class template member function 'unifex::_let_v::_sender<unifex::_just::_sender<>::type,a::<lambda_1>>::type unifex::_let_v::_cpo::_fn::operator ()<unifex::_just::_sender<>::type,a::<lambda_1>>(Predecessor &&,SuccessorFactory &&) noexcept const'
[build]         with
[build]         [
[build]             Predecessor=unifex::_just::_sender<>::type,
[build]             SuccessorFactory=a::<lambda_1>
[build]         ]
[build] C:\include\unifex/let_value.hpp(419): note: see reference to variable template 'const bool is_nothrow_constructible_v<unifex::_let_v::_sender<unifex::_just::_sender<>::type,`a'::`2'::<lambda_1> >::type,unifex::_just::_sender<>::type,`a'::`2'::<lambda_1> >' being compiled
[build] C:\include\unifex/let_value.hpp(317): note: while compiling class 'unifex::_let_v::_sender<unifex::_just::_sender<>::type,a::<lambda_1>>::type'
[build] C:\include\unifex/let_value.hpp(404): note: while compiling class template member function 'unifex::_block::blocking_kind unifex::_let_v::tag_invoke(unifex::_block::_fn,const unifex::_let_v::_sender<unifex::_just::_sender<>::type,a::<lambda_1>>::type &) noexcept'
[build] C:\include\unifex/tag_invoke.hpp(34): note: see the first reference to 'unifex::_let_v::tag_invoke' in 'unifex::_tag_invoke::_fn::operator ()'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforcing blocking_kind for stop_when source sender unifex::let doesn't customize unifex::blocking
4 participants