-
Notifications
You must be signed in to change notification settings - Fork 116
Add deduction guides for blocked_nd_range #651
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
Open
kboyarinov
wants to merge
1
commit into
uxlfoundation:main
Choose a base branch
from
kboyarinov:blocked_nd_range-deduction-guides
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,4 +1,4 @@ | ||||||
.. SPDX-FileCopyrightText: 2019-2024 Intel Corporation | ||||||
.. SPDX-FileCopyrightText: 2019-2025 Intel Corporation | ||||||
.. SPDX-FileCopyrightText: Contributors to the oneAPI Specification project. | ||||||
.. | ||||||
.. SPDX-License-Identifier: CC-BY-4.0 | ||||||
|
@@ -45,8 +45,20 @@ For example, ``blocked_nd_range<int,2>`` is analogous but not identical to ``blo | |||||
// Access | ||||||
bool is_divisible() const; | ||||||
const dim_range_type& dim(unsigned int dimension) const; | ||||||
}; | ||||||
}; // class blocked_nd_range | ||||||
|
||||||
// Deduction Guides | ||||||
template <typename Value, typename... Values> | ||||||
blocked_nd_range(blocked_range<Value>, blocked_range<Values>...) | ||||||
-> blocked_nd_range<Value, 1 + sizeof...(Values)>; | ||||||
|
||||||
template <typename Value> | ||||||
blocked_nd_range(/*a set of braced-init-lists of Value objects*/) | ||||||
-> blocked_nd_range<Value, /*number of braced-init-lists*/>; | ||||||
|
||||||
template <typename Value, unsigned int N> | ||||||
blocked_nd_range(const Value (&)[N], typename blocked_nd_range<Value, N>::size_type = 1) | ||||||
-> blocked_nd_range<Value, N>; | ||||||
} // namespace tbb | ||||||
} // namespace oneapi | ||||||
|
||||||
|
@@ -171,9 +183,48 @@ Other dimensions and the grain sizes for each subrange remain the same as in the | |||||
|
||||||
**Returns:** ``blocked_range`` containing the value space along the dimension specified by the argument. | ||||||
|
||||||
Deduction Guides | ||||||
---------------- | ||||||
|
||||||
.. code:: cpp | ||||||
|
||||||
template <typename Value, typename... Values> | ||||||
blocked_nd_range(blocked_range<Value>, blocked_range<Values>...) | ||||||
-> blocked_nd_range<Value, 1 + sizeof...(Values)>; | ||||||
|
||||||
**Effects:**: Enables deduction when a set of ``blocked_range`` objects is passed to the ``blocked_nd_range`` constructor. | ||||||
|
||||||
**Constraints:**: Participates in overload resolution only if all of the types in ``Values`` are same as ``Value``. | ||||||
|
||||||
.. code:: cpp | ||||||
|
||||||
template <typename Value> | ||||||
blocked_nd_range(/*a set of braced-init-lists of Value objects*/) | ||||||
-> blocked_nd_range<Value, /*number of braced-init-lists*/>; | ||||||
|
||||||
**Effects:**: Enables deduction when a set of ``blocked_range`` objects is provided as braced-init-lists to the ``blocked_nd_range`` constructor. | ||||||
|
||||||
The exact signature of this deduction guide is unspecified. | ||||||
|
||||||
**Constraints:**: Participates in overload resolution only if the number of braced-init-lists provided is more than ``1`` and each list contains | ||||||
``2`` or ``3`` elements of the same type, corresponding to ``blocked_range`` constructors with 2 and 3 arguments, respectively. | ||||||
|
||||||
**Example:**: ``blocked_nd_range range({0, 100}, {0, 100, 50})`` should deduce ``range`` as ``blocked_nd_range<int, 3>``. | ||||||
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.
Suggested change
3 is definitely wrong for the given example |
||||||
|
||||||
|
||||||
.. code:: cpp | ||||||
|
||||||
template <typename Value, unsigned int N> | ||||||
blocked_nd_range(const Value (&)[N], typename blocked_nd_range<Value, N>::size_type = 1) | ||||||
-> blocked_nd_range<Value, N>; | ||||||
|
||||||
**Effects:**: Enables deduction from a single C array object indicating a set of dimension sizes. | ||||||
|
||||||
In addition to the explicit deduction guides above, the implementation shall provide implicit or explicit deduction guides for copy constructor, | ||||||
move constructor and constructors taking ``split`` and ``proportional_split`` arguments. | ||||||
|
||||||
See also: | ||||||
|
||||||
* :doc:`blocked_range <blocked_range_cls>` | ||||||
* :doc:`blocked_range2d <blocked_range2d_cls>` | ||||||
* :doc:`blocked_range3d <blocked_range3d_cls>` | ||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is there anything important in the part that I suggest to remove?