You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/GSG/get_started.rst
+1-30Lines changed: 1 addition & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,36 +3,7 @@
3
3
Get Started with |full_name|
4
4
=============================
5
5
6
-
|short_name| Get Started Guide provides the information you need to begin working with oneTBB.
7
-
It is helpful for new users of parallel programming and experienced developers that want to improve code performance.
8
-
9
-
It is recommended for you to have a basic knowledge of C++ programming and some experience with parallel programming concepts.
10
-
11
-
|full_name| is a runtime-based parallel programming model for C++ code that uses tasks.
12
-
The template-based runtime library can help you harness the latent performance of multi-core processors.
13
-
14
-
oneTBB enables you to simplify parallel programming by breaking computation into parallel running tasks. Within a single process,
15
-
parallelism is carried out by mapping tasks to threads. Threads are an operating system mechanism that allows the same or different sets of instructions
16
-
to be executed simultaneously. Using threads can make your program work faster and more efficiently.
17
-
18
-
Here you can see one of the possible executions of tasks by threads.
19
-
20
-
.. figure:: Images/how-oneTBB-works.png
21
-
:scale:70%
22
-
:align:center
23
-
24
-
Use oneTBB to write scalable applications that:
25
-
26
-
* Specify logical parallel structure instead of threads.
27
-
* Emphasize data-parallel programming.
28
-
* Take advantage of concurrent collections and parallel algorithms.
29
-
30
-
oneTBB supports nested parallelism and load balancing. It means that you can use the library without worrying about oversubscribing a system, which happens when more tasks are assigned to a system than it can handle efficiently.
31
-
32
-
oneTBB is used in different areas, such as scientific simulations, gaming, data analysis, etc.
33
-
34
-
It is available as a stand-alone product and as part of the |base_tk|.
|short_name| Get Started Guide provides the information you need to begin working with oneTBB.
2
+
It is helpful for new users of parallel programming and experienced developers that want to improve code performance.
3
+
4
+
It is recommended for you to have a basic knowledge of C++ programming and some experience with parallel programming concepts.
5
+
6
+
|full_name| is a runtime-based parallel programming model for C++ code that uses tasks.
7
+
The template-based runtime library can help you harness the latent performance of multi-core processors.
8
+
9
+
oneTBB enables you to simplify parallel programming by breaking computation into parallel running tasks. Within a single process,
10
+
parallelism is carried out by mapping tasks to threads. Threads are an operating system mechanism that allows the same or different sets of instructions
11
+
to be executed simultaneously. Using threads can make your program work faster and more efficiently.
12
+
13
+
Here you can see one of the possible executions of tasks by threads.
14
+
15
+
.. figure:: /GSG/Images/how-oneTBB-works.png
16
+
:scale:70%
17
+
:align:center
18
+
19
+
Use oneTBB to write scalable applications that:
20
+
21
+
* Specify logical parallel structure instead of threads.
22
+
* Emphasize data-parallel programming.
23
+
* Take advantage of concurrent collections and parallel algorithms.
24
+
25
+
oneTBB supports nested parallelism and load balancing. It means that you can use the library without worrying about oversubscribing a system, which happens when more tasks are assigned to a system than it can handle efficiently.
26
+
27
+
oneTBB is used in different areas, such as scientific simulations, gaming, data analysis, etc.
28
+
29
+
It is available as a stand-alone product and as part of the |base_tk|.
Copy file name to clipboardExpand all lines: doc/GSG/next_steps.rst
+71-70Lines changed: 71 additions & 70 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,101 +27,102 @@ After installing |short_name|, set the environment variables:
27
27
Build and Run a Sample
28
28
**********************
29
29
30
-
.. tabs::
30
+
.. tab-set::
31
31
32
-
.. group-tab:: Windows* OS
32
+
.. tab-item:: Windows* OS
33
33
34
-
#. Create a new C++ project using your IDE. In this example, Microsoft* Visual Studio* Code is used.
35
-
#. Create an ``example.cpp`` file in the project.
36
-
#. Copy and paste the code below. It is a typical example of a |short_name| algorithm. The sample calculates a sum of all integer numbers from 1 to 100.
34
+
#. Create a new C++ project using your IDE. In this example, Microsoft* Visual Studio* Code is used.
35
+
#. Create an ``example.cpp`` file in the project.
36
+
#. Copy and paste the code below. It is a typical example of a |short_name| algorithm. The sample calculates a sum of all integer numbers from 1 to 100.
37
37
38
-
.. code::
38
+
.. code::
39
39
40
-
#include <oneapi/tbb.h>
40
+
#include <oneapi/tbb.h>
41
41
42
-
int main (){
43
-
int sum = oneapi::tbb::parallel_reduce(
44
-
oneapi::tbb::blocked_range<int>(1,101), 0,
45
-
[](oneapi::tbb::blocked_range<int> const& r, int init) -> int {
46
-
for (int v = r.begin(); v != r.end(); v++) {
47
-
init += v;
48
-
}
49
-
return init;
50
-
},
51
-
[](int lhs, int rhs) -> int {
52
-
return lhs + rhs;
53
-
}
54
-
);
42
+
int main (){
43
+
int sum = oneapi::tbb::parallel_reduce(
44
+
oneapi::tbb::blocked_range<int>(1,101), 0,
45
+
[](oneapi::tbb::blocked_range<int> const& r, int init) -> int {
46
+
for (int v = r.begin(); v != r.end(); v++) {
47
+
init += v;
48
+
}
49
+
return init;
50
+
},
51
+
[](int lhs, int rhs) -> int {
52
+
return lhs + rhs;
53
+
}
54
+
);
55
55
56
-
printf("Sum: %d\n", sum);
57
-
return 0;
58
-
}
56
+
printf("Sum: %d\n", sum);
57
+
return 0;
58
+
}
59
59
60
-
#. Open the ``tasks.json`` file in the ``.vscode`` directory and paste the following lines to the args array:
60
+
#. Open the ``tasks.json`` file in the ``.vscode`` directory and paste the following lines to the args array:
61
61
62
-
* ``-Ipath/to/oneTBB/include`` to add oneTBB include directory.
63
-
* ``path/to/oneTBB/`` to add oneTBB.
62
+
* ``-Ipath/to/oneTBB/include`` to add oneTBB include directory.
#. If oneTBB is configured correctly, the output displays ``Sum: 5050``.
80
+
#. Build the project.
81
+
#. Run the example.
82
+
#. If oneTBB is configured correctly, the output displays ``Sum: 5050``.
83
83
84
-
.. group-tab:: Linux* OS
84
+
.. tab-item:: Linux* OS
85
85
86
-
#. Create an ``example.cpp`` file in the project.
87
-
#. Copy and paste the code below. It is a typical example of a |short_name| algorithm. The sample calculates a sum of all integer numbers from 1 to 100.
86
+
#. Create an ``example.cpp`` file in the project.
87
+
#. Copy and paste the code below. It is a typical example of a |short_name| algorithm. The sample calculates a sum of all integer numbers from 1 to 100.
88
88
89
-
.. code::
90
-
91
-
#include <oneapi/tbb.h>
92
-
93
-
int main(){
94
-
int sum = oneapi::tbb::parallel_reduce(
95
-
oneapi::tbb::blocked_range<int>(1,101), 0,
96
-
[](oneapi::tbb::blocked_range<int> const& r, int init) -> int {
97
-
for (int v = r.begin(); v != r.end(); v++) {
98
-
init += v;
99
-
}
100
-
return init;
101
-
},
102
-
[](int lhs, int rhs) -> int {
103
-
return lhs + rhs;
104
-
}
105
-
);
89
+
.. code::
90
+
91
+
#include <oneapi/tbb.h>
92
+
93
+
int main(){
94
+
int sum = oneapi::tbb::parallel_reduce(
95
+
oneapi::tbb::blocked_range<int>(1,101), 0,
96
+
[](oneapi::tbb::blocked_range<int> const& r, int init) -> int {
97
+
for (int v = r.begin(); v != r.end(); v++) {
98
+
init += v;
99
+
}
100
+
return init;
101
+
},
102
+
[](int lhs, int rhs) -> int {
103
+
return lhs + rhs;
104
+
}
105
+
);
106
106
107
-
printf("Sum: %d\n", sum);
108
-
return 0;
109
-
}
107
+
printf("Sum: %d\n", sum);
108
+
return 0;
109
+
}
110
110
111
-
#. Compile the code using oneTBB. For example,
111
+
#. Compile the code using oneTBB. For example,
112
112
113
-
.. code-block::
113
+
.. code-block::
114
114
115
-
g++ -std=c++11 example.cpp -o example -ltbb
115
+
g++ -std=c++11 example.cpp -o example -ltbb
116
116
117
117
118
-
#. Run the executable:
118
+
#. Run the executable:
119
119
120
-
.. code-block::
120
+
.. code-block::
121
121
122
-
./example
122
+
./example
123
123
124
-
#. If oneTBB is configured correctly, the output displays ``Sum: 5050``.
124
+
#. If oneTBB is configured correctly, the output displays ``Sum: 5050``.
Copy file name to clipboardExpand all lines: doc/main/intro/limitations.rst
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,20 +5,30 @@ Known Limitations
5
5
6
6
This page outlines the known limitations of oneTBB to help you better understand its capabilities.
7
7
8
+
Debug TBB In The SYCL Program
9
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10
+
11
+
**Limitation:** The application may crash when using the Debug version of oneTBB in a SYCL program compiled with Intel(R) oneAPI DPC++/C++ Compiler. This happens because both ``tbb`` (Release version) and ``tbb_debug`` (Debug version) libraries load simultaneously, causing conflicts.
12
+
13
+
**Solution:** Do one of the following:
14
+
15
+
* Link the application with the Release version ``tbb`` instead of ``tbb_debug``.
16
+
* Use the ``qtbb`` flag provided by the Intel(R) oneAPI DPC++/C++ Compiler.
17
+
8
18
Freestanding Compilation Mode
9
19
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10
20
11
21
**Limitation:** oneTBB does not support the freestanding compilation mode.
12
22
13
-
**Risk:** Compiling an application that utilizes oneTBB headers using the Intel(R) oneAPI DPC+/C+ Compiler may result in failure on Windows* OS if the ``/Qfreestanding`` compiler option is employed.
23
+
**Risk:** Compiling an application that utilizes oneTBB headers using the Intel(R) oneAPI DPC++/C++ Compiler may result in failure on Windows* OS if the ``/Qfreestanding`` compiler option is employed.
14
24
15
25
Static Assert
16
26
^^^^^^^^^^^^^
17
27
18
28
**Limitation:** A static assert causes the compilation failures in oneTBB headers if the following conditions are satisfied:
19
29
20
-
* Compilation is done with Clang 12.0.0 or a more recent version.
21
-
* The LLVM standard library is employed, coupled with the use of the ``-ffreestanding`` flag and C++11/14 compiler options.
30
+
* Compilation is done with Clang 12.0.0 or a more recent version.
31
+
* The LLVM standard library is employed, coupled with the use of the ``-ffreestanding`` flag and C++11/14 compiler options.
**Limitation:** On Linux* OS, using dynamic malloc replacement with ``tbb::info`` and ``tbb::task_arena::constraints`` APIs may result in runtime failures.
62
+
63
+
**Solution:** Set ``TBB_ENABLE_SANITIZERS=1`` in the environment. This informs that dynamic malloc replacement is used.
0 commit comments