Skip to content

Commit

Permalink
Commit oneTBB source code 2539ba6
Browse files Browse the repository at this point in the history
  • Loading branch information
tbbdev committed May 2, 2024
1 parent 9afd759 commit 003b086
Show file tree
Hide file tree
Showing 75 changed files with 845 additions and 547 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.0
7.1.1
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# More details are here: https://help.github.com/articles/about-codeowners/

src/tbbmalloc @ldorau @lplewa @kfilipek
src/tbbmalloc_proxy @ldorau @lplewa @kfilipek
37 changes: 32 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ jobs:

pages:
if: ${{ github.ref == 'refs/heads/master' }}
permissions:
contents: write
pages: write
id-token: write
runs-on: ubuntu-latest
needs: [documentation]
steps:
Expand Down Expand Up @@ -142,7 +146,7 @@ jobs:
ctest -R python_test --output-on-failure --timeout ${TEST_TIMEOUT}
linux-testing:
name: ${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }}
name: ${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }}${{ matrix.cmake_static }}
runs-on: ['${{ matrix.os }}']
timeout-minutes: 45
strategy:
Expand All @@ -167,20 +171,27 @@ jobs:
std: 20
build_type: debug
preview: 'ON'
- os: ubuntu-22.04
c_compiler: gcc-11
cxx_compiler: g++-11
std: 20
build_type: release
preview: 'ON'
cmake_static: -DBUILD_SHARED_LIBS=OFF
steps:
- uses: actions/checkout@v2
- name: Run testing
shell: bash
run: |
set -x
mkdir build && cd build
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.cmake_static }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} ..
make VERBOSE=1 -j${BUILD_CONCURRENCY}
ctest --timeout ${TEST_TIMEOUT} --output-on-failure
macos-testing:
name: ${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }}
name: ${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }}${{ matrix.cmake_static }}
runs-on: ['${{ matrix.os }}']
timeout-minutes: 45
strategy:
Expand All @@ -193,14 +204,21 @@ jobs:
std: 14
build_type: relwithdebinfo
preview: 'ON'
- os: macos-13
c_compiler: clang
cxx_compiler: clang++
std: 20
build_type: release
preview: 'ON'
cmake_static: -DBUILD_SHARED_LIBS=OFF
steps:
- uses: actions/checkout@v2
- name: Run testing
shell: bash
run: |
set -x
mkdir build && cd build
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.cmake_static }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} ..
make VERBOSE=1 -j${MACOS_BUILD_CONCURRENCY}
ctest --timeout ${TEST_TIMEOUT} --output-on-failure
Expand All @@ -221,6 +239,15 @@ jobs:
build_type: relwithdebinfo
preview: 'ON'
job_name: windows_cl2019_cxx14_relwithdebinfo_preview=ON
- os: windows-2019
generator: Visual Studio 16 2019
c_compiler: cl
cxx_compiler: cl
std: 20
build_type: release
preview: 'ON'
job_name: windows_cl2019_cxx20_release_preview=ON-DBUILD_SHARED_LIBS=OFF
cmake_static: -DBUILD_SHARED_LIBS=OFF
- os: windows-2022
generator: Visual Studio 17 2022
c_compiler: cl
Expand All @@ -235,7 +262,7 @@ jobs:
run: |
mkdir build
cd build
cmake -G "${{ matrix.generator }}" -A x64 -DCMAKE_CXX_STANDARD=${{ matrix.std }} `
cmake -G "${{ matrix.generator }}" -A x64 -DCMAKE_CXX_STANDARD=${{ matrix.std }} ${{ matrix.cmake_static }} `
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} `
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} ..
cmake --build . --config ${{ matrix.build_type }} -j -v
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/issue_labeler.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023 Intel Corporation
# Copyright (c) 2023-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.
Expand All @@ -19,6 +19,8 @@ on:
pull_request:
types: [opened, edited]

permissions: read-all

jobs:
triage:
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023 Intel Corporation
# Copyright (c) 2023-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.
Expand All @@ -15,6 +15,8 @@ name: "Pull Request Labeler"
on:
- pull_request_target

permissions: read-all

jobs:
triage:
permissions:
Expand Down
15 changes: 14 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2022 Intel Corporation
# 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.
Expand Down Expand Up @@ -116,3 +116,16 @@ cc_library(
":tbbmalloc",
],
)

cc_test(
name = "test_task",
srcs = [
"test/tbb/test_task.cpp",
] + glob([
"test/common/*.h",
]),
includes = ["test"],
deps = [
":tbb",
],
)
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ option(TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH "Disable HWLOC automatic search by pkg
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)
if(APPLE)
option(TBB_BUILD_APPLE_FRAMEWORKS "Build as Apple Frameworks" OFF)
endif()

if (NOT DEFINED BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS ON)
Expand Down Expand Up @@ -230,7 +233,7 @@ else()
message(WARNING "TBB compiler settings not found ${TBB_COMPILER_SETTINGS_FILE}")
endif()

if (TBB_FIND_PACKAGE OR TBB_DIR)
if (TBB_FIND_PACKAGE AND TBB_DIR)
# Allow specifying external TBB to test with.
# Do not add main targets and installation instructions in that case.
message(STATUS "Using external TBB for testing")
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ module(
compatibility_level = 1,
)

bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "platforms", version = "0.0.9")
15 changes: 9 additions & 6 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ This document contains changes of oneTBB compared to the last release.
- 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/``
- 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.
- When CPU resource coordination is enabled, tasks from a lower-priority ``task_arena`` might be executed before tasks from a higher-priority ``task_arena``.

> **_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``.
- Fixed ``parallel_for_each`` algorithm behavior for iterators defining ``iterator_concept`` trait instead of ``iterator_category``.
- Fixed the redefinition issue for ``std::min`` and ``std::max`` on Windows* OS ([GitHub* #832](https://github.com/oneapi-src/oneTBB/issues/832)).
- Fixed the incorrect binary search order in ``TBBConfig.cmake``.
- Enabled the oneTBB library search using the pkg-config tool in Conda packages.

## :octocat: Open-source Contributions Integrated
- Fixed the compiler warning for missing virtual destructor. Contributed by Elias Engelbert Plank (https://github.com/oneapi-src/oneTBB/pull/1215).
69 changes: 64 additions & 5 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,66 @@
# Security Policy
Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution,
impact, severity and mitigation.
As an open-source project, we understand the importance of and responsibility
for security. This Security Policy outlines our guidelines and procedures to
ensure the highest level of security and trust for oneTBB users.

## 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).
## Supported Versions
Security vulnerabilities are fixed in the [latest version][1]
and delivered as a patch release. We don't guarantee security fixes to be
back-ported to older oneTBB versions.

## Report a Vulnerability
We are very grateful to the security researchers and users that report back
security vulnerabilities. We investigate every report thoroughly.
We strongly encourage you to report security vulnerabilities to us privately,
before disclosing them on public forums or opening a public GitHub* issue.

Report a vulnerability to us in one of two ways:
* Open a draft **[GitHub* Security Advisory][2]**
* Send an e-mail to: **[email protected]**.
Along with the report, provide the following info:
* A descriptive title.
* Your name and affiliation (if any).
* A description of the technical details of the vulnerabilities.
* A minimal example of the vulnerability so we can reproduce your findings.
* An explanation of who can exploit this vulnerability, and what they gain
doing so.
* Whether this vulnerability is public or known to third parties. If it is,
provide details.

### When Should I Report a Vulnerability?
* You think you discovered a potential security vulnerability in oneTBB.
* You are unsure how the potential vulnerability affects oneTBB.
* You think you discovered a vulnerability in another project or 3rd party
component on which oneTBB depends. If the issue is not fixed in the 3rd party
component, try to report directly there first.

### When Should I NOT Report a Vulnerability?
* You got an automated scan hit and are unable to provide details.
* You need help using oneTBB for security.
* You need help applying security-related updates.
* Your issue is not security-related.

## Security Reports Review Process
We aim to respond quickly to your inquiry and coordinate a fix and
disclosure with you. All confirmed security vulnerabilities will be addressed
according to severity level and impact on oneTBB. Normally, security issues
are fixed in the next planned release.

## Disclosure Policy
We will publish security advisories using the
[**GitHub Security Advisories feature**][3]
to keep our community well-informed, and will credit you for your findings
unless you prefer to stay anonymous. We request that you refrain from
exploiting the vulnerability or making it public before the official disclosure.

We will disclose the vulnerabilities and bugs as soon as possible once
mitigation is implemented and available.

## Feedback on This Policy
If you have any suggestions on how this Policy could be improved, submit
an issue or a pull request to this repository. **Do not** report
potential vulnerabilities or security flaws via a pull request.

[1]: https://github.com/oneapi-src/oneTBB/releases/latest
[2]: https://github.com/oneapi-src/oneTBB/security/advisories/new
[3]: https://github.com/oneapi-src/oneTBB/security/advisories
4 changes: 2 additions & 2 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021 Intel Corporation
# 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.
Expand All @@ -16,4 +16,4 @@
# use Bazel internally. The Bazel build can have security risks or
# optimization gaps.

workspace(name = "oneTBB")
# WORKSPACE marker file needed by Bazel
1 change: 1 addition & 0 deletions cmake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ TBB_INSTALL_VARS:BOOL - Enable auto-generated vars installation(packages generat
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)
TBB_BUILD_APPLE_FRAMEWORKS - Enable the Apple* frameworks instead of dylibs, only available on the Apple platform. (OFF by default)
```

## Configure, Build, and Test
Expand Down
4 changes: 3 additions & 1 deletion cmake/compilers/Clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ 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 (NOT CMAKE_CXX_FLAGS MATCHES "_FORTIFY_SOURCE")
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__)
Expand Down
7 changes: 4 additions & 3 deletions cmake/compilers/GNU.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023 Intel Corporation
# Copyright (c) 2020-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.
Expand Down Expand Up @@ -75,8 +75,9 @@ set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-secur
if (NOT APPLE AND NOT MINGW)
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,relro,-z,now,-z,noexecstack)
endif()
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2> )

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

# TBB malloc settings
set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions)
Expand Down
8 changes: 6 additions & 2 deletions cmake/compilers/Intel.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023 Intel Corporation
# Copyright (c) 2020-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.
Expand All @@ -21,7 +21,11 @@ if (MSVC)
elseif (APPLE)
include(${CMAKE_CURRENT_LIST_DIR}/AppleClang.cmake)
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fstack-protector -Wformat -Wformat-security
$<$<NOT:$<CONFIG:Debug>>:-fno-omit-frame-pointer -qno-opt-report-embed -D_FORTIFY_SOURCE=2>)
$<$<NOT:$<CONFIG:Debug>>:-fno-omit-frame-pointer -qno-opt-report-embed>)
if (NOT CMAKE_CXX_FLAGS MATCHES "_FORTIFY_SOURCE")
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2>)
endif ()

set(TBB_OPENMP_FLAG -qopenmp)
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-ipo>)
else()
Expand Down
4 changes: 2 additions & 2 deletions cmake/compilers/MSVC.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023 Intel Corporation
# Copyright (c) 2020-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.
Expand Down Expand Up @@ -35,7 +35,7 @@ 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)
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} /DEPENDENTLOADFLAG:0x2000 /DYNAMICBASE /NXCOMPAT)

if (TBB_ARCH EQUAL 32)
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} /SAFESEH )
Expand Down
8 changes: 6 additions & 2 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023 Intel Corporation
# Copyright (c) 2020-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.
Expand Down Expand Up @@ -35,7 +35,11 @@ macro(tbb_install_target target)
COMPONENT runtime
ARCHIVE
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT devel)
COMPONENT devel
FRAMEWORK
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT runtime
OPTIONAL)

if (BUILD_SHARED_LIBS)
install(TARGETS ${target}
Expand Down
Loading

0 comments on commit 003b086

Please sign in to comment.