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

[oneTBB] Rework the parallel_for_each algorithm requirements #348

Merged

Conversation

ivankochin
Copy link
Contributor

Now the parallel_for_each algorithm body named requirements contain unclear and incorrect formulation. This patch fixes it and makes it more clear.

Signed-off-by: Kochin, Ivan kochin.ivan@intel.com

Signed-off-by: Kochin, Ivan <kochin.ivan@intel.com>
@ivankochin
Copy link
Contributor Author

@kboyarinov , @alexandraepan pls review

ivankochin and others added 3 commits July 27, 2021 15:12
Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>
Signed-off-by: Kochin, Ivan <kochin.ivan@intel.com>
Signed-off-by: Kochin, Ivan <kochin.ivan@intel.com>
@ivankochin ivankochin changed the title oneTBB spec: Rework the parallel_for_each algorithm requirements [oneTBB] Rework the parallel_for_each algorithm requirements Jul 29, 2021
Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>
@ivankochin
Copy link
Contributor Author

@kboyarinov, @alexandraepan please review one more time!

Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>
`tbb::parallel_for_each algorithm <../../algorithms/functions/parallel_for_each_func>`
requires the Body::operator() call with an object of type const value_type& or value_type&& to be well-formed if:

* the iterator does not meet all of the `Forward iterator` requirements described in the [forward.iterators] section of the ISO C++ Standard
Copy link
Contributor

Choose a reason for hiding this comment

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

What are we trying to say in this point? Could you please clarify the use-case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree that this case seems unclear, but here we are trying to describe the case when the iterator meets input iterator requirements but does not meet forward iterator requirements.

Please, consider the following replacement:
#348 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems better for me, but I would swap the bullets:

... if all of the following requirements are met:

  • The iterator meets the requirements of Input Iterator
  • The iterator does not meet the requirements of Forward Iterator

As well, I would use the simple form "meets the requirements" instead of "meets all of the requirements". This "all of" is a little confusing for me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kboyarinov, @alexandraepan please review the update

Copy link
Contributor

Choose a reason for hiding this comment

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

I am OK with the change

Co-authored-by: kboyarinov <konstantin.boyarinov@intel.com>
`tbb::parallel_for_each algorithm <../../algorithms/functions/parallel_for_each_func>`
requires the Body::operator() call with an object of type const value_type& or value_type&& to be well-formed if:

* the iterator does not meet all of the `Forward iterator` requirements described in the [forward.iterators] section of the ISO C++ Standard
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree that this case seems unclear, but here we are trying to describe the case when the iterator meets input iterator requirements but does not meet forward iterator requirements.

Please, consider the following replacement:
#348 (comment)

`tbb::parallel_for_each algorithm <../../algorithms/functions/parallel_for_each_func>`
requires the Body::operator() call with an object of type const value_type& or value_type&& to be well-formed if:

* the iterator does not meet all of the `Forward iterator` requirements described in the [forward.iterators] section of the ISO C++ Standard
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems better for me, but I would swap the bullets:

... if all of the following requirements are met:

  • The iterator meets the requirements of Input Iterator
  • The iterator does not meet the requirements of Forward Iterator

As well, I would use the simple form "meets the requirements" instead of "meets all of the requirements". This "all of" is a little confusing for me

Kochin Ivan added 2 commits August 25, 2021 15:43
Signed-off-by: Kochin Ivan <kochin.ivan@intel.com>
Signed-off-by: Kochin Ivan <kochin.ivan@intel.com>
Signed-off-by: Kochin Ivan <kochin.ivan@intel.com>
@aepanchi
Copy link
Contributor

The rest looks good to me!

…r_for_each_body.rst

Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>
@ivankochin
Copy link
Contributor Author

@rscohn2 please review and merge, if possible

@aepanchi
Copy link
Contributor

aepanchi commented Sep 2, 2021

@ivankochin please change .. SPDX-FileCopyrightText: 2019-2020 Intel Corporation to .. SPDX-FileCopyrightText: 2019-2021 Intel Corporation

@ivankochin
Copy link
Contributor Author

@rscohn2 all comments were resolved, so please merge if possible

@rscohn2 rscohn2 merged commit cfc8954 into uxlfoundation:main Sep 7, 2021
@rscohn2
Copy link
Member

rscohn2 commented Sep 7, 2021

Merged. We can add more maintainers with the ability to merge PR's if you need it.

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.

None yet

4 participants