Skip to content

Commit f819fc1

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 f819fc1

File tree

2 files changed

+39
-1
lines changed

2 files changed

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