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

Add RFC for CTAD in blocked_nd_range #1607

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

kboyarinov
Copy link
Contributor

@kboyarinov kboyarinov commented Jan 17, 2025

Description

Reference implementation is #1525

Fixes # - issue number(s) if exists

Type of change

Choose one or multiple, leave empty if none of the other choices apply

Add a respective label(s) to PR if you have permissions

  • bug fix - change that fixes an issue
  • new feature - change that adds functionality
  • tests - change in tests
  • infrastructure - change in infrastructure and CI
  • documentation - documentation update

Tests

  • added - required for new features and some bug fixes
  • not needed

Documentation

  • updated in # - add PR number
  • needs to be updated
  • not needed

Breaks backward compatibility

  • Yes
  • No
  • Unknown

Notify the following users

List users with @ to send notifications

Other information

If we add one more explicit deduction guide to support the code above, the single braced-init-list of size 2 or 3 would also match on this guide.

There are the following options how this issue can be resolved:
* Add a new deduction guide to support the code above. The downside of this approach is that it makes the ambiguity, discussed in the
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My vision is that it would be better to pick that option since the explanation of the downside would not be surprise for the user and will be understandable from the deduction guides definition. I also think that construction of multi-dimensional ranges are mostly common use-case for blocked_nd_range.

The only thing that actually can be affected, is some generic code that can create both one and multi-dimensional ranges

Copy link
Contributor

Choose a reason for hiding this comment

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

Since the goal now is an experimental feature, I agree that it makes sense to go with the expected case (multidimensional range) and elicit feedback to see if its really viewed as problematic.

If we add one more explicit deduction guide to support the code above, the single braced-init-list of size 2 or 3 would also match on this guide.

There are the following options how this issue can be resolved:
* Add a new deduction guide to support the code above. The downside of this approach is that it makes the ambiguity, discussed in the
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the goal now is an experimental feature, I agree that it makes sense to go with the expected case (multidimensional range) and elicit feedback to see if its really viewed as problematic.


These arguments would not match nether on the `[g1]` not `[g2]` and it is unclear how to define the deduction guide that covers this case.
Current proposal is to keep this scenario a limitation for using the CTAD and always require using the consistent set of parameters - or
the set of braced-init-lists or the set of `tbb::blocked_range` objects.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add exit criteria? Likely the exit conditions are that we get feedback on user experience and it confirms choices made about open questions. This could be a place to collect those choices. And another exit criteria is that we get specification updates accepted (likely backed by user experience).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants