Skip to content

Commit c77a17f

Browse files
committed
Add a page with constraints helpers to the spec
Signed-off-by: Isaev, Ilya <ilya.isaev@intel.com>
1 parent e36aad1 commit c77a17f

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.. SPDX-FileCopyrightText: 2025 Intel Corporation
2+
..
3+
.. SPDX-License-Identifier: CC-BY-4.0
4+
5+
=========================
6+
Constrained Arena Helpers
7+
=========================
8+
**[constrained_arena_helpers]**
9+
Helper interfaces to create and manage multiple ``task_arena`` objects with constraints.
10+
11+
.. code:: cpp
12+
13+
// Defined in header <oneapi/tbb/task_arena.h>
14+
15+
namespace oneapi {
16+
namespace tbb {
17+
std::vector<oneapi::tbb::task_arena> create_numa_task_arenas(
18+
oneapi::tbb::task_arena::constraints other_constraints = {},
19+
unsigned reserved_slots = 0);
20+
} // namespace tbb
21+
} // namespace oneapi
22+
23+
Functions
24+
---------
25+
26+
.. cpp:function:: std::vector<oneapi::tbb::task_arena> create_numa_task_arenas(
27+
oneapi::tbb::task_arena::constraints other_constraints = {},
28+
unsigned reserved_slots = 0)
29+
30+
Returns a ``std::vector`` of ``task_arena`` objects, each bound to a separate NUMA node.
31+
The number of created ``task_arena`` is equal to the number of NUMA nodes available on the system.
32+
It optionally takes additional ``other_constraints`` argument to be applied to each created
33+
``task_arena``, ignoring ``numa_id`` value. The second optional ``reserved_slots`` argument
34+
allows to reserve a number of slots in each created ``task_arena`` for application threads.
35+
36+
.. note::
37+
If error occurs during system topology parsing, returns ``std::vector`` containing single
38+
``task_arena`` object equivalent to ``task_arena(other_constraints, reserved_slots)``.

source/elements/oneTBB/source/nested-aux-interfaces.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. SPDX-FileCopyrightText: 2019-2020 Intel Corporation
1+
.. SPDX-FileCopyrightText: 2019-2025 Intel Corporation
22
..
33
.. SPDX-License-Identifier: CC-BY-4.0
44
@@ -9,6 +9,7 @@
99
.. toctree::
1010
:maxdepth: 2
1111

12+
constrained_arena_helpers.rst
1213
memory_allocation.rst
1314
mutual_exclusion.rst
1415
timing.rst

0 commit comments

Comments
 (0)