Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
``2`` or ``3`` elements of the same type, corresponding to ``blocked_range`` constructors with 2 and 3 arguments, respectively.
``2`` or ``3`` elements of the same type.

Is there anything important in the part that I suggest to remove?


**Example:**: ``blocked_nd_range range({0, 100}, {0, 100, 50})`` should deduce ``range`` as ``blocked_nd_range<int, 3>``.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
**Example:**: ``blocked_nd_range range({0, 100}, {0, 100, 50})`` should deduce ``range`` as ``blocked_nd_range<int, 3>``.
**Example:**: ``blocked_nd_range range({0, 100}, {0, 100, 50})`` should deduce ``range`` as ``blocked_nd_range<int, 2>``.

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>`

Loading