Skip to content

Commit 003b086

Browse files
committed
Commit oneTBB source code 2539ba6
1 parent 9afd759 commit 003b086

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+845
-547
lines changed

.bazelversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.0.0
1+
7.1.1

.github/CODEOWNERS

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Lines starting with '#' are comments.
2+
# Each line is a file pattern followed by one or more owners.
3+
4+
# More details are here: https://help.github.com/articles/about-codeowners/
5+
6+
src/tbbmalloc @ldorau @lplewa @kfilipek
7+
src/tbbmalloc_proxy @ldorau @lplewa @kfilipek

.github/workflows/ci.yml

+32-5
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ jobs:
8282

8383
pages:
8484
if: ${{ github.ref == 'refs/heads/master' }}
85+
permissions:
86+
contents: write
87+
pages: write
88+
id-token: write
8589
runs-on: ubuntu-latest
8690
needs: [documentation]
8791
steps:
@@ -142,7 +146,7 @@ jobs:
142146
ctest -R python_test --output-on-failure --timeout ${TEST_TIMEOUT}
143147
144148
linux-testing:
145-
name: ${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }}
149+
name: ${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }}${{ matrix.cmake_static }}
146150
runs-on: ['${{ matrix.os }}']
147151
timeout-minutes: 45
148152
strategy:
@@ -167,20 +171,27 @@ jobs:
167171
std: 20
168172
build_type: debug
169173
preview: 'ON'
174+
- os: ubuntu-22.04
175+
c_compiler: gcc-11
176+
cxx_compiler: g++-11
177+
std: 20
178+
build_type: release
179+
preview: 'ON'
180+
cmake_static: -DBUILD_SHARED_LIBS=OFF
170181
steps:
171182
- uses: actions/checkout@v2
172183
- name: Run testing
173184
shell: bash
174185
run: |
175186
set -x
176187
mkdir build && cd build
177-
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
188+
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.cmake_static }} \
178189
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} ..
179190
make VERBOSE=1 -j${BUILD_CONCURRENCY}
180191
ctest --timeout ${TEST_TIMEOUT} --output-on-failure
181192
182193
macos-testing:
183-
name: ${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }}
194+
name: ${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }}${{ matrix.cmake_static }}
184195
runs-on: ['${{ matrix.os }}']
185196
timeout-minutes: 45
186197
strategy:
@@ -193,14 +204,21 @@ jobs:
193204
std: 14
194205
build_type: relwithdebinfo
195206
preview: 'ON'
207+
- os: macos-13
208+
c_compiler: clang
209+
cxx_compiler: clang++
210+
std: 20
211+
build_type: release
212+
preview: 'ON'
213+
cmake_static: -DBUILD_SHARED_LIBS=OFF
196214
steps:
197215
- uses: actions/checkout@v2
198216
- name: Run testing
199217
shell: bash
200218
run: |
201219
set -x
202220
mkdir build && cd build
203-
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
221+
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.cmake_static }} \
204222
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} ..
205223
make VERBOSE=1 -j${MACOS_BUILD_CONCURRENCY}
206224
ctest --timeout ${TEST_TIMEOUT} --output-on-failure
@@ -221,6 +239,15 @@ jobs:
221239
build_type: relwithdebinfo
222240
preview: 'ON'
223241
job_name: windows_cl2019_cxx14_relwithdebinfo_preview=ON
242+
- os: windows-2019
243+
generator: Visual Studio 16 2019
244+
c_compiler: cl
245+
cxx_compiler: cl
246+
std: 20
247+
build_type: release
248+
preview: 'ON'
249+
job_name: windows_cl2019_cxx20_release_preview=ON-DBUILD_SHARED_LIBS=OFF
250+
cmake_static: -DBUILD_SHARED_LIBS=OFF
224251
- os: windows-2022
225252
generator: Visual Studio 17 2022
226253
c_compiler: cl
@@ -235,7 +262,7 @@ jobs:
235262
run: |
236263
mkdir build
237264
cd build
238-
cmake -G "${{ matrix.generator }}" -A x64 -DCMAKE_CXX_STANDARD=${{ matrix.std }} `
265+
cmake -G "${{ matrix.generator }}" -A x64 -DCMAKE_CXX_STANDARD=${{ matrix.std }} ${{ matrix.cmake_static }} `
239266
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} `
240267
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} ..
241268
cmake --build . --config ${{ matrix.build_type }} -j -v

.github/workflows/issue_labeler.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2023 Intel Corporation
1+
# Copyright (c) 2023-2024 Intel Corporation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -19,6 +19,8 @@ on:
1919
pull_request:
2020
types: [opened, edited]
2121

22+
permissions: read-all
23+
2224
jobs:
2325
triage:
2426
runs-on: ubuntu-latest

.github/workflows/labeler.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2023 Intel Corporation
1+
# Copyright (c) 2023-2024 Intel Corporation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -15,6 +15,8 @@ name: "Pull Request Labeler"
1515
on:
1616
- pull_request_target
1717

18+
permissions: read-all
19+
1820
jobs:
1921
triage:
2022
permissions:

BUILD.bazel

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021-2022 Intel Corporation
1+
# Copyright (c) 2021-2024 Intel Corporation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -116,3 +116,16 @@ cc_library(
116116
":tbbmalloc",
117117
],
118118
)
119+
120+
cc_test(
121+
name = "test_task",
122+
srcs = [
123+
"test/tbb/test_task.cpp",
124+
] + glob([
125+
"test/common/*.h",
126+
]),
127+
includes = ["test"],
128+
deps = [
129+
":tbb",
130+
],
131+
)

CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ option(TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH "Disable HWLOC automatic search by pkg
107107
option(TBB_ENABLE_IPO "Enable Interprocedural Optimization (IPO) during the compilation" ON)
108108
option(TBB_FUZZ_TESTING "Enable fuzz testing" OFF)
109109
option(TBB_INSTALL "Enable installation" ON)
110+
if(APPLE)
111+
option(TBB_BUILD_APPLE_FRAMEWORKS "Build as Apple Frameworks" OFF)
112+
endif()
110113

111114
if (NOT DEFINED BUILD_SHARED_LIBS)
112115
set(BUILD_SHARED_LIBS ON)
@@ -230,7 +233,7 @@ else()
230233
message(WARNING "TBB compiler settings not found ${TBB_COMPILER_SETTINGS_FILE}")
231234
endif()
232235

233-
if (TBB_FIND_PACKAGE OR TBB_DIR)
236+
if (TBB_FIND_PACKAGE AND TBB_DIR)
234237
# Allow specifying external TBB to test with.
235238
# Do not add main targets and installation instructions in that case.
236239
message(STATUS "Using external TBB for testing")

MODULE.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ module(
2121
compatibility_level = 1,
2222
)
2323

24-
bazel_dep(name = "platforms", version = "0.0.8")
24+
bazel_dep(name = "platforms", version = "0.0.9")

RELEASE_NOTES.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,17 @@ This document contains changes of oneTBB compared to the last release.
2626
- 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.
2727
- 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.
2828
- 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.
29-
- 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).
30-
- Using ``TBBConfig.cmake`` in 32-bit environment may cause incorrect linkage with 64-bit oneTBB library. As a workaround, set ``CMAKE_PREFIX_PATH``:
31-
- On Linux* OS: to ``TBBROOT/lib32/``
32-
- On Windows* OS: to ``TBBROOT/lib32/;TBBROOT/bin32/``
29+
- 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.
30+
- When CPU resource coordination is enabled, tasks from a lower-priority ``task_arena`` might be executed before tasks from a higher-priority ``task_arena``.
3331

3432
> **_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).
3533
3634

3735
## :hammer: Fixed Issues
38-
- Fixed ``tbb::this_task_arena()`` behavior for specific ``tbb::task_arena{1,0}``.
39-
- Restored performance on systems with a high number of CPU cores that support ``_tpause``.
36+
- Fixed ``parallel_for_each`` algorithm behavior for iterators defining ``iterator_concept`` trait instead of ``iterator_category``.
37+
- Fixed the redefinition issue for ``std::min`` and ``std::max`` on Windows* OS ([GitHub* #832](https://github.com/oneapi-src/oneTBB/issues/832)).
38+
- Fixed the incorrect binary search order in ``TBBConfig.cmake``.
39+
- Enabled the oneTBB library search using the pkg-config tool in Conda packages.
40+
41+
## :octocat: Open-source Contributions Integrated
42+
- Fixed the compiler warning for missing virtual destructor. Contributed by Elias Engelbert Plank (https://github.com/oneapi-src/oneTBB/pull/1215).

SECURITY.md

+64-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,66 @@
11
# Security Policy
2-
Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution,
3-
impact, severity and mitigation.
2+
As an open-source project, we understand the importance of and responsibility
3+
for security. This Security Policy outlines our guidelines and procedures to
4+
ensure the highest level of security and trust for oneTBB users.
45

5-
## Reporting a Vulnerability
6-
Please report any security vulnerabilities in this project
7-
[utilizing the guidelines here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html).
6+
## Supported Versions
7+
Security vulnerabilities are fixed in the [latest version][1]
8+
and delivered as a patch release. We don't guarantee security fixes to be
9+
back-ported to older oneTBB versions.
10+
11+
## Report a Vulnerability
12+
We are very grateful to the security researchers and users that report back
13+
security vulnerabilities. We investigate every report thoroughly.
14+
We strongly encourage you to report security vulnerabilities to us privately,
15+
before disclosing them on public forums or opening a public GitHub* issue.
16+
17+
Report a vulnerability to us in one of two ways:
18+
* Open a draft **[GitHub* Security Advisory][2]**
19+
* Send an e-mail to: **[email protected]**.
20+
Along with the report, provide the following info:
21+
* A descriptive title.
22+
* Your name and affiliation (if any).
23+
* A description of the technical details of the vulnerabilities.
24+
* A minimal example of the vulnerability so we can reproduce your findings.
25+
* An explanation of who can exploit this vulnerability, and what they gain
26+
doing so.
27+
* Whether this vulnerability is public or known to third parties. If it is,
28+
provide details.
29+
30+
### When Should I Report a Vulnerability?
31+
* You think you discovered a potential security vulnerability in oneTBB.
32+
* You are unsure how the potential vulnerability affects oneTBB.
33+
* You think you discovered a vulnerability in another project or 3rd party
34+
component on which oneTBB depends. If the issue is not fixed in the 3rd party
35+
component, try to report directly there first.
36+
37+
### When Should I NOT Report a Vulnerability?
38+
* You got an automated scan hit and are unable to provide details.
39+
* You need help using oneTBB for security.
40+
* You need help applying security-related updates.
41+
* Your issue is not security-related.
42+
43+
## Security Reports Review Process
44+
We aim to respond quickly to your inquiry and coordinate a fix and
45+
disclosure with you. All confirmed security vulnerabilities will be addressed
46+
according to severity level and impact on oneTBB. Normally, security issues
47+
are fixed in the next planned release.
48+
49+
## Disclosure Policy
50+
We will publish security advisories using the
51+
[**GitHub Security Advisories feature**][3]
52+
to keep our community well-informed, and will credit you for your findings
53+
unless you prefer to stay anonymous. We request that you refrain from
54+
exploiting the vulnerability or making it public before the official disclosure.
55+
56+
We will disclose the vulnerabilities and bugs as soon as possible once
57+
mitigation is implemented and available.
58+
59+
## Feedback on This Policy
60+
If you have any suggestions on how this Policy could be improved, submit
61+
an issue or a pull request to this repository. **Do not** report
62+
potential vulnerabilities or security flaws via a pull request.
63+
64+
[1]: https://github.com/oneapi-src/oneTBB/releases/latest
65+
[2]: https://github.com/oneapi-src/oneTBB/security/advisories/new
66+
[3]: https://github.com/oneapi-src/oneTBB/security/advisories

WORKSPACE.bazel

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021 Intel Corporation
1+
# Copyright (c) 2021-2024 Intel Corporation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -16,4 +16,4 @@
1616
# use Bazel internally. The Bazel build can have security risks or
1717
# optimization gaps.
1818

19-
workspace(name = "oneTBB")
19+
# WORKSPACE marker file needed by Bazel

cmake/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ TBB_INSTALL_VARS:BOOL - Enable auto-generated vars installation(packages generat
1919
TBB_VALGRIND_MEMCHECK:BOOL - Enable scan for memory leaks using Valgrind (OFF by default)
2020
TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH - Disable HWLOC automatic search by pkg-config tool (OFF by default)
2121
TBB_ENABLE_IPO - Enable Interprocedural Optimization (IPO) during the compilation (ON by default)
22+
TBB_BUILD_APPLE_FRAMEWORKS - Enable the Apple* frameworks instead of dylibs, only available on the Apple platform. (OFF by default)
2223
```
2324

2425
## Configure, Build, and Test

cmake/compilers/Clang.cmake

+3-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ endif()
6868

6969
set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS})
7070

71-
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2>)
71+
if (NOT CMAKE_CXX_FLAGS MATCHES "_FORTIFY_SOURCE")
72+
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2>)
73+
endif ()
7274

7375
if (MINGW)
7476
list(APPEND TBB_COMMON_COMPILE_FLAGS -U__STRICT_ANSI__)

cmake/compilers/GNU.cmake

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020-2023 Intel Corporation
1+
# Copyright (c) 2020-2024 Intel Corporation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -75,8 +75,9 @@ set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-secur
7575
if (NOT APPLE AND NOT MINGW)
7676
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,relro,-z,now,-z,noexecstack)
7777
endif()
78-
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2> )
79-
78+
if (NOT CMAKE_CXX_FLAGS MATCHES "_FORTIFY_SOURCE")
79+
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2> )
80+
endif ()
8081

8182
# TBB malloc settings
8283
set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions)

cmake/compilers/Intel.cmake

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020-2023 Intel Corporation
1+
# Copyright (c) 2020-2024 Intel Corporation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -21,7 +21,11 @@ if (MSVC)
2121
elseif (APPLE)
2222
include(${CMAKE_CURRENT_LIST_DIR}/AppleClang.cmake)
2323
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fstack-protector -Wformat -Wformat-security
24-
$<$<NOT:$<CONFIG:Debug>>:-fno-omit-frame-pointer -qno-opt-report-embed -D_FORTIFY_SOURCE=2>)
24+
$<$<NOT:$<CONFIG:Debug>>:-fno-omit-frame-pointer -qno-opt-report-embed>)
25+
if (NOT CMAKE_CXX_FLAGS MATCHES "_FORTIFY_SOURCE")
26+
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2>)
27+
endif ()
28+
2529
set(TBB_OPENMP_FLAG -qopenmp)
2630
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-ipo>)
2731
else()

cmake/compilers/MSVC.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020-2023 Intel Corporation
1+
# Copyright (c) 2020-2024 Intel Corporation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@ endif()
3535
set(TBB_LIB_COMPILE_FLAGS -D_CRT_SECURE_NO_WARNINGS /GS)
3636
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} /volatile:iso /FS /EHsc)
3737

38-
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} /DYNAMICBASE /NXCOMPAT)
38+
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} /DEPENDENTLOADFLAG:0x2000 /DYNAMICBASE /NXCOMPAT)
3939

4040
if (TBB_ARCH EQUAL 32)
4141
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} /SAFESEH )

cmake/utils.cmake

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020-2023 Intel Corporation
1+
# Copyright (c) 2020-2024 Intel Corporation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -35,7 +35,11 @@ macro(tbb_install_target target)
3535
COMPONENT runtime
3636
ARCHIVE
3737
DESTINATION ${CMAKE_INSTALL_LIBDIR}
38-
COMPONENT devel)
38+
COMPONENT devel
39+
FRAMEWORK
40+
DESTINATION ${CMAKE_INSTALL_LIBDIR}
41+
COMPONENT runtime
42+
OPTIONAL)
3943

4044
if (BUILD_SHARED_LIBS)
4145
install(TARGETS ${target}

0 commit comments

Comments
 (0)