Compare commits

..
141 Commits
Author SHA1 Message Date
Alexandra fc73d1b060 Delete INSTALL.md 2021-11-11 17:06:18 +03:00
Alexandra 3c76a402e5 Update INSTALL.md 2021-10-11 13:16:51 +03:00
Alexandra f50d5b274d Update INSTALL.md 2021-10-11 13:11:52 +03:00
Alexandra c371153bfc Update INSTALL.md 2021-10-11 13:08:48 +03:00
Alexandra 63da7bb974 Update INSTALL.md 2021-10-08 10:08:08 +03:00
Alexandra 285f1500cb Update README.md 2021-10-07 21:47:34 +03:00
Alexandra 03e0e99768 Update INSTALL.md 2021-10-07 21:44:42 +03:00
Alexandra e75752005b Update INSTALL.md 2021-10-07 21:43:42 +03:00
Alexandra 354ecff2f1 Update INSTALL.md 2021-10-07 21:42:24 +03:00
Alexandra 94603260f6 Merge branch 'master' into guidelines 2021-09-29 13:28:16 +03:00
Ilya Isaev d65c9b3a5f Fix test_tbb_header compiling on Windows with IntelLLVM (#589)
Fixed compilation error on Windows while compiling with IntelLLVM compiler: "#include resolved using non-portable Microsoft search rules"

Signed-off-by: Ilya Isaev <ilya.isaev@intel.com>
2021-09-28 18:09:51 +03:00
Alexandra a2aab3a2b4 Update INSTALL.md 2021-09-27 13:20:56 +03:00
Ilya Mishin e6162e8838 Fix comment in test_limiter_node (#585)
Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>
2021-09-24 17:43:45 +03:00
Sergey Zheltov 43169c243f CMake: fix compile options for Windows ARM64 (#579)
Signed-off-by: Zheltov, Sergey1 <sergey1.zheltov@intel.com>
2021-09-16 19:18:49 +03:00
Alexandra 5d7abed881 Update index.rst (#578) 2021-09-15 12:46:54 +03:00
Anton PotapovandAlexandra f580ec8edb DOC: Migration guide: Deferred task creation (#537)
- added Deferred task creation chapter

Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>

Signed-off-by: Anton Potapov <anton.potapov@intel.com>
2021-09-14 21:53:25 +03:00
Anton Potapov c4a120705f [DOC]: Update Get Started Guide (#575)
- added code sample
2021-09-14 18:33:42 +03:00
Alexandra 3b1bc31f45 [DOC]: Update Get Started Guide (#564) 2021-09-14 16:55:00 +03:00
e8037363ac DOC: Migration guide chapter for Scheduler Bypass (#525)
* DOC: Migration guide chapter for Scheduler Bypass

Signed-off-by: Anton Potapov <anton.potapov@intel.com>

* DOC: Migration guide chapter for Scheduler Bypass

Minor code cleanups for code samples

Co-authored-by: Pavel <pavel.kumbrasev@intel.com>
Signed-off-by: Anton Potapov <anton.potapov@intel.com>

* DOC: Migration guide chapter for Scheduler Bypass

- fixed wording

Co-authored-by: Alex <alexei.katranov@intel.com>
Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>

* DOC: Migration guide chapter for Scheduler Bypass

- fixed wording

* DOC: Migration guide chapter for Scheduler Bypass

- fixed code sample
- add sentence about what defer is doing

Signed-off-by: Anton Potapov <anton.potapov@intel.com>

* DOC: Migration guide chapter for Scheduler Bypass

- fixed wording

Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>

Co-authored-by: Pavel <pavel.kumbrasev@intel.com>
Co-authored-by: Alex <alexei.katranov@intel.com>
Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>
2021-09-14 15:57:16 +03:00
Alexandra 0a57bda871 Update index.rst (#572) 2021-09-14 11:08:07 +03:00
Alexandra a52c65b06a Update index.rst 2021-09-13 11:34:01 +03:00
Ekaterina Mekhnetsova 4624e4ff59 Remove old tms configurations (#571)
* Remove old tms configurations

* Update custom.js
2021-09-10 13:50:24 +03:00
Ilya Mishin 7567de93ae Workaround gcc bug in test_limiter_node (#569)
* Workaround gcc bug in test_limiter_node

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* unify workaround

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>
2021-09-07 18:29:59 +03:00
Alex 97ac8f4324 Disable RTM based tests under TSAN (#567)
* Disable RTM based tests (speculative mutexes) under TSAN

Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
2021-09-07 11:26:55 +03:00
PavelandAlex 40a9a10600 Fix memory semantics in queuing_rw_mutex (#552)
Signed-off-by: pavelkumbrasev <pavel.kumbrasev@intel.com>

Co-authored-by: Alex <alexei.katranov@intel.com>
2021-09-03 17:05:11 +03:00
Alexey Oralov 5d8ddb3fb6 Add PR template (#554)
Signed-off-by: Alexey Oralov alexey.oralov@intel.com
2021-09-03 09:25:41 +03:00
vlserovandpavelkumbrasev 4d3f9752d0 Performance: Avoid lock during working with multiple arenas (#562)
Synchronization order of calls function market::adjust_demand should
be made for arena, not for the market itself.

Signed-off-by: Serov, Vladimir <vladimir.serov@intel.com>
Co-authored-by: pavelkumbrasev <pavel.kumbrasev@intel.com>
2021-09-02 15:22:24 +03:00
Ekaterina Mekhnetsova 0a2b398702 Add analytics script for documentation (#561)
* Add analytics script for doc

* Update layout.html
2021-09-02 13:45:25 +03:00
Alexey Veprev 497a2b1695 Update version to 2021.5 (#559)
Signed-off-by: Veprev, Alexey <alexey.veprev@intel.com>
2021-09-01 17:07:44 +03:00
Alexandra 1eb893a18e Update README.md 2021-09-01 13:25:43 +03:00
Alexandra Epanchinzeva da864d5ecb Update 2021-09-01 14:56:38 +05:00
Pavel 86fe3f04c1 Fix arena layout (#557)
Signed-off-by: pavelkumbrasev <pavel.kumbrasev@intel.com>
2021-08-31 15:03:40 +03:00
Anton PotapovandAlex dd8f8a7826 task_group extensions run_and_wait(task_handle&&) method (#538)
* task_group extensions:

- added task_group::run_and_wait(task_handle&&) method

Signed-off-by: Anton Potapov <anton.potapov@intel.com>
Co-authored-by: Alex <alexei.katranov@intel.com>
2021-08-31 14:51:53 +03:00
Alexandra Epanchinzeva d2da407b4d New doc 2021-08-31 11:13:53 +05:00
Ilya Isaev f81abcb640 Increase number of iterations to cover 'resume_node::reset' call (#551)
Increased number of iterations to have a more stable coverage of resume_node::reset() function.

Signed-off-by: Ilya Isaev ilya.isaev@intel.com
2021-08-30 13:54:46 +03:00
Ilya Mishin 6aab19f72a Cover remove_edge with successor::input_ports_type (#549)
Signed-off-by: Ilya Mishin <ilya.mishin@intel.com>
2021-08-27 12:59:13 +03:00
Alexandra a6b90fc9f5 Contribution guidelines (#506)
* Signed-off-by:Alexandra Epanchinzeva alexandra.epanchinzeva@intel.com

* Minor fixes

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md
2021-08-26 17:55:23 +03:00
Ivan Kochin 1ea36d9e9d Cover the constraints_threads_per_core() reserved interface by testing (#544)
* Cover the constraints_threads_per_core reserved interface by testing

Signed-off-by: Kochin Ivan <kochin.ivan@intel.com>
2021-08-25 13:12:07 +03:00
Ilya IsaevandAlex 9924f9e808 Fix static build on Windows (#543)
This patch fixes issue with reference leak reported by test_global_control and test_tbb_fork on static build.

Signed-off-by: Isaev, Ilya ilya.isaev@intel.com

Co-authored-by: Alex <alexei.katranov@intel.com>
2021-08-24 14:23:05 +03:00
Ekaterina Mekhnetsova b60c4d3631 Update conf.py (#545) 2021-08-24 10:40:49 +03:00
Ekaterina Mekhnetsova 0695d176ff DOC: Add a link to Intel cookies (#542)
* Add a link to Intel cookies

* Update syntax
2021-08-24 10:29:57 +03:00
Pavel c6045a4f6f Fix using tbb::this_task_arena::current_thread_index() with uninitilized arena (#541)
Fix using tbb::this_task_arena::current_thread_index() with uninitilized arena
Signed-off-by: pavelkumbrasev <pavel.kumbrasev@intel.com>
2021-08-23 09:48:35 +03:00
vlserov d2405e35d1 Remove unused template class tls (#536)
Signed-off-by: Serov, Vladimir <vladimir.serov@intel.com>
2021-08-18 10:46:17 +03:00
Ilya Mishin de0109bed0 Improve Flow Graph conformance tests (#410)
* continue and function node

* multifunction node

* input node

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* buffering nodes

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* new input and output messages

* service nodes

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* green CI

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* graph reset tests

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* additional reset tests

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* fix codestyle issues

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* copy constructor fix

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* sfinae fix

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* fix unique_ptr on cxx11

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* style fixes

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* copy_constructor fix

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* fix atomic initialization

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* fid data race

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>
2021-08-12 11:29:31 +03:00
AlexandAlexandra b44f164b5c [DOC] Fix task_scheduler_handle description (#509)
* [DOC] Fix task_scheduler_hadnle description

Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>

Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>
2021-08-12 10:51:15 +03:00
Sergey Zheltov 1167f54bdf CMake: suppress alignment warning for ARM64-MSVC (#532)
Signed-off-by: Zheltov, Sergey1 <sergey1.zheltov@intel.com>
2021-08-11 20:39:08 +03:00
Ilya Isaev 8584c45634 Code coverage fixes (#516)
In scope of this patch TBB_BUILD and TBBMALLOC_BUILD options were added. It was done to support scenarios when we are testing without tbbmalloc. It allows us to cover place where we fail to link with tbbmalloc and start using std_cache_aligned_allocate/deallocate.

Signed-off-by: Ilya Isaev ilya.isaev@intel.com
2021-08-09 11:52:01 +03:00
Ilya Mishin 1ecde27f49 Fix inclusive language usage issues in tbbmalloc (#522)
Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>
2021-08-06 11:45:00 +03:00
vlserov 5a643c2360 GCC 11: suppress stringop-overread warning (#519)
1. Using thread_local for non-pointer types instead of tbb::detail::r1::tls
2. Replace magic-value with valid pointer

Signed-off-by: Serov, Vladimir <vladimir.serov@intel.com>
2021-08-05 15:57:27 +03:00
Alexey Veprev 357c9b27fa Update version number for 2021.4 (#520)
Signed-off-by: Veprev, Alexey alexey.veprev@intel.com
2021-08-02 18:20:31 +03:00
Alex 4df48f9850 Fix a race condition in AddrRange in tbbmalloc (#518)
The change fixes a possible crash of realloc when replaced with tbbmalloc_proxy on Linux.

Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
2021-07-30 21:09:57 +03:00
Pavel 552f342b26 Add workaround for incorrect soft limit initialization (#512)
Signed-off-by: pavelkumbrasev <pavel.kumbrasev@intel.com>
2021-07-30 15:59:06 +03:00
Alexandpavelkumbrasev 34c7d170ca Add heavy mix test for the scheduler (#490)
The test found a couple of issues that are also addressed in the patch

Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
Co-authored-by: pavelkumbrasev <pavel.kumbrasev@intel.com>
2021-07-30 15:58:14 +03:00
Ivan KochinandAlexey Veprev 7ec3cf8408 Fix the HWLOC linking when it was found using pkg-config (#508)
* Use imported target instead of variables during the HWLOC search using pkg-config
* Remove redundant code + rephrase the description
* Fix the indentation
* Rework testing

Signed-off-by: Kochin Ivan <kochin.ivan@intel.com>

Co-authored-by: Alexey Veprev <alexey.veprev@intel.com>
2021-07-30 15:21:15 +03:00
Ilya Mishin a070e5f208 Fix optimization flag on icx Windows Release build (#513)
Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>
2021-07-29 15:50:48 +03:00
Michael Vitrano 7d70bb51c3 Support building for Windows ARM64 (#507)
* Support building for Windows ARM64

Signed-off-by: Michael Vitrano <michaelvitrano@gmail.com>
2021-07-26 18:23:29 +03:00
Ivan Kochin b53726aac7 Prevent linking HWLOC 2.4 with tbbbind_2_5 (#501)
* Prevent linking HWLOC 2.4 with tbbbind_2_5
* Fix typo
* Rename and extend the comment

Signed-off-by: Kochin Ivan <kochin.ivan@intel.com>
2021-07-23 14:49:49 +03:00
vlserov fcb8377bee ASAN: test_task_group timeout (#502)
Disable memory leak tests under ASAN

Signed-off-by: Serov, Vladimir <vladimir.serov@intel.com>
2021-07-22 14:41:20 +03:00
Ilya Mishin dbccbee9f5 ICX compiler support on windows (#499)
* Support ICX on windows

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* clang macro

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* update compiler map

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* fix intptr_t

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* fix duplicate

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* fix spaces

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* fix spaces 2

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* update style

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* Update CMakeLists.txt

* Update test_openmp.cpp
2021-07-22 10:43:27 +03:00
Ivan Kochin edc30c82a1 Bind internal pinning observer lifetime to internal arena (#488)
* Bind internal pinning observer lifetime to the internal arena
* Control the tbbbind system_topology lifetime manually
* Fix entry point name
* Apply review remarks:
 * rename platform_topology to system_topology inside tbbbind
 * other minor fixes

Signed-off-by: Kochin Ivan <kochin.ivan@intel.com>
2021-07-21 23:01:03 +03:00
7941f880cb Fix build and tests of statically linked oneTBB (#492)
Fix build of libraries and tests while linking statically.

Signed-off-by: buzyaba <isaev.ameninc@gmail.com>

Co-authored-by: Alexey Veprev <alexey.veprev@intel.com>
Co-authored-by: buzyaba <isaev.ameninc@gmail.com>
2021-07-21 15:56:23 +03:00
8827ea7d1d Add export attributes + bug fixes (#351)
* Change (_WIN32 || _WIN64) to (_WIN32)

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Add _MSC_VER guards around #pragma warning directives

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Tweak MUTEX_INITIALIZER to suppress warnings

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Undefine PATH_MAX before redefining to suppress warnings

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Wrap #undef PATH_MAX

Co-authored-by: Alex <alexei.katranov@intel.com>

* Add lib prefix to dll names on mingw

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Quote LINK_FLAGS and LINK_DEPENDS to avoid space in paths problem

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Move #include <cstring> outside of #if _WIN32 block

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* wchar_t everywhere

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Add export attributes

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Tweak export macros

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Add export directives to tbbmalloc

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Wrap version script arguments + Undefine __STRICT_ANSI__

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Export directives for tbbbind

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Temporarily disable def files flag

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Fix __STRICT_ANSI__ undefine

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Fix macro in spin_mutex.h

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Add export directives to task_group.h

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Add waitpkg detection

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Tweak x86_64 detection

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Fix -U__STRICT_ANSI__ again

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Do not link with dl on mingw

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Add extra include files for allocator.cpp

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Add export directives for version.h

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Move export directives macro to a separate file

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Split export directives into separate macros

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Remove tbbmalloc symbols from proxy.h

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Replace TBBMALLOC_EXPORT with TBB_EXPORT in tbb_allocator.h

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Include scalable_allocator.h in tbbmalloc.cpp

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Disable C4275 in _exception.h

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Add export directives for is_writer

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Add export directives for _waitable_atomic.h

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Create macro for tbbbind

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Include <new> in scalable_allocator.h

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Add export case for Apple OS

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Add VERSION and SOVERSION

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Fix warnings under MSYS2 + GCC 10.3.x

* Trying to fix Linux CI

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Remove std::this_thread::yield() dependency on Windows

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Apply suggestions + fix typo

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Add def file flags back in

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Tweak export directives mechanism

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

* Change bool to auto to prevent warnings on VS2015

Signed-off-by: Long Nguyen <nguyen.long.908132@gmail.com>

Co-authored-by: Alex <alexei.katranov@intel.com>
Co-authored-by: Vittorio Romeo <vittorio.romeo@outlook.com>
2021-07-21 10:04:02 +03:00
Alexandpavelkumbrasev a080baf996 Additional set of Thread Sanitizer related fixes (#482)
- Fix incorrect assert in concurrent_hash_map implementation
- Fix incorrect asserts in global_control implementation
- Fix exception pointer inside task_group_context
- Rework racy asserts in test_flow_graph_whitebox
- Improve test_eh_algorithm to work with sanitizers
- Disable memory limit test in test_malloc_compliance
- Add lifetime asserts in collaborative_call_once
- Rework backref space in tbbmalloc to use atomics
- Fix a lifetime issue in utils::SpinBariier
- Some tests were disabled

Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
Co-authored-by: pavelkumbrasev <pavel.kumbrasev@intel.com>
2021-07-19 14:47:09 +03:00
Ilya Isaev 9cef57778c Workaround non-zero exit code (#496)
Signed-off-by: Ilya Isaev <ilya.isaev@intel.com>
2021-07-19 09:19:45 +03:00
Ilya Isaev e279ae19cb Remove dead code for code coverage (#497)
Signed-off-by: Ilya Isaev <ilya.isaev@intel.com>
2021-07-19 09:12:58 +03:00
Ilya Mishin 1098f48187 Fix failed test_limiter_node on gcc10,11 release build (#493)
Signed-off-by: ilya.mishin <ilya.mishin@intel.com>
2021-07-16 18:00:30 +03:00
Olga Malysheva a85a8bd32f Update third-party-programs.txt (#495)
Signed-off-by: Olga Malysheva <Olga.Malysheva@intel.com>
2021-07-16 16:29:00 +03:00
Ilya Isaev 35147e0021 Simplify synchronization logic in task_group_context (#462)
The current synchronization in task_group_context made by more then one atomic variable. This code hard to debug and each ThreadSanitizer report in this code usual require unreadable workaround to fix it. To improve correctness and readability of this code it was decided to rewrite synchronization using mutex.

Signed-off-by: Ilya Isaev ilya.isaev@intel.com
2021-07-16 12:03:21 +03:00
vlserov 68e075cbb9 ASAN: leak in test_arena_constraints/conformance_arena_constraints (#484)
Memory leak has been caused by ThirdParty library.
Adding LSAN suppression list for filter known issues.

Signed-off-by: Serov, Vladimir <vladimir.serov@intel.com>
2021-07-14 09:10:47 +03:00
Pavel b3fb839485 Enable thread-based resumable tasks under ASan (#486)
Signed-off-by: pavelkumbrasev <pavel.kumbrasev@intel.com>
2021-07-09 15:26:02 +03:00
Vertexwahn 6164044548 Add support for Bazel build (#442)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
2021-07-08 11:04:01 +03:00
Alex 8e7f9e14ba Fix internal allocator related issues (#480)
*For some reason, GCC does not instrument tbbmalloc with TSan when lto is enabled.
*Fix race in internal allocator on handler pointer initialization.
*Simplify checks in conformance_parallel_for

Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
2021-07-08 09:32:20 +03:00
Ivan Kochin a3151ce8ac Fix tests compilation on FreeBSD (#425)
* Use right affinity mask type during tests compilation on FreeBSD
* Disable priority inversion testing on FreeBSD
* Fix test_malloc_compliance compilation
* Add TODO, remove redundant blank line

Signed-off-by: Kochin, Ivan <kochin.ivan@intel.com>
2021-07-08 08:01:30 +03:00
43c1805ec6 Add thread based resumable tasks (#479)
Co-authored-by: vlserov <vladimir.serov@intel.com>
Co-authored-by: pavelkumbrasev <pavel.kumbrasev@intel.com>

Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
2021-07-07 09:11:23 +03:00
Ilya Mishin c94904e909 oneAPI pkg-config support (#452)
* oneAPI pkg-config support

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* tbb and tbb32

* remove uwp

* remove unnecessary variable

* define variable

* correct install

* remove exec_prefix

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* new path

* update vars

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* absolute paths for CMAKE_INSTALL_*DIR

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* remove )

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>
2021-07-06 18:43:44 +03:00
Alexey Oralov c75ed5bf40 Update path to archive (#483)
Signed-off-by: Alexey Oralov alexey.oralov@intel.com
2021-07-06 13:38:13 +03:00
Alexey Oralov 055cc6eaa0 CI: enable publishing of documentation on pages (#473)
Signed-off-by: Aleksey Oralov <alexey.oralov@intel.com>
2021-07-06 13:05:41 +03:00
Ivan Kochin 07300f7eab Prevent vars generation conflict (#469)
Signed-off-by: Kochin, Ivan <kochin.ivan@intel.com>
2021-07-06 07:33:42 +03:00
Alexey Veprev a3a6cd638d CMake: fix path to tbb.pc.in file (#476)
Signed-off-by: Veprev, Alexey <alexey.veprev@intel.com>
2021-07-05 17:23:29 +03:00
Alex 59ac78fa87 Fix flow graph tests under Thread Sanitizer (#444)
* Fix fg tests under tsan

Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
2021-07-05 11:49:17 +03:00
Pablo Romero 734f0bc0be Add support for QNX Neutrino (#440)
* Added support for QCC (QNX GNU Compiler)
* Enable source code compilation with non-Linux Unix systems with special focus on QNX.

Signed-off-by: promero <promero@mathworks.com>
2021-07-02 18:44:55 +03:00
vlserov de8bf52c4a ASAN: test_handle_perror (#472)
test_handle_perror doesn't depend on TBB library.
Only include paths are required.

Signed-off-by: Serov, Vladimir <vladimir.serov@intel.com>
2021-07-02 15:13:20 +03:00
Ivan Kochin c646de018a Fix LTO flags for Visual Studio compilation with old Cmake versions(<3.13) (#471)
Signed-off-by: Kochin Ivan <kochin.ivan@intel.com>
2021-07-01 18:22:16 +03:00
Ivan KochinandAleksei Fedotov e96dbf4b48 Upgrade from HWLOC 2.4 to HWLOC 2.5 (#448)
* Upgrade from HWLOC 2.4 to HWLOC 2.5
* Introduce tbbbind_2_5 library
* Remove tbbbind_2_4 library
* Use the HWLOC_TOPOLOGY_FLAG_RESTRICT_TO_CPUBINDING topology flag (introduces as a part of HWLOC 2.5) to restrict topology discovering to process binding
* Fix testing on Linux
* Apply review comments
* Improve wording: variable -> substring
* Use right tbbbind version for incompatible hwlocs test
* Rework option semantic
* Update README.md for CMake
* Rework readme
* Update cmake/README.md

Signed-off-by: Kochin, Ivan <kochin.ivan@intel.com>

Co-authored-by: Aleksei Fedotov <aleksei.fedotov@intel.com>
2021-07-01 15:07:39 +03:00
vlserov 94b62cc1d8 ASAN: test_malloc_whitebox (#467)
Reverting ASAN fix for test_malloc_regression #415
Turn off memory leaks test in test_malloc_regression test case

Signed-off-by: Serov, Vladimir <vladimir.serov@intel.com>
2021-07-01 11:31:04 +03:00
Ilya Isaev 112076d06c Improve code coverage (#463)
Signed-off-by: Ilya Isaev <ilya.isaev@intel.com>
2021-07-01 10:09:04 +03:00
kboyarinov 4a23d00235 Multiple fixes for constraints (#465)
* Fix a typo in chmap, temporary rename concept range

* Rename range concept, add workaround for Windows

* Reimplement with respect to prospective destructors

* Fix fibonacci
2021-06-30 16:22:06 +03:00
Ivan Kochin a3635ce50b Fix LTO flags on Windows for old CMake versions (#466)
* Fix LTO flags for old CMake versions
* Update cmake/README.md

Signed-off-by: Kochin Ivan <kochin.ivan@intel.com>
2021-06-30 01:01:00 +03:00
Mircho Rodozov fa944e1960 Remove arch macros checks for getSmallObjectIndex (#461)
Remove arch macros checks for getSmallObjectIndex 

Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
2021-06-29 21:09:43 +03:00
Ivan Kochin 3e4ab55091 Fix dlopen flags for loading tbbmalloc and rml (#457)
* Fix dlopen flags for loading tbbmalloc and rml
* Rework macro definition approach
* Use correct macro name

Signed-off-by: Kochin, Ivan <kochin.ivan@intel.com>
2021-06-29 09:41:39 +03:00
Alexey Oralov 67c1171696 Add build documentation to CI (#423)
Signed-off-by: Aleksey Oralov <alexey.oralov@intel.com>
2021-06-28 17:44:37 +03:00
Anton Potapov c0b91bdba9 ASAN: disable OOM test in test_malloc_compliance (#459)
Out Of Memory conditions simulated in the ReallocParam test breaking ASAN, so skip this case under it.

Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
2021-06-28 10:25:55 +03:00
Anton Potapov 3a47fb3718 ASAN: disable test_malloc_overload (#458)
- ASAN overload malloc/free, so test is no longer test TBBMalloc

Signed-off-by: Anton Potapov <anton.potapov@intel.com>
2021-06-28 10:21:31 +03:00
Anton Potapov 3a6580652d ASAN: disable tests causing OOM conditions (#456)
- do not run theses tests under ASAN :
   - test_eh_thread
   - test_malloc_new_handler

Signed-off-by: Anton Potapov <anton.potapov@intel.com>
2021-06-25 12:05:27 +03:00
Alex 2ca2a5f206 Fix leaking proxy task objects (#431)
* Fix leaking proxy task objects

Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
2021-06-25 09:15:57 +03:00
Ivan Kochin 0354fc109f Solve the issue with different incompatible HWLOC library versions in one executable (#426)
* Solve the issue with different incompatible hwlocs in one executable
* Support macOS and Windows
* Fix flags on Windows and MacOS
* Try to fix Windows compilation
* Add warning suppression
* Rename the CMake variable
* Fix the RTLD_DEEPBIND flag placement condition
* Improve naming
* Change flags logic
* Suppress MSVC 2015 warning: 'int': forcing value to bool 'true' or 'false'

Signed-off-by: Kochin Ivan <kochin.ivan@intel.com>
2021-06-23 19:45:29 +03:00
Anton PotapovandAleksei Fedotov 4386b0f0cd task_group extensions : task_handle comparison operators unit tests (#451)
* task_group extensions

- unit tests for empty check / comparison operators

Signed-off-by: Anton Potapov <anton.potapov@intel.com>

Co-authored-by: Aleksei Fedotov <aleksei.fedotov@intel.com>
2021-06-23 14:12:52 +03:00
kboyarinov 16b6a651a9 Fix error C3864 for constraints on Windows (#449)
* Fix Windows warning on constraints

* Fix whitespaces
2021-06-23 12:16:05 +03:00
Anton Potapov ec505c7d5a Workaround GCC 11 warning in concurrent_unordered_base (#447)
Signed-off-by: Anton Potapov <anton.potapov@intel.com>
2021-06-22 12:16:57 +03:00
Ivan KochinandAnton Potapov e1b24895e6 SOM example: enable mandatory concurrency (#450)
SOM requires mandatory concurrency to prevent hanging on 1-threaded configurations since this example has cross-graph dependencies

* SOM example: enable mandatory concurrency
* Add include & define NOMINMAX
* Improve comment wording

Signed-off-by: Kochin Ivan <kochin.ivan@intel.com>
Co-authored-by: Anton Potapov <anton.potapov@intel.com>
2021-06-22 09:38:19 +03:00
Ivan Kochin ac3d43b691 Enable intermodular optimization during the compilation (#432)
* Enable IPO during the compilation
* Add compilation flag for clang++
* Rework CMake approach
* Disable LTO on Android due to Android NDK bug
* Remove redundant code

Signed-off-by: Kochin, Ivan <kochin.ivan@intel.com>
2021-06-21 12:23:49 +03:00
vlserov fbc48b39c6 ASAN: Use after scope in conformance_concurrent_queue (#435)
Updating concurrent_queue_rep to accept Allocator as a function parameter instead of holding reference to it.

Signed-off-by: Serov, Vladimir <vladimir.serov@intel.com>
2021-06-18 10:21:25 +03:00
Sergey Zheltov 29009a8e51 Fix oneTBB package version in CMake integration (#446)
Signed-off-by: Zheltov, Sergey1 <sergey1.zheltov@intel.com>
2021-06-17 12:10:46 +03:00
Ilya Isaev 4beec37a1d Fix TSAN errors in collaborative_call_once (#445)
* Fix TSAN errors in collaborative_call_once

Signed-off-by: Ilya Isaev <ilya.isaev@intel.com>
2021-06-17 07:34:44 +03:00
Khem Raj 933a38a460 arena: Remove dead code (#429)
Fixes clang warning
arena.cpp:226:19: error: variable 'drained' set b
ut not used [-Werror,-Wunused-but-set-variable]
|     std::intptr_t drained = 0;
|                   ^

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-06-17 07:34:08 +03:00
Ilya Mishin 64715f43d8 Fix failed mips debug build (#443)
* Fix mips debug join_node tests

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* Macro in header

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* Macro name

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* Right macro

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* remove unnecessary macro

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* macro only in join_node test

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>
2021-06-16 12:09:09 +03:00
Alexandra 2526dcf136 Update README.md (#436)
* Update README.md
2021-06-10 15:05:29 +03:00
Ilya Mishin b36260b443 Enable all join_node constructors testing (#441)
* enable all constructors testing

Signed-off-by: Mishin, Ilya <ilya.mishin@intel.com>

* remove unnecessary definitions
2021-06-10 13:37:16 +03:00
vlserov 345a2204ca ASAN: skip test_malloc_atexit under ASAN (#434)
Skip test_malloc_atexit since it not applicable under ASAN.

Signed-off-by: Serov, Vladimir <vladimir.serov@intel.com>
2021-06-10 12:05:36 +03:00
Alex 81dd27c4f6 Fix some gcc11 warnings (#433)
* Supress mallinfo deprecation warning in test_malloc_overload.cpp
* Fix warning in flow_graph_types_impl

Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
2021-06-09 12:00:48 +03:00
Ivan Kochin 55f9b17864 Update doctest version to 2.4.6 (#413)
* Update doctest version to 2.4.6

Signed-off-by: Kochin, Ivan <kochin.ivan@intel.com>
2021-06-08 17:43:37 +03:00
PavelandAlexei Katranov 3119997522 Improve wakeup signal propagation in private server (#427)
* Improve wakeup signal propagation in private server

Signed-off-by: pkumbras <pavel.kumbrasev@intel.com>

Co-authored-by: Alexei Katranov <alexei.katranov@intel.com>
2021-06-07 16:51:19 +03:00
Rupanshu Yadav fc9a3bbc78 Fix grammatical mistake in README.md (#428) 2021-06-04 21:25:36 +03:00
Ilya MishinandAleksei Fedotov 25e2b1dd25 Fix negative delta in limiter_node decrementer (#422)
* fix negative delta in limiter_node decrementer

* add assert

* fix warning

* add new test

* refactor test

* more checks

Co-authored-by: Aleksei Fedotov <aleksei.fedotov@intel.com>

* counter to right place

* fix build

Co-authored-by: Aleksei Fedotov <aleksei.fedotov@intel.com>
2021-06-04 17:27:08 +03:00
vlserov 4b479c1e0b ASAN fix for test_malloc_regression (#415)
ASAN allocator never releases memory to OS, instead of it just marks those memory as "freed".
Generic OS functions for getting currently allocated memory aren't working correctly under ASAN.

- Using __sanitizer_get_current_allocated_bytes func instead of generic OS func for getting currently allocated memory

Signed-off-by: Serov, Vladimir <vladimir.serov@intel.com>
2021-06-02 16:55:58 +03:00
Ilya IsaevandAlex bf1f2ab6eb Add collaborative_call_once algorithm (#397)
collaborative_call_once is a function similar to std::call_once but allows waiting threads to join oneTBB parallel construction called inside the initializing functor. The semantics of exceptions is also similar to std::call_once: whenever the exception is thrown, it is rethrown on the initializing thread and this or other thread can try to call initializing functor again until it is completed without an exception.

This pull request integrates #357. It is reworked to avoid dynamic memory allocation and fit the state into one word (see state machine in #267).  In cooperation with @BenFrantzDale @HenryHeffanFormlabs

Signed-off-by: Ilya Isaev <ilya.isaev@intel.com>

Co-authored-by: Alex <alexei.katranov@intel.com>
2021-06-02 16:44:25 +03:00
Anton Potapov fde1856728 task_group extensions (task_handle) minor cleanups (#404)
- moved task_handle related stuff to separate header file
- replaced free standing helper functions with single "acessor" class
- removed needless condition in the ctx_of() function

Signed-off-by: Anton Potapov <anton.potapov@intel.com>
2021-06-01 15:34:30 +03:00
Anton Potapov 16350adcff ASAN: fix memory leak in concurrent_skip_list move assign operator (#409)
- delete head node as well beffore move assigning
 - introduced internal helper member function delete_head


Signed-off-by: Anton Potapov <anton.potapov@intel.com>
2021-05-31 18:11:34 +03:00
Ilya Isaev 012aea0351 Fix shellcheck scan errors and warnings (#411)
* Fix shellcheck errors and warnings

Signed-off-by: Ilya Isaev <ilya.isaev@intel.com>

* Apply comments and parse args properly on ZSH

Signed-off-by: Ilya Isaev <ilya.isaev@intel.com>

* Parse ia32 via regex

Signed-off-by: Ilya Isaev <ilya.isaev@intel.com>

* arg_ia32 to tbb_arg_ia32

Signed-off-by: Ilya Isaev <ilya.isaev@intel.com>

* Fix indenting

Signed-off-by: Ilya Isaev <ilya.isaev@intel.com>

* Change regex

Signed-off-by: Ilya Isaev <ilya.isaev@intel.com>
2021-05-26 20:20:51 +03:00
Ivan KochinandAlex c52c62ba78 Remove the same test cases to fix MIPS compilation (#412)
* Remove the same test cases to fix MIPS compilation

* Update test/tbb/test_join_node_msg_key_matching.cpp

Co-authored-by: Ivan Kochin <iv.kochin@gmail.com>

Co-authored-by: Alex <alexei.katranov@intel.com>
2021-05-25 14:33:00 +03:00
Alexei Katranov 3b04521726 Fix atomic usage in conformance_parallel_pipeline
Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
2021-05-25 08:02:10 +03:00
Jan Tojnar fa3268c3df CMake/pkg-config: fix paths in .pc file with absolute GNUInstallDirs (#395)
Signed-off-by: Jan Tojnar <jtojnar@gmail.com>
2021-05-21 18:46:06 +03:00
Ivan KochinandKochin, Ivan 5d4a4acf95 Fix the logic that depends on optional copy elision (#402)
* Fix the behavior when copy elision is disabled

* Update test/tbb/test_task_arena.cpp

* Rework doctest ContextScope destruction to fix MSVC compilation

* Remove raii_guard assignment + remove std::move from doctest

* Fix typo

* Rework the fix for doctest to get rid of hangs on Windows

* Add static assertion to check constructors noexcept state

* Remove copy elision disabling flag

* Add a comment with the reason of absence of std::move

Co-authored-by: Kochin, Ivan <ivan.kochin@intel.com>
2021-05-21 12:37:58 +03:00
Anton Potapov 0063fb3c76 ASAN fix for test_eh_algorithm (fixup for #401) (#403)
- fixup for #401

Signed-off-by: Anton Potapov <anton.potapov@intel.com>
2021-05-21 12:03:25 +03:00
Anton Potapov d8251013ce ASAN use after scope fix for concurrent_skip_list (#400)
- removed reference to container allocator from skip_list_node
 - added special skip_list_node::create skip_list_node::destroy static
methods

 - moved concurrent_skip_list, *_map/*multimap, *set/*multiset into d2
namespace due layout change of skip_list_node


Signed-off-by: Anton Potapov <anton.potapov@intel.com>
2021-05-21 10:50:08 +03:00
Anton Potapov 444fd2bd0f ASAN fix for test_eh_algorithm (#401)
- fixed read out of bounds

Signed-off-by: Anton Potapov <anton.potapov@intel.com>
2021-05-19 18:52:27 +03:00
Ilya Mishin 3e9e8c9c4d Add threshold requirement for eh tests (#399)
* Add threshold requirement for eeh tests

* typo error fix
2021-05-18 12:40:09 +03:00
Tobias Fischer c46e2aa03e Pull in https://github.com/oneapi-src/oneTBB/pull/299 2021-05-17 20:05:20 +03:00
Alexey Veprev a497817ca0 README: add CI status badge (#398)
Signed-off-by: Alexey Veprev <alexey.veprev@intel.com>
2021-05-17 14:39:38 +03:00
tbbdev 8b6f831c68 Commit oneTBB source code 5ba997e1 2021-05-17 10:52:00 +03:00
Sergey Zheltov 6aa706d879 CI: fix a typo in the job name (#392) 2021-05-07 21:24:55 +03:00
Sergey Zheltov 6caecf9630 CI: enable testing via GitHub Actions (#390) 2021-05-07 17:15:01 +03:00
tbbdev be66b3a1cf Commit oneTBB source code 614fdc20 2021-05-07 16:29:12 +03:00
tbbdev 478de5b188 Commit oneTBB source code 82ff8707 2021-05-05 10:28:54 +03:00
tbbdev 9e15720bc7 Commit oneTBB source code b0fb1535 2021-03-26 10:22:37 +03:00
tbbdev 4523a7615e Commit oneTBB source code 4fcd448a 2021-03-01 17:31:49 +03:00
tbbdev b15aabb39a Commit oneTBB source code 9ed4a21c 2021-01-26 15:10:57 +03:00
tbbdev d86ed7fbaa Commit oneTBB source code 09241505 2020-12-24 16:20:58 +03:00
tbbdev 8dcbd5b11b Commit oneTBB source code 8fda6294 2020-11-18 12:07:23 +03:00
tbbdev 49e08aac08 Commit oneTBB source code 6420d97a 2020-10-28 19:26:00 +03:00
tbbdev 51c0b2f742 Commit oneTBB source code 4ebd2d06 2020-09-25 11:03:12 +03:00
484 changed files with 7782 additions and 17864 deletions
+1 -1
View File
@@ -16,4 +16,4 @@
# use Bazel internally. The Bazel build can have security risks or
# optimization gaps.
build --symlink_prefix=/ # Out of source build
build --symlink_prefix=/ # Out of source build
+1 -1
View File
@@ -1 +1 @@
7.0.0
4.1.0
-27
View File
@@ -1,27 +0,0 @@
# Copyright (c) 2023 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# PR template regexp's for issue labeler
bug fix:
- '\[(x|X)\]\sbug\sfix'
enhancement:
- '\[(x|X)\]\snew\sfeature'
tests:
- '\[(x|X)\]\stests'
infrastructure:
- '\[(x|X)\]\sinfrastructure'
documentation:
- '\[(x|X)\]\sdocumentation'
allocator:
- '\[(x|X)\]\sallocator'
-18
View File
@@ -1,18 +0,0 @@
# Copyright (c) 2023 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
allocator:
- 'src/tbbmalloc/**/*'
- 'src/tbbmalloc_proxy/**/*'
- 'test/tbbmalloc/**/*'
+5 -7
View File
@@ -1,26 +1,24 @@
### Description
_Add a comprehensive description of proposed changes_
_Add comprehensive description of proposed changes_
Fixes # - _issue number(s) if exists_
- [ ] - git commit message contains an appropriate signed-off-by string _(see [CONTRIBUTING.md](https://github.com/oneapi-src/oneTBB/blob/master/CONTRIBUTING.md#pull-requests) for details)_
### Type of change
_Choose one or multiple, leave empty if none of the other choices apply_
_Add a respective label(s) to PR if you have permissions_
_Add respective label(s) to PR if you have permissions_
- [ ] bug fix - _change that fixes an issue_
- [ ] new feature - _change that adds functionality_
- [ ] bug fix - _change which fixes an issue_
- [ ] new feature - _change which adds functionality_
- [ ] tests - _change in tests_
- [ ] infrastructure - _change in infrastructure and CI_
- [ ] documentation - _documentation update_
### Tests
- [ ] added - _required for new features and some bug fixes_
- [ ] added - _required for new features and for some bug fixes_
- [ ] not needed
### Documentation
+22 -47
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2024 Intel Corporation
# Copyright (c) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -25,8 +25,6 @@ on:
- synchronize
- reopened
permissions: read-all
env:
BUILD_CONCURRENCY: 2
MACOS_BUILD_CONCURRENCY: 3
@@ -50,29 +48,26 @@ jobs:
- uses: actions/checkout@v2
- name: Run scan
run: |
command -v clang-format-10
cp -r examples examples_formatted
find examples_formatted -regex '.*\.\(cpp\|hpp\)' -exec clang-format-10 -style=file -i {} \;
find examples_formatted -regex '.*\.\(cpp\|hpp\)' -exec clang-format-9 -style=file -i {} \;
diff -r examples examples_formatted
documentation:
needs: [codespell]
env:
BUILD_TYPE: oss
runs-on: [ubuntu-22.04]
runs-on: [ubuntu-20.04]
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Install prerequisites
run: |
pip3 install -U Jinja2
pip3 install git+https://github.com/executablebooks/sphinx-book-theme.git
pip3 install sphinx-tabs
echo GITHUB_SHA_SHORT=${GITHUB_SHA::8} >> $GITHUB_ENV
mkdir html
- name: Build documentation
run: |
export BUILD_TYPE=${BUILD_TYPE} && sphinx-build doc html
export BUILD_TYPE=${BUILD_TYPE} && sphinx-build doc/main html
tar -czvf html.tar.gz html/
- name: Save docs
uses: actions/upload-artifact@v2.2.1
@@ -109,28 +104,8 @@ jobs:
git commit --reset-author --amend -m "Update from GitHub Actions"
git push --force origin gh-pages
copyright_check:
if: ${{ github.ref != 'refs/heads/master' }}
runs-on: [ubuntu-20.04]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run check
run: |
sed -i \
-e "/Copyright (c) .* Intel Corporation/s/ \([0-9]\+\)[-0-9]*/ \\1-$(date +%Y)/" \
-e "/Copyright (c) .* Intel Corporation/s/$(date +%Y)-$(date +%Y)/$(date +%Y)/" \
$(git diff --diff-filter=d --name-only ${{ github.event.pull_request.base.sha }})
git checkout -- third-party-programs.txt
git diff > years.diff
if [[ -s years.diff ]]; then
echo "Wrong copyright years"
cat years.diff
exit 1
fi
python_module_test_ubuntu_latest:
runs-on: [ubuntu-latest]
python_module_test_ubuntu18-04:
runs-on: [ubuntu-18.04]
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
@@ -149,7 +124,7 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: ubuntu-18.04
c_compiler: gcc
cxx_compiler: g++
std: 14
@@ -187,7 +162,7 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-12
- os: macos-10.15
c_compiler: clang
cxx_compiler: clang++
std: 14
@@ -213,22 +188,22 @@ jobs:
fail-fast: false
matrix:
include:
- os: windows-2019
generator: Visual Studio 16 2019
- os: windows-2016
generator: Visual Studio 15 2017
c_compiler: cl
cxx_compiler: cl
std: 14
build_type: relwithdebinfo
preview: 'ON'
job_name: windows_cl2019_cxx14_relwithdebinfo_preview=ON
- os: windows-2022
generator: Visual Studio 17 2022
job_name: windows_cl2017_cxx14_relwithdebinfo_preview=ON
- os: windows-2019
generator: Visual Studio 16 2019
c_compiler: cl
cxx_compiler: cl
std: 17
build_type: relwithdebinfo
preview: 'OFF'
job_name: windows_cl2022_cxx17_relwithdebinfo_preview=OFF
job_name: windows_cl2019_cxx17_relwithdebinfo_preview=OFF
steps:
- uses: actions/checkout@v2
- name: Run testing
@@ -249,7 +224,7 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: ubuntu-18.04
c_compiler: gcc
cxx_compiler: g++
std: 14
@@ -287,7 +262,7 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-12
- os: macos-10.15
c_compiler: clang
cxx_compiler: clang++
std: 14
@@ -313,22 +288,22 @@ jobs:
fail-fast: false
matrix:
include:
- os: windows-2019
generator: Visual Studio 16 2019
- os: windows-2016
generator: Visual Studio 15 2017
c_compiler: cl
cxx_compiler: cl
std: 14
build_type: relwithdebinfo
preview: 'ON'
job_name: examples_windows_cl2019_cxx14_relwithdebinfo_preview=ON
- os: windows-2022
generator: Visual Studio 17 2022
job_name: examples_windows_cl2017_cxx14_relwithdebinfo_preview=ON
- os: windows-2019
generator: Visual Studio 16 2019
c_compiler: cl
cxx_compiler: cl
std: 17
build_type: relwithdebinfo
preview: 'OFF'
job_name: examples_windows_cl2022_cxx17_relwithdebinfo_preview=OFF
job_name: examples_windows_cl2019_cxx17_relwithdebinfo_preview=OFF
steps:
- uses: actions/checkout@v2
- name: Run testing
-35
View File
@@ -1,35 +0,0 @@
# Copyright (c) 2023 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: "Issue Labeler"
on:
issues:
types: [opened, edited]
pull_request:
types: [opened, edited]
jobs:
triage:
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: write
contents: read
steps:
- uses: github/issue-labeler@v3.2 #May not be the latest version
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/issue_labeler.yml
enable-versioned-regex: 0
sync-labels: 1
-26
View File
@@ -1,26 +0,0 @@
# Copyright (c) 2023 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: "Pull Request Labeler"
on:
- pull_request_target
jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
+6 -12
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2022 Intel Corporation
# Copyright (c) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -35,33 +35,27 @@ cc_library(
"include/oneapi/tbb/*.h",
"include/oneapi/tbb/detail/*.h",
]),
copts = ["-w"] + select({
"@platforms//os:windows": [""],
"//conditions:default": ["-mwaitpkg"],
}),
copts = [
"-w",
],
defines =
select({
"@platforms//cpu:x86_64": ["__TBB_NO_IMPLICIT_LINKAGE"],
"//conditions:default": [
"USE_PTHREAD",
],
}) +
select({
"@platforms//os:osx": ["_XOPEN_SOURCE"],
"//conditions:default": [],
}),
includes = [
"include",
],
linkopts =
select({
"@platforms//os:windows": [],
"@platforms//os:linux": [
"@bazel_tools//platforms:windows": [],
"//conditions:default": [
"-ldl",
"-pthread",
"-lrt",
],
"//conditions:default": ["-pthread"],
}),
local_defines = select({
"@platforms//cpu:x86_64": [
+20 -56
View File
@@ -1,39 +1,25 @@
# Bazel* build support
# Bazel build support
The main build system of oneTBB is CMake*.
[Bazel*](https://bazel.build/) support is community-based.
The Bazel configuration may not include recommended compiler and/or linker flags used in the official CMake configuration.
The main build system of oneTBB is CMake.
Bazel support is community-based.
The maintainers do not use Bazel internally.
The Bazel configuration may not include recommended compiler and linker flags used in official CMake configuration.
---
**NOTE**
The Bazel build of oneTBB currently only aims for a subset of oneTBB that suffices restricted use cases of the usage of oneTBB.
Pull requests to improve the Bazel build experience are welcomed.
Bazel is not recommended for use by oneTBB maintainers. Thus, it is not used internally.
The standard approach of how Bazel handles third-party libraries is static linking.
Even this is not recommended by the oneTBB maintainers this is chosen since this is considered as the best practice in the Bazel ecosystem.
---
## Example usage
1. [Install Bazel](https://docs.bazel.build/versions/main/install.html).
The Bazel oneTBB build is currently only intended for a subset of oneTBB that suffices restricted use cases.
Pull requests to improve the Bazel build experience are welcome.
The standard Bazel approach to handling third-party libraries is static linking. It is the best practice within the Bazel ecosystem.
## Using oneTBB as a dependency
This example demonstrates how to use oneTBB as a dependency within a Bazel project.
The following file structure is assumed:
```
example
├── .bazelrc
├── BUILD.bazel
├── main.cpp
└── WORKSPACE.bazel
```
2. Create the following files in one folder (this folder will be considered as the workspace folder):
_WORKSPACE.bazel_:
```python
load("@platforms//tools/build_defs/repo:git.bzl", "git_repository")
```
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository(
name = "oneTBB",
@@ -42,11 +28,8 @@ git_repository(
)
```
In the *WORKSPACE* file, the oneTBB GitHub* repository is fetched.
_BUILD.bazel_:
```python
_BUILD_:
```
cc_binary(
name = "Demo",
srcs = ["main.cpp"],
@@ -54,11 +37,8 @@ cc_binary(
)
```
The *BUILD* file defines a binary named `Demo` that has a dependency to oneTBB.
_main.cpp_:
```c++
```
#include "oneapi/tbb/version.h"
#include <iostream>
@@ -74,23 +54,7 @@ int main() {
}
```
The expected output of this program is the current version of oneTBB.
3. Switch to the folder where you create the files.
Switch to the folder with the files created earlier and run the binary with `bazel run //:Demo`.
## Build oneTBB using Bazel
Run ```bazel build //...``` in the oneTBB root directory.
## Compiler support
The Bazel build uses the compiler flag `-mwaitpkg` in non-Windows* builds.
This flag is supported by the GNU* Compiler Collection (GCC) version 9.3, Clang* 12, and newer versions of those tools.
---
**NOTE**
To use the Bazel build with earlier versions of GCC, remove `-mwaitpkg` flag as it leads to errors during compilation.
---
4. Execute the command `bazel run //:Demo`.
As an expected output, you should see the oneTBB version.
+50 -114
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2024 Intel Corporation
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,15 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.1)
# Enable CMake policies
if (POLICY CMP0068)
# RPATH settings do not affect install_name on macOS since CMake 3.9
cmake_policy(SET CMP0068 NEW)
endif()
if (POLICY CMP0091)
# The NEW behavior for this policy is to not place MSVC runtime library flags in the default
# CMAKE_<LANG>_FLAGS_<CONFIG> cache entries and use CMAKE_MSVC_RUNTIME_LIBRARY abstraction instead.
@@ -43,6 +38,12 @@ if (APPLE)
endif()
endif()
# Until CMake 3.4.0 FindThreads.cmake requires C language enabled.
# Enable C language before CXX to avoid possible override of CMAKE_SIZEOF_VOID_P.
if (CMAKE_VERSION VERSION_LESS 3.4)
enable_language(C)
endif()
file(READ include/oneapi/tbb/version.h _tbb_version_info)
string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" _tbb_ver_major "${_tbb_version_info}")
string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" _tbb_ver_minor "${_tbb_version_info}")
@@ -59,7 +60,6 @@ unset(_tbb_ver_minor)
include(CheckCXXCompilerFlag)
include(GNUInstallDirs)
include(CMakeDependentOption)
# ---------------------------------------------------------------------------------------------------------
# Handle C++ standard version.
@@ -100,22 +100,16 @@ option(TBB_NO_APPCONTAINER "Apply /APPCONTAINER:NO (for testing binaries for Win
option(TBB4PY_BUILD "Enable tbb4py build" OFF)
option(TBB_BUILD "Enable tbb build" ON)
option(TBBMALLOC_BUILD "Enable tbbmalloc build" ON)
cmake_dependent_option(TBBMALLOC_PROXY_BUILD "Enable tbbmalloc_proxy build" ON "TBBMALLOC_BUILD" OFF)
option(TBB_CPF "Enable preview features of the library" OFF)
option(TBB_FIND_PACKAGE "Enable search for external oneTBB using find_package instead of build from sources" OFF)
option(TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH "Disable HWLOC automatic search by pkg-config tool" ${CMAKE_CROSSCOMPILING})
option(TBB_ENABLE_IPO "Enable Interprocedural Optimization (IPO) during the compilation" ON)
option(TBB_FUZZ_TESTING "Enable fuzz testing" OFF)
option(TBB_INSTALL "Enable installation" ON)
option(TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH "Disable HWLOC automatic search by pkg-config tool" OFF)
if (NOT DEFINED BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS ON)
endif()
if (NOT BUILD_SHARED_LIBS)
if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
message(WARNING "You are building oneTBB as a static library. This is highly discouraged and such configuration is not supported. Consider building a dynamic library to avoid unforeseen issues.")
endif()
@@ -126,14 +120,6 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
if (CMAKE_BUILD_TYPE)
string(TOLOWER ${CMAKE_BUILD_TYPE} _tbb_build_type)
if (_tbb_build_type STREQUAL "debug")
set(TBB_ENABLE_IPO OFF)
endif()
unset(_tbb_build_type)
endif()
# -------------------------------------------------------------------
# Files and folders naming
set(CMAKE_DEBUG_POSTFIX _debug)
@@ -182,22 +168,10 @@ foreach(output_type LIBRARY ARCHIVE PDB RUNTIME)
endif()
endforeach()
if (CMAKE_CONFIGURATION_TYPES)
# We can't use generator expressions in a cmake variable name.
set(TBB_TEST_WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${TBB_OUTPUT_DIR_BASE}_$<LOWER_CASE:$<CONFIG>>)
else()
set(TBB_TEST_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif()
# -------------------------------------------------------------------
# -------------------------------------------------------------------
# Common dependencies
#force -pthread during compilation for Emscripten
if (EMSCRIPTEN AND NOT EMSCRIPTEN_WITHOUT_PTHREAD)
set(THREADS_HAVE_PTHREAD_ARG TRUE)
endif()
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
# -------------------------------------------------------------------
@@ -207,22 +181,6 @@ foreach(FILE_WITH_EXTRA_TARGETS ${FILES_WITH_EXTRA_TARGETS})
include(${FILE_WITH_EXTRA_TARGETS})
endforeach()
# - Enabling LTO on Android causes the NDK bug.
# NDK throws the warning: "argument unused during compilation: '-Wa,--noexecstack'"
# - For some reason GCC does not instrument code with Thread Sanitizer when lto is enabled and C linker is used.
if (TBB_ENABLE_IPO AND BUILD_SHARED_LIBS AND NOT ANDROID_PLATFORM AND NOT TBB_SANITIZE MATCHES "thread")
if (NOT CMAKE_VERSION VERSION_LESS 3.9)
cmake_policy(SET CMP0069 NEW)
include(CheckIPOSupported)
check_ipo_supported(RESULT TBB_IPO_PROPERTY)
else()
set(TBB_IPO_FLAGS TRUE)
endif()
if (TBB_IPO_PROPERTY OR TBB_IPO_FLAGS)
message(STATUS "IPO enabled")
endif()
endif()
set(TBB_COMPILER_SETTINGS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/compilers/${CMAKE_CXX_COMPILER_ID}.cmake)
if (EXISTS ${TBB_COMPILER_SETTINGS_FILE})
include(${TBB_COMPILER_SETTINGS_FILE})
@@ -239,50 +197,45 @@ else()
if (TBB_BUILD)
add_subdirectory(src/tbb)
endif()
if (TBBMALLOC_BUILD)
add_subdirectory(src/tbbmalloc)
if(TBBMALLOC_PROXY_BUILD AND NOT "${MSVC_CXX_ARCHITECTURE_ID}" MATCHES "ARM64")
if (NOT "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips")
if (TBBMALLOC_BUILD)
add_subdirectory(src/tbbmalloc)
add_subdirectory(src/tbbmalloc_proxy)
endif()
endif()
if (NOT BUILD_SHARED_LIBS)
message(STATUS "TBBBind build targets are disabled due to unsupported environment")
else()
add_subdirectory(src/tbbbind)
endif()
if (TBB_INSTALL)
# -------------------------------------------------------------------
# Installation instructions
include(CMakePackageConfigHelpers)
install(DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT devel)
install(EXPORT ${PROJECT_NAME}Targets
NAMESPACE TBB::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
COMPONENT devel)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
"include(\${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}Targets.cmake)\n")
if (NOT BUILD_SHARED_LIBS)
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
"include(CMakeFindDependencyMacro)\nfind_dependency(Threads)\n")
if (APPLE)
message(STATUS "TBBBind build targets are disabled due to unsupported environment")
else()
add_subdirectory(src/tbbbind)
endif()
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
COMPATIBILITY AnyNewerVersion)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
COMPONENT devel)
install(FILES "README.md"
DESTINATION ${CMAKE_INSTALL_DOCDIR}
COMPONENT devel)
# -------------------------------------------------------------------
endif()
# -------------------------------------------------------------------
# Installation instructions
include(CMakePackageConfigHelpers)
install(DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT devel)
install(EXPORT ${PROJECT_NAME}Targets
NAMESPACE TBB::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
COMPONENT devel)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
"include(\${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}Targets.cmake)\n")
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
COMPATIBILITY AnyNewerVersion)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
COMPONENT devel)
install(FILES "README.md"
DESTINATION ${CMAKE_INSTALL_DOCDIR}
COMPONENT devel)
# -------------------------------------------------------------------
endif()
if (TBB_TEST)
@@ -304,28 +257,11 @@ if (TBB_BENCH)
endif()
if (ANDROID_PLATFORM)
if ("${ANDROID_STL}" STREQUAL "c++_shared")
if (${ANDROID_NDK_MAJOR} GREATER_EQUAL "25")
if(ANDROID_ABI STREQUAL "arm64-v8a")
set(ANDROID_TOOLCHAIN_NAME "aarch64-linux-android")
elseif(ANDROID_ABI STREQUAL "x86_64")
set(ANDROID_TOOLCHAIN_NAME "x86_64-linux-android")
elseif(ANDROID_ABI STREQUAL "armeabi-v7a")
set(ANDROID_TOOLCHAIN_NAME "arm-linux-androideabi")
elseif(ANDROID_ABI STREQUAL "x86")
set(ANDROID_TOOLCHAIN_NAME "i686-linux-android")
endif()
configure_file(
"${ANDROID_TOOLCHAIN_ROOT}/sysroot/usr/lib/${ANDROID_TOOLCHAIN_NAME}/libc++_shared.so"
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libc++_shared.so"
COPYONLY)
else()
configure_file(
"${ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${ANDROID_ABI}/libc++_shared.so"
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libc++_shared.so"
COPYONLY)
endif()
if (${ANDROID_STL} STREQUAL "c++_shared")
configure_file(
"${ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${ANDROID_ABI}/libc++_shared.so"
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libc++_shared.so"
COPYONLY)
endif()
# This custom target may be implemented without separate CMake script, but it requires
# ADB(Android Debug Bridge) executable file availability, so to incapsulate this requirement
+7 -5
View File
@@ -29,6 +29,11 @@ The DCO is an attestation attached to every contribution made by every developer
As a contributor, you’ll want to be familiar with the oneTBB project and the repository layout. You should also know how to use it as explained in the [oneTBB documentation](https://oneapi-src.github.io/oneTBB/) and how to set up your build development environment to configure, build, and test oneTBB as explained in the [oneTBB Build System Description](cmake/README.md).
## Issues
If you face a problem, first check out open [oneTBB GitHub issues](https://github.com/oneapi-src/oneTBB/issues) to see if the issue you’d like to address is already reported. You may find users that have encountered the bug you’re finding or have similar ideas for changes or additions.
You can use issues to report a problem, make a feature request, or add comments on an existing issue.
## Pull Requests
You can find all [open oneTBB pull requests](https://github.com/oneapi-src/oneTBB/pulls) on GitHub.
@@ -39,15 +44,12 @@ No anonymous contributions are accepted. The name in the commit message Signed-o
`git config --global user.email taylor.developer@company.com`
### Before contributing changes directly to the oneTBB repository
Before contributing changes directly to the oneTBB repository:
* Make sure you can build the product and run all the tests with your patch.
* For a larger feature, provide a relevant test.
* Document your code. The oneTBB project uses reStructuredText for documentation.
* Update the copyright year in the first line of the changing file(s).
For example, if you commit your changes in 2022:
* the copyright year should be `2005-2022` for existing files
* the copyright year should be `2022` for new files
* Submit a pull request into the master branch. You can submit changes with a pull request (preferred) or by sending an email patch.
Continuous Integration (CI) testing is enabled for the repository. Your pull request must pass all checks before it can be merged. We will review your contribution and may provide feedback to guide you if any additional fixes or modifications are necessary. When reviewed and accepted, your pull request will be merged into our GitHub repository.
-135
View File
@@ -1,135 +0,0 @@
# Installation from Sources
## Prerequisites
- Make sure you have installed CMake version 3.1 (or newer) on your system. oneTBB uses CMake build configuration.
- Configure and build oneTBB. To work with build configurations, see [Build System Description](cmake/README.md).
## Configure oneTBB
At the command prompt, type:
```
cmake <options> <repo_root>
```
You may want to use some additional options for configuration:
| Option | Purpose | Description |
| ------ |------ | ------ |
| `-G <generator>` | Specify project generator | For more information, run cmake `–help`. |
|`-DCMAKE_BUILD_TYPE=Debug` | Specify for Debug build | Not applicable for multi-configuration generators such as Visual Studio generator. |
## Build oneTBB
To build the system, run:
```
cmake --build . <options>
```
Some useful build options:
- `--target <target>` - specific target, "all" is default.
- `--config <Release|Debug>` - build configuration, applicable only for multi-config generators such as Visual Studio generator.
## Install and Pack oneTBB
---
**NOTE**
Be careful about installing prefix. It defaults to `/usr/local` on UNIX* and `c:/Program Files/${PROJECT_NAME}` on Windows* OS.
You can define custom `CMAKE_INSTALL_PREFIX` during configuration:
```
cmake -DCMAKE_INSTALL_PREFIX=/my/install/prefix ..
```
---
Installation can also be done using:
```
cmake --install <project-binary-dir>
```
Special ``--install`` target can alternatively be used for installation, e.g. ``make install``.
You can use the ``install`` components for partial installation.
The following install components are supported:
- `runtime` - oneTBB runtime package (core shared libraries and `.dll` files on Windows* OS).
- `devel` - oneTBB development package (header files, CMake integration files, library symbolic links, and `.lib` files on Windows* OS).
- `tbb4py` - [oneTBB Module for Python](https://github.com/oneapi-src/oneTBB/blob/master/python/README.md).
If you want to install specific components after configuration and build, run:
```bash
cmake -DCOMPONENT=<component> [-DBUILD_TYPE=<build-type>] -P cmake_install.cmake
```
Simple packaging using CPack is supported.
The following commands allow you to create a simple portable package that includes header files, libraries, and integration files for CMake:
```bash
cmake <options> ..
cpack
```
## Installation from vcpkg
You can download and install oneTBB using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
```sh
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh #.\bootstrap-vcpkg.bat(for Windows)
./vcpkg integrate install
./vcpkg install tbb
```
The oneTBB port in vcpkg is kept up to date by Microsoft* team members and community contributors. If the version is out of date, create an issue or pull request on the [vcpkg repository](https://github.com/Microsoft/vcpkg).
## Example of Installation
### Single-configuration generators
The following example demonstrates how to install oneTBB for single-configuration generators (e.g. GNU Make, Ninja, etc.).
```bash
# Do our experiments in /tmp
cd /tmp
# Clone oneTBB repository
git clone https://github.com/oneapi-src/oneTBB.git
cd oneTBB
# Create binary directory for out-of-source build
mkdir build && cd build
# Configure: customize CMAKE_INSTALL_PREFIX and disable TBB_TEST to avoid tests build
cmake -DCMAKE_INSTALL_PREFIX=/tmp/my_installed_onetbb -DTBB_TEST=OFF ..
# Build
cmake --build .
# Install
cmake --install .
# Well done! Your installed oneTBB is in /tmp/my_installed_onetbb
```
### Multi-configuration generators
The following example demonstrates how to install oneTBB for multi-configuration generators such as Visual Studio*.
Choose the configuration during the build and install steps:
```batch
REM Do our experiments in %TMP%
cd %TMP%
REM Clone oneTBB repository
git clone https://github.com/oneapi-src/oneTBB.git
cd oneTBB
REM Create binary directory for out-of-source build
mkdir build && cd build
REM Configure: customize CMAKE_INSTALL_PREFIX and disable TBB_TEST to avoid tests build
cmake -DCMAKE_INSTALL_PREFIX=%TMP%\my_installed_onetbb -DTBB_TEST=OFF ..
REM Build "release with debug information" configuration
cmake --build . --config relwithdebinfo
REM Install "release with debug information" configuration
cmake --install . --config relwithdebinfo
REM Well done! Your installed oneTBB is in %TMP%\my_installed_onetbb
```
-24
View File
@@ -1,24 +0,0 @@
# Copyright (c) 2021-2024 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# DISCLAIMER: Bazel support is community-based. The maintainers do not
# use Bazel internally. The Bazel build can have security risks or
# optimization gaps.
module(
name = "onetbb",
compatibility_level = 1,
)
bazel_dep(name = "platforms", version = "0.0.8")
+11 -35
View File
@@ -1,49 +1,25 @@
# oneAPI Threading Building Blocks
[![Apache License Version 2.0](https://img.shields.io/badge/license-Apache_2.0-green.svg)](LICENSE.txt) [![oneTBB CI](https://github.com/oneapi-src/oneTBB/actions/workflows/ci.yml/badge.svg)](https://github.com/oneapi-src/oneTBB/actions/workflows/ci.yml?query=branch%3Amaster)
oneTBB is a flexible C++ library that simplifies the work of adding parallelism
to complex applications, even if you are not a threading expert.
oneAPI Threading Building Blocks (oneTBB) lets you easily write parallel C++ programs that take
full advantage of multicore performance that are portable, composable, and have future-proof scalability.
The library lets you easily write parallel programs that take full advantage of the multi-core performance. Such programs are portable,
composable and have a future-proof scalability. oneTBB provides you with functions, interfaces, and classes to parallelize and scale the code.
All you have to do is to use the templates.
The library differs from typical threading packages in the following ways:
* oneTBB enables you to specify logical parallelism instead of threads.
* oneTBB targets threading for performance.
* oneTBB is compatible with other threading packages.
* oneTBB emphasizes scalable, data parallel programming.
* oneTBB relies on generic programming.
Refer to oneTBB [examples](examples) and [samples](https://github.com/oneapi-src/oneAPI-samples/tree/master/Libraries/oneTBB) to see how you can use the library.
oneTBB is a part of [oneAPI](https://oneapi.io). The current branch implements version 1.1 of oneAPI Specification.
> **_NOTE:_** Threading Building Blocks (TBB) is now called oneAPI Threading Building Blocks (oneTBB) to highlight that the tool is a part of the oneAPI ecosystem.
## Release Information
See [Release Notes](RELEASE_NOTES.md) and [System Requirements](SYSTEM_REQUIREMENTS.md).
## Installation
You can install oneTBB from GitHub*, see [Installation from Sources](INSTALL.md) for details.
## Documentation
* [oneTBB Specification](https://spec.oneapi.com/versions/latest/elements/oneTBB/source/nested-index.html)
* [oneTBB Developer Guide and Reference](https://oneapi-src.github.io/oneTBB)
* [Migrating from TBB to oneTBB](https://oneapi-src.github.io/oneTBB/main/tbb_userguide/Migration_Guide.html)
* [README for the CMake build system](cmake/README.md)
* [oneTBB Testing Approach](https://oneapi-src.github.io/oneTBB/main/intro/testing_approach.html)
* [oneTBB Developer Guide and Reference](https://oneapi-src.github.io/oneTBB/)
* [Migrating from TBB to oneTBB](https://oneapi-src.github.io/oneTBB/tbb_userguide/Migration_Guide.html)
* [README for build system](cmake/README.md)
* [Basic support for the Bazel build system](Bazel.md)
* [oneTBB Discussions](https://github.com/oneapi-src/oneTBB/discussions)
* [WASM Support](WASM_Support.md)
## Installation
See [Installation from Sources](INSTALL.md) to learn how to install oneTBB.
## Support
See our [documentation](./SUPPORT.md) to learn how to request help.
Please report issues and suggestions via
[GitHub issues](https://github.com/oneapi-src/oneTBB/issues). See our [documentation](./CONTRIBUTING.md##Issues) to learn how to work with issues.
## How to Contribute
We welcome community contributions, so check our [Contributing Guidelines](CONTRIBUTING.md)
We welcome community contributions, so check our [contributing guidelines](CONTRIBUTING.md)
to learn more.
## License
@@ -51,7 +27,7 @@ oneAPI Threading Building Blocks is licensed under [Apache License, Version 2.0]
By its terms, contributions submitted to the project are also done under that license.
## Engineering team contacts
* [Email us.](mailto:inteltbbdevelopers@intel.com)
* [E-mail us.](mailto:inteltbbdevelopers@intel.com)
------------------------------------------------------------------------
\* All names and brands may be claimed as the property of others.
-39
View File
@@ -1,39 +0,0 @@
<!--
******************************************************************************
* 
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/-->
# Release Notes <!-- omit in toc -->
This document contains changes of oneTBB compared to the last release.
## Table of Contents <!-- omit in toc -->
- [Known Limitations](#known-limitations)
- [Fixed Issues](#fixed-issues)
## :rotating_light: Known Limitations
- The ``oneapi::tbb::info`` namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
- The NUMA topology may be detected incorrectly on Windows* OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
- C++ exception handling mechanism on Windows* OS on ARM64* might corrupt memory if an exception is thrown from any oneTBB parallel algorithm (see Windows* OS on ARM64* compiler issue: https://developercommunity.visualstudio.com/t/ARM64-incorrect-stack-unwinding-for-alig/1544293).
- Using ``TBBConfig.cmake`` in 32-bit environment may cause incorrect linkage with 64-bit oneTBB library. As a workaround, set ``CMAKE_PREFIX_PATH``:
- On Linux* OS: to ``TBBROOT/lib32/``
- On Windows* OS: to ``TBBROOT/lib32/;TBBROOT/bin32/``
> **_NOTE:_** To see known limitations that impact all versions of oneTBB, refer to [oneTBB Documentation](https://oneapi-src.github.io/oneTBB/main/intro/limitations.html).
## :hammer: Fixed Issues
- Fixed ``tbb::this_task_arena()`` behavior for specific ``tbb::task_arena{1,0}``.
- Restored performance on systems with a high number of CPU cores that support ``_tpause``.
-7
View File
@@ -1,7 +0,0 @@
# Security Policy
Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution,
impact, severity and mitigation.
## Reporting a Vulnerability
Please report any security vulnerabilities in this project
[utilizing the guidelines here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html).
-35
View File
@@ -1,35 +0,0 @@
<!--
******************************************************************************
* 
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/-->
# oneTBB Support
We are committed to providing support and assistance to help you make the most out of oneTBB.
Use the following methods if you face any challenges.
## Issues
If you have a problem, check out the [GitHub Issues](https://github.com/oneapi-src/oneTBB/issues) to see if the issue you want to address is already reported.
You may find users that have encountered the same bug or have similar ideas for changes or updates.
You can use issues to report a problem, make a feature request, or add comments on an existing issue.
## Discussions
Visit the [GitHub Discussions](https://github.com/oneapi-src/oneTBB/discussions) to engage with the community, ask questions, or help others.
## Email
Reach out to us privately via [email](mailto:inteltbbdevelopers@intel.com).
-86
View File
@@ -1,86 +0,0 @@
<!--
******************************************************************************
* 
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/-->
# System Requirements <!-- omit in toc -->
This document provides details about hardware, operating system, and software prerequisites for the oneAPI Threading Building Blocks (oneTBB).
## Table of Contents <!-- omit in toc -->
- [Supported Hardware](#supported-hardware)
- [Software](#software)
- [Supported Operating Systems](#supported-operating-systems)
- [Community-Supported Platforms](#community-supported-platforms)
- [Supported Compilers](#supported-compilers)
- [Limitations](#limitations)
## Supported Hardware
- Intel(R) Celeron(R) processor family
- Intel(R) Core* processor family
- Intel(R) Xeon(R) processor family
- Intel(R) Atom* processor family
- Non-Intel(R) processors compatible with the processors listed above
## Software
### Supported Operating Systems
- Systems with Microsoft* Windows* operating systems:
- Microsoft* Windows* 10
- Microsoft* Windows* 11
- Microsoft* Windows* Server 2019
- Microsoft* Windows* Server 2022
- Systems with Linux* operating systems:
- Oracle Linux* 8
- Amazon* Linux 2, 2022
- Debian* 9, 10, 11
- Fedora* 36, 37, 38
- Rocky* Linux* 8, 9
- Red Hat* Enterprise Linux* 8, 9
- SuSE* Linux* Enterprise Server 15
- Ubuntu* 20.04, 22.04
- Systems with macOS* operating systems:
- macOS* 12.x, 13.x
- Systems with Android* operating systems:
- Android* 9
### Community-Supported Platforms
- MinGW*
- FreeBSD*
- Microsoft* Windows* on ARM*/ARM64*
- macOS* on ARM64*
### Supported Compilers
- Intel* oneAPI DPC++/C++ Compiler
- Intel® C++ Compiler Classic 2021.1 - 2021.9
- Microsoft* Visual C++ 14.2 (Microsoft* Visual Studio* 2019, Windows* OS only)
- Microsoft* Visual C++ 14.3 (Microsoft* Visual Studio* 2022, Windows* OS only)
- For each supported Linux* operating system, the standard gcc version provided with that operating system is supported:
- GNU Compilers (gcc) 8.x – 12.x
- GNU C Library (glibc) version 2.28 – 2.36
- Clang* 6.0.0 - 13.0.0
## Limitations
There are some cases where we cannot provide support for your platforms. It includes:
1. The platform is out of official support (met end of life). When you use an unsupported platform, you can face a security risk that can be difficult to resolve.
2. We do not have the infrastructure to test a platform. Therefore we cannot guarantee that oneTBB works correctly on that platform.
3. Changes affect more code than just platform-specific macros.
4. The platform is incompatible with oneTBB. Some platforms may have limitations that prevent oneTBB from working correctly. We cannot provide support in these cases as the issue is beyond our control.
5. The platform is modified or customized. If you made significant updates to your platform, it might be hard for us to find the root cause of the issue. Therefore, we may not be able to provide support as the modification could affect the oneTBB functionality.
We understand that these limitations can be frustrating. Thus, we suggest creating a branch specifically for the unsupported platform, allowing other users to contribute to or use your implementation.
-60
View File
@@ -1,60 +0,0 @@
<!--
******************************************************************************
* 
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/-->
# WASM Support
oneTBB extends its capabilities by offering robust support for ``WASM``.
``WASM`` stands for WebAssembly, a low-level binary format for executing code in web browsers.
It is designed to be a portable target for compilers and efficient to parse and execute.
Using oneTBB with WASM, you can take full advantage of parallelism and concurrency while working on web-based applications, interactive websites, and a variety of other WASM-compatible platforms.
oneTBB offers WASM support through the integration with [Emscripten*](https://emscripten.org/docs/introducing_emscripten/index.html), a powerful toolchain for compiling C and C++ code into WASM-compatible runtimes.
## Build
**Prerequisites:** Download and install Emscripten*. See the [instructions](https://emscripten.org/docs/getting_started/downloads.html).
To build the system, run:
```
mkdir build && cd build
emcmake cmake .. -DCMAKE_CXX_COMPILER=em++ -DCMAKE_C_COMPILER=emcc -DTBB_STRICT=OFF -DCMAKE_CXX_FLAGS=-Wno-unused-command-line-argument -DTBB_DISABLE_HWLOC_AUTOMATIC_SEARCH=ON -DBUILD_SHARED_LIBS=ON -DTBB_EXAMPLES=ON -DTBB_TEST=ON
```
To compile oneTBB without ``pthreads``, set the flag ``-DEMSCRIPTEN_WITHOUT_PTHREAD=true`` in the command above. By default, oneTBB uses the ``pthreads``.
```
cmake --build . <options>
cmake --install . <options>
```
Where:
* ``emcmake`` - a tool that sets up the environment for Emscripten*.
* ``-DCMAKE_CXX_COMPILER=em++`` - specifies the C++ compiler as Emscripten* C++ compiler.
* ``-DCMAKE_C_COMPILER=emcc`` - specifies the C compiler as Emscripten* C compiler.
> **_NOTE:_** See [CMake documentation](https://github.com/oneapi-src/oneTBB/blob/master/cmake/README.md) to learn about other options.
## Run Test
To run tests, use:
```
ctest
```
+1 -1
View File
@@ -16,4 +16,4 @@
# use Bazel internally. The Bazel build can have security risks or
# optimization gaps.
workspace(name = "oneTBB")
workspace(name = "oneTBB")
+93 -122
View File
@@ -1,31 +1,32 @@
# Build System Description
# Build system description
The project uses CMake* build configuration.
The project uses CMake build configuration.
The following controls are available during the configure stage:
```
TBB_TEST:BOOL - Enable testing (ON by default)
TBB_STRICT:BOOL - Treat compiler warnings as errors (ON by default)
TBB_SANITIZE:STRING - Sanitizer parameter, passed to compiler/linker
TBB_SIGNTOOL:FILEPATH - Tool for digital signing, used in post-install step for libraries if provided.
TBB_SIGNTOOL:FILEPATH - Tool for digital signing, used in post install step for libraries if provided.
TBB_SIGNTOOL_ARGS:STRING - Additional arguments for TBB_SIGNTOOL, used if TBB_SIGNTOOL is set.
TBB_BUILD:BOOL - Enable Intel(R) oneAPI Threading Building Blocks (oneTBB) build (ON by default)
TBBMALLOC_BUILD:BOOL - Enable Intel(R) oneAPI Threading Building Blocks (oneTBB) memory allocator build (ON by default)
TBBMALLOC_PROXY_BUILD:BOOL - Enable Intel(R) oneAPI Threading Building Blocks (oneTBB) memory allocator proxy build (requires TBBMALLOC_BUILD. ON by default)
TBB4PY_BUILD:BOOL - Enable Intel(R) oneAPI Threading Building Blocks (oneTBB) Python module build (OFF by default)
TBB_CPF:BOOL - Enable preview features of the library (OFF by default)
TBB_INSTALL:BOOL - Enable installation (ON by default)
TBB_INSTALL_VARS:BOOL - Enable auto-generated vars installation(packages generated by `cpack` and `make install` will also include the vars script)(OFF by default)
TBB_VALGRIND_MEMCHECK:BOOL - Enable scan for memory leaks using Valgrind (OFF by default)
TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH - Disable HWLOC automatic search by pkg-config tool (OFF by default)
TBB_ENABLE_IPO - Enable Interprocedural Optimization (IPO) during the compilation (ON by default)
```
## Configure, Build, and Test
## Configure, build and test
### Prerequisites
* CMake >= 3.1
### Preparation
To perform an out-of-source build, create a build directory and go there:
In order to perform out-of-source build you have to create a build directory and go there:
```bash
mkdir /tmp/my-build
@@ -39,47 +40,28 @@ cmake <options> <repo_root>
```
Some useful options:
- `-G <generator>` - specify particular project generator. See `cmake --help` for details.
- `-DCMAKE_BUILD_TYPE=Debug` - specify for Debug build. It is not applicable for multi-config generators, e.g., Microsoft* Visual Studio* generator.
- `-G <generator>` - specify particular project generator, see `cmake --help` for details.
- `-DCMAKE_BUILD_TYPE=Debug` - specify for Debug build, it isn't applicable for multi-config generators, e.g. for Visual Studio generator).
#### TBBBind Library Configuration
#### TBBBind library configuration
> **_TIP:_** It is recommended to install the HWLOC* library. See [oneTBB documentation](https://oneapi-src.github.io/oneTBB/GSG/next_steps.html#hybrid-cpu-and-numa-support) for details.
The TBBbind library has three versions: `tbbbind`, `tbbbind_2_0` and `tbbbind_2_5`. Each of these versions is linked with corresponding HWLOC library version: `tbbbind` links with HWLOC 1.11.x , `tbbbind_2_0` links with HWLOC 2.1-2.4, `tbbbind_2_5` links with HWLOC 2.5 and later.
The TBBbind library has three versions: `tbbbind`, `tbbbind_2_0`, and `tbbbind_2_5`. Each of these versions is linked with the corresponding HWLOC* library version:
- `tbbbind` links with `HWLOC 1.11.x`
- `tbbbind_2_0` links with `HWLOC 2.1–2.4`
- `tbbbind_2_5` links with `HWLOC 2.5` and later
The search for a suitable version of the HWLOC library is enabled by default, but if you want to use a specific version of the library, you can specify the path to it manually using the following CMake variables:
The search for a suitable version of the HWLOC library is enabled by default. If you want to use a specific version of the library, you can specify the path to it manually using the following CMake variables:
- `CMAKE_HWLOC_<HWLOC_VER>_LIBRARY_PATH` - path to the corresponding HWLOC version shared library on Linux or path to `.lib` file on Windows.
- `CMAKE_HWLOC_<HWLOC_VER>_INCLUDE_PATH` - path to the corresponding HWLOC version includes directory.
- `CMAKE_HWLOC_<HWLOC_VER>_LIBRARY_PATH` - path to the corresponding HWLOC version shared library on Linux* OS or path to `.lib` file on Windows* OS
- `CMAKE_HWLOC_<HWLOC_VER>_INCLUDE_PATH` - path to the corresponding HWLOC version including directory
Automatic HWLOC searching requires CMake >= 3.6.
---
**NOTE:** Automatic HWLOC searching requires CMake version 3.6 or higher.
---
Windows* OS requires an additional variable for correct TBBBind library building:
Windows requires one additional variable for correct TBBBind library building:
- `CMAKE_HWLOC_<HWLOC_VER>_DLL_PATH` - path to the corresponding HWLOC version `.dll` file.
The `HWLOC_VER` substring used earlier can be replaced with one of the three values:
- `1_11` for the `tbbbind` library configuration
- `2` for the `tbbbind_2_0` library configuration
- `2_5` for the `tbbbind_2_5` library configuration
`HWLOC_VER` substring used above can be replaced with one of the three values: `1_11` for the `tbbbind` library configuration, `2` for the `tbbbind_2_0`, and `2_5` for the `tbbbind_2_5` library configuration.
If you specify variables for several TBBBind versions, the building process for all of these versions is performed during a single build session.
---
**TIP**
Specify the `TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH` to turn off the HWLOC library's automatic search.
---
If you specify variables for several TBBBind versions, then building process for all of these versions will be performed during single build session.
Specify the `TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH` to disable HWLOC libraries automatic search.
### Build
@@ -88,28 +70,21 @@ cmake --build . <options>
```
Some useful options:
- `--target <target>` - specific target, "all" is the default.
- `--config <Release|Debug>` - build configuration, applicable only for multi-config generators, e.g., Visual Studio* generator.
- `--target <target>` - specific target, "all" is default.
- `--config <Release|Debug>` - build configuration, applicable only for multi-config generators, e.g. Visual Studio generator.
The binaries are placed to `./<compiler-id>_<compiler-ver>_cxx<stdver>_<build-type>`. For example, `./gnu_4.8_cxx11_release`.
Binaries are placed to `./<compiler-id>_<compiler-ver>_cxx<stdver>_<build-type>` (for example, `./gnu_4.8_cxx11_release`)
#### Build For 32-bit
#### Build for 32-bit
* **Intel(R) Compiler**. Source Intel(R) C++ Compiler with `ia32` and build as usual.
* **MSVC**. Use switch for [generator](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html) (e.g., `-A Win32` for [VS2019](https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2016%202019.html)) during the configuration stage and then build as usual.
* **GCC/Clang**. Specify `-m32` during the configuration. It can be `CXXFLAGS=-m32 cmake ..` or `cmake -DCMAKE_CXX_FLAGS=-m32 ..`
* For any other compiler, which builds for 64-bit by default, specify a 32-bit compiler key during the configuration as above.
* Intel Compiler: just source Intel(R) C++ Compiler with `ia32` and build as usual.
* MSVC: use switch for [generator](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html) (e.g. `-A Win32` for [VS2019](https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2016%202019.html)) during the configuration stage and then build as usual.
* GCC/Clang: specify `-m32` during the configuration: `CXXFLAGS=-m32 cmake ..` or `cmake -DCMAKE_CXX_FLAGS=-m32 ..`
* Any other compiler which builds for 64-bit by default: specify 32-bit compiler key during the configuration as above.
#### Windows* OS-Specific Builds
#### Windows specific builds (CMake 3.15 or newer is required)
---
**NOTE**
The following builds require CMake version 3.15 or higher.
---
* **Dynamic linkage with C Runtime Library (CRT)**. The default behavior can be explicitly specified by setting `CMAKE_MSVC_RUNTIME_LIBRARY` to `MultiThreadedDLL` or `MultiThreadedDebugDLL`.
* Dynamic linkage with CRT: default behavior, can be explicitly specified by setting `CMAKE_MSVC_RUNTIME_LIBRARY` to `MultiThreadedDLL` or `MultiThreadedDebugDLL`.
```bash
cmake .. # dynamic linkage is used by default
```
@@ -119,76 +94,51 @@ cmake -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL ..
```bash
cmake -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL -DCMAKE_BUILD_TYPE=Debug ..
```
* **Static linkage with CRT**. Set `CMAKE_MSVC_RUNTIME_LIBRARY` to `MultiThreaded` or `MultiThreadedDebug`.
* Static linkage with CRT: set `CMAKE_MSVC_RUNTIME_LIBRARY` to `MultiThreaded` or `MultiThreadedDebug`.
```bash
cmake -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded ..
```
```bash
cmake -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug -DCMAKE_BUILD_TYPE=Debug ..
```
* **Windows OS 10 Universal Windows application build**. Set `CMAKE_SYSTEM_NAME` to `WindowsStore` and `CMAKE_SYSTEM_VERSION` to `10.0`.
---
**NOTE**
Set `TBB_NO_APPCONTAINER` to `ON` to apply the `/APPCONTAINER:NO` option during the compilation (used for testing).
---
* Windows 10 Universal Windows application build: set `CMAKE_SYSTEM_NAME` to `WindowsStore` and `CMAKE_SYSTEM_VERSION` to `10.0`.
_Note: set `TBB_NO_APPCONTAINER` to `ON` in order to apply `/APPCONTAINER:NO` option during the compilation (used for testing)._
```bash
cmake -DCMAKE_SYSTEM_NAME:STRING=WindowsStore -DCMAKE_SYSTEM_VERSION:STRING=10.0 ..
```
* **Universal Windows OS Driver build**. Set `TBB_WINDOWS_DRIVER` to `ON` and use static linkage with CRT.
* Universal Windows Driver build: set `TBB_WINDOWS_DRIVER` to `ON` and use static linkage with CRT (see above).
```bash
cmake -DTBB_WINDOWS_DRIVER=ON -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded ..
```
#### Example
```bash
cmake -DCMAKE_CXX_COMPILER=icpc -DCMAKE_C_COMPILER=icc -DTBB_TEST=off -DCMAKE_HWLOC_1_11_LIBRARY_PATH=<path_to_hwloc_library_file>/libhwloc.so.15
-DCMAKE_HWLOC_1_11_INCLUDE_PATH=<path_to_hwloc_header_directory> -DCMAKE_INSTALL_PREFIX=<path_to_install_oneTBB>/oneTBB_install ..
make -j8 && make install
```
---
**NOTE**
The library path points to a file, while the include path points to a directory and not to ``hwloc.h``.
---
### Test
#### Build test
To build a test, use the default target ``all``:
Using default ('all') target:
```
cmake --build .
```
Or use a specific test target:
or using specific test target:
```
cmake --build . --target <test> # e.g. test_version
```
#### Run Test
#### Run test
You can run a test by using CTest:
Using CTest:
```bash
ctest
```
Or by using the ``test`` target:
or using 'test' target:
```bash
cmake --build . --target test # currently does not work on Windows* OS
cmake --build . --target test # currently doesn't work on Windows
```
## Installation
See [Installation from Sources](../INSTALL.md) to learn how to install oneTBB.
## Sanitizers - Configure, Build, and Run
## Sanitizers - сonfigure, build and run
```bash
mkdir build
@@ -198,7 +148,7 @@ make -j
ctest -V
```
## Valgrind Memcheck - Configure, Build, and Run
## Valgrind memcheck - configure, build and run
### Prerequisites
* Valgrind tool executable
@@ -210,9 +160,7 @@ cmake -DTBB_VALGRIND_MEMCHECK=ON ..
make -j memcheck-<test name> # or memcheck-all to scan all tests
```
## Test Specification
Use Doxygen* to generate oneTBB test specification:
## Test specification (Doxygen)
```bash
mkdir build
@@ -221,12 +169,35 @@ cmake -DTBB_TEST_SPEC=ON ..
make test_spec
```
## TBBConfig - Integration of Binary Packages
## Intallation and packaging
It is a configuration module that is used for the integration of prebuilt oneTBB. It consists of two files (``TBBConfig.cmake`` and ``TBBConfigVersion.cmake``) and can be used via the [find_package](https://cmake.org/cmake/help/latest/command/find_package.html) function.
**NOTE: be careful about installation: avoid commands like `make install` unless you fully understand the consequences.**
To use this module in your CMake project:
1. Let CMake know where to search for TBBConfig, e.g. specify the location of ``TBBConfig.cmake`` in `TBB_DIR` (for more details about search paths, see [find_package](https://cmake.org/cmake/help/latest/command/find_package.html)).
The following install components are supported:
- `runtime` - oneTBB runtime package (core shared libraries and `.dll` files on Windows).
- `devel` - oneTBB development package (header files, CMake integration files, library symbolic links and `.lib` files on Windows).
- `tbb4py` - [oneTBB Module for Python](#onetbb-python-module-support).
How to install specific components after configuration and build:
```bash
cmake -DCOMPONENT=<component> [-DBUILD_TYPE=<build-type>] -P cmake_install.cmake
```
Simple packaging using CPack is supported.
The following commands allow to create a simple portable package which includes header files, libraries and integration files for CMake:
```bash
cmake <options> ..
cpack
```
## TBBConfig - integration of binary packages
It is a configuration module that is used for integration of prebuilt oneTBB. It consists of two files (TBBConfig.cmake and TBBConfigVersion.cmake) and can be used via [find_package](https://cmake.org/cmake/help/latest/command/find_package.html) function.
How to use this module in your CMake project:
1. Let CMake know where to search for TBBConfig, e.g. specify location of TBBConfig.cmake in `TBB_DIR` (for more details about search paths see [find_package](https://cmake.org/cmake/help/latest/command/find_package.html)).
2. Use [find_package](https://cmake.org/cmake/help/latest/command/find_package.html) to find oneTBB.
3. Use provided variables and/or imported targets (described below) to work with the found oneTBB.
@@ -241,14 +212,14 @@ target_link_libraries(foo TBB::tbb)
oneTBB components can be passed to [find_package](https://cmake.org/cmake/help/latest/command/find_package.html) after keyword ``COMPONENTS`` or ``REQUIRED``.
Use basic names of components (`tbb`, `tbbmalloc`, etc.).
If components are not specified, then the default set is used: `tbb`, `tbbmalloc`, and ``tbbmalloc_proxy``.
If components are not specified then the default set is used: `tbb`, `tbbmalloc` and ``tbbmalloc_proxy``.
If `tbbmalloc_proxy` is requested, the `tbbmalloc` component is also added and set as a dependency for `tbbmalloc_proxy`.
If `tbbmalloc_proxy` is requested, `tbbmalloc` component will also be added and set as dependency for `tbbmalloc_proxy`.
TBBConfig creates [imported targets](https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#imported-targets>) as
shared libraries using the following format: `TBB::<component>`. For example, `TBB::tbb` or `TBB::tbbmalloc`.
shared libraries using the following format: `TBB::<component>` (for example, `TBB::tbb`, `TBB::tbbmalloc`).
To search only for release oneTBB version, set `TBB_FIND_RELEASE_ONLY` to `TRUE` before calling `find_package`. This variable helps to avoid simultaneous linkage of release and debug oneTBB versions when CMake configuration is `Debug,` but a third-party component depends on the release oneTBB version.
Set `TBB_FIND_RELEASE_ONLY` to `TRUE` before calling `find_package` in order to search only for release oneTBB version. This variable helps to avoid simultaneous linkage of release and debug oneTBB versions when CMake configuration is `Debug` but a third-party component depends on release oneTBB version.
Variables set during TBB configuration:
@@ -259,14 +230,14 @@ Variable | Description
`TBB_VERSION` | oneTBB version (format: `<major>.<minor>.<patch>.<tweak>`)
`TBB_IMPORTED_TARGETS` | All created oneTBB imported targets (not supported for builds from source code)
Starting from [oneTBB 2021.1](https://github.com/oneapi-src/oneTBB/releases/tag/v2021.1), GitHub* release TBBConfig files in the binary packages are located under `<tbb-root>/lib/cmake/TBB`.
Starting from [oneTBB 2021.1](https://github.com/oneapi-src/oneTBB/releases/tag/v2021.1) GitHub release TBBConfig files in the binary packages are located under `<tbb-root>/lib/cmake/TBB`.
For example, `TBB_DIR` should be set to `<tbb-root>/lib/cmake/TBB`.
TBBConfig files are automatically created during the build from source code and can be installed together with the library.
Also, oneTBB provides a helper function that creates TBBConfig files from predefined templates. See `tbb_generate_config` in `cmake/config_generation.cmake`.
Also oneTBB provides a helper function that creates TBBConfig files from predefined templates: see `tbb_generate_config` in `cmake/config_generation.cmake`.
## oneTBB Python Module Support
The `TBB4PY_BUILD` Cmake option provides the ability to build a Python module for oneTBB.
## oneTBB Python Module support
`TBB4PY_BUILD` Cmake option provides ability to build Python module for oneTBB.
### Targets:
- `irml` - build IPC RML server
@@ -276,30 +247,30 @@ The `TBB4PY_BUILD` Cmake option provides the ability to build a Python module fo
- Python version 3.5 or newer
- SWIG version 3.0.6 or newer
## CMake Files
## CMake files
### Compile and Link Options
### Compile/link options
Compile and link options may be specific for certain compilers. This part is handled in `cmake/compilers/*` files.
Options in TBB CMake are handled via variables in two ways for convenience:
* by options group
* by the specific option
* by specific option
#### Options Group
#### Options group
Naming convention is the following: `TBB_<SCOPE>_<STAGE>_<CATEGORY>`, where:
Naming convention is the following: `TBB_<SCOPE>_<STAGE>_<CATEGORY>`, where
* `<SCOPE>` can be:
* `<SCOPE>` could be
* `LIB` - options applied during libraries build.
* `TEST` - options applied during test build.
* `BENCH` - options applied during benchmarks build.
* `COMMON` - options applied during all (libraries, test, benchmarks) builds.
* `<STAGE>` can be:
* `<STAGE>` could be
* `COMPILE` - options applied during the compilation.
* `LINK` - options applied during the linkage.
* `<CATEGORY>` can be:
* `<CATEGORY>` could be
* `FLAGS` - list of flags
* `LIBS` - list of libraries
@@ -307,17 +278,17 @@ Naming convention is the following: `TBB_<SCOPE>_<STAGE>_<CATEGORY>`, where:
Variable | Description
--- | ---
`TBB_COMMON_COMPILE_FLAGS` | Applied to libraries, tests, and benchmarks as compile options
`TBB_COMMON_COMPILE_FLAGS` | Applied to libraries, tests and benchmarks as compile options
`TBB_LIB_LINK_FLAGS` | Applied to libraries as link options
`TBB_LIB_LINK_LIBS ` | Applied to libraries as link libraries
`TBB_TEST_COMPILE_FLAGS` | Applied to tests as compile options
Specify the `LINK` options prefixed with a dash(-) for MSVC(Visual Studio) compiler with CMake < 3.13 to avoid issues caused by `target_link_libraries` CMake command usage.
Please specify the `LINK` options prefixed with dash(-) for MSVC(Visual Studio) compiler with CMake < 3.13 to avoid issues caused by `target_link_libraries` CMake command usage.
#### Specific Options
#### Specific options
If the option is used only in part of the places (library, tests, benchmarks) and adding this option to the group of other options is not possible,
If the option used only in part of the places (library, tests, benchmarks) as well as adding this option to the group of other options is not possible,
then the option must be named using common sense.
Warning suppressions should be added to the `TBB_WARNING_SUPPRESS` variable, which is applied during the compilation of libraries, tests, and benchmarks.
Additional warnings should be added to the `TBB_WARNING_TEST_FLAGS` variable, which is applied during the compilation of tests.
Warnings supperssions should be added into `TBB_WARNING_SUPPRESS` variable which is applied during the compilation of libraries, tests and benchmarks.
Additional warnings should be added into `TBB_WARNING_TEST_FLAGS` variable which is applied during the compilation of tests.
+4 -10
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2022 Intel Corporation
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -31,16 +31,10 @@ if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
tbb_remove_compile_flag(-Werror)
endif()
# Enable Intel(R) Transactional Synchronization Extensions (-mrtm) and WAITPKG instructions support (-mwaitpkg) on relevant processors
if (CMAKE_OSX_ARCHITECTURES)
set(_tbb_target_architectures "${CMAKE_OSX_ARCHITECTURES}")
else()
set(_tbb_target_architectures "${CMAKE_SYSTEM_PROCESSOR}")
# Enable Intel(R) Transactional Synchronization Extensions (-mrtm) on relevant processors
if (NOT "${CMAKE_OSX_ARCHITECTURES}" MATCHES "^arm64$" AND CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|AMD64)") # OSX systems are 64-bit only
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm)
endif()
if ("${_tbb_target_architectures}" MATCHES "(x86_64|amd64|AMD64)") # OSX systems are 64-bit only
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},12.0>>:-mwaitpkg>)
endif()
unset(_tbb_target_architectures)
# TBB malloc settings
set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions)
+11 -23
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2024 Intel Corporation
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,15 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
if (EMSCRIPTEN)
set(TBB_EMSCRIPTEN 1)
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fexceptions)
set(TBB_TEST_LINK_FLAGS ${TBB_COMMON_LINK_FLAGS} -fexceptions -sINITIAL_MEMORY=65536000 -sALLOW_MEMORY_GROWTH=1 -sEXIT_RUNTIME=1)
if (NOT EMSCRIPTEN_WITHOUT_PTHREAD)
set_property(TARGET Threads::Threads PROPERTY INTERFACE_LINK_LIBRARIES "-pthread")
endif()
endif()
if (MINGW)
set(TBB_LINK_DEF_FILE_FLAG "")
set(TBB_DEF_FILE_PREFIX "")
@@ -36,7 +27,6 @@ elseif (MSVC)
else()
set(TBB_LINK_DEF_FILE_FLAG -Wl,--version-script=)
set(TBB_DEF_FILE_PREFIX lin${TBB_ARCH})
set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},10.0>>:-ffp-model=precise>)
endif()
# Depfile options (e.g. -MD) are inserted automatically in some cases.
@@ -54,28 +44,26 @@ if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
endif()
# Enable Intel(R) Transactional Synchronization Extensions (-mrtm) and WAITPKG instructions support (-mwaitpkg) on relevant processors
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)" AND NOT EMSCRIPTEN)
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64)")
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},12.0>>:-mwaitpkg>)
endif()
# Clang flags to prevent compiler from optimizing out security checks
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security -fPIC $<$<NOT:$<BOOL:${EMSCRIPTEN}>>:-fstack-protector-strong>)
# -z switch is not supported on MacOS
if (NOT APPLE)
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,relro,-z,now)
endif()
set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS})
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2>)
if (ANDROID_PLATFORM)
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2>)
endif()
if (MINGW)
list(APPEND TBB_COMMON_COMPILE_FLAGS -U__STRICT_ANSI__)
endif()
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
# Enabling LTO on Android causes the NDK bug.
# NDK throws the warning: "argument unused during compilation: '-Wa,--noexecstack'"
if (NOT ANDROID_PLATFORM AND BUILD_SHARED_LIBS)
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
endif()
# TBB malloc settings
set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions)
+13 -22
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023 Intel Corporation
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -36,11 +36,13 @@ if (NOT CMAKE_GENERATOR MATCHES "Ninja" AND NOT CMAKE_CXX_DEPENDS_USE_COMPILER)
endif()
# Enable Intel(R) Transactional Synchronization Extensions (-mrtm) and WAITPKG instructions support (-mwaitpkg) on relevant processors
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)")
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64)")
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$<AND:$<NOT:$<CXX_COMPILER_ID:Intel>>,$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},11.0>>>:-mwaitpkg>)
endif()
set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS})
if (NOT MINGW)
set(TBB_COMMON_LINK_LIBS dl)
endif()
# Ignore -Werror set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled.
if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
@@ -50,33 +52,22 @@ endif()
if (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL Intel)
# gcc 6.0 and later have -flifetime-dse option that controls elimination of stores done outside the object lifetime
set(TBB_DSE_FLAG $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},6.0>>:-flifetime-dse=1>)
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},8.0>>:-fstack-clash-protection>)
endif()
# Workaround for heavy tests and too many symbols in debug (rellocation truncated to fit: R_MIPS_CALL16)
if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips")
set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} -DTBB_TEST_LOW_WORKLOAD $<$<CONFIG:DEBUG>:-fPIE -mxgot>)
set(TBB_TEST_LINK_FLAGS ${TBB_TEST_LINK_FLAGS} $<$<CONFIG:DEBUG>:-pie>)
set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} -DTBB_TEST_LOW_WORKLOAD $<$<CONFIG:DEBUG>:-mxgot>)
endif()
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
if (MINGW AND CMAKE_SYSTEM_PROCESSOR MATCHES "i.86")
list (APPEND TBB_COMMON_COMPILE_FLAGS -msse2)
endif ()
# Gnu flags to prevent compiler from optimizing out security checks
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fno-strict-overflow -fno-delete-null-pointer-checks -fwrapv)
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security
-fstack-protector-strong )
# -z switch is not supported on MacOS and MinGW
if (NOT APPLE AND NOT MINGW)
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,relro,-z,now,-z,noexecstack)
if (MINGW)
list(APPEND TBB_COMMON_COMPILE_FLAGS -U__STRICT_ANSI__)
endif()
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2> )
# For some reason GCC does not instrument code with Thread Sanitizer when lto is enabled and C linker is used.
if (NOT TBB_SANITIZE MATCHES "thread")
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
endif()
# TBB malloc settings
set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions)
+5 -3
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023 Intel Corporation
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -26,8 +26,10 @@ elseif (APPLE)
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-ipo>)
else()
include(${CMAKE_CURRENT_LIST_DIR}/GNU.cmake)
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<EQUAL:${TBB_ARCH},32>:-falign-stack=maintain-16-byte>)
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -static-intel)
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -static-intel -Wl,-z,relro,-z,now,)
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fstack-protector -Wformat -Wformat-security
$<$<NOT:$<CONFIG:Debug>>:-qno-opt-report-embed -D_FORTIFY_SOURCE=2>
$<$<EQUAL:${TBB_ARCH},32>:-falign-stack=maintain-16-byte>)
set(TBB_OPENMP_FLAG -qopenmp)
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-ipo>)
endif()
+1 -3
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023 Intel Corporation
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,12 +14,10 @@
if (WIN32)
include(${CMAKE_CURRENT_LIST_DIR}/MSVC.cmake)
set(TBB_OPENMP_FLAG /Qopenmp)
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:/Qipo>)
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:/INCREMENTAL:NO>)
else()
include(${CMAKE_CURRENT_LIST_DIR}/Clang.cmake)
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-ipo>)
set(TBB_OPENMP_FLAG -qopenmp)
endif()
set(TBB_IPO_LINK_FLAGS ${TBB_IPO_LINK_FLAGS} ${TBB_IPO_COMPILE_FLAGS})
+5 -12
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023 Intel Corporation
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ set(TBB_WARNING_LEVEL $<$<NOT:$<CXX_COMPILER_ID:Intel>>:/W4> $<$<BOOL:${TBB_STRI
# Warning suppression C4324: structure was padded due to alignment specifier
set(TBB_WARNING_SUPPRESS /wd4324)
set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} /bigobj)
set(TBB_TEST_COMPILE_FLAGS /bigobj)
if (MSVC_VERSION LESS_EQUAL 1900)
# Warning suppression C4503 for VS2015 and earlier:
# decorated name length exceeded, name was truncated.
@@ -33,13 +33,7 @@ if (MSVC_VERSION LESS_EQUAL 1900)
set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} /wd4503)
endif()
set(TBB_LIB_COMPILE_FLAGS -D_CRT_SECURE_NO_WARNINGS /GS)
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} /volatile:iso /FS /EHsc)
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} /DYNAMICBASE /NXCOMPAT)
if (TBB_ARCH EQUAL 32)
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} /SAFESEH )
endif()
set(TBB_COMMON_COMPILE_FLAGS /volatile:iso /FS /EHsc)
# Ignore /WX set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled.
if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
@@ -78,15 +72,14 @@ if (TBB_WINDOWS_DRIVER)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "(Clang|IntelLLVM)")
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64|i.86)")
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64)")
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm -mwaitpkg)
endif()
set(TBB_OPENMP_NO_LINK_FLAG TRUE)
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
else()
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:/GL>)
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-LTCG> $<$<NOT:$<CONFIG:Debug>>:-INCREMENTAL:NO>)
endif()
set(TBB_OPENMP_FLAG /openmp)
set(TBB_OPENMP_NO_LINK_FLAG TRUE) # TBB_OPENMP_FLAG will be used only on compilation but not on linkage
+30 -41
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023 Intel Corporation
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ function(tbb_generate_config)
set(options HANDLE_SUBDIRS)
set(oneValueArgs INSTALL_DIR
SYSTEM_NAME
LIB_REL_PATH INC_REL_PATH
LIB_REL_PATH INC_REL_PATH DLL_REL_PATH
VERSION
TBB_BINARY_VERSION
TBBMALLOC_BINARY_VERSION
@@ -35,6 +35,7 @@ function(tbb_generate_config)
file(MAKE_DIRECTORY ${config_install_dir})
file(TO_CMAKE_PATH "${tbb_gen_cfg_LIB_REL_PATH}" TBB_LIB_REL_PATH)
file(TO_CMAKE_PATH "${tbb_gen_cfg_DLL_REL_PATH}" TBB_DLL_REL_PATH)
file(TO_CMAKE_PATH "${tbb_gen_cfg_INC_REL_PATH}" TBB_INC_REL_PATH)
set(TBB_VERSION ${tbb_gen_cfg_VERSION})
@@ -53,61 +54,45 @@ set(_tbbbind_bin_version ${tbb_gen_cfg_TBBBIND_BINARY_VERSION})
if (tbb_gen_cfg_SYSTEM_NAME STREQUAL "Linux")
set(TBB_LIB_PREFIX "lib")
set(TBB_LIB_EXT "so.\${_\${_tbb_component}_bin_version}")
set (TBB_HANDLE_IMPLIB "
set (_tbb_release_dll \${_tbb_release_lib})
set (_tbb_debug_dll \${_tbb_debug_lib})
")
set(TBB_IMPLIB_RELEASE "")
set(TBB_IMPLIB_DEBUG "")
if (tbb_gen_cfg_HANDLE_SUBDIRS)
set(TBB_HANDLE_SUBDIRS "set(_tbb_subdir gcc4.8)")
set(TBB_HANDLE_SUBDIRS "
if (CMAKE_SIZEOF_VOID_P STREQUAL \"8\")
set(_tbb_subdir intel64/gcc4.8)
else ()
set(_tbb_subdir ia32/gcc4.8)
endif()
")
set(_libdir_for_pc_file "\${prefix}/lib/intel64/gcc4.8")
set(_tbb_pc_extra_libdir "-L\${prefix}/lib")
configure_file(${_tbb_gen_cfg_path}/../integration/pkg-config/tbb.pc.in ${config_install_dir}/tbb.pc @ONLY)
set(_libdir_for_pc_file "\${prefix}/lib/ia32/gcc4.8")
set(_tbb_pc_extra_libdir "-L\${prefix}/lib32")
configure_file(${_tbb_gen_cfg_path}/../integration/pkg-config/tbb.pc.in ${config_install_dir}/tbb32.pc @ONLY)
endif()
elseif (tbb_gen_cfg_SYSTEM_NAME STREQUAL "Darwin")
set(TBB_LIB_PREFIX "lib")
set(TBB_LIB_EXT "\${_\${_tbb_component}_bin_version}.dylib")
set (TBB_HANDLE_IMPLIB "
set (_tbb_release_dll \${_tbb_release_lib})
set (_tbb_debug_dll \${_tbb_debug_lib})
")
set(TBB_IMPLIB_RELEASE "")
set(TBB_IMPLIB_DEBUG "")
set(_libdir_for_pc_file "\${prefix}/lib")
configure_file(${_tbb_gen_cfg_path}/../integration/pkg-config/tbb.pc.in ${config_install_dir}/tbb.pc @ONLY)
elseif (tbb_gen_cfg_SYSTEM_NAME STREQUAL "Windows")
set(TBB_LIB_PREFIX "")
set(TBB_LIB_EXT "lib")
set(TBB_LIB_EXT "dll")
set(TBB_COMPILE_DEFINITIONS "
INTERFACE_COMPILE_DEFINITIONS \"__TBB_NO_IMPLICIT_LINKAGE=1\"")
# .lib - installed to TBB_LIB_REL_PATH (e.g. <prefix>/lib) and are passed as IMPORTED_IMPLIB_<CONFIG> property to target
# .dll - installed to <prefix>/bin or <prefix>/redist and are passed as IMPORTED_LOCATION_<CONFIG> property to target
set (TBB_HANDLE_IMPLIB "
find_file(_tbb_release_dll
NAMES \${_tbb_component}\${_bin_version}.dll
PATHS \${_tbb_root}
PATH_SUFFIXES \"redist/\${_tbb_intel_arch}/\${_tbb_subdir}\" \"bin\${_tbb_arch_suffix}/\${_tbb_subdir}\" \"bin\${_tbb_arch_suffix}/\" \"bin\"
NO_DEFAULT_PATH
)
if (EXISTS \"\${_tbb_debug_lib}\")
find_file(_tbb_debug_dll
NAMES \${_tbb_component}\${_bin_version}_debug.dll
PATHS \${_tbb_root}
PATH_SUFFIXES \"redist/\${_tbb_intel_arch}/\${_tbb_subdir}\" \"bin\${_tbb_arch_suffix}/\${_tbb_subdir}\" \"bin\${_tbb_arch_suffix}/\" \"bin\"
NO_DEFAULT_PATH
)
endif()
")
set(TBB_IMPLIB_RELEASE "
IMPORTED_IMPLIB_RELEASE \"\${_tbb_release_lib}\"")
set(TBB_IMPLIB_DEBUG "
IMPORTED_IMPLIB_DEBUG \"\${_tbb_debug_lib}\"")
# .lib files installed to TBB_LIB_REL_PATH (e.g. <prefix>/lib);
# .dll files installed to TBB_DLL_REL_PATH (e.g. <prefix>/bin);
# Expand TBB_LIB_REL_PATH here in IMPORTED_IMPLIB property and
# redefine it with TBB_DLL_REL_PATH value to properly fill IMPORTED_LOCATION property in TBBConfig.cmake.in template.
set(TBB_IMPLIB_RELEASE "
IMPORTED_IMPLIB_RELEASE \"\${_tbb_root}/${TBB_LIB_REL_PATH}/\${_tbb_subdir}/\${_tbb_component}\${_bin_version}.lib\"")
set(TBB_IMPLIB_DEBUG "
IMPORTED_IMPLIB_DEBUG \"\${_tbb_root}/${TBB_LIB_REL_PATH}/\${_tbb_subdir}/\${_tbb_component}\${_bin_version}_debug.lib\"")
set(TBB_LIB_REL_PATH ${TBB_DLL_REL_PATH})
if (tbb_gen_cfg_HANDLE_SUBDIRS)
set(TBB_HANDLE_SUBDIRS "
@@ -115,15 +100,19 @@ set(_tbb_subdir vc14)
if (WINDOWS_STORE)
set(_tbb_subdir \${_tbb_subdir}_uwp)
endif()
if (CMAKE_SIZEOF_VOID_P STREQUAL \"8\")
set(_tbb_subdir intel64/\${_tbb_subdir})
else ()
set(_tbb_subdir ia32/\${_tbb_subdir})
endif()
")
set(_tbb_pc_lib_name ${_tbb_pc_lib_name}${TBB_BINARY_VERSION})
set(_libdir_for_pc_file "\${prefix}/lib/intel64/vc14")
set(_tbb_pc_extra_libdir "-L\${prefix}/lib")
configure_file(${_tbb_gen_cfg_path}/../integration/pkg-config/tbb.pc.in ${config_install_dir}/tbb.pc @ONLY)
set(_libdir_for_pc_file "\${prefix}/lib/ia32/vc14")
set(_tbb_pc_extra_libdir "-L\${prefix}/lib32")
configure_file(${_tbb_gen_cfg_path}/../integration/pkg-config/tbb.pc.in ${config_install_dir}/tbb32.pc @ONLY)
endif()
+3 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023 Intel Corporation
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -46,6 +46,8 @@ endforeach()
unset(HWLOC_TARGET_NAME)
if (NOT HWLOC_TARGET_EXPLICITLY_DEFINED AND
# No hwloc auto detection for cross compilation
NOT CMAKE_CROSSCOMPILING AND
NOT TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH
)
find_package(PkgConfig QUIET)
+3 -11
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023 Intel Corporation
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -31,18 +31,10 @@ endif()
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/memcheck)
function(_tbb_run_memcheck test_target subdir)
function(_tbb_run_memcheck test_target)
set(target_name memcheck-${test_target})
if(${subdir} STREQUAL "tbbmalloc")
# Valgring intercepts all allocation symbols with its own by default,
# so it disables using tbbmalloc. In case of tbbmalloc tests
# intercept allocation symbols only in the default system libraries,
# but not in any other shared library or the executable
# defining public malloc or operator new related functions.
set(option "--soname-synonyms=somalloc=nouserintercepts")
endif()
add_custom_target(${target_name}
COMMAND ${VALGRIND_EXE} ${option} --leak-check=full --show-leak-kinds=all --log-file=${CMAKE_BINARY_DIR}/memcheck/${target_name}.log -v $<TARGET_FILE:${test_target}>)
COMMAND ${VALGRIND_EXE} --leak-check=full --show-leak-kinds=all --log-file=${CMAKE_BINARY_DIR}/memcheck/${target_name}.log -v $<TARGET_FILE:${test_target}>)
add_dependencies(memcheck-all ${target_name})
endfunction()
+2 -5
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023 Intel Corporation
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,7 +18,4 @@ set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_VERSION "${TBB_VERSION}")
string(TOLOWER ${CPACK_PACKAGE_NAME}-${PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}_${TBB_OUTPUT_DIR_BASE}_${CMAKE_BUILD_TYPE} CPACK_PACKAGE_FILE_NAME)
set(CPACK_GENERATOR ZIP)
# Note: this is an internal non-documented variable set by CPack
if (NOT CPack_CMake_INCLUDED)
include(CPack)
endif()
include(CPack)
-1
View File
@@ -14,7 +14,6 @@
# Add code signing as post-install step.
if (DEFINED TBB_SIGNTOOL)
file(TO_CMAKE_PATH "${TBB_SIGNTOOL}" TBB_SIGNTOOL)
install(CODE "
file(GLOB_RECURSE FILES_TO_SIGN \${CMAKE_INSTALL_PREFIX}/*${CMAKE_SHARED_LIBRARY_SUFFIX})
execute_process(COMMAND ${TBB_SIGNTOOL} \${FILES_TO_SIGN} ${TBB_SIGNTOOL_ARGS})
-31
View File
@@ -1,31 +0,0 @@
# Copyright (c) 2023 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
include(CheckSymbolExists)
if (UNIX)
set(CMAKE_REQUIRED_FLAGS -Wno-deprecated-declarations)
if (APPLE)
set(CMAKE_REQUIRED_DEFINITIONS -D_XOPEN_SOURCE)
endif()
check_symbol_exists("getcontext" "ucontext.h" _tbb_have_ucontext)
if (NOT _tbb_have_ucontext)
set(TBB_RESUMABLE_TASKS_USE_THREADS "__TBB_RESUMABLE_TASKS_USE_THREADS=1")
endif()
unset(_tbb_have_ucontext)
unset(CMAKE_REQUIRED_DEFINITIONS)
unset(CMAKE_REQUIRED_FLAGS)
endif()
+2 -5
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2022 Intel Corporation
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -34,10 +34,7 @@ if (NOT ${FLAG_DISPLAY_NAME})
"please try another compiler or omit TBB_SANITIZE variable")
endif()
set(TBB_TESTS_ENVIRONMENT ${TBB_TESTS_ENVIRONMENT}
"TSAN_OPTIONS=suppressions=${CMAKE_CURRENT_SOURCE_DIR}/cmake/suppressions/tsan.suppressions"
"LSAN_OPTIONS=suppressions=${CMAKE_CURRENT_SOURCE_DIR}/cmake/suppressions/lsan.suppressions")
set(TBB_TESTS_ENVIRONMENT ${TBB_TESTS_ENVIRONMENT} "LSAN_OPTIONS=suppressions=${CMAKE_CURRENT_SOURCE_DIR}/cmake/suppressions/lsan.suppressions")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TBB_SANITIZE_OPTION}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TBB_SANITIZE_OPTION}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${TBB_SANITIZE_OPTION}")
+4 -3
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023 Intel Corporation
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ set(TBB_ROOT_REL_PATH "../../..")
# Paths relative to TBB root directory
set(INC_REL_PATH "include")
set(LIB_REL_PATH "lib")
set(DLL_REL_PATH "redist")
# Parse version info
file(READ ${CMAKE_CURRENT_LIST_DIR}/../../include/oneapi/tbb/version.h _tbb_version_info)
@@ -44,6 +45,6 @@ set(COMMON_ARGS
)
tbb_generate_config(INSTALL_DIR ${INSTALL_DIR}/linux SYSTEM_NAME Linux HANDLE_SUBDIRS ${COMMON_ARGS})
tbb_generate_config(INSTALL_DIR ${INSTALL_DIR}/windows SYSTEM_NAME Windows HANDLE_SUBDIRS ${COMMON_ARGS})
tbb_generate_config(INSTALL_DIR ${INSTALL_DIR}/darwin SYSTEM_NAME Darwin ${COMMON_ARGS})
tbb_generate_config(INSTALL_DIR ${INSTALL_DIR}/windows SYSTEM_NAME Windows HANDLE_SUBDIRS DLL_REL_PATH ${DLL_REL_PATH} ${COMMON_ARGS})
tbb_generate_config(INSTALL_DIR ${INSTALL_DIR}/darwin SYSTEM_NAME Darwin ${COMMON_ARGS})
message(STATUS "TBBConfig files were created in ${INSTALL_DIR}")
-4
View File
@@ -1,4 +0,0 @@
# TSAN suppression for known issues.
# Possible data race during ittnotify initialization. Low impact.
race:__itt_nullify_all_pointers
race:__itt_init_ittlib
+7 -37
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2017-2023 Intel Corporation
# Copyright (c) 2017-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -43,38 +43,14 @@ if (NOT _tbbmalloc_proxy_ix EQUAL -1)
set(TBB_FIND_REQUIRED_tbbmalloc ${TBB_FIND_REQUIRED_tbbmalloc_proxy})
endif()
unset(_tbbmalloc_proxy_ix)
if (CMAKE_SIZEOF_VOID_P STREQUAL "8")
set(_tbb_intel_arch intel64)
else ()
set(_tbb_intel_arch ia32)
set(_tbb_arch_suffix 32)
endif()
@TBB_HANDLE_SUBDIRS@
foreach (_tbb_component ${TBB_FIND_COMPONENTS})
unset(_tbb_release_dll CACHE)
unset(_tbb_debug_dll CACHE)
unset(_tbb_release_lib CACHE)
unset(_tbb_debug_lib CACHE)
set(TBB_${_tbb_component}_FOUND 0)
@TBB_HANDLE_BIN_VERSION@
find_library(_tbb_release_lib
NAMES @TBB_LIB_PREFIX@${_tbb_component}${_bin_version}.@TBB_LIB_EXT@
PATHS ${_tbb_root}
PATH_SUFFIXES "@TBB_LIB_REL_PATH@/${_tbb_intel_arch}/${_tbb_subdir}" "@TBB_LIB_REL_PATH@${_tbb_arch_suffix}/${_tbb_subdir}" "@TBB_LIB_REL_PATH@${_tbb_arch_suffix}" "@TBB_LIB_REL_PATH@"
NO_DEFAULT_PATH
)
get_filename_component(_tbb_release_lib "${_tbb_root}/@TBB_LIB_REL_PATH@/${_tbb_subdir}/@TBB_LIB_PREFIX@${_tbb_component}${_bin_version}.@TBB_LIB_EXT@" ABSOLUTE)
if (NOT TBB_FIND_RELEASE_ONLY)
find_library(_tbb_debug_lib
NAMES @TBB_LIB_PREFIX@${_tbb_component}${_bin_version}_debug.@TBB_LIB_EXT@
PATHS ${_tbb_root}
PATH_SUFFIXES "@TBB_LIB_REL_PATH@/${_tbb_intel_arch}/${_tbb_subdir}" "@TBB_LIB_REL_PATH@${_tbb_arch_suffix}/${_tbb_subdir}" "@TBB_LIB_REL_PATH@${_tbb_arch_suffix}" "@TBB_LIB_REL_PATH@"
NO_DEFAULT_PATH
)
get_filename_component(_tbb_debug_lib "${_tbb_root}/@TBB_LIB_REL_PATH@/${_tbb_subdir}/@TBB_LIB_PREFIX@${_tbb_component}${_bin_version}_debug.@TBB_LIB_EXT@" ABSOLUTE)
endif()
if (EXISTS "${_tbb_release_lib}" OR EXISTS "${_tbb_debug_lib}")
@@ -87,17 +63,15 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})
unset(_tbb_current_realpath)
unset(_tbb_include_dir)
@TBB_HANDLE_IMPLIB@
if (EXISTS "${_tbb_release_dll}")
if (EXISTS "${_tbb_release_lib}")
set_target_properties(TBB::${_tbb_component} PROPERTIES
IMPORTED_LOCATION_RELEASE "${_tbb_release_dll}"@TBB_IMPLIB_RELEASE@)
IMPORTED_LOCATION_RELEASE "${_tbb_release_lib}"@TBB_IMPLIB_RELEASE@)
set_property(TARGET TBB::${_tbb_component} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
endif()
if (EXISTS "${_tbb_debug_dll}")
if (EXISTS "${_tbb_debug_lib}")
set_target_properties(TBB::${_tbb_component} PROPERTIES
IMPORTED_LOCATION_DEBUG "${_tbb_debug_dll}"@TBB_IMPLIB_DEBUG@)
IMPORTED_LOCATION_DEBUG "${_tbb_debug_lib}"@TBB_IMPLIB_DEBUG@)
set_property(TARGET TBB::${_tbb_component} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
endif()
@@ -119,10 +93,6 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})
endif()
endforeach()
list(REMOVE_DUPLICATES TBB_IMPORTED_TARGETS)
unset(_tbb_release_dll)
unset(_tbb_debug_dll)
unset(_tbb_release_lib)
unset(_tbb_debug_lib)
unset(_tbb_root)
unset(_tbb_intel_arch)
unset(_tbb_arch_suffix)
-34
View File
@@ -1,34 +0,0 @@
# Copyright (c) 2023 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Prevent double invocation.
if (RISCV_TOOLCHAIN_INCLUDED)
return()
endif()
set(RISCV_TOOLCHAIN_INCLUDED TRUE)
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR riscv)
# User can use -DCMAKE_FIND_ROOT_PATH to specific toolchain path
set(CMAKE_C_COMPILER ${CMAKE_FIND_ROOT_PATH}/bin/riscv64-unknown-linux-gnu-clang)
set(CMAKE_CXX_COMPILER ${CMAKE_FIND_ROOT_PATH}/bin/riscv64-unknown-linux-gnu-clang++)
set(CMAKE_LINKER ${CMAKE_FIND_ROOT_PATH}/bin/riscv64-unknown-linux-gnu-ld)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# Most linux on riscv64 support rv64imafd_zba_zbb extensions
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=rv64imafd_zba_zbb -mabi=lp64d " CACHE INTERNAL "")
+17 -41
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023 Intel Corporation
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,53 +18,29 @@ macro(tbb_remove_compile_flag flag)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_OPTIONS ${_tbb_compile_options})
unset(_tbb_compile_options)
if (CMAKE_CXX_FLAGS)
string(REGEX REPLACE "(^|[ \t\r\n]+)${flag}($|[ \t\r\n]+)" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
endif()
endmacro()
macro(tbb_install_target target)
if (TBB_INSTALL)
install(TARGETS ${target}
EXPORT TBBTargets
LIBRARY
DESTINATION ${CMAKE_INSTALL_LIBDIR}
NAMELINK_SKIP
COMPONENT runtime
RUNTIME
DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT runtime
ARCHIVE
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT devel)
if (BUILD_SHARED_LIBS)
install(TARGETS ${target}
EXPORT TBBTargets
LIBRARY
DESTINATION ${CMAKE_INSTALL_LIBDIR}
NAMELINK_SKIP
COMPONENT runtime
RUNTIME
DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT runtime
ARCHIVE
DESTINATION ${CMAKE_INSTALL_LIBDIR}
NAMELINK_ONLY
COMPONENT devel)
if (BUILD_SHARED_LIBS)
install(TARGETS ${target}
LIBRARY
DESTINATION ${CMAKE_INSTALL_LIBDIR}
NAMELINK_ONLY
COMPONENT devel)
endif()
if (MSVC AND BUILD_SHARED_LIBS)
install(FILES $<TARGET_PDB_FILE:${target}>
DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT devel
OPTIONAL)
endif()
endif()
endmacro()
macro(tbb_handle_ipo target)
if (TBB_IPO_PROPERTY)
set_target_properties(${target} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION TRUE
INTERPROCEDURAL_OPTIMIZATION_DEBUG FALSE
)
elseif (TBB_IPO_FLAGS)
target_compile_options(${target} PRIVATE ${TBB_IPO_COMPILE_FLAGS})
if (COMMAND target_link_options)
target_link_options(${target} PRIVATE ${TBB_IPO_LINK_FLAGS})
else()
target_link_libraries(${target} PRIVATE ${TBB_IPO_LINK_FLAGS})
endif()
endif()
endmacro()
Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

-37
View File
@@ -1,37 +0,0 @@
window.MathJax = {
TeX: {
Macros: {
src: '\\operatorname{src}',
srclayer: '\\operatorname{src\\_layer}',
srciter: '\\operatorname{src\\_iter}',
srciterc: '\\operatorname{src\\_iter\\_c}',
weights: '\\operatorname{weights}',
weightslayer: '\\operatorname{weights\\_layer}',
weightsiter: '\\operatorname{weights\\_iter}',
weightspeephole: '\\operatorname{weights\\_peephole}',
weightsprojection: '\\operatorname{weights\\_projection}',
bias: '\\operatorname{bias}',
dst: '\\operatorname{dst}',
dstlayer: '\\operatorname{dst\\_layer}',
dstiter: '\\operatorname{dst\\_iter}',
dstiterc: '\\operatorname{dst\\_iter\\_c}',
diffsrc: '\\operatorname{diff\\_src}',
diffsrclayer: '\\operatorname{diff\\_src\\_layer}',
diffsrciter: '\\operatorname{diff\\_src\\_iter}',
diffsrciterc: '\\operatorname{diff\\_src\\_iter\\_c}',
diffweights: '\\operatorname{diff\\_weights}',
diffweightslayer: '\\operatorname{diff\\_weights\\_layer}',
diffweightsiter: '\\operatorname{diff\\_weights\\_iter}',
diffweightspeephole: '\\operatorname{diff\\_weights\\_peephole}',
diffweightsprojection: '\\operatorname{diff\\_weights\\_projection}',
diffbias: '\\operatorname{diff\\_bias}',
diffdst: '\\operatorname{diff\\_dst}',
diffdstlayer: '\\operatorname{diff\\_dst\\_layer}',
diffdstiter: '\\operatorname{diff\\_dst\\_iter}',
diffdstiterc: '\\operatorname{diff\\_dst\\_iter\\_c}',
diffgamma: '\\operatorname{diff\\_\\gamma}',
diffbeta: '\\operatorname{diff\\_\\beta}',
workspace: '\\operatorname{workspace}'
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 467 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

-13
View File
@@ -1,13 +0,0 @@
/* override table width restrictions */
@media screen and (min-width: 767px) {
.wy-table-responsive table td {
/* !important prevents the common CSS stylesheets from overriding
this as on RTD they are loaded after this stylesheet */
white-space: normal !important;
}
.wy-table-responsive {
overflow: visible !important;
}
}
-48
View File
@@ -1,48 +0,0 @@
.. _Before_You_Begin:
Before You Begin
****************
After installing |short_name|, you need to set the environment variables:
#. Go to the oneTBB installation directory (``<install_dir>``). By default, ``<install_dir>`` is the following:
* On Linux* OS:
* For superusers (root): ``/opt/intel/oneapi``
* For ordinary users (non-root): ``$HOME/intel/oneapi``
* On Windows* OS:
* ``<Program Files>\Intel\oneAPI``
#. Set the environment variables, using the script in <install_dir>, by running
* On Linux* OS:
``vars.{sh|csh} in <install_dir>/tbb/latest/env``
* On Windows* OS:
``vars.bat in <install_dir>/tbb/latest/env``
Example
*******
Below you can find a typical example for a |short_name| algorithm.
The sample calculates a sum of all integer numbers from 1 to 100.
.. code:: cpp
int sum = oneapi::tbb::parallel_reduce(oneapi::tbb::blocked_range<int>(1,101), 0,
[](oneapi::tbb::blocked_range<int> const& r, int init) -> int {
for (int v = r.begin(); v != r.end(); v++ ) {
init += v;
}
return init;
},
[](int lhs, int rhs) -> int {
return lhs + rhs;
}
);
+3 -40
View File
@@ -26,10 +26,7 @@ BUILD_TYPE = os.getenv("BUILD_TYPE")
# -- Project information -----------------------------------------------------
if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
project = u'Intel® oneAPI Threading Building Blocks (oneTBB)'
else:
project = u'oneAPI Threading Building Blocks (oneTBB)'
project = u'Intel® oneAPI Threading Building Blocks (oneTBB)'
copyright = u'2021, Intel Corporation'
author = u'Intel'
@@ -93,8 +90,7 @@ pygments_style = None
highlight_language = 'cpp'
if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
rst_prolog = """
rst_prolog = """
.. |full_name| replace:: Intel\ |reg|\ oneAPI Threading Building Blocks (oneTBB)
.. |short_name| replace:: oneTBB
.. |product| replace:: oneTBB
@@ -103,16 +99,6 @@ if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
.. |base_tk| replace:: Intel\ |reg|\ oneAPI Base Toolkit
.. |dpcpp| replace:: Intel\ |reg|\ oneAPI DPC++/C++ Compiler
"""
else:
rst_prolog = """
.. |full_name| replace:: oneAPI Threading Building Blocks (oneTBB)
.. |short_name| replace:: oneTBB
.. |product| replace:: oneTBB
.. |reg| unicode:: U+000AE
.. |copy| unicode:: U+000A9
.. |base_tk| replace:: Intel\ |reg|\ oneAPI Base Toolkit
.. |dpcpp| replace:: Intel\ |reg|\ oneAPI DPC++/C++ Compiler
"""
# -- Options for HTML output -------------------------------------------------
@@ -124,36 +110,13 @@ else:
# further. For a list of options available for each theme, see the
# documentation.
#
if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
html_theme = 'sphinx_rtd_theme'
else:
html_theme = 'sphinx_book_theme'
html_theme_options = {
'repository_url': 'https://github.com/oneapi-src/oneTBB',
'path_to_docs': 'doc/main',
'use_issues_button': True,
'use_edit_page_button': True,
'repository_branch': 'master',
'extra_footer': '<p align="right"><a href="https://www.intel.com/content/www/us/en/privacy/intel-cookie-notice.html">Cookies</a></p>'
}
html_theme = 'sphinx_book_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
html_context = {
'css_files': [
'_static/theme_overrides.css', # override wide tables in RTD theme
],
}
else:
html_js_files = ['custom.js']
html_logo = '_static/oneAPI-rgb-rev-100.png'
html_favicon = '_static/favicons.png'
# Custom sidebar templates, must be a dictionary that maps document names
-45
View File
@@ -1,45 +0,0 @@
.. _examples:
oneTBB Samples
==============
Refer to the following examples to see how |short_name| works.
* **Containers**
* `concurrent_hash_map <https://github.com/oneapi-src/oneTBB/tree/master/examples/concurrent_hash_map>`_
* `concurrent_priority_queue <https://github.com/oneapi-src/oneTBB/tree/master/examples/concurrent_priority_queue>`_
* `Flow Graph <https://github.com/oneapi-src/oneTBB/tree/master/examples/graph>`_
* `A solution to the binpacking problem using a queue_node, a buffer_node, and function_node. <https://github.com/oneapi-src/oneTBB/tree/master/examples/graph/binpack>`_
* `Cholesky Factorization algorithm <https://github.com/oneapi-src/oneTBB/tree/master/examples/graph/cholesky>`_
* `An implementation of dining philosophers in graph using the reserving join_node <https://github.com/oneapi-src/oneTBB/tree/master/examples/graph/dining_philosophers>`_
* `A parallel implementation of bzip2 block-sorting file compressor <https://github.com/oneapi-src/oneTBB/tree/master/examples/graph/fgbzip2>`_
* `An example of a collection of digital logic gates that can be easily composed into larger circuits <https://github.com/oneapi-src/oneTBB/tree/master/examples/graph/logic_sim>`_
* `An example of a Kohonen Self-Organizing Map using cancellation <https://github.com/oneapi-src/oneTBB/tree/master/examples/graph/som>`_
* `Split computational kernel for execution between CPU and GPU <https://github.com/oneapi-src/oneAPI-samples/tree/master/Libraries/oneTBB/tbb-async-sycl>`_
* **Algorithms**
* `parallel_for <https://github.com/oneapi-src/oneTBB/tree/master/examples/parallel_for>`_
* `Game of life overlay <https://github.com/oneapi-src/oneTBB/tree/master/examples/parallel_for/game_of_life>`_
* `Polygon overlay <https://github.com/oneapi-src/oneTBB/tree/master/examples/parallel_for/polygon_overlay>`_
* `Parallel seismic wave simulation <https://github.com/oneapi-src/oneTBB/tree/master/examples/parallel_for/seismic>`_
* `Parallel 2-D raytracer/renderer <https://github.com/oneapi-src/oneTBB/tree/master/examples/parallel_for/tachyon>`_
* `Find largest matching substrings <https://github.com/oneapi-src/oneTBB/tree/master/examples/getting_started>`_
* `Resumable task: Split computational kernel for execution between CPU and GPU <https://github.com/oneapi-src/oneAPI-samples/tree/master/Libraries/oneTBB/tbb-resumable-tasks-sycl>`_
* `parallel_for_each <https://github.com/oneapi-src/oneTBB/tree/master/examples/parallel_for_each>`_
* `parallel_pipeline <https://github.com/oneapi-src/oneTBB/tree/master/examples/parallel_pipeline>`_
* `parallel_reduce <https://github.com/oneapi-src/oneTBB/tree/master/examples/parallel_reduce>`_
* **Task Scheduler**
* `task_arena <https://github.com/oneapi-src/oneTBB/tree/master/examples/task_arena>`_
* `task_group <https://github.com/oneapi-src/oneTBB/tree/master/examples/task_group>`_
* `Execute similar computational kernels, with one task executing the SYCL* code and the other task executing the oneTBB code <https://github.com/oneapi-src/oneAPI-samples/tree/master/Libraries/oneTBB/tbb-task-sycl>`_
* **Other**
* `Compute Fibonacci numbers in different ways <https://github.com/oneapi-src/oneTBB/tree/master/examples/test_all>`_
-24
View File
@@ -1,24 +0,0 @@
.. _Get_Started_Guide:
Get Started with |full_name|
=============================
|short_name| Get Started Guide provides the information you need to begin working with oneTBB.
It is helpful for new users of parallel programming and experienced developers that want to improve code performance.
It is recommended for you to have a basic knowledge of C++ programming and some experience with parallel programming concepts.
To start using oneTBB, follow the next steps:
*********************************************
#. Learn what :ref:`oneTBB is<intro>` and see the :ref:`System Requirements<system_requirements>`.
#. :ref:`Install oneTBB<installation>`.
#. Run your program using oneTBB following the :ref:`Next Steps <next_steps>`.
#. Learn how to :ref:`Integrate oneTBB into your project <integrate>` using CMake* and pkg-config tool.
#. See :ref:`oneTBB Samples <samples>`.
-40
View File
@@ -1,40 +0,0 @@
.. _hybrid_cpu_support:
Hybrid CPU and NUMA Support
***************************
If you need NUMA/Hybrid CPU support in oneTBB, you need to make sure that HWLOC* is installed on your system.
HWLOC* (Hardware Locality) is a library that provides a portable abstraction of the hierarchical topology of modern architectures (NUMA, hybrid CPU systems, etc).
oneTBB relies on HWLOC* to identify the underlying topology of the system to optimize thread scheduling and memory allocation.
Without HWLOC*, oneTBB may not take advantage of NUMA/Hybrid CPU support. Therefore, it's important to make sure that HWLOC* is installed before using oneTBB on such systems.
Check HWLOC* on the System
^^^^^^^^^^^^^^^^^^^^^^^^^^
To check if HWLOC* is already installed on your system, run `hwloc-ls`:
* For Linux* OS, in the command line.
* For Windows* OS, in the command prompt.
If HWLOC* is installed, the command displays information about the hardware topology of your system.
If it is not installed, you receive an error message saying that the command ``hwloc-ls`` could not be found.
.. note:: For Hybrid CPU support, make sure that HWLOC* is version 2.5 or higher.
For NUMA support, install HWLOC* version 1.11 or higher.
Install HWLOC*
^^^^^^^^^^^^^^
To install HWLOC*, visit the official Portable Hardware Locality website (https://www-lb.open-mpi.org/projects/hwloc/).
* For Windows* OS, binaries are available for download.
* For Linux* OS, only the source code is provided and binaries should be built.
On Linux* OS, HWLOC* can be also installed with package managers, such as APT*, YUM*, etc.
To do so, run: ``sudo apt install hwloc``.
.. note:: For Hybrid CPU support, make sure that HWLOC* is version 2.5 or higher.
For NUMA support, install HWLOC* version 1.11 or higher.
-7
View File
@@ -1,7 +0,0 @@
.. _installation:
Installation
============
See the `installation instructions <https://github.com/oneapi-src/oneTBB/blob/master/INSTALL.md>`_
that will help you to install |short_name| successfully.
-68
View File
@@ -1,68 +0,0 @@
.. _integrate:
Integrate oneTBB
================
If you want to improve the performance and scalability of your application, you can integrate oneTBB into your project.
For example, you may want to integrate oneTBB if your application needs to process large amounts of data in parallel.
To integrate oneTBB, you need to:
* Link oneTBB with the project's source code.
* Provide the necessary compiler and linker flags.
However, you can use CMake* and the pkg-config tool to simplify the process of integrating oneTBB into your project and handling its dependencies.
See the instructions below to learn how to use the tools.
CMake*
*******
CMake* is a cross-platform build tool that helps you manage dependencies and build systems.
Integrating oneTBB into your project using CMake*:
* Simplifies the process of building and linking against the library.
* Ensures that your project can be built and run on multiple platforms.
* Lets you manage oneTBB dependencies.
To add oneTBB to another project using CMake*, add the following commands to your ``CMakeLists.txt`` file:
.. code-block::
`find_package(TBB REQUIRED)`
`target_link_libraries(my_executable TBB::tbb)`
After that, configure your project with CMake* as usual.
Compile a Program Using pkg-config
***********************************
The pkg-config tool is used to simplify the compilation line by retrieving information about packages
from special metadata files. It helps avoid large hard-coded paths and makes compilation more portable.
To compile a test program ``test.cpp`` with oneTBB on Linux* OS,
provide the full path to search for included files and libraries, or provide a line as the following:
.. code-block::
g++ -o test test.cpp $(pkg-config --libs --cflags tbb)
Where:
``--cflags`` provides oneTBB library include path:
.. code-block::
$ pkg-config --cflags tbb
-I<path-to>/tbb/latest/lib/pkgconfig/../..//include
``--libs`` provides the Intel(R) oneTBB library name and the search path to find it:
.. code-block::
$ pkg-config –libs tbb
-L<path to>tbb/latest/lib/pkgconfig/../..//lib/intel64/gcc4.8 -ltbb
.. note::
For Windows* OS, additionally, use the ``--msvc-syntax`` option flag that converts the compiling and linking flags in an appropriate mode.
-29
View File
@@ -1,29 +0,0 @@
.. _intro:
What oneTBB Is
==============
|full_name| is a runtime-based parallel programming model for C++ code that uses threads.
The template-based runtime library can help you harness the latent performance of multi-core processors.
oneTBB enables you to simplify parallel programming by breaking computation into parallel running tasks. Within a single process,
parallelism is carried out through threads, an operating system mechanism that allows the same or different sets of instructions
to be executed simultaneously. Using threads can make your program work faster and more efficiently.
Here you can see one of the possible executions of tasks by threads.
.. figure:: Images/how-oneTBB-works.png
:scale: 70%
:align: center
Use oneTBB to write scalable applications that:
* Specify logical parallel structure instead of threads.
* Emphasize data-parallel programming.
* Take advantage of concurrent collections and parallel algorithms.
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.
oneTBB is used in different areas, such as scientific simulations, gaming, data analysis, etc.
It is available as a stand-alone product and as part of the |base_tk|.
-23
View File
@@ -1,23 +0,0 @@
.. _Intro_gsg:
|full_name| is a runtime-based parallel programming model for C++ code that uses threads.
It consists of a template-based runtime library to help you harness the latent performance of multi-core processors.
oneTBB enables you to simplify parallel programming by breaking computation into parallel running tasks. Within a single process,
parallelism is carried out through threads, an operating system mechanism that allows the same or different sets of instructions
to be executed simultaneously.
Here you can see one of the possible executions of tasks by threads.
.. figure:: /GSG/Images/how-oneTBB-works.png
:scale: 70%
:align: center
Use oneTBB to write scalable applications that:
* Specify logical parallel structure instead of threads
* Emphasize data-parallel programming
* Take advantage of concurrent collections and parallel algorithms
oneTBB supports nested parallelism and load balancing. It means that you can use the library without being worried about oversubscribing a system.
-157
View File
@@ -1,157 +0,0 @@
.. _next_steps:
Next Steps
===========
After installing oneTBB, complete the following steps to start working with the library.
Set the Environment Variables
*****************************
After installing |short_name|, set the environment variables:
#. Go to the oneTBB installation directory.
#. Set the environment variables using the script in ``<install_dir>`` by running:
* On Linux* OS: ``vars.{sh|csh} in <install_dir>/tbb/latest/env``
* On Windows* OS: ``vars.bat in <install_dir>/tbb/latest/env``
.. tip::
oneTBB can coordinate with Intel(R) OpenMP on CPU resources usage
to avoid excessive oversubscription when both runtimes are used within a process.
To enable this feature set up ``TCM_ENABLE`` environment variable to ``1``.
Build and Run a Sample
**********************
.. tabs::
.. group-tab:: Windows* OS
#. Create a new C++ project using your IDE. In this example, Microsoft* Visual Studio* Code is used.
#. Create an ``example.cpp`` file in the project.
#. 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.
.. code::
#include <oneapi/tbb.h>
int main (){
int sum = oneapi::tbb::parallel_reduce(
oneapi::tbb::blocked_range<int>(1,101), 0,
[](oneapi::tbb::blocked_range<int> const& r, int init) -> int {
for (int v = r.begin(); v != r.end(); v++) {
init += v;
}
return init;
},
[](int lhs, int rhs) -> int {
return lhs + rhs;
}
);
printf("Sum: %d\n", sum);
return 0;
}
#. Open the ``tasks.json`` file in the ``.vscode`` directory and paste the following lines to the args array:
* ``-Ipath/to/oneTBB/include`` to add oneTBB include directory.
* ``path/to/oneTBB/`` to add oneTBB.
For example:
.. code-block::
{
"tasks": [
{
"label": "build & run",
"type": "cppbuild",
"group": {
"args": [
"/IC:\\Program Files (x86)\\Intel\\oneAPI\\tbb\\2021.9.0\\include",
"C:\\Program Files (x86)\\Intel\\oneAPI\\tbb\\2021.9.0\\lib\\ia32\\vc14\\tbb12.lib"
#. Build the project.
#. Run the example.
#. If oneTBB is configured correctly, the output displays ``Sum: 5050``.
.. group-tab:: Linux* OS
#. Create an ``example.cpp`` file in the project.
#. 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.
.. code::
#include <oneapi/tbb.h>
int main(){
int sum = oneapi::tbb::parallel_reduce(
oneapi::tbb::blocked_range<int>(1,101), 0,
[](oneapi::tbb::blocked_range<int> const& r, int init) -> int {
for (int v = r.begin(); v != r.end(); v++) {
init += v;
}
return init;
},
[](int lhs, int rhs) -> int {
return lhs + rhs;
}
);
printf("Sum: %d\n", sum);
return 0;
}
#. Compile the code using oneTBB. For example,
.. code-block::
g++ -std=c++11 example.cpp -o example -ltbb
#. Run the executable:
.. code-block::
./example
#. If oneTBB is configured correctly, the output displays ``Sum: 5050``.
Hybrid CPU and NUMA Support
****************************
If you need NUMA/Hybrid CPU support in oneTBB, you need to make sure that HWLOC* is installed on your system.
HWLOC* (Hardware Locality) is a library that provides a portable abstraction of the hierarchical topology of modern architectures (NUMA, hybrid CPU systems, etc). oneTBB relies on HWLOC* to identify the underlying topology of the system to optimize thread scheduling and memory allocation.
Without HWLOC*, oneTBB may not take advantage of NUMA/Hybrid CPU support. Therefore, it's important to make sure that HWLOC* is installed before using oneTBB on such systems.
Check HWLOC* on the System
^^^^^^^^^^^^^^^^^^^^^^^^^^^
To check if HWLOC* is already installed on your system, run ``hwloc-ls``:
* For Linux* OS, in the command line.
* For Windows* OS, in the command prompt.
If HWLOC* is installed, the command displays information about the hardware topology of your system. If it is not installed, you receive an error message saying that the command ``hwloc-ls`` could not be found.
.. note:: For Hybrid CPU support, make sure that HWLOC* is version 2.5 or higher. For NUMA support, install HWLOC* version 1.11 or higher.
Install HWLOC*
^^^^^^^^^^^^^^
To install HWLOC*, visit the official Portable Hardware Locality website (https://www-lb.open-mpi.org/projects/hwloc/).
* For Windows* OS, binaries are available for download.
* For Linux* OS, only the source code is provided and binaries should be built.
On Linux* OS, HWLOC* can be also installed with package managers, such as APT*, YUM*, etc. To do so, run: sudo apt install hwloc.
.. note:: For Hybrid CPU support, make sure that HWLOC* is version 2.5 or higher. For NUMA support, install HWLOC* version 1.11 or higher.
-49
View File
@@ -1,49 +0,0 @@
.. _samples:
oneTBB Samples
==============
To become an expert in using oneTBB, explore its samples and examples to learn how
to properly utilize the features and functionality of oneTBB and avoid common mistakes that may impede your performance.
The following samples are available:
* **Containers**
* `concurrent_hash_map <https://github.com/oneapi-src/oneTBB/tree/master/examples/concurrent_hash_map>`_
* `concurrent_priority_queue <https://github.com/oneapi-src/oneTBB/tree/master/examples/concurrent_priority_queue>`_
* `Flow Graph <https://github.com/oneapi-src/oneTBB/tree/master/examples/graph>`_
* `A solution to the binpacking problem using a queue_node, a buffer_node, and function_node. <https://github.com/oneapi-src/oneTBB/tree/master/examples/graph/binpack>`_
* `Cholesky Factorization algorithm <https://github.com/oneapi-src/oneTBB/tree/master/examples/graph/cholesky>`_
* `An implementation of dining philosophers in graph using the reserving join_node <https://github.com/oneapi-src/oneTBB/tree/master/examples/graph/dining_philosophers>`_
* `A parallel implementation of bzip2 block-sorting file compressor <https://github.com/oneapi-src/oneTBB/tree/master/examples/graph/fgbzip2>`_
* `An example of a collection of digital logic gates that can be easily composed into larger circuits <https://github.com/oneapi-src/oneTBB/tree/master/examples/graph/logic_sim>`_
* `An example of a Kohonen Self-Organizing Map using cancellation <https://github.com/oneapi-src/oneTBB/tree/master/examples/graph/som>`_
* `Split computational kernel for execution between CPU and GPU <https://github.com/oneapi-src/oneAPI-samples/tree/master/Libraries/oneTBB/tbb-async-sycl>`_
* **Algorithms**
* `parallel_for <https://github.com/oneapi-src/oneTBB/tree/master/examples/parallel_for>`_
* `Game of life overlay <https://github.com/oneapi-src/oneTBB/tree/master/examples/parallel_for/game_of_life>`_
* `Polygon overlay <https://github.com/oneapi-src/oneTBB/tree/master/examples/parallel_for/polygon_overlay>`_
* `Parallel seismic wave simulation <https://github.com/oneapi-src/oneTBB/tree/master/examples/parallel_for/seismic>`_
* `Parallel 2-D raytracer/renderer <https://github.com/oneapi-src/oneTBB/tree/master/examples/parallel_for/tachyon>`_
* `Find largest matching substrings <https://github.com/oneapi-src/oneTBB/tree/master/examples/getting_started>`_
* `Resumable task: Split computational kernel for execution between CPU and GPU <https://github.com/oneapi-src/oneAPI-samples/tree/master/Libraries/oneTBB/tbb-resumable-tasks-sycl>`_
* `parallel_for_each <https://github.com/oneapi-src/oneTBB/tree/master/examples/parallel_for_each>`_
* `parallel_pipeline <https://github.com/oneapi-src/oneTBB/tree/master/examples/parallel_pipeline>`_
* `parallel_reduce <https://github.com/oneapi-src/oneTBB/tree/master/examples/parallel_reduce>`_
* **Task Scheduler**
* `task_arena <https://github.com/oneapi-src/oneTBB/tree/master/examples/task_arena>`_
* `task_group <https://github.com/oneapi-src/oneTBB/tree/master/examples/task_group>`_
* `Execute similar computational kernels, with one task executing the SYCL* code and the other task executing the oneTBB code <https://github.com/oneapi-src/oneAPI-samples/tree/master/Libraries/oneTBB/tbb-task-sycl>`_
* **Other**
* `Compute Fibonacci numbers in different ways <https://github.com/oneapi-src/oneTBB/tree/master/examples/test_all>`_
.. note:: You can also refer to the `oneAPI Samples <https://oneapi-src.github.io/oneAPI-samples/>`_ to learn more about the ecosystem.
-6
View File
@@ -1,6 +0,0 @@
.. _System_Requirements:
System Requirements
*******************
Refer to the `oneTBB System Requirements <https://github.com/oneapi-src/oneTBB/blob/master/SYSTEM_REQUIREMENTS.md>`_.
-36
View File
@@ -1,36 +0,0 @@
#===============================================================================
# Copyright (C) 2022 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#===============================================================================
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = doc
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
-34
View File
@@ -1,34 +0,0 @@
# How to build oneTBB documentation
Our documentation is written in restructured text markup (.rst) and built using [Sphinx](http://www.sphinx-doc.org/en/master/).
This document explains how to build oneTBB documentation locally.
## Prerequisites
- Python 3.7.0 or higher
- Sphinx
## Build documentation
Do the following to generate HTML output of the documentation:
1. Clone oneTBB repository:
```
git clone https://github.com/oneapi-src/oneTBB.git
```
2. Go to the `doc` folder:
```
cd oneTBB/doc
```
3. Run in the command line:
```
make html
```
That's it! Your built documentation is located in the ``build/html`` folder.
-37
View File
@@ -1,37 +0,0 @@
window.MathJax = {
TeX: {
Macros: {
src: '\\operatorname{src}',
srclayer: '\\operatorname{src\\_layer}',
srciter: '\\operatorname{src\\_iter}',
srciterc: '\\operatorname{src\\_iter\\_c}',
weights: '\\operatorname{weights}',
weightslayer: '\\operatorname{weights\\_layer}',
weightsiter: '\\operatorname{weights\\_iter}',
weightspeephole: '\\operatorname{weights\\_peephole}',
weightsprojection: '\\operatorname{weights\\_projection}',
bias: '\\operatorname{bias}',
dst: '\\operatorname{dst}',
dstlayer: '\\operatorname{dst\\_layer}',
dstiter: '\\operatorname{dst\\_iter}',
dstiterc: '\\operatorname{dst\\_iter\\_c}',
diffsrc: '\\operatorname{diff\\_src}',
diffsrclayer: '\\operatorname{diff\\_src\\_layer}',
diffsrciter: '\\operatorname{diff\\_src\\_iter}',
diffsrciterc: '\\operatorname{diff\\_src\\_iter\\_c}',
diffweights: '\\operatorname{diff\\_weights}',
diffweightslayer: '\\operatorname{diff\\_weights\\_layer}',
diffweightsiter: '\\operatorname{diff\\_weights\\_iter}',
diffweightspeephole: '\\operatorname{diff\\_weights\\_peephole}',
diffweightsprojection: '\\operatorname{diff\\_weights\\_projection}',
diffbias: '\\operatorname{diff\\_bias}',
diffdst: '\\operatorname{diff\\_dst}',
diffdstlayer: '\\operatorname{diff\\_dst\\_layer}',
diffdstiter: '\\operatorname{diff\\_dst\\_iter}',
diffdstiterc: '\\operatorname{diff\\_dst\\_iter\\_c}',
diffgamma: '\\operatorname{diff\\_\\gamma}',
diffbeta: '\\operatorname{diff\\_\\beta}',
workspace: '\\operatorname{workspace}'
}
}
}
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 467 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

-13
View File
@@ -1,13 +0,0 @@
/* override table width restrictions */
@media screen and (min-width: 767px) {
.wy-table-responsive table td {
/* !important prevents the common CSS stylesheets from overriding
this as on RTD they are loaded after this stylesheet */
white-space: normal !important;
}
.wy-table-responsive {
overflow: visible !important;
}
}
-312
View File
@@ -1,312 +0,0 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
SOURCE_DIR = os.path.dirname(__file__)
LATEX_DIR = os.path.join(SOURCE_DIR, '_latex')
PREAMBLE_FILE = os.path.join(LATEX_DIR, 'preamble.tex')
TITLE_PAGE_FILE = os.path.join(LATEX_DIR, 'title_page.tex')
BUILD_TYPE = os.getenv("BUILD_TYPE")
# -- Project information -----------------------------------------------------
if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
project = u'Intel® oneAPI Threading Building Blocks (oneTBB)'
else:
project = u'oneTBB'
copyright = u'2023, Intel Corporation'
author = u'Intel'
# The short X.Y version
version = u''
# The full version, including alpha/beta/rc tags
release = u''
# -- General configuration ---------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.imgmath',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx_tabs.tabs'
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['main/_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
#master_doc = 'main/title_main'
master_doc = 'index'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None
# Syntax highlighting for the :: directive
highlight_language = 'cpp'
if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
rst_prolog = """
.. |full_name| replace:: Intel\ |reg|\ oneAPI Threading Building Blocks (oneTBB)
.. |short_name| replace:: oneTBB
.. |product| replace:: oneTBB
.. |reg| unicode:: U+000AE
.. |copy| unicode:: U+000A9
.. |base_tk| replace:: Intel\ |reg|\ oneAPI Base Toolkit
.. |dpcpp| replace:: Intel\ |reg|\ oneAPI DPC++/C++ Compiler
"""
else:
rst_prolog = """
.. |full_name| replace:: oneAPI Threading Building Blocks (oneTBB)
.. |short_name| replace:: oneTBB
.. |product| replace:: oneTBB
.. |reg| unicode:: U+000AE
.. |copy| unicode:: U+000A9
.. |base_tk| replace:: Intel\ |reg|\ oneAPI Base Toolkit
.. |dpcpp| replace:: Intel\ |reg|\ oneAPI DPC++/C++ Compiler
"""
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme = 'sphinx_book_theme'
if BUILD_TYPE == 'dita':
html_theme_options = {
'repository_url': 'https://github.com/oneapi-src/oneTBB',
'path_to_docs': 'doc',
'repository_branch': 'master'
}
else:
html_theme_options = {
'repository_url': 'https://github.com/oneapi-src/oneTBB',
'path_to_docs': 'doc',
'use_issues_button': True,
'use_edit_page_button': True,
'repository_branch': 'master',
}
if BUILD_TYPE != 'oneapi' and BUILD_TYPE != 'dita':
html_theme_options = {
"extra_footer": "<div><a href='https://www.intel.com/content/www/us/en/privacy/intel-cookie-notice.html' data-cookie-notice='true'>Cookies</a> <a href='https://www.intel.com/content/www/us/en/privacy/intel-privacy-notice.html'>| Privacy</a> <a data-wap_ref='dns' id='wap_dns' href='https://www.intel.com/content/www/us/en/privacy/intel-cookie- notice.html'>| Do Not Share My Personal Information</a> </div><div>&copy; Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others. No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this document, with the sole exception that code included in this document is licensed subject to the Zero-Clause BSD open source license (OBSD), <a href='http://opensource.org/licenses/0BSD'>http://opensource.org/licenses/0BSD</a>. </div><br><div>oneTBB is licensed under Apache License Version 2.0. Refer to the <a href='https://github.com/oneapi-src/oneTBB/blob/master/LICENSE.txt'>LICENSE </a> file for the full license text and copyright notice.</div>"
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
html_context = {
'css_files': [
'_static/theme_overrides.css', # override wide tables in RTD theme
],
}
else:
html_js_files = ['custom.js']
html_theme_options = {
"logo": {
"text": "oneTBB Documentation",
}
}
html_logo = '_static/oneAPI-rgb-rev-100.png'
html_favicon = '_static/favicons.png'
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'sphinx-infodevdoc'
# -- Options for LaTeX output ------------------------------------------------
#latex_engine = 'xelatex'
#PDF_TITLE = 'Information Development Template'
#
#with open(PREAMBLE_FILE, 'r', encoding='utf-8') as f:
# PREAMBLE = f.read()
#
#with open(TITLE_PAGE_FILE, 'r', encoding='utf-8') as f:
# TITLE_PAGE = f.read().replace('<PDF_TITLE>', PDF_TITLE)
#
#
#latex_elements = {
# # The paper size ('letterpaper' or 'a4paper').
# #
# 'extraclassoptions': 'openany,oneside',
# 'babel' : '\\usepackage[english]{babel}',
# 'papersize': 'a4paper',
# 'releasename':" ",
# # Sonny, Lenny, Glenn, Conny, Rejne, Bjarne and Bjornstrup
# # 'fncychap': '\\usepackage[Lenny]{fncychap}',
# 'fncychap': '',
# #'fontpkg': '\\usepackage{amsmath,amsfonts,amssymb,amsthm}',
#
# 'figure_align':'htbp',
# # The font size ('10pt', '11pt' or '12pt').
# #
# 'pointsize': '12pt',
#
# # Additional stuff for the LaTeX preamble.
# #
# 'preamble': PREAMBLE,
#
# 'maketitle': TITLE_PAGE,
# # Latex figure (float) alignment
# #
# # 'figure_align': 'htbp',
# 'sphinxsetup': \
# 'hmargin={0.7in,0.7in}, vmargin={1in,1in}, \
# verbatimwithframe=true, \
# TitleColor={rgb}{0,0.686,0.941}, \
# HeaderFamily=\\rmfamily\\bfseries, \
# InnerLinkColor={rgb}{0,0.686,0.941}, \
# OuterLinkColor={rgb}{0,0.686,0.941}',
#
# 'tableofcontents':' '
#}
#
#latex_logo = '_latex/intel_logo.png'
## Grouping the document tree into LaTeX files. List of tuples
## (source start file, target name, title,
## author, documentclass [howto, manual, or own class]).
#latex_documents = [
# (master_doc, 'sphinx-infodev.tex', u'sphinx-infodev Documentation',
# u'Intel', 'manual'),
#]
#breathe_projects = { #todd-mod
# project: "../doxygen/xml"
#}
#breathe_default_project = project
# Setup the exhale extension
#exhale_args = { #todd-mod
# # These arguments are required
# "containmentFolder": "./api",
# "rootFileName": "library_root.rst",
# "rootFileTitle": "Library API",
# "doxygenStripFromPath": "..",
# "fullApiSubSectionTitle": 'Full API'
#}
# -- Options for manual page output ------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'sphinx-infodev', u'sphinx-infodev Documentation',
[author], 1)
]
# -- Options for Texinfo output ----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'sphinx-infodev', u'sphinx-infodev Documentation',
author, 'sphinx-infodev', 'One line description of project.',
'Miscellaneous'),
]
# -- Options for Epub output -------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = project
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''
# A unique identification for the text.
#
# epub_uid = ''
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
# -- Extension configuration -------------------------------------------------
# -- Options for intersphinx extension ---------------------------------------
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
# -- Options for todo extension ----------------------------------------------
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
-15
View File
@@ -1,15 +0,0 @@
|full_name|
===========
.. include:: index/index_intro.rst
The following are some important topics for the ``novice user``:
* :ref:`Get_Started_Guide` gives you a brief explanation of what oneTBB is.
* :ref:`Benefits` describes how |short_name| differs from typical threading packages.
* :ref:`Package_Contents` describes dynamic library files and header files for Windows*, Linux*, and macOS* operating systems used in |short_name|.
.. include:: index/useful_topics.rst
.. include:: index/toctree.rst
-5
View File
@@ -1,5 +0,0 @@
.. _index_intro:
This document contains information about |short_name|.
It is a flexible performance library that let you break computation into parallel running tasks.
-39
View File
@@ -1,39 +0,0 @@
.. _toctree:
.. toctree::
:caption: About
:maxdepth: 1
/main/intro/help_support
/main/intro/notation
/main/intro/intro_os
/main/intro/Benefits
/main/intro/testing_approach
/main/intro/limitations.rst
.. toctree::
:caption: Get Started
:maxdepth: 2
/GSG/get_started
/GSG/intro
/GSG/system_requirements
/GSG/installation
/GSG/next_steps
/GSG/integrate
/GSG/samples
.. toctree::
:maxdepth: 3
:caption: Developer Guide
/main/tbb_userguide/title
.. toctree::
:maxdepth: 3
:caption: Developer Reference
/main/reference/reference
-5
View File
@@ -1,5 +0,0 @@
.. _Usefull_Topics:
The following is an important topic for the ``experienced user``:
:ref:`Migration_Guide` describes how to migrate from TBB to oneTBB.
+3 -3
View File
@@ -7,9 +7,9 @@
var wapSection = "oneapi-tbb"; // WAP team will give you a unique section for your site
// Load TMS
(function () {
var url = 'https://www.intel.com/content/dam/www/global/wap/tms-loader.js'; // WAP file URL
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = url;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
var url = 'https://www.intel.com/content/dam/www/global/wap/tms-loader.js'; // WAP file URL
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = url;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
{% endblock %}
+5 -6
View File
@@ -25,7 +25,7 @@ BUILD_TYPE = os.getenv("BUILD_TYPE")
# -- Project information -----------------------------------------------------
if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
if BUILD_TYPE == 'oneapi':
project = u'Intel® oneAPI Threading Building Blocks (oneTBB)'
else:
project = u'oneAPI Threading Building Blocks (oneTBB)'
@@ -90,7 +90,7 @@ pygments_style = None
# Syntax highlighting for the :: directive
highlight_language = 'cpp'
if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
if BUILD_TYPE == 'oneapi':
rst_prolog = """
.. |full_name| replace:: Intel\ |reg|\ oneAPI Threading Building Blocks (oneTBB)
.. |short_name| replace:: oneTBB
@@ -120,7 +120,7 @@ else:
# further. For a list of options available for each theme, see the
# documentation.
#
if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
if BUILD_TYPE == 'oneapi':
html_theme = 'sphinx_rtd_theme'
else:
html_theme = 'sphinx_book_theme'
@@ -140,7 +140,7 @@ else:
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
if BUILD_TYPE == 'oneapi':
html_context = {
'css_files': [
'_static/theme_overrides.css', # override wide tables in RTD theme
@@ -149,8 +149,7 @@ if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
else:
html_js_files = ['custom.js']
html_logo = '_static/oneAPI-rgb-rev-100.png'
html_favicon = '_static/favicons.png'
html_favicon = '_static/favicons.png'
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
+18 -6
View File
@@ -1,6 +1,7 @@
|full_name|
===========
This document contains information about |full_name|.
|short_name| is a flexible performance library that can be found in the |base_tk|
or as a stand-alone product. More information and specifications can be found on the
@@ -12,17 +13,28 @@ For a list of available documentation downloads by product version, see these pa
* `Download Documentation for Intel Parallel Studio XE <https://software.intel.com/content/www/us/en/develop/articles/download-documentation-intel-parallel-studio-xe-current-previous.html>`_
* `Download Documentation for Intel System Studio <https://software.intel.com/content/www/us/en/develop/articles/download-documentation-intel-system-studio-current-previous.html>`_
The following are some important topics for the ``novice user``:
* `Get Started with oneTBB <https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-onetbb/top.html>`_ gives you a brief explanation of what oneTBB is.
* :ref:`Benefits` describes how |short_name| differs from typical threading packages.
* :ref:`Package_Contents` describes dynamic library files and header files for Windows*, Linux*, and macOS* operating systems used in |short_name|.
**Get Started with oneAPI Threading Building Blocks (oneTBB)**
`Get Started with oneTBB <https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-onetbb/top.html>`_ gives you a brief explanation of what oneTBB is.
**oneTBB Benefits**
:ref:`Benefits` describes how |short_name| differs from typical threading packages.
**Package Contents**
|short_name| includes dynamic library files and header files for Windows*, Linux*, and macOS*
operating systems as described in :ref:`Package_Contents`.
The following is an important topic for the ``experienced user``:
The following is important topic for the ``experienced user``:
**Migrating from Threading Building Blocks (TBB)**
Learn how to migrate from TBB to oneTBB with :ref:`Migration_Guide`.
:ref:`Migration_Guide` describes how to migrate from TBB to oneTBB.
.. toctree::
+1 -1
View File
@@ -20,7 +20,7 @@ it with any compiler supporting ISO C++. The library differs from
typical threading packages in the following ways:
- **oneTBB enables you to specify logical parallelism instead of
- **oneTBB enables you to specify logical paralleism instead of
threads**. Most threading packages require you to specify threads.
Programming directly in terms of threads can be tedious and lead to
inefficient programs, because threads are low-level, heavy constructs
+13 -2
View File
@@ -4,12 +4,23 @@ Getting Help and Support
========================
.. container:: section
.. rubric:: Getting Technical Support
:class: sectiontitle
For general information about oneTBB technical support, product
If you did not register your Intel® software product during
installation, please do so now at the Intel® Software Development
Products Registration Center. Registration entitles you to free
technical support, product updates and upgrades for the duration of
the support term.
For general information about Intel technical support, product
updates, user forums, FAQs, tips and tricks and other support
questions, go to `GitHub issues <https://github.com/oneapi-src/oneTBB/issues>`_.
questions, go to: http://www.intel.com/software/products/support/.
-35
View File
@@ -1,35 +0,0 @@
.. _intro:
Introduction
============
|full_name| is a library that supports scalable parallel programming using
standard ISO C++ code. It does not require special languages or
compilers. It is designed to promote scalable data parallel programming.
Additionally, it fully supports nested parallelism, so you can build
larger parallel components from smaller parallel components. To use the
library, you specify tasks, not threads, and let the library map tasks
onto threads in an efficient manner.
Many of the library interfaces employ generic programming, in which
interfaces are defined by requirements on types and not specific types.
The C++ Standard Template Library (STL) is an example of generic
programming. Generic programming enables oneTBB to be flexible yet
efficient. The generic interfaces enable you to customize components to
your specific needs.
.. note::
|full_name| requires C++11 standard compiler support.
The net result is that oneTBB enables you to specify parallelism far
more conveniently than using raw threads, and at the same time can
improve performance.
-46
View File
@@ -1,46 +0,0 @@
.. _limitations:
Known Limitations
*****************
This page outlines the known limitations of oneTBB to help you better understand its capabilities.
Freestanding Compilation Mode
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**Limitation:** oneTBB does not support the freestanding compilation mode.
**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.
Static Assert
^^^^^^^^^^^^^
**Limitation:** A static assert causes the compilation failures in oneTBB headers if the following conditions are satisfied:
* Compilation is done with Clang 12.0.0 or a more recent version.
* The LLVM standard library is employed, coupled with the use of the ``-ffreestanding`` flag and C++11/14 compiler options.
**Risk:** The compilation failures.
Interface Incompatibilities: TBB vs oneTBB
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**Limitation:** An application using Parallel STL algorithms in the ``libstdc++`` versions 9 and 10 may fail to compile due to incompatible interface changes between earlier versions of Threading Building Blocks (TBB) and oneAPI Threading Building Blocks (oneTBB).
**Solution:** Disable support for Parallel STL algorithms by defining ``PSTL_USE_PARALLEL_POLICIES`` (in libstdc++ 9) or ``_GLIBCXX_USE_TBB_PAR_BACKEND`` (in libstdc++ 10) macro to zero before inclusion of the first standard header file in each translation unit.
Incorrect Installation Location
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**Limitation:** On Linux* OS, if oneAPI Threading Building Blocks (oneTBB) or Threading Building Blocks (TBB) are installed in a system folder, such as ``/usr/lib64``, the application may fail to link due to the order in which the linker searches for libraries.
**Risk:** The issue does not affect the program execution.
**Solution:** Use the ``-L`` linker option to specify the correct location of oneTBB library.
``fork()`` Support
^^^^^^^^^^^^^^^^^^^
**Limitation:** oneTBB does not support ``fork()``.
**Solution:** To work-around the issue, consider using ``task_scheduler_handle`` to join oneTBB worker threads before using ``fork()``.
-31
View File
@@ -1,31 +0,0 @@
.. _testing_approach:
Testing Approach
================
There are four main types of errors/hazards you can encounter in the development of libraries for parallelism:
* Interface correspondence to specification
* Memory errors
* Data race
* Race conditions and deadlocks
|short_name| testing approach is designed to provide high coverage of these error types.
All types of errors are covered with unit testing and review.
Code coverage metrics are tracked to ensure high code coverage with tests. Uncovered branches are analyzed manually.
Memory errors and data races are additionally covered by special tools that include thread and memory sanitizers.
Race conditions and deadlocks are the most complicated errors.
They are covered by:
* **Unit tests** that, however, have limited capability to catch such errors
* **Integration tests**. Multiple different functionalities are heavily combined to emulate user use cases that may trigger such errors based on prior knowledge and expertise.
* **Stress testing with different possible combinations**. It ensures that even rarely triggered error conditions are caught by testing.
.. note:: Every fix is required to be covered by a test to guarantee the detection of such issues in the future.
Continuous Integration triggers all the tests on each commit. This ensures that:
* Issues are detected, starting from the early development phase and up to the moment of integration of changes into the library.
* The highest quality of the library is maintained even in such error-prone domains as parallelism.
@@ -1,72 +0,0 @@
.. _parallel_sort_ranges_extension:
parallel_sort ranges interface extension
========================================
.. contents::
:local:
:depth: 1
Description
***********
|full_name| implementation extends the `oneapi::tbb::parallel_sort specification <https://spec.oneapi.io/versions/latest/elements/oneTBB/source/algorithms/functions/parallel_sort_func.html>`_
with overloads that takes the container by forwarding reference.
API
***
Header
------
.. code:: cpp
#include <oneapi/tbb/parallel_sort.h>
Syntax
------
.. code:: cpp
namespace oneapi {
namespace tbb {
template <typename Container>
void parallel_sort( Container&& c );
template <typename Container, typename Compare>
void parallel_sort( Container&& c, const Compare& comp );
} // namespace tbb
} // namespace oneapi
Functions
---------
.. cpp:function:: template <typename Container> void parallel_sort( Container&& c );
Equivalent to ``parallel_sort( std::begin(c), std::end(c), comp )``, where `comp` uses `operator<` to determine relative orderings.
.. cpp:function:: template <typename Container, typename Compare> void parallel_sort( Container&& c, const Compare& comp );
Equivalent to ``parallel_sort( std::begin(c), std::end(c), comp )``.
Example
-------
This interface may be used for sorting rvalue or constant views:
.. code:: cpp
#include <array>
#include <span> // requires C++20
#include <oneapi/tbb/parallel_sort.h>
std::span<int> get_span() {
static std::array<int, 3> arr = {3, 2, 1};
return std::span<int>(arr);
}
int main() {
tbb::parallel_sort(get_span());
}
+9 -2
View File
@@ -16,9 +16,8 @@ It also describes features that are not included in the oneTBB specification.
.. toctree::
:titlesonly:
info_namespace
parallel_for_each_semantics
parallel_sort_ranges_extension
scalable_memory_pools/malloc_replacement_log
Preview features
****************
@@ -44,8 +43,16 @@ The key properties of a preview feature are:
:titlesonly:
type_specified_message_keys
blocking_terminate
scalable_memory_pools
helpers_for_expressing_graphs
concurrent_lru_cache_cls
constraints_extensions
info_namespace_extensions
task_group_extensions
task_arena_extensions
this_task_arena_extensions
mutex_cls
rw_mutex_cls
heterogeneous_extensions_chmap
custom_mutex_chmap
@@ -41,4 +41,3 @@ Here, ``P`` represents an instance of the memory pool class.
scalable_memory_pools/memory_pool_cls
scalable_memory_pools/fixed_pool_cls
scalable_memory_pools/memory_pool_allocator_cls
@@ -1,84 +0,0 @@
.. _malloc_replacement_log:
TBB_malloc_replacement_log Function
===================================
.. note:: This function is for Windows* OS only.
Summary
*******
Provides information about the status of dynamic memory allocation replacement.
Syntax
*******
::
extern "C" int TBB_malloc_replacement_log(char *** log_ptr);
Header
******
::
#include "oneapi/tbb/tbbmalloc_proxy.h"
Description
***********
Dynamic replacement of memory allocation functions on Windows* OS uses in-memory binary instrumentation techniques.
To make sure that such instrumentation is safe, oneTBB first searches for a subset of replaced functions in the Visual C++* runtime DLLs
and checks if each one has a known bytecode pattern. If any required function is not found or its bytecode pattern is unknown, the replacement is skipped,
and the program continues to use the standard memory allocation functions.
The ``TBB_malloc_replacement_log`` function allows the program to check if the dynamic memory replacement happens and to get a log of the performed checks.
**Returns:**
* 0, if all necessary functions are successfully found and the replacement takes place.
* 1, otherwise.
The ``log_ptr`` parameter must be an address of a char** variable or be ``NULL``. If it is not ``NULL``, the function writes there the address of an array of
NULL-terminated strings containing detailed information about the searched functions in the following format:
::
search_status: function_name (dll_name), byte pattern: <bytecodes>
For more information about the replacement of dynamic memory allocation functions, see :ref:`Windows_C_Dynamic_Memory_Interface_Replacement`.
Example
*******
::
#include "oneapi/tbb/tbbmalloc_proxy.h"
#include <stdio.h>
int main(){
char **func_replacement_log;
int func_replacement_status = TBB_malloc_replacement_log(&func_replacement_log);
if (func_replacement_status != 0) {
printf("tbbmalloc_proxy cannot replace memory allocation routines\n");
for (char** log_string = func_replacement_log; *log_string != 0; log_string++) {
printf("%s\n",*log_string);
}
}
return 0;
}
Example output:
::
tbbmalloc_proxy cannot replace memory allocation routines
Success: free (ucrtbase.dll), byte pattern: <C7442410000000008B4424>
Fail: _msize (ucrtbase.dll), byte pattern: <E90B000000CCCCCCCCCCCC>
@@ -0,0 +1,61 @@
.. _task_arena_extensions:
task_arena extensions
=====================
.. note::
To enable these extensions, set the ``TBB_PREVIEW_TASK_GROUP_EXTENSIONS`` macro to 1.
.. contents::
:local:
:depth: 1
Description
***********
|full_name| implementation extends the `tbb::task_arena specification <https://spec.oneapi.com/versions/latest/elements/oneTBB/source/task_scheduler/task_arena/task_arena_cls.html>`_
with an overload of ``enqueue`` method accepting ``task_handle``.
API
***
Header
------
.. code:: cpp
#include <oneapi/tbb/task_arena.h>
Synopsis
--------
.. code:: cpp
namespace oneapi {
namespace tbb {
class task_arena {
public:
void enqueue(task_handle&& h);
};
} // namespace tbb
} // namespace oneapi
Member Functions
----------------
.. cpp:function:: void enqueue(task_handle&& h)
Enqueues a task owned by ``h`` into the ``task_arena`` for procession.
Behavior of this function is identical to generic version (``template<typename F> void task_arena::enqueue(F&& f)``) except parameter type.
.. note::
``h`` should not be empty to avoid undefined behavior.
.. rubric:: See also
* `oneapi::tbb::task_arena specification <https://spec.oneapi.com/versions/latest/elements/oneTBB/source/task_scheduler/task_arena/task_arena_cls.html>`_
* :ref:`task_handle`
+31 -18
View File
@@ -13,7 +13,11 @@ task_group extensions
Description
***********
|full_name| implementation extends the `tbb::task_group specification <https://spec.oneapi.com/versions/latest/elements/oneTBB/source/task_scheduler/task_group/task_group_cls.html>`_ with the requirements for a user-provided function object.
|full_name| implementation extends the `tbb::task_group specification <https://spec.oneapi.com/versions/latest/elements/oneTBB/source/task_scheduler/task_group/task_group_cls.html>`_ with the following members:
- Constructor that takes a custom ``tbb::task_group_context`` object as an argument.
- Methods to create and run deferred tasks with ``task_handle``.
- Requirements for a user-provided function object.
API
@@ -36,16 +40,14 @@ Synopsis
class task_group {
public:
//only the requirements for the return type of function F are changed
task_group(task_group_context& context);
template<typename F>
task_handle defer(F&& f);
//only the requirements for the return type of function F are changed
template<typename F>
task_group_status run_and_wait(const F& f);
//only the requirements for the return type of function F are changed
void run(task_handle&& h);
//only F return type requirements have changed
template<typename F>
void run(F&& f);
};
@@ -53,26 +55,38 @@ Synopsis
} // namespace tbb
} // namespace oneapi
Member Functions
----------------
.. cpp:function:: task_group(task_group_context& context)
Constructs an empty ``task_group``, which tasks are associated with the ``context``.
.. cpp:function:: template<typename F> task_handle defer(F&& f)
As an optimization hint, ``F`` might return a ``task_handle``, which task object can be executed next.
Creates a deferred task to compute ``f()`` and returns ``task_handle`` pointing to it.
.. note::
The ``task_handle`` returned by the function must be created using ``*this`` ``task_group``. That is, the one for which the run method is called, otherwise it is undefined behavior.
The task is not scheduled for execution until explicitly requested. For example, with the ``task_group::run`` method.
However, the task is still added into the ``task_group``, thus the ``task_group::wait`` method waits until the ``task_handle`` is either scheduled or destroyed.
.. cpp:function:: template<typename F> task_group_status run_and_wait(const F& f)
The ``F`` type must meet the `Function Objects` requirements described in the [function.objects] section of the ISO C++ Standard.
As an optimization hint, ``F`` might return a ``task_handle``, which task object can be executed next.
.. note::
The ``task_handle`` returned by the function must be created using ``*this`` ``task_group``. That is, the one for which the run method is called, otherwise it is undefined behavior.
The ``task_handle`` returned by the function must be created with ``*this`` ``task_group``. It means, with the one for which run method is called, otherwise it is an undefined behavior.
**Returns:** ``task_handle`` object pointing to task to compute ``f()``.
.. cpp:function:: void run(task_handle&& h)
Schedules the task object pointed by the ``h`` for execution.
.. note::
The failure to satisfy the following conditions leads to undefined behavior:
* ``h`` is not empty.
* ``*this`` is the same ``task_group`` that ``h`` is created with.
.. cpp:function:: template<typename F> void run(F&& f)
As an optimization hint, ``F`` might return a ``task_handle``, which task object can be executed next.
@@ -85,5 +99,4 @@ As an optimization hint, ``F`` might return a ``task_handle``, which task object
* `oneapi::tbb::task_group specification <https://spec.oneapi.com/versions/latest/elements/oneTBB/source/task_scheduler/task_group/task_group_cls.html>`_
* `oneapi::tbb::task_group_context specification <https://spec.oneapi.com/versions/latest/elements/oneTBB/source/task_scheduler/scheduling_controls/task_group_context_cls.html>`_
* `oneapi::tbb::task_group_status specification <https://spec.oneapi.com/versions/latest/elements/oneTBB/source/task_scheduler/task_group/task_group_status_enum.html>`_
* `oneapi::tbb::task_handle class <https://oneapi-src.github.io/oneAPI-spec/spec/elements/oneTBB/source/task_scheduler/task_group/task_handle.html>`_
* :doc:`oneapi::tbb::task_handle class <task_group_extensions/task_handle>`
@@ -0,0 +1,101 @@
.. _task_handle:
task_handle
===========
.. note:: To enable these extensions, set the ``TBB_PREVIEW_TASK_GROUP_EXTENSIONS`` macro to 1.
.. contents::
:local:
:depth: 1
Description
***********
This class owns a deferred task object.
API
***
Header
------
.. code:: cpp
#include <oneapi/tbb/task_group.h>
Synopsis
--------
.. code:: cpp
namespace oneapi {
namespace tbb {
class task_handle {
public:
task_handle();
task_handle(task_handle&& src);
~task_handle();
task_handle& operator=(task_handle&& src);
explicit operator bool() const noexcept;
};
bool operator==(task_handle const& h, std::nullptr_t) noexcept;
bool operator==(std::nullptr_t, task_handle const& h) noexcept;
bool operator!=(task_handle const& h, std::nullptr_t) noexcept;
bool operator!=(std::nullptr_t, task_handle const& h) noexcept;
} // namespace tbb
} // namespace oneapi
Member Functions
----------------
.. cpp:function:: task_handle()
Creates an empty ``task_handle`` object.
.. cpp:function:: task_handle(task_handle&& src)
Constructs ``task_handle`` object with the content of ``src`` using move semantics. ``src`` is left in an empty state.
.. cpp:function:: ~task_handle()
Destroys the ``task_handle`` object and associated task if it exists.
.. cpp:function:: task_handle& operator=(task_handle&& src)
Replaces the content of ``task_handle`` object with the content of ``src`` using move semantics. ``src`` is left in an empty state.
The previously associated task object, if any, is destroyed before the assignment.
**Returns:** Reference to ``*this``.
.. cpp:function:: explicit operator bool() const noexcept
Checks if ``*this`` has an associated task object.
**Returns:** ``true`` if ``*this`` is not empty, ``false`` otherwise.
Non-Member Functions
--------------------
.. code:: cpp
bool operator==(task_handle const& h, std::nullptr_t) noexcept
bool operator==(std::nullptr_t, task_handle const& h) noexcept
**Returns**: ``true`` if ``h`` is empty, ``false`` otherwise.
.. code:: cpp
bool operator!=(task_handle const& h, std::nullptr_t) noexcept
bool operator!=(std::nullptr_t, task_handle const& h) noexcept
**Returns**: ``true`` if ``h`` is not empty, ``false`` otherwise.
@@ -0,0 +1,71 @@
.. _this_task_arena_extensions:
this_task_arena extensions
==========================
.. note::
To enable these extensions, set the ``TBB_PREVIEW_TASK_GROUP_EXTENSIONS`` macro to 1.
.. contents::
:local:
:depth: 1
Description
***********
|full_name| implementation extends the `tbb::this_task_arena specification <https://spec.oneapi.com/versions/latest/elements/oneTBB/source/task_scheduler/task_arena/this_task_arena_ns.html>`_
with an overloaded ``enqueue`` function.
API
***
Header
------
.. code:: cpp
#include <oneapi/tbb/task_arena.h>
Synopsis
--------
.. code:: cpp
namespace oneapi {
namespace tbb {
namespace this_task_arena {
void enqueue(task_handle&& h);
template<typename F>
void enqueue(F&& f) ;
} // namespace this_task_arena
} // namespace tbb
} // namespace oneapi
Member Functions
----------------
.. cpp:function:: template<typename F> void enqueue(F&& f)
Enqueues a task into the ``task_arena`` currently used by the calling thread to process the specified functor, then immediately returns.
The ``F`` type must meet the `Function Objects` requirements described in the [function.objects] section of the ISO C++ Standard.
Behavior of this function is identical to ``template<typename F> void task_arena::enqueue(F&& f)`` applied to ``task_arena`` object constructed with ``attach`` parameter.
.. cpp:function:: void enqueue(task_handle&& h)
Enqueues a task owned by ``h`` into the ``task_arena`` that is currently used by the calling thread.
Behavior of this function is identical to generic version (``template<typename F> void enqueue(F&& f)``) except the parameter type.
.. note::
``h`` should not be empty to avoid undefined behavior.
.. rubric:: See also:
* `oneapi::tbb::this_task_arena specification <https://spec.oneapi.com/versions/latest/elements/oneTBB/source/task_scheduler/task_arena/this_task_arena_ns.html>`_
* `oneapi::tbb::task_arena specification <https://spec.oneapi.com/versions/latest/elements/oneTBB/source/task_scheduler/task_arena/task_arena_cls.html>`_
* :ref:`task_handle`
@@ -4,13 +4,15 @@ Advanced Topic: Other Kinds of Iteration Spaces
===============================================
The examples so far have used the class ``blocked_range<T>`` to specify ranges.
This class is useful in many situations, but it does not fit every situation.
You can use |full_name| to define your own iteration space objects. The object
must specify how it can be split into subspaces by providing a basic splitting
constructor, an optional proportional splitting constructor, and two predicate
methods. If your class is called ``R``, the methods and constructors should be
as follows:
The examples so far have used the class ``blocked_range<T>`` to specify
ranges. This class is useful in many situations, but it does not fit
every situation. You can use |full_name|
to define your own iteration space objects. The object must specify how
it can be split into subspaces by providing a basic splitting
constructor, an optional proportional splitting constructor (accompanied
with a trait value that enables its usage), and two predicate methods.
If your class is called ``R``, the methods and constructors should be as
follows:
::
@@ -23,8 +25,10 @@ as follows:
bool is_divisible() const;
// Splits r into subranges r and *this
R( R& r, split );
// (optional) Splits r into subranges r and *this in proportion p
// Splits r into subranges r and *this in proportion p
R( R& r, proportional_split p );
// Allows usage of proportional splitting constructor
static const bool is_splittable_in_proportion = true;
...
};
@@ -56,7 +60,9 @@ constructor is optional and takes the second argument of type
that return the values of the proportion. These values should be used to
split ``r`` accordingly, so that the updated ``r`` corresponds to the
left part of the proportion, and the constructed object corresponds to
the right part.
the right part. The proportional splitting constructor will be used only
if the static constant ``is_splittable_in_proportion`` is defined in the
class and assigned the value of ``true``.
Both splitting constructors should guarantee that the updated ``r`` part
@@ -1,107 +0,0 @@
.. _Bandwidth_and_Cache_Affinity:
Bandwidth and Cache Affinity
============================
For a sufficiently simple function ``Foo``, the examples might not show
good speedup when written as parallel loops. The cause could be
insufficient system bandwidth between the processors and memory. In that
case, you may have to rethink your algorithm to take better advantage of
cache. Restructuring to better utilize the cache usually benefits the
parallel program as well as the serial program.
An alternative to restructuring that works in some cases is
``affinity_partitioner.`` It not only automatically chooses the
grainsize, but also optimizes for cache affinity and tries to distribute
the data uniformly among threads. Using ``affinity_partitioner`` can
significantly improve performance when:
- The computation does a few operations per data access.
- The data acted upon by the loop fits in cache.
- The loop, or a similar loop, is re-executed over the same data.
- There are more than two hardware threads available (and especially if
the number of threads is not a power of two). If only two threads are
available, the default scheduling in |full_name|
usually provides sufficient cache affinity.
The following code shows how to use ``affinity_partitioner``.
::
#include "oneapi/tbb.h"
 
void ParallelApplyFoo( float a[], size_t n ) {
static affinity_partitioner ap;
parallel_for(blocked_range<size_t>(0,n), ApplyFoo(a), ap);
}
 
void TimeStepFoo( float a[], size_t n, int steps ) {
for( int t=0; t<steps; ++t )
ParallelApplyFoo( a, n );
}
In the example, the ``affinity_partitioner`` object ``ap`` lives between
loop iterations. It remembers where iterations of the loop ran, so that
each iteration can be handed to the same thread that executed it before.
The example code gets the lifetime of the partitioner right by declaring
the ``affinity_partitioner`` as a local static object. Another approach
would be to declare it at a scope outside the iterative loop in
``TimeStepFoo``, and hand it down the call chain to ``parallel_for``.
If the data does not fit across the system’s caches, there may be little
benefit. The following figure shows the situations.
.. container:: fignone
:name: fig3
Benefit of Affinity Determined by Relative Size of Data Set and Cache
|image0|
The next figure shows how parallel speedup might vary with the size of a
data set. The computation for the example is ``A[i]+=B[i]`` for ``i`` in
the range [0,N). It was chosen for dramatic effect. You are unlikely to
see quite this much variation in your code. The graph shows not much
improvement at the extremes. For small N, parallel scheduling overhead
dominates, resulting in little speedup. For large N, the data set is too
large to be carried in cache between loop invocations. The peak in the
middle is the sweet spot for affinity. Hence ``affinity_partitioner``
should be considered a tool, not a cure-all, when there is a low ratio
of computations to memory accesses.
.. container:: fignone
:name: fig4
Improvement from Affinity Dependent on Array Size
|image1|
.. |image0| image:: Images/image007.jpg
:width: 453px
:height: 178px
.. |image1| image:: Images/image008.jpg
:width: 551px
:height: 192px
@@ -1,170 +0,0 @@
.. _Controlling_Chunking:
Controlling Chunking
====================
Chunking is controlled by a *partitioner* and a *grainsize.*\ To gain
the most control over chunking, you specify both.
- Specify ``simple_partitioner()`` as the third argument to
``parallel_for``. Doing so turns off automatic chunking.
- Specify the grainsize when constructing the range. The thread
argument form of the constructor is
``blocked_range<T>(begin,end,grainsize)``. The default value of
``grainsize`` is 1. It is in units of loop iterations per chunk.
If the chunks are too small, the overhead may exceed the performance
advantage.
The following code is the last example from parallel_for, modified to
use an explicit grainsize ``G``.
::
#include "oneapi/tbb.h"
 
void ParallelApplyFoo( float a[], size_t n ) {
parallel_for(blocked_range<size_t>(0,n,G), ApplyFoo(a),
simple_partitioner());
}
The grainsize sets a minimum threshold for parallelization. The
``parallel_for`` in the example invokes ``ApplyFoo::operator()`` on
chunks, possibly of different sizes. Let *chunksize* be the number of
iterations in a chunk. Using ``simple_partitioner`` guarantees that
[G/2] <= *chunksize* <= G.
There is also an intermediate level of control where you specify the
grainsize for the range, but use an ``auto_partitioner`` and
``affinity_partitioner``. An ``auto_partitioner`` is the default
partitioner. Both partitioners implement the automatic grainsize
heuristic described in :ref:`Automatic_Chunking`. An
``affinity_partitioner`` implies an additional hint, as explained later
in Section :ref:`Bandwidth_and_Cache_Affinity`. Though these partitioners
may cause chunks to have more than G iterations, they never generate
chunks with less than [G/2] iterations. Specifying a range with an
explicit grainsize may occasionally be useful to prevent these
partitioners from generating wastefully small chunks if their heuristics
fail.
Because of the impact of grainsize on parallel loops, it is worth
reading the following material even if you rely on ``auto_partitioner``
and ``affinity_partitioner`` to choose the grainsize automatically.
.. container:: tablenoborder
.. list-table::
:header-rows: 1
* - |image0|
- |image1|
* - Case A
- Case B
The above figure illustrates the impact of grainsize by showing the
useful work as the gray area inside a brown border that represents
overhead. Both Case A and Case B have the same total gray area. Case A
shows how too small a grainsize leads to a relatively high proportion of
overhead. Case B shows how a large grainsize reduces this proportion, at
the cost of reducing potential parallelism. The overhead as a fraction
of useful work depends upon the grainsize, not on the number of grains.
Consider this relationship and not the total number of iterations or
number of processors when setting a grainsize.
A rule of thumb is that ``grainsize`` iterations of ``operator()``
should take at least 100,000 clock cycles to execute. For example, if a
single iteration takes 100 clocks, then the ``grainsize`` needs to be at
least 1000 iterations. When in doubt, do the following experiment:
#. Set the ``grainsize`` parameter higher than necessary. The grainsize
is specified in units of loop iterations. If you have no idea of how
many clock cycles an iteration might take, start with
``grainsize``\ =100,000. The rationale is that each iteration
normally requires at least one clock per iteration. In most cases,
step 3 will guide you to a much smaller value.
#. Run your algorithm.
#. Iteratively halve the ``grainsize`` parameter and see how much the
algorithm slows down or speeds up as the value decreases.
A drawback of setting a grainsize too high is that it can reduce
parallelism. For example, if the grainsize is 1000 and the loop has 2000
iterations, the ``parallel_for`` distributes the loop across only two
processors, even if more are available. However, if you are unsure, err
on the side of being a little too high instead of a little too low,
because too low a value hurts serial performance, which in turns hurts
parallel performance if there is other parallelism available higher up
in the call tree.
.. tip::
You do not have to set the grainsize too precisely.
The next figure shows the typical "bathtub curve" for execution time
versus grainsize, based on the floating point ``a[i]=b[i]*c``
computation over a million indices. There is little work per iteration.
The times were collected on a four-socket machine with eight hardware
threads.
.. container:: fignone
:name: fig2
Wall Clock Time Versus Grainsize
|image2|
The scale is logarithmic. The downward slope on the left side indicates
that with a grainsize of one, most of the overhead is parallel
scheduling overhead, not useful work. An increase in grainsize brings a
proportional decrease in parallel overhead. Then the curve flattens out
because the parallel overhead becomes insignificant for a sufficiently
large grainsize. At the end on the right, the curve turns up because the
chunks are so large that there are fewer chunks than available hardware
threads. Notice that a grainsize over the wide range 100-100,000 works
quite well.
.. tip::
A general rule of thumb for parallelizing loop nests is to
parallelize the outermost one possible. The reason is that each
iteration of an outer loop is likely to provide a bigger grain of
work than an iteration of an inner loop.
.. |image0| image:: Images/image002.jpg
:width: 161px
:height: 163px
.. |image1| image:: Images/image004.jpg
:width: 157px
:height: 144px
.. |image2| image:: Images/image006.jpg
:width: 462px
:height: 193px
+2 -1
View File
@@ -191,7 +191,8 @@ This final implementation has all of the nodes and edges from the
much advantage in using an ``input_node`` over an explicit loop. But,
because an ``input_node`` is able to react to the behavior of downstream
nodes, it can limit memory use in more complex graphs. For more
information, see:ref:`create_token_based_system` .
information, see `Creating a Token-Based
System <create_token_based_system.html#create_token_based_system>`__
.. |image0| image:: Images/flow_graph.jpg
+2 -2
View File
@@ -37,8 +37,8 @@ it and then connect that to the first node with an edge.
g.wait_for_all();
Now there are two ``function_node`` ``s``, ``n`` and ``m``. The call to ``make_edge`` creates
an edge from ``n`` to ``m``. The node ``n`` is created with unlimited concurrency,
Now there are two ``function_node``s, ``n`` and ``m``. The call to ``make_edge`` creates
an edge from ``n`` to ``m``. The node n is created with unlimited concurrency,
while ``m`` has a concurrency limit of 1. The invocations of ``n`` can all
proceed in parallel, while the invocations of ``m`` will be serialized.
Because there is an edge from ``n`` to ``m``, each value ``v``, returned by ``n``, will
@@ -1,60 +0,0 @@
.. _Floating_Point_Settings:
Floating-point Settings
=======================
To propagate CPU-specific settings for floating-point computations to tasks executed by the task scheduler, you can use one of the following two methods:
* When a ``task_arena`` or a task scheduler for a given application thread is initialized, they capture the current floating-point settings of the thread.
* The ``task_group_context`` class has a method to capture the current floating-point settings.
By default, worker threads use floating-point settings obtained during the initialization of a ``task_arena`` or the implicit arena of the application thread. The settings are applied to all computations within that ``task_arena`` or started by that application thread.
For better control over floating point behavior, a thread may capture the current settings in a task group context. Do it at context creation with a special flag passed to the constructor:
::
task_group_context ctx( task_group_context::isolated,
task_group_context::default_traits | task_group_context::fp_settings );
Or call the ``capture_fp_settings`` method:
::
task_group_context ctx;
ctx.capture_fp_settings();
You can then pass the task group context to most parallel algorithms, including ``flow::graph``, to ensure that all tasks related to this algorithm use the specified floating-point settings.
It is possible to execute the parallel algorithms with different floating-point settings captured to separate contexts, even at the same time.
Floating-point settings captured to a task group context prevail over the settings captured during task scheduler initialization. It means, if a context is passed to a parallel algorithm, the floating-point settings captured to the context are used.
Otherwise, if floating-point settings are not captured to the context, or a context is not explicitly specified, the settings captured during the task arena initialization are used.
In a nested call to a parallel algorithm that does not use the context of a task group with explicitly captured floating-point settings, the outer-level settings are used.
If none of the outer-level contexts capture floating-point settings, the settings captured during task arena initialization are used.
It guarantees that:
* Floating-point settings are applied to all tasks executed within a task arena, if they are captured:
* To a task group context.
* During the arena initialization.
* A call to a oneTBB parallel algorithm does not change the floating-point settings of the calling thread, even if the algorithm uses different settings.
.. note::
The guarantees above apply only to the following conditions:
* A user code inside a task should:
* Not change the floating-point settings.
* Revert any modifications.
* Restore previous settings before the end of the task.
* oneTBB task scheduler observers are not used to set or modify floating point settings.
Otherwise, the stated guarantees are not valid and the behavior related to floating-point settings is undefined.
@@ -1,17 +0,0 @@
.. _Flow_Graph_exception_tips:
Flow Graph Tips for Exception Handling and Cancellation
=======================================================
The execution of a flow graph can be canceled directly or as a result of
an exception that propagates beyond a node's body. You can then
optionally reset the graph so that it can be re-executed.
.. toctree::
:maxdepth: 4
../tbb_userguide/catching_exceptions
../tbb_userguide/cancel_a_graph
../tbb_userguide/use_graph_reset
../tbb_userguide/cancelling_nested_parallelism
@@ -1,11 +0,0 @@
.. _Flow_Graph_waiting_tips:
Flow Graph Tips for Waiting for and Destroying a Flow Graph
===========================================================
.. toctree::
:maxdepth: 4
../tbb_userguide/always_use_wait_for_all
../tbb_userguide/avoid_dynamic_node_removal
../tbb_userguide/destroy_graphs_outside_main_thread
@@ -63,7 +63,7 @@ messages and do not support ``try_get()`` or ``try_reserve()``.
broadcast_node<int> bn(g);
buffer_node<int> buf1(g);
buffer_node<int> buf2(g);
typedef join_node<tuple<int,int>, reserving> join_type;
typedef join_node<tuple<int,int> reserving> join_type;
join_type jn(g);
buffer_node<join_type::output_type> buf_out(g);
join_type::output_type tuple_out;
@@ -71,9 +71,9 @@ messages and do not support ``try_get()`` or ``try_reserve()``.
// join_node predecessors are both reservable buffer_nodes
make_edge(buf1,input_port<0>(jn));
make_edge(bn,input_port<0>(jn)); // attach a broadcast_node
make_edge(buf2,input_port<1>(jn));
make_edge(buf1,input_port<0>jn));
make_edge(bn,input_port<0>jn)); // attach a broadcast_node
make_edge(buf2,input_port<1>jn));
make_edge(jn, buf_out);
bn.try_put(2);
buf1.try_put(3);
@@ -81,7 +81,7 @@ messages and do not support ``try_get()`` or ``try_reserve()``.
buf2.try_put(7);
g.wait_for_all();
while (buf_out.try_get(tuple_out)) {
printf("join_node output == (%d,%d)\n",get<0>(tuple_out), get<1>(tuple_out) );
printf("join_node output == (%d,%d)\n",get<0>tuple_out), get<1>tuple_out) );
}
if(buf1.try_get(icnt)) printf("buf1 had %d\n", icnt);
else printf("buf1 was empty\n");
+2 -2
View File
@@ -6,8 +6,8 @@ Flow Graph Tips and Tricks
.. toctree::
:maxdepth: 4
../tbb_userguide/Flow-Graph-waiting-tips
../tbb_userguide/Flow_Graph_waiting_tips
../tbb_userguide/Flow_Graph_making_edges_tips
../tbb_userguide/Flow_Graph_nested_parallelism_tips
../tbb_userguide/Flow_Graph_resource_tips
../tbb_userguide/Flow-Graph-exception-tips
../tbb_userguide/Flow_Graph_exception_tips
@@ -14,5 +14,4 @@ in a flow graph.
../tbb_userguide/use_limiter_node
../tbb_userguide/use_concurrency_limits
../tbb_userguide/create_token_based_system
../tbb_userguide/attach_flow_graph_to_arena
../tbb_userguide/create_token_based_system
-7
View File
@@ -25,10 +25,3 @@ or edges, and therefore no tasks are spawned.
graph g;
g.wait_for_all();
The graph object does not own the nodes associated with it. You need to make sure that the graph object's lifetime is longer than the lifetimes of all nodes added to the graph and any activity associated with the graph.
.. tip:: Call ``wait_for_all`` on a graph object before destroying it to make sure all activities are complete.
Even when using smart pointers, be aware of the order of destruction for nodes and the graph to make sure that nodes are not deleted before the graph.
@@ -61,9 +61,8 @@ assign a NUMA node identifier to the ``task_arena::constraints::numa_id`` field.
The processors with `Intel® Hybrid Technology <https://www.intel.com/content/www/us/en/products/docs/processors/core/core-processors-with-hybrid-technology-brief.html>`_
contain several core types, each is suited for different purposes.
In most cases, systems with hybrid CPU architecture show reasonable performance without involving additional API calls.
However, in some exceptional scenarios, performance may be tuned by setting the preferred core type.
To set the preferred core type for the execution, assign a specific core type identifier to the ``task_arena::constraints::core_type`` field.
For example, some applications may improve their performance by preferring execution on the most performant cores.
To set execution preference, assign specific core type identifier to the ``task_arena::constraints::core_type`` field.
The example shows how to set the most performant core type as preferable for work execution:
@@ -1,50 +0,0 @@
.. _How_Task_Scheduler_Works.rst:
How Task Scheduler Works
========================
While the task scheduler is not bound to any particular type of parallelism,
it was designed to work efficiently for fork-join parallelism with lots of forks.
This type of parallelism is typical for parallel algorithms such as `oneapi::tbb::parallel_for
<https://spec.oneapi.io/versions/latest/elements/oneTBB/source/algorithms/functions/parallel_for_func.html>`_.
Let's consider the mapping of fork-join parallelism on the task scheduler in more detail.
The scheduler runs tasks in a way that tries to achieve several targets simultaneously:
- Enable as many threads as possible, by creating enough job, to achieve actual parallelism
- Preserve data locality to make a single thread execution more efficient
- Minimize both memory demands and cross-thread communication to reduce an overhead
To achieve this, a balance between depth-first and breadth-first execution strategies
must be reached. Assuming that the task graph is finite, depth-first is better for
a sequential execution because:
- **Strike when the cache is hot**. The deepest tasks are the most recently created tasks and therefore are the hottest in the cache.
Also, if they can be completed, tasks that depend on it can continue executing, and though not the hottest in a cache,
they are still warmer than the older tasks deeper in the dequeue.
- **Minimize space**. Execution of the shallowest task leads to the breadth-first unfolding of a graph. It creates an exponential
number of nodes that co-exist simultaneously. In contrast, depth-first execution creates the same number
of nodes, but only a linear number can exists at the same time, since it creates a stack of other ready
tasks.
Each thread has its deque of tasks that are ready to run. When a
thread spawns a task, it pushes it onto the bottom of its deque.
When a thread participates in the evaluation of tasks, it constantly executes
a task obtained by the first rule that applies from the roughly equivalent ruleset:
- Get the task returned by the previous one, if any.
- Take a task from the bottom of its deque, if any.
- Steal a task from the top of another randomly chosen deque. If the
selected deque is empty, the thread tries again to execute this rule until it succeeds.
Rule 1 is described in :doc:`Task Scheduler Bypass <Task_Scheduler_Bypass>`.
The overall effect of rule 2 is to execute the *youngest* task spawned by the thread,
which causes the depth-first execution until the thread runs out of work.
Then rule 3 applies. It steals the *oldest* task spawned by another thread,
which causes temporary breadth-first execution that converts potential parallelism
into actual parallelism.
+1 -1
View File
@@ -68,4 +68,4 @@ redirect the standard routines to these functions.
../tbb_userguide/Which_Dynamic_Libraries_to_Use
../tbb_userguide/Allocator_Configuration
../tbb_userguide/automatically-replacing-malloc
../tbb_userguide/Automically_Replacing_malloc
@@ -46,4 +46,3 @@ TBB possible output:
TBB: RML private
TBB: Tools support disabled
.. note:: The ``tbbmalloc`` library in oneTBB is fully binary compatible with TBB.

Some files were not shown because too many files have changed in this diff Show More