diff --git a/.bazelversion b/.bazelversion
index 21c8c7b46b..b26a34e470 100644
--- a/.bazelversion
+++ b/.bazelversion
@@ -1 +1 @@
-7.1.1
+7.2.1
diff --git a/.github/ISSUE_TEMPLATE/1_question.md b/.github/ISSUE_TEMPLATE/1_question.md
new file mode 100644
index 0000000000..bee63c246b
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/1_question.md
@@ -0,0 +1,7 @@
+---
+name: Ask a question
+about: Use this template for any questions
+title: ''
+labels: 'question'
+assignees: ''
+---
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/2_bug_report.md b/.github/ISSUE_TEMPLATE/2_bug_report.md
new file mode 100644
index 0000000000..4e135815ca
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/2_bug_report.md
@@ -0,0 +1,32 @@
+---
+name: Report a bug or a performance issue
+about: Use this template to report unexpected behavior
+title: ''
+labels: 'bug'
+assignees: ''
+---
+
+# Summary
+Provide a short summary of the issue.
+See the sections below
+for factors important for the reproduction of an issue.
+
+# Version
+Report oneTBB version used to reproduce the problem.
+
+# Environment
+Provide any environmental details that you consider significant for reproducing the issue.
+The following information is important:
+* Hardware
+* OS name and version
+* Compiler version
+
+# Observed Behavior
+Document behavior you observe.
+
+# Expected Behavior
+Document behavior you expect.
+
+# Steps To Reproduce
+Check that the issue is reproducible with the latest revision
+of the master branch. Include all the steps to reproduce the issue.
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/3_feature_request.md b/.github/ISSUE_TEMPLATE/3_feature_request.md
new file mode 100644
index 0000000000..c4f8cfcbb3
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/3_feature_request.md
@@ -0,0 +1,19 @@
+---
+name: Request a feature
+about: Use this template to request new functionality or change the behavior of the library
+title: ''
+labels: 'new feature'
+assignees: ''
+---
+
+# Summary
+Include a short summary of the request.
+
+See the sections below
+for factors important for a feature request.
+
+# Problem Statement
+Describe the problem you want to solve with a reasonable level of detail.
+
+# Preferred Solution
+Provide your ideas regarding problem solutions.
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/4_documentation.md b/.github/ISSUE_TEMPLATE/4_documentation.md
new file mode 100644
index 0000000000..3788d13b89
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/4_documentation.md
@@ -0,0 +1,20 @@
+---
+name: Request a documentation change
+about: Use this template to report documentation issue or request documentation changes
+title: ''
+labels: 'documentation'
+assignees: ''
+---
+
+# Summary
+Include a short summary of the issue or request.
+See the sections below
+for factors important for a documentation
+issue.
+
+# URLs
+Include pointers to documents that are impacted.
+
+# Additional Details
+Provide a detailed description of the expected changes in documentation
+and suggestions you have.
\ No newline at end of file
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index caf80fff86..f986d31a40 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -4,8 +4,6 @@ _Add a 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_
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a65de62241..7dbf3c407d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -37,7 +37,7 @@ jobs:
runs-on: [ubuntu-20.04]
timeout-minutes: 10
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Run scan
run: |
sudo apt update && sudo apt install -y codespell
@@ -47,7 +47,7 @@ jobs:
runs-on: [ubuntu-20.04]
timeout-minutes: 10
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Run scan
run: |
command -v clang-format-10
@@ -62,7 +62,7 @@ jobs:
runs-on: [ubuntu-22.04]
timeout-minutes: 10
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Install prerequisites
run: |
pip3 install -U Jinja2
@@ -90,7 +90,7 @@ jobs:
needs: [documentation]
steps:
- name: Checkout gh-pages
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
@@ -117,7 +117,7 @@ jobs:
if: ${{ github.ref != 'refs/heads/master' }}
runs-on: [ubuntu-20.04]
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run check
@@ -137,7 +137,7 @@ jobs:
runs-on: [ubuntu-latest]
timeout-minutes: 15
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Run testing
run: |
mkdir build && cd build
@@ -179,7 +179,7 @@ jobs:
preview: 'ON'
cmake_static: -DBUILD_SHARED_LIBS=OFF
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Run testing
shell: bash
run: |
@@ -212,7 +212,7 @@ jobs:
preview: 'ON'
cmake_static: -DBUILD_SHARED_LIBS=OFF
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Run testing
shell: bash
run: |
@@ -257,7 +257,7 @@ jobs:
preview: 'OFF'
job_name: windows_cl2022_cxx17_relwithdebinfo_preview=OFF
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Run testing
run: |
mkdir build
@@ -295,7 +295,7 @@ jobs:
build_type: debug
preview: 'ON'
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Run testing
shell: bash
run: |
@@ -321,7 +321,7 @@ jobs:
build_type: relwithdebinfo
preview: 'ON'
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Run testing
shell: bash
run: |
@@ -357,7 +357,7 @@ jobs:
preview: 'OFF'
job_name: examples_windows_cl2022_cxx17_relwithdebinfo_preview=OFF
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Run testing
run: |
mkdir build
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 0000000000..7a80c5f0e2
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,86 @@
+# Copyright (c) 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.
+
+name: "CodeQL"
+
+on:
+ push:
+ branches: [ "master" ]
+ pull_request:
+ branches: [ "master" ]
+ schedule:
+ - cron: '0 0 * * 1'
+
+permissions:
+ contents: read
+
+jobs:
+ analyze:
+ name: Analyze (${{ matrix.language }})
+ runs-on: ubuntu-latest
+ # timeout-minutes:
+ permissions:
+ # required for all workflows
+ security-events: write
+ # required to fetch internal or private CodeQL packs
+ packages: read
+ # only required for workflows in private repositories
+ actions: read
+ contents: read
+
+ strategy:
+ fail-fast: false
+ matrix:
+ language: ["cpp", "python"]
+
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@v2.6.1
+ with:
+ egress-policy: audit
+
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v3
+ with:
+ languages: ${{ matrix.language }}
+
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
+ # If this step fails, then you should remove it and run the build manually (see below)
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@v3.24.10
+
+ # If the analyze step fails for one of the languages you are analyzing with
+ # "We were unable to automatically build your code", modify the matrix above
+ # to set the build mode to "manual" for that language. Then modify this step
+ # to build your code.
+ # Command-line programs to run using the OS shell.
+ # See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
+ #- if: matrix.build-mode == 'manual'
+ # shell: bash
+ # run: |
+ # echo 'If you are using a "manual" build mode for one or more of the' \
+ # 'languages you are analyzing, replace this with the commands to build' \
+ # 'your code, for example:'
+ # echo ' make bootstrap'
+ # echo ' make release'
+ # exit 1
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v3
+ with:
+ category: "/language:${{matrix.language}}"
diff --git a/.github/workflows/ossf-scorecard.yml b/.github/workflows/ossf-scorecard.yml
new file mode 100644
index 0000000000..9f45569f8a
--- /dev/null
+++ b/.github/workflows/ossf-scorecard.yml
@@ -0,0 +1,83 @@
+# Copyright (c) 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.
+
+name: OSSF Scorecard
+on:
+ # For Branch-Protection check. Only the default branch is supported. See
+ # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
+ branch_protection_rule:
+ # To guarantee Maintained check is occasionally updated. See
+ # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
+ schedule:
+ - cron: '00 02 * * *'
+ push:
+ branches: [ "master" ]
+
+# Declare default permissions as read only.
+permissions: read-all
+
+jobs:
+ analysis:
+ name: Scorecard analysis
+ runs-on: ubuntu-latest
+ permissions:
+ # Needed to upload the results to code-scanning dashboard.
+ security-events: write
+ # Needed to publish results and get a badge (see publish_results below).
+ id-token: write
+ # Uncomment the permissions below if installing in a private repository.
+ # contents: read
+ # actions: read
+
+ steps:
+ - name: "Checkout code"
+ uses: actions/checkout@v4.1.1
+ with:
+ persist-credentials: false
+
+ - name: "Run analysis"
+ uses: ossf/scorecard-action@v2.3.1
+ with:
+ results_file: results.sarif
+ results_format: sarif
+ # (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
+ # - you want to enable the Branch-Protection check on a *public* repository, or
+ # - you are installing Scorecard on a *private* repository
+ # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
+ # repo_token: ${{ secrets.SCORECARD_TOKEN }}
+
+ # Public repositories:
+ # - Publish results to OpenSSF REST API for easy access by consumers
+ # - Allows the repository to include the Scorecard badge.
+ # - See https://github.com/ossf/scorecard-action#publishing-results.
+ # For private repositories:
+ # - `publish_results` will always be set to `false`, regardless
+ # of the value entered here.
+ publish_results: true
+
+ # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
+ # format to the repository Actions tab.
+ #- name: "Upload artifact"
+ # uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20
+ # with:
+ # name: SARIF file
+ # path: results.sarif
+ # retention-days: 5
+
+ # Upload the results to GitHub's code scanning dashboard (optional).
+ # Commenting out will disable upload of results to your repo's Code Scanning dashboard
+ #- name: "Upload to code-scanning"
+ # uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
+ # with:
+ # sarif_file: results.sarif
diff --git a/BUILD.bazel b/BUILD.bazel
index 34f98eba10..9073f4640d 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -117,6 +117,47 @@ cc_library(
],
)
+cc_test(
+ name = "test_mutex",
+ srcs = [
+ "test/tbb/test_mutex.cpp",
+ "test/tbb/test_mutex.h"
+ ] + glob([
+ "test/common/*.h",
+ ]),
+ includes = ["test"],
+ deps = [
+ ":tbb",
+ ],
+)
+
+cc_test(
+ name = "test_parallel_for",
+ srcs = [
+ "test/tbb/test_parallel_for.cpp",
+ "test/tbb/test_partitioner.h"
+ ] + glob([
+ "test/common/*.h",
+ ]),
+ includes = ["test"],
+ deps = [
+ ":tbb",
+ ],
+)
+
+cc_test(
+ name = "test_parallel_reduce",
+ srcs = [
+ "test/tbb/test_parallel_reduce.cpp",
+ ] + glob([
+ "test/common/*.h",
+ ]),
+ includes = ["test"],
+ deps = [
+ ":tbb",
+ ],
+)
+
cc_test(
name = "test_task",
srcs = [
diff --git a/Bazel.md b/Bazel.md
index 996a3b2eb5..09a630a72b 100644
--- a/Bazel.md
+++ b/Bazel.md
@@ -19,6 +19,8 @@ The standard Bazel approach to handling third-party libraries is static linking.
## Using oneTBB as a dependency
+### Traditional WORKSPACE approach
+
This example demonstrates how to use oneTBB as a dependency within a Bazel project.
The following file structure is assumed:
@@ -78,6 +80,16 @@ The expected output of this program is the current version of oneTBB.
Switch to the folder with the files created earlier and run the binary with `bazel run //:Demo`.
+### Bzlmod
+
+If you use Bzlmod, you can fetch oneTBB with the [Bazel Central Registry](https://registry.bazel.build/).
+
+Add the following line to your `MODULE.bazel` file:
+
+```bazel
+bazel_dep(name = "onetbb", version = "2021.13.0")
+```
+
## Build oneTBB using Bazel
Run ```bazel build //...``` in the oneTBB root directory.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 19232a9920..811a3a5549 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,7 +49,7 @@ string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" _tbb_ver_min
string(REGEX REPLACE ".*#define TBB_VERSION_PATCH ([0-9]+).*" "\\1" _tbb_ver_patch "${_tbb_version_info}")
string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_tbb_version_info}")
string(REGEX REPLACE ".*#define __TBB_BINARY_VERSION ([0-9]+).*" "\\1" TBB_BINARY_VERSION "${_tbb_version_info}")
-set(TBB_BINARY_MINOR_VERSION ${_tbb_ver_minor})
+string(REGEX REPLACE "..(..)." "\\1" TBB_BINARY_MINOR_VERSION "${TBB_INTERFACE_VERSION}")
set(TBBMALLOC_BINARY_VERSION 2)
set(TBBBIND_BINARY_VERSION 3)
@@ -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(LINUX)
+option(TBB_LINUX_SEPARATE_DBG "Enable separation of the debug symbols during the build" OFF)
+endif()
if(APPLE)
option(TBB_BUILD_APPLE_FRAMEWORKS "Build as Apple Frameworks" OFF)
endif()
diff --git a/CODEOWNERS b/CODEOWNERS
new file mode 100644
index 0000000000..78105ac7e8
--- /dev/null
+++ b/CODEOWNERS
@@ -0,0 +1,27 @@
+# Where component owners are known, add them here.
+
+/oneTBB/src/tbb/ @pavelkumbrasev
+/oneTBB/src/tbb/ @dnmokhov
+/oneTBB/src/tbb/ @JhaShweta1
+/oneTBB/src/tbb/ @sarathnandu
+/oneTBB/include/oneapi/tbb/parallel_* @pavelkumbrasev
+/oneTBB/include/oneapi/tbb/concurrent_* @kboyarinov
+/oneTBB/include/oneapi/tbb/flow_graph* @kboyarinov
+/oneTBB/include/oneapi/tbb/flow_graph* @aleksei-fedotov
+/oneTBB/include/oneapi/tbb/detail/_flow_graph* @kboyarinov
+/oneTBB/include/oneapi/tbb/detail/_flow_graph* @aleksei-fedotov
+/oneTBB/include/oneapi/tbb/detail/_concurrent* @kboyarinov
+/oneTBB/src/doc @aepanchi
+/oneTBB/src/tbbbind/ @isaevil
+/oneTBB/src/tbbmalloc/ @lplewa
+/oneTBB/src/tbbmalloc_proxy/ @lplewa
+/oneTBB/cmake/ @isaevil
+/oneTBB/*CMakeLists.txt @isaevil
+/oneTBB/python/ @sarathnandu
+/oneTBB/python/ @isaevil
+
+# Bazel build related files.
+/oneTBB/.bazelversion @Vertexwahn
+/oneTBB/Bazel.md @Vertexwahn
+/oneTBB/BUILD.bazel @Vertexwahn
+/oneTBB/MODULE.bazel @Vertexwahn
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000000..c169707396
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,134 @@
+
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+We as members, contributors, and leaders pledge to make participation in our
+community a harassment-free experience for everyone, regardless of age, body
+size, visible or invisible disability, ethnicity, sex characteristics, gender
+identity and expression, level of experience, education, socio-economic status,
+nationality, personal appearance, race, caste, color, religion, or sexual
+identity and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming,
+diverse, inclusive, and healthy community.
+
+## Our Standards
+
+Examples of behavior that contributes to a positive environment for our
+community include:
+
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes,
+ and learning from the experience
+* Focusing on what is best not just for us as individuals, but for the overall
+ community
+
+Examples of unacceptable behavior include:
+
+* The use of sexualized language or imagery, and sexual attention or advances of
+ any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or email address,
+ without their explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Enforcement Responsibilities
+
+Community leaders are responsible for clarifying and enforcing our standards of
+acceptable behavior and will take appropriate and fair corrective action in
+response to any behavior that they deem inappropriate, threatening, offensive,
+or harmful.
+
+Community leaders have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, and will communicate reasons for moderation
+decisions when appropriate.
+
+## Scope
+
+This Code of Conduct applies within all community spaces, and also applies when
+an individual is officially representing the community in public spaces.
+Examples of representing our community include using an official email address,
+posting via an official social media account, or acting as an appointed
+representative at an online or offline event.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported to the community leaders responsible for enforcement at
+oneTBBCodeOfConduct At intel DOT com.
+All complaints will be reviewed and investigated promptly and fairly.
+
+All community leaders are obligated to respect the privacy and security of the
+reporter of any incident.
+
+## Enforcement Guidelines
+
+Community leaders will follow these Community Impact Guidelines in determining
+the consequences for any action they deem in violation of this Code of Conduct:
+
+### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed
+unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from community leaders, providing
+clarity around the nature of the violation and an explanation of why the
+behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
+
+**Community Impact**: A violation through a single incident or series of
+actions.
+
+**Consequence**: A warning with consequences for continued behavior. No
+interaction with the people involved, including unsolicited interaction with
+those enforcing the Code of Conduct, for a specified period of time. This
+includes avoiding interactions in community spaces as well as external channels
+like social media. Violating these terms may lead to a temporary or permanent
+ban.
+
+### 3. Temporary Ban
+
+**Community Impact**: A serious violation of community standards, including
+sustained inappropriate behavior.
+
+**Consequence**: A temporary ban from any sort of interaction or public
+communication with the community for a specified period of time. No public or
+private interaction with the people involved, including unsolicited interaction
+with those enforcing the Code of Conduct, is allowed during this period.
+Violating these terms may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+**Community Impact**: Demonstrating a pattern of violation of community
+standards, including sustained inappropriate behavior, harassment of an
+individual, or aggression toward or disparagement of classes of individuals.
+
+**Consequence**: A permanent ban from any sort of public interaction within the
+community.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+version 2.1, available at
+[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
+
+Community Impact Guidelines were inspired by
+[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
+
+For answers to common questions about this code of conduct, see the FAQ at
+[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
+[https://www.contributor-covenant.org/translations][translations].
+
+[homepage]: https://www.contributor-covenant.org
+[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
+[Mozilla CoC]: https://github.com/mozilla/diversity
+[FAQ]: https://www.contributor-covenant.org/faq
+[translations]: https://www.contributor-covenant.org/translations
+
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 3048b21199..b2b6a968cd 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -21,9 +21,7 @@ As an open source project, we welcome community contributions to oneAPI Threadin
Licensing is very important to open source projects. It helps ensure the software continues to be available under the terms that the author desired. The oneTBB project uses the [Apache 2.0 License](https://github.com/oneapi-src/oneTBB/blob/master/LICENSE.txt), a permissive open source license that allows you to freely use, modify, and distribute your own products that include Apache 2.0 licensed software. By contributing to the oneTBB project, you agree to the license and copyright terms therein and release your own contributions under these terms.
-Some imported or reused components within oneTBB use other licenses, as described in [third-party-programs.txt](https://github.com/oneapi-src/oneTBB/blob/master/third-party-programs.txt). By carefully reviewing potential contributions and enforcing a [Developer Certification of Origin (DCO)](https://developercertificate.org/) for contributed code, we can ensure that the community can develop products with oneTBB without concerns over patent or copyright issues.
-
-The DCO is an attestation attached to every contribution made by every developer. In the commit message of the contribution, (described later), the developer simply adds a Signed-off-by statement and thereby agrees to the DCO.
+Some imported or reused components within oneTBB use other licenses, as described in [third-party-programs.txt](https://github.com/oneapi-src/oneTBB/blob/master/third-party-programs.txt). By carefully reviewing potential contributions, we can ensure that the community can develop products with oneTBB without concerns over patent or copyright issues.
## Prerequisites
@@ -32,12 +30,6 @@ As a contributor, you’ll want to be familiar with the oneTBB project and the r
## Pull Requests
You can find all [open oneTBB pull requests](https://github.com/oneapi-src/oneTBB/pulls) on GitHub.
-
-No anonymous contributions are accepted. The name in the commit message Signed-off-by line and your email must match the change authorship information. Make sure your .gitconfig is set up correctly so you can use `git commit -s` for signing your patches:
-
-`git config --global user.name "Taylor Developer"`
-
-`git config --global user.email taylor.developer@company.com`
### Before contributing changes directly to the oneTBB repository
diff --git a/MODULE.bazel b/MODULE.bazel
index cc6698f0de..063bc2f468 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -21,4 +21,4 @@ module(
compatibility_level = 1,
)
-bazel_dep(name = "platforms", version = "0.0.9")
+bazel_dep(name = "platforms", version = "0.0.10")
diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock
new file mode 100644
index 0000000000..06f9098032
--- /dev/null
+++ b/MODULE.bazel.lock
@@ -0,0 +1,65 @@
+{
+ "lockFileVersion": 11,
+ "registryFileHashes": {
+ "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497",
+ "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2",
+ "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589",
+ "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/source.json": "7e3a9adf473e9af076ae485ed649d5641ad50ec5c11718103f34de03170d94ad",
+ "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel": "50341a62efbc483e8a2a6aec30994a58749bd7b885e18dd96aa8c33031e558ef",
+ "https://bcr.bazel.build/modules/apple_support/1.5.0/source.json": "eb98a7627c0bc486b57f598ad8da50f6625d974c8f723e9ea71bd39f709c9862",
+ "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8",
+ "https://bcr.bazel.build/modules/bazel_features/1.11.0/source.json": "c9320aa53cd1c441d24bd6b716da087ad7e4ff0d9742a9884587596edfe53015",
+ "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8",
+ "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a",
+ "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5",
+ "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917",
+ "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/source.json": "082ed5f9837901fada8c68c2f3ddc958bb22b6d654f71dd73f3df30d45d4b749",
+ "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84",
+ "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8",
+ "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4",
+ "https://bcr.bazel.build/modules/googletest/1.11.0/source.json": "c73d9ef4268c91bd0c1cd88f1f9dfa08e814b1dbe89b5f594a9f08ba0244d206",
+ "https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5",
+ "https://bcr.bazel.build/modules/platforms/0.0.10/source.json": "f22828ff4cf021a6b577f1bf6341cb9dcd7965092a439f64fc1bb3b7a5ae4bd5",
+ "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee",
+ "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37",
+ "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615",
+ "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814",
+ "https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc",
+ "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7",
+ "https://bcr.bazel.build/modules/protobuf/21.7/source.json": "bbe500720421e582ff2d18b0802464205138c06056f443184de39fbb8187b09b",
+ "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0",
+ "https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858",
+ "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647",
+ "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c",
+ "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e",
+ "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5",
+ "https://bcr.bazel.build/modules/rules_cc/0.0.9/source.json": "1f1ba6fea244b616de4a554a0f4983c91a9301640c8fe0dd1d410254115c8430",
+ "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74",
+ "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe",
+ "https://bcr.bazel.build/modules/rules_java/7.6.1/source.json": "8f3f3076554e1558e8e468b2232991c510ecbcbed9e6f8c06ac31c93bcf38362",
+ "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7",
+ "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/source.json": "a075731e1b46bc8425098512d038d416e966ab19684a10a34f4741295642fc35",
+ "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0",
+ "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d",
+ "https://bcr.bazel.build/modules/rules_license/0.0.7/source.json": "355cc5737a0f294e560d52b1b7a6492d4fff2caf0bef1a315df5a298fca2d34a",
+ "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc",
+ "https://bcr.bazel.build/modules/rules_pkg/0.7.0/source.json": "c2557066e0c0342223ba592510ad3d812d4963b9024831f7f66fd0584dd8c66c",
+ "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06",
+ "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7",
+ "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/source.json": "d57902c052424dfda0e71646cb12668d39c4620ee0544294d9d941e7d12bc3a9",
+ "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f",
+ "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel": "26114f0c0b5e93018c0c066d6673f1a2c3737c7e90af95eff30cfee38d0bbac7",
+ "https://bcr.bazel.build/modules/rules_python/0.22.1/source.json": "57226905e783bae7c37c2dd662be078728e48fa28ee4324a7eabcafb5a43d014",
+ "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c",
+ "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8",
+ "https://bcr.bazel.build/modules/stardoc/0.5.1/source.json": "a96f95e02123320aa015b956f29c00cb818fa891ef823d55148e1a362caacf29",
+ "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43",
+ "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/source.json": "f1ef7d3f9e0e26d4b23d1c39b5f5de71f584dd7d1b4ef83d9bbba6ec7a6a6459",
+ "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0",
+ "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27",
+ "https://bcr.bazel.build/modules/zlib/1.3/MODULE.bazel": "6a9c02f19a24dcedb05572b2381446e27c272cd383aed11d41d99da9e3167a72",
+ "https://bcr.bazel.build/modules/zlib/1.3/source.json": "b6b43d0737af846022636e6e255fd4a96fee0d34f08f3830e6e0bac51465c37c"
+ },
+ "selectedYankedVersions": {},
+ "moduleExtensions": {}
+}
diff --git a/README.md b/README.md
index f2bc0a0afa..2e7c2e81ba 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,8 @@
-# oneAPI Threading Building Blocks
+# oneAPI Threading Building Blocks (oneTBB)
[](LICENSE.txt) [](https://github.com/oneapi-src/oneTBB/actions/workflows/ci.yml?query=branch%3Amaster)
+[](https://github.com/oneapi-src/oneTBB/discussions)
+[](https://www.bestpractices.dev/projects/9125)
+[](https://securityscorecards.dev/viewer/?uri=github.com/oneapi-src/oneTBB)
oneTBB is a flexible C++ library that simplifies the work of adding parallelism
to complex applications, even if you are not a threading expert.
@@ -18,7 +21,7 @@ The library differs from typical threading packages in the following ways:
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.
+oneTBB is a part of the [UXL Foundation](http://www.uxlfoundation.org) and is an implementation of [oneAPI specification](https://oneapi.io).
> **_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.
@@ -39,6 +42,14 @@ See [Release Notes](RELEASE_NOTES.md) and [System Requirements](SYSTEM_REQUIREME
## Installation
See [Installation from Sources](INSTALL.md) to learn how to install oneTBB.
+## Governance
+
+The oneTBB project is governed by the UXL Foundation.
+You can get involved in this project in following ways:
+* Join the [Open Source and Specification Working Group](https://github.com/uxlfoundation/foundation/tree/main?tab=readme-ov-file#working-groups) meetings.
+* Join the mailing lists for the [UXL Foundation](https://lists.uxlfoundation.org/g/main/subgroups) to receive meetings schedule and latest updates.
+* Contribute to oneTBB project or oneTBB specification. Read [CONTRIBUTING](./CONTRIBUTING.md) for more information.
+
## Support
See our [documentation](./SUPPORT.md) to learn how to request help.
@@ -46,6 +57,8 @@ See our [documentation](./SUPPORT.md) to learn how to request help.
We welcome community contributions, so check our [Contributing Guidelines](CONTRIBUTING.md)
to learn more.
+Use GitHub Issues for feature requests, bug reports, and minor inquiries. For broader questions and development-related discussions, use GitHub Discussions.
+
## License
oneAPI Threading Building Blocks is licensed under [Apache License, Version 2.0](LICENSE.txt).
By its terms, contributions submitted to the project are also done under that license.
diff --git a/WASM_Support.md b/WASM_Support.md
index 8c2f6c1af9..6306620d7c 100644
--- a/WASM_Support.md
+++ b/WASM_Support.md
@@ -16,7 +16,7 @@
# WASM Support
-oneTBB extends its capabilities by offering robust support for ``WASM``.
+oneTBB extends its capabilities by offering robust support for ``WASM`` (see ``Limitation`` sections).
``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.
@@ -58,3 +58,24 @@ To run tests, use:
ctest
```
+# Limitations
+
+You can successfully build your application with oneTBB using WASM, but you may not achieve optimal performance immediately. This is due to the limitation with nested Web Workers: a Web Worker cannot schedule another worker without help from a browser thread. This can lead to unexpected performance outcomes, such as the application running in serial.
+Find more information in the [issue](https://github.com/emscripten-core/emscripten/discussions/21963) in the Emscripten repository.
+To workaround this issue, try one of the following ways:
+1. **Recommended Solution: Use the ``-sPROXY_TO_PTHREAD`` Flag**.
+This flag splits the initial thread into a browser thread and a main thread (proxied by a Web Worker), effectively resolving the issue as the browser thread is always present in the event loop and can participate in Web Workers scheduling. Refer to the [Emscripten documentation](https://emscripten.org/docs/porting/pthreads.html) for more details about ``-sPROXY_TO_PTHREAD`` since using this flag may require refactoring the code.
+2. **Alternative Solution: Warm Up the oneTBB Thread Pool**
+Initialize the oneTBB thread pool before making the first call to oneTBB. This approach forces the browser thread to participate in Web Workers scheduling.
+```cpp
+ int num_threads = tbb::this_task_arena::max_concurrency();
+ std::atomic barrier{num_threads};
+ tbb::parallel_for(0, num_threads, [&barrier] (int) {
+ barrier--;
+ while (barrier > 0) {
+ // Send browser thread to event loop
+ std::this_thread::yield();
+ }
+ }, tbb::static_partitioner{});
+```
+> **_NOTE:_** Be aware that it might cause delays on the browser side.
diff --git a/cmake/README.md b/cmake/README.md
index aa811b0fc0..3a357218d5 100644
--- a/cmake/README.md
+++ b/cmake/README.md
@@ -10,6 +10,7 @@ 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_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)
+TBB_FIND_PACKAGE - Enable search for external oneTBB using find_package instead of build from sources (OFF 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)
@@ -187,7 +188,14 @@ cmake --build . --target test # currently does not work on Windows* OS
```
## Installation
-See [Installation from Sources](../INSTALL.md) to learn how to install oneTBB.
+See [Installation from Sources](../INSTALL.md) to learn how to install oneTBB.
+
+To install oneTBB from the release packages, use the following commands:
+```bash
+tar -xvf oneapi-tbb-xxx.xx.x-*.tgz
+source env/vars.sh
+```
+
## Sanitizers - Configure, Build, and Run
diff --git a/cmake/compilers/Clang.cmake b/cmake/compilers/Clang.cmake
index f56b5fba0f..dcd66634f3 100644
--- a/cmake/compilers/Clang.cmake
+++ b/cmake/compilers/Clang.cmake
@@ -13,12 +13,16 @@
# 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()
+ 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 -sMALLOC=mimalloc -sEXIT_RUNTIME=1)
+ if (NOT EMSCRIPTEN_WITHOUT_PTHREAD)
+ set_property(TARGET Threads::Threads PROPERTY INTERFACE_LINK_LIBRARIES "-pthread")
+ endif()
+ set(TBB_EMSCRIPTEN_STACK_SIZE 65536)
+ set(TBB_LIB_COMPILE_FLAGS -D__TBB_EMSCRIPTEN_STACK_SIZE=${TBB_EMSCRIPTEN_STACK_SIZE})
+ set(TBB_TEST_LINK_FLAGS ${TBB_TEST_LINK_FLAGS} -sTOTAL_STACK=${TBB_EMSCRIPTEN_STACK_SIZE})
+ unset(TBB_EMSCRIPTEN_STACK_SIZE)
endif()
if (MINGW)
diff --git a/cmake/compilers/GNU.cmake b/cmake/compilers/GNU.cmake
index 6fd8d9808d..cf6d8bdbca 100644
--- a/cmake/compilers/GNU.cmake
+++ b/cmake/compilers/GNU.cmake
@@ -35,8 +35,39 @@ if (NOT CMAKE_GENERATOR MATCHES "Ninja" AND NOT CMAKE_CXX_DEPENDS_USE_COMPILER)
set(TBB_MMD_FLAG -MMD)
endif()
+
+# Binutils < 2.31.1 do not support the tpause instruction. When compiling with
+# a modern version of GCC (supporting it) but relying on an outdated assembler,
+# will result in an error reporting "no such instruction: tpause".
+# The following code invokes the GNU assembler to extract the version number
+# and convert it to an integer that can be used in the C++ code to compare
+# against, and conditionally disable the __TBB_WAITPKG_INTRINSICS_PRESENT
+# macro if the version is incompatible. Binutils only report the version in the
+# MAJOR.MINOR format, therefore the version checked is >=2.32 (instead of
+# >=2.31.1). Capturing the output in CMake can be done like below. The version
+# information is written to either stdout or stderr. To not make any
+# assumptions, both are captured.
+execute_process(
+ COMMAND ${CMAKE_COMMAND} -E env "LANG=C" ${CMAKE_CXX_COMPILER} -xc -c /dev/null -Wa,-v -o/dev/null
+ OUTPUT_VARIABLE ASSEMBLER_VERSION_LINE_OUT
+ ERROR_VARIABLE ASSEMBLER_VERSION_LINE_ERR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_STRIP_TRAILING_WHITESPACE
+)
+set(ASSEMBLER_VERSION_LINE ${ASSEMBLER_VERSION_LINE_OUT}${ASSEMBLER_VERSION_LINE_ERR})
+string(REGEX REPLACE ".*GNU assembler version ([0-9]+)\\.([0-9]+).*" "\\1" _tbb_gnu_asm_major_version "${ASSEMBLER_VERSION_LINE}")
+string(REGEX REPLACE ".*GNU assembler version ([0-9]+)\\.([0-9]+).*" "\\2" _tbb_gnu_asm_minor_version "${ASSEMBLER_VERSION_LINE}")
+unset(ASSEMBLER_VERSION_LINE_OUT)
+unset(ASSEMBLER_VERSION_LINE_ERR)
+unset(ASSEMBLER_VERSION_LINE)
+message(TRACE "Extracted GNU assembler version: major=${_tbb_gnu_asm_major_version} minor=${_tbb_gnu_asm_minor_version}")
+
+math(EXPR _tbb_gnu_asm_version_number "${_tbb_gnu_asm_major_version} * 1000 + ${_tbb_gnu_asm_minor_version}")
+set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} "-D__TBB_GNU_ASM_VERSION=${_tbb_gnu_asm_version_number}")
+message(STATUS "GNU Assembler version: ${_tbb_gnu_asm_major_version}.${_tbb_gnu_asm_minor_version} (${_tbb_gnu_asm_version_number})")
+
# 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 "(AMD64|amd64|i.86|x86)" AND NOT EMSCRIPTEN)
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$>,$>>:-mwaitpkg>)
endif()
@@ -51,6 +82,9 @@ 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 $<$>:-flifetime-dse=1>)
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$>:-fstack-clash-protection>)
+
+ # Suppress GCC 12.x-13.x warning here that to_wait_node(n)->my_is_in_list might have size 0
+ set(TBB_COMMON_LINK_FLAGS ${TBB_COMMON_LINK_FLAGS} $<$>,$>:-Wno-stringop-overflow>)
endif()
# Workaround for heavy tests and too many symbols in debug (rellocation truncated to fit: R_MIPS_CALL16)
diff --git a/cmake/compilers/IntelLLVM.cmake b/cmake/compilers/IntelLLVM.cmake
index a9ebb3e670..b514378164 100644
--- a/cmake/compilers/IntelLLVM.cmake
+++ b/cmake/compilers/IntelLLVM.cmake
@@ -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.
@@ -20,6 +20,9 @@ if (WIN32)
else()
include(${CMAKE_CURRENT_LIST_DIR}/Clang.cmake)
set(TBB_IPO_COMPILE_FLAGS $<$>:-ipo>)
+ # "--exclude-libs,ALL" is used to avoid accidental exporting of symbols
+ # from statically linked libraries
+ set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -static-intel -Wl,--exclude-libs,ALL)
set(TBB_OPENMP_FLAG -qopenmp)
endif()
set(TBB_IPO_LINK_FLAGS ${TBB_IPO_LINK_FLAGS} ${TBB_IPO_COMPILE_FLAGS})
diff --git a/doc/conf.py b/doc/conf.py
index 19da0a4caf..a0ef593b9b 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -29,7 +29,7 @@
project = u'Intel® oneAPI Threading Building Blocks (oneTBB)'
else:
project = u'oneTBB'
-copyright = u'2023, Intel Corporation'
+copyright = u'Intel Corporation'
author = u'Intel'
# The short X.Y version
@@ -304,7 +304,7 @@
# -- Options for intersphinx extension ---------------------------------------
# Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {'https://docs.python.org/': None}
+intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
# -- Options for todo extension ----------------------------------------------
diff --git a/doc/main/reference/custom_mutex_chmap.rst b/doc/main/reference/custom_mutex_chmap.rst
index 152320fd65..acf502e66d 100644
--- a/doc/main/reference/custom_mutex_chmap.rst
+++ b/doc/main/reference/custom_mutex_chmap.rst
@@ -50,7 +50,7 @@ Type requirements
-----------------
The type of the mutex passed as a template argument for ``concurrent_hash_map`` should
-meet the requirements of `ReaderWriterMutex `_.
+meet the requirements of `ReaderWriterMutex `_.
It should also provide the following API:
.. cpp:function:: bool ReaderWriterMutex::scoped_lock::is_writer() const;
diff --git a/doc/main/reference/parallel_for_each_semantics.rst b/doc/main/reference/parallel_for_each_semantics.rst
index 1f8815b3b3..c007066b3b 100644
--- a/doc/main/reference/parallel_for_each_semantics.rst
+++ b/doc/main/reference/parallel_for_each_semantics.rst
@@ -10,7 +10,7 @@ parallel_for_each Body semantics and requirements
Description
***********
-This page clarifies `ParallelForEachBody `_
+This page clarifies `ParallelForEachBody `_
named requirements for ``tbb::parallel_for_each`` algorithm specification.
.. code:: cpp
diff --git a/doc/main/reference/parallel_sort_ranges_extension.rst b/doc/main/reference/parallel_sort_ranges_extension.rst
index 52f2283a17..cad65b54b0 100644
--- a/doc/main/reference/parallel_sort_ranges_extension.rst
+++ b/doc/main/reference/parallel_sort_ranges_extension.rst
@@ -10,7 +10,7 @@ parallel_sort ranges interface extension
Description
***********
-|full_name| implementation extends the `oneapi::tbb::parallel_sort specification `_
+|full_name| implementation extends the `oneapi::tbb::parallel_sort specification `_
with overloads that takes the container by forwarding reference.
diff --git a/doc/main/reference/reference.rst b/doc/main/reference/reference.rst
index 833a50ee70..c8ba0af944 100644
--- a/doc/main/reference/reference.rst
+++ b/doc/main/reference/reference.rst
@@ -3,13 +3,13 @@
|short_name| API Reference
==========================
-For oneTBB API Reference, refer to `oneAPI Specification `_. The current supported
+For oneTBB API Reference, refer to `oneAPI Specification `_. The current supported
version of oneAPI Specification is 1.0.
Specification extensions
************************
-|full_name| implements the `oneTBB specification `_.
+|full_name| implements the `oneTBB specification `_.
This document provides additional details or restrictions where necessary.
It also describes features that are not included in the oneTBB specification.
diff --git a/doc/main/reference/rvalue_reduce.rst b/doc/main/reference/rvalue_reduce.rst
index 53880952aa..69d480d465 100644
--- a/doc/main/reference/rvalue_reduce.rst
+++ b/doc/main/reference/rvalue_reduce.rst
@@ -10,8 +10,8 @@ Parallel Reduction for rvalues
Description
***********
-|full_name| implementation extends the `ParallelReduceFunc `_ and
-`ParallelReduceReduction `_
+|full_name| implementation extends the `ParallelReduceFunc `_ and
+`ParallelReduceReduction `_
to optimize operating with ``rvalues`` using functional form of ``tbb::parallel_reduce`` and ``tbb::parallel_deterministic_reduce`` algorithms.
API
@@ -33,8 +33,8 @@ or
.. cpp:function:: Value Func::operator()(const Range& range, const Value& x) const
- Accumulates the result for a subrange, starting with initial value ``x``. The ``Range`` type must meet the `Range requirements _`.
- The ``Value`` type must be the same as a corresponding template parameter for the `parallel_reduce algorithm `_.
+ Accumulates the result for a subrange, starting with initial value ``x``. The ``Range`` type must meet the `Range requirements _`.
+ The ``Value`` type must be the same as a corresponding template parameter for the `parallel_reduce algorithm `_.
If both ``rvalue`` and ``lvalue`` forms are provided, the ``rvalue`` is preferred.
@@ -47,7 +47,7 @@ or
.. cpp:function:: Value Reduction::operator()(const Value& x, const Value& y) const
- Combines the ``x`` and ``y`` results. The ``Value`` type must be the same as a corresponding template parameter for the `parallel_reduce algorithm `_.
+ Combines the ``x`` and ``y`` results. The ``Value`` type must be the same as a corresponding template parameter for the `parallel_reduce algorithm `_.
If both ``rvalue`` and ``lvalue`` forms are provided, the ``rvalue`` is preferred.
@@ -83,7 +83,7 @@ Example
.. rubric:: See also
-* `oneapi::tbb::parallel_reduce specification `_
-* `oneapi::tbb::parallel_deterministic_reduce specification `_
-* `ParallelReduceFunc specification `_
-* `ParallelReduceReduction specification `_
+* `oneapi::tbb::parallel_reduce specification `_
+* `oneapi::tbb::parallel_deterministic_reduce specification `_
+* `ParallelReduceFunc specification `_
+* `ParallelReduceReduction specification `_
diff --git a/doc/main/reference/task_group_extensions.rst b/doc/main/reference/task_group_extensions.rst
index 10d3980161..47795f9574 100644
--- a/doc/main/reference/task_group_extensions.rst
+++ b/doc/main/reference/task_group_extensions.rst
@@ -13,7 +13,7 @@ task_group extensions
Description
***********
-|full_name| implementation extends the `tbb::task_group specification `_ with the requirements for a user-provided function object.
+|full_name| implementation extends the `tbb::task_group specification `_ with the requirements for a user-provided function object.
API
@@ -83,7 +83,7 @@ As an optimization hint, ``F`` might return a ``task_handle``, which task object
.. rubric:: See also
-* `oneapi::tbb::task_group specification `_
-* `oneapi::tbb::task_group_context specification `_
-* `oneapi::tbb::task_group_status specification `_
-* `oneapi::tbb::task_handle class `_
+* `oneapi::tbb::task_group specification `_
+* `oneapi::tbb::task_group_context specification `_
+* `oneapi::tbb::task_group_status specification `_
+* `oneapi::tbb::task_handle class `_
diff --git a/doc/main/reference/type_specified_message_keys.rst b/doc/main/reference/type_specified_message_keys.rst
index 3b1dbc56fa..a50cd7f434 100644
--- a/doc/main/reference/type_specified_message_keys.rst
+++ b/doc/main/reference/type_specified_message_keys.rst
@@ -66,4 +66,4 @@ lookup and used in place of the default implementation.
See Also
********
-`join_node Specification `_
+`join_node Specification `_
diff --git a/doc/main/tbb_userguide/Constraints.rst b/doc/main/tbb_userguide/Constraints.rst
index d37ce12028..1928fe8eeb 100644
--- a/doc/main/tbb_userguide/Constraints.rst
+++ b/doc/main/tbb_userguide/Constraints.rst
@@ -4,7 +4,7 @@ Constrained APIs
================
Starting from C++20, most of |full_name| APIs are constrained to
-enforce `named requirements `_ on
+enforce `named requirements `_ on
template arguments types.
The violations of these requirements are detected at a compile time during the template instantiation.
diff --git a/doc/main/tbb_userguide/How_Task_Scheduler_Works.rst b/doc/main/tbb_userguide/How_Task_Scheduler_Works.rst
index 5ad1670baa..744794fc07 100644
--- a/doc/main/tbb_userguide/How_Task_Scheduler_Works.rst
+++ b/doc/main/tbb_userguide/How_Task_Scheduler_Works.rst
@@ -7,7 +7,7 @@ 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
-`_.
+`_.
Let's consider the mapping of fork-join parallelism on the task scheduler in more detail.
diff --git a/doc/main/tbb_userguide/Migration_Guide/Task_Scheduler_Init.rst b/doc/main/tbb_userguide/Migration_Guide/Task_Scheduler_Init.rst
index aa8658acf8..6acdb272eb 100644
--- a/doc/main/tbb_userguide/Migration_Guide/Task_Scheduler_Init.rst
+++ b/doc/main/tbb_userguide/Migration_Guide/Task_Scheduler_Init.rst
@@ -14,27 +14,27 @@ Querying the default number of threads
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* `oneapi::tbb::info::default_concurrency()
- `_
+ `_
returns the maximum concurrency that will be created by *default* in implicit or explicit ``task_arena``.
* `oneapi::tbb::this_task_arena::max_concurrency()
- `_
+ `_
returns the maximum number of threads available for the parallel algorithms within the current context
(or *default* if an implicit arena is not initialized)
* `oneapi::tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism)
- `_
+ `_
returns the current limit of the thread pool (or *default* if oneTBB scheduler is not initialized)
Setting the maximum concurrency
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* `task_arena(/* max_concurrency */)
- `_
+ `_
limits the maximum concurrency of the parallel algorithm running inside ``task_arena``
* `tbb::global_control(tbb::global_control::max_allowed_parallelism, /* max_concurrency */)
- `_
+ `_
limits the total number of oneTBB worker threads
Examples
@@ -116,7 +116,7 @@ The limited parallelism:
Setting thread stack size
---------------------------------------
Use `oneapi::tbb::global_control(oneapi::tbb::global_control::thread_stack_size, /* stack_size */)
-`_
+`_
to set the stack size for oneTBB worker threads:
.. code:: cpp
@@ -141,7 +141,7 @@ to set the stack size for oneTBB worker threads:
Terminating oneTBB scheduler
---------------------------------------
-`task_scheduler_handle `_
+`task_scheduler_handle `_
allows waiting for oneTBB worker threads completion:
.. code:: cpp
diff --git a/examples/task_group/sudoku/README.md b/examples/task_group/sudoku/README.md
index 0e3ef499ea..9f59bbb446 100644
--- a/examples/task_group/sudoku/README.md
+++ b/examples/task_group/sudoku/README.md
@@ -1,4 +1,4 @@
-# Fractal sample
+# Sudoku sample
This directory contains an example that finds all solutions to a Sudoku board.
It uses a straightforward state-space search algorithm that exhibits OR-parallelism. It can be optionally run until it obtains just the first solution. The point of the example is to teach how to use the `task_group` interface.
@@ -11,9 +11,8 @@ cmake --build .
## Running the sample
### Predefined make targets
-* `make run_fractal` - executes the example with predefined parameters.
-* `make perf_run_fractal` - executes the example with suggested parameters to measure the oneTBB performance.
-* `make light_test_fractal` - executes the example with suggested parameters to reduce execution time.
+* `make run_sudoku` - executes the example with predefined parameters.
+* `make perf_run_sudoku` - executes the example with suggested parameters to measure the oneTBB performance.
### Application parameters
Usage:
diff --git a/examples/test_all/fibonacci/README.md b/examples/test_all/fibonacci/README.md
index 3d1d795df8..f65edcece7 100644
--- a/examples/test_all/fibonacci/README.md
+++ b/examples/test_all/fibonacci/README.md
@@ -1,4 +1,4 @@
-# Fractal sample
+# Fibonacci sample
This directory contains an example that computes Fibonacci numbers in several different ways.
The purpose of the example is to exercise every include file and class in Intel® oneAPI Threading Building Blocks. Most of the computations are deliberately silly and not expected to show any speedup on multiprocessors.
@@ -11,9 +11,7 @@ cmake --build .
## Running the sample
### Predefined make targets
-* `make run_fractal` - executes the example with predefined parameters.
-* `make perf_run_fractal` - executes the example with suggested parameters to measure the oneTBB performance.
-* `make light_test_fractal` - executes the example with suggested parameters to reduce execution time.
+* `make run_fibonacci` - executes the example with predefined parameters.
### Application parameters
Usage:
diff --git a/include/oneapi/tbb/collaborative_call_once.h b/include/oneapi/tbb/collaborative_call_once.h
index db082f891a..18e3bbb245 100644
--- a/include/oneapi/tbb/collaborative_call_once.h
+++ b/include/oneapi/tbb/collaborative_call_once.h
@@ -1,5 +1,5 @@
/*
- 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.
@@ -32,6 +32,27 @@ namespace d1 {
#pragma warning (disable: 4324)
#endif
+template
+class collaborative_call_stack_task : public task {
+ const F& m_func;
+ wait_context& m_wait_ctx;
+
+ void finalize() {
+ m_wait_ctx.release();
+ }
+ task* execute(d1::execution_data&) override {
+ task* res = d2::task_ptr_or_nullptr(m_func);
+ finalize();
+ return res;
+ }
+ task* cancel(d1::execution_data&) override {
+ finalize();
+ return nullptr;
+ }
+public:
+ collaborative_call_stack_task(const F& f, wait_context& wctx) : m_func(f), m_wait_ctx(wctx) {}
+};
+
constexpr std::uintptr_t collaborative_once_max_references = max_nfs_size;
constexpr std::uintptr_t collaborative_once_references_mask = collaborative_once_max_references-1;
@@ -103,7 +124,7 @@ class alignas(max_nfs_size) collaborative_once_runner : no_copy {
task_group_context context{ task_group_context::bound,
task_group_context::default_traits | task_group_context::concurrent_wait };
- function_stack_task t{ std::forward(f), m_storage.m_wait_context };
+ collaborative_call_stack_task t{ std::forward(f), m_storage.m_wait_context };
// Set the ready flag after entering the execute body to prevent
// moonlighting threads from occupying all slots inside the arena.
@@ -151,7 +172,7 @@ class collaborative_once_flag : no_copy {
spin_wait_until_eq(m_state, expected);
} while (!m_state.compare_exchange_strong(expected, desired));
}
-
+
template
void do_collaborative_call_once(Fn&& f) {
std::uintptr_t expected = m_state.load(std::memory_order_acquire);
diff --git a/include/oneapi/tbb/concurrent_unordered_map.h b/include/oneapi/tbb/concurrent_unordered_map.h
index 336425cc8f..9cade0a94e 100644
--- a/include/oneapi/tbb/concurrent_unordered_map.h
+++ b/include/oneapi/tbb/concurrent_unordered_map.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -24,14 +24,14 @@
namespace tbb {
namespace detail {
-namespace d1 {
+namespace d2 {
template
struct concurrent_unordered_map_traits {
using value_type = std::pair;
using key_type = Key;
using allocator_type = Allocator;
- using hash_compare_type = hash_compare;
+ using hash_compare_type = d1::hash_compare;
static constexpr bool allow_multimapping = AllowMultimapping;
static constexpr const key_type& get_key( const value_type& value ) {
@@ -399,13 +399,13 @@ void swap( concurrent_unordered_multimap& lhs
lhs.swap(rhs);
}
-} // namespace d1
+} // namespace d2
} // namespace detail
inline namespace v1 {
-using detail::d1::concurrent_unordered_map;
-using detail::d1::concurrent_unordered_multimap;
+using detail::d2::concurrent_unordered_map;
+using detail::d2::concurrent_unordered_multimap;
using detail::split;
} // inline namespace v1
diff --git a/include/oneapi/tbb/concurrent_unordered_set.h b/include/oneapi/tbb/concurrent_unordered_set.h
index c135b92222..b7e4b4cafc 100644
--- a/include/oneapi/tbb/concurrent_unordered_set.h
+++ b/include/oneapi/tbb/concurrent_unordered_set.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -23,14 +23,14 @@
namespace tbb {
namespace detail {
-namespace d1 {
+namespace d2 {
template
struct concurrent_unordered_set_traits {
using key_type = Key;
using value_type = key_type;
using allocator_type = Allocator;
- using hash_compare_type = hash_compare;
+ using hash_compare_type = d1::hash_compare;
static constexpr bool allow_multimapping = AllowMultimapping;
static constexpr const key_type& get_key( const value_type& value ) {
@@ -318,13 +318,13 @@ void swap( concurrent_unordered_multiset& lhs,
lhs.swap(rhs);
}
-} // namespace d1
+} // namespace d2
} // namespace detail
inline namespace v1 {
-using detail::d1::concurrent_unordered_set;
-using detail::d1::concurrent_unordered_multiset;
+using detail::d2::concurrent_unordered_set;
+using detail::d2::concurrent_unordered_multiset;
using detail::split;
} // inline namespace v1
diff --git a/include/oneapi/tbb/detail/_concurrent_unordered_base.h b/include/oneapi/tbb/detail/_concurrent_unordered_base.h
index 408292086a..85f54d0a57 100644
--- a/include/oneapi/tbb/detail/_concurrent_unordered_base.h
+++ b/include/oneapi/tbb/detail/_concurrent_unordered_base.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2023 Intel Corporation
+ Copyright (c) 2005-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.
@@ -46,7 +46,7 @@
namespace tbb {
namespace detail {
-namespace d1 {
+namespace d2 {
template
class concurrent_unordered_base;
@@ -171,7 +171,7 @@ class value_node : public list_node
value_node( sokey_type ord_key ) : base_type(ord_key) {}
~value_node() {}
value_type* storage() {
- return reinterpret_cast(&my_value);
+ return &my_value;
}
value_type& value() {
@@ -179,8 +179,9 @@ class value_node : public list_node
}
private:
- using aligned_storage_type = typename std::aligned_storage::type;
- aligned_storage_type my_value;
+ union {
+ value_type my_value;
+ };
}; // class value_node
template
@@ -237,7 +238,7 @@ class concurrent_unordered_base {
template
using is_transparent = dependent_bool, T>;
public:
- using node_type = node_handle;
+ using node_type = d1::node_handle;
explicit concurrent_unordered_base( size_type bucket_count, const hasher& hash = hasher(),
const key_equal& equal = key_equal(), const allocator_type& alloc = allocator_type() )
@@ -441,7 +442,7 @@ class concurrent_unordered_base {
std::pair insert( node_type&& nh ) {
if (!nh.empty()) {
- value_node_ptr insert_node = node_handle_accessor::get_node_ptr(nh);
+ value_node_ptr insert_node = d1::node_handle_accessor::get_node_ptr(nh);
auto init_node = [&insert_node]( sokey_type order_key )->value_node_ptr {
insert_node->init(order_key);
return insert_node;
@@ -451,7 +452,7 @@ class concurrent_unordered_base {
// If the insertion succeeded - set node handle to the empty state
__TBB_ASSERT(insert_result.remaining_node == nullptr,
"internal_insert_node should not return the remaining node if the insertion succeeded");
- node_handle_accessor::deactivate(nh);
+ d1::node_handle_accessor::deactivate(nh);
}
return { iterator(insert_result.node_with_equal_key), insert_result.inserted };
}
@@ -521,12 +522,12 @@ class concurrent_unordered_base {
node_type unsafe_extract( const_iterator pos ) {
internal_extract(pos.get_node_ptr());
- return node_handle_accessor::construct(pos.get_node_ptr());
+ return d1::node_handle_accessor::construct(pos.get_node_ptr());
}
node_type unsafe_extract( iterator pos ) {
internal_extract(pos.get_node_ptr());
- return node_handle_accessor::construct(pos.get_node_ptr());
+ return d1::node_handle_accessor::construct(pos.get_node_ptr());
}
node_type unsafe_extract( const key_type& key ) {
@@ -787,11 +788,11 @@ class concurrent_unordered_base {
static constexpr size_type pointers_per_embedded_table = sizeof(size_type) * 8 - 1;
class unordered_segment_table
- : public segment_table, allocator_type, unordered_segment_table, pointers_per_embedded_table>
+ : public d1::segment_table, allocator_type, unordered_segment_table, pointers_per_embedded_table>
{
using self_type = unordered_segment_table;
using atomic_node_ptr = std::atomic;
- using base_type = segment_table, allocator_type, unordered_segment_table, pointers_per_embedded_table>;
+ using base_type = d1::segment_table, allocator_type, unordered_segment_table, pointers_per_embedded_table>;
using segment_type = typename base_type::segment_type;
using base_allocator_type = typename base_type::allocator_type;
@@ -921,7 +922,7 @@ class concurrent_unordered_base {
node_allocator_traits::deallocate(dummy_node_allocator, node, 1);
} else {
// GCC 11.1 issues a warning here that incorrect destructor might be called for dummy_nodes
- #if (__TBB_GCC_VERSION >= 110100 && __TBB_GCC_VERSION < 140000 ) && !__clang__ && !__INTEL_COMPILER
+ #if (__TBB_GCC_VERSION >= 110100 && __TBB_GCC_VERSION < 150000 ) && !__clang__ && !__INTEL_COMPILER
volatile
#endif
value_node_ptr val_node = static_cast(node);
@@ -1212,7 +1213,7 @@ class concurrent_unordered_base {
// Node handle with curr cannot be used directly in insert call, because
// the destructor of node_type will destroy curr
- node_type curr_node = node_handle_accessor::construct(curr);
+ node_type curr_node = d1::node_handle_accessor::construct(curr);
// If the insertion fails - return ownership of the node to the source
if (!insert(std::move(curr_node)).second) {
@@ -1230,7 +1231,7 @@ class concurrent_unordered_base {
curr->set_next(next_node);
source_prev->set_next(curr);
source_prev = curr;
- node_handle_accessor::deactivate(curr_node);
+ d1::node_handle_accessor::deactivate(curr_node);
} else {
source.my_size.fetch_sub(1, std::memory_order_relaxed);
}
@@ -1507,7 +1508,7 @@ bool operator!=( const concurrent_unordered_base& lhs,
#pragma warning(pop) // warning 4127 is back
#endif
-} // namespace d1
+} // namespace d2
} // namespace detail
} // namespace tbb
diff --git a/include/oneapi/tbb/detail/_config.h b/include/oneapi/tbb/detail/_config.h
index d6705e154c..e676b1558b 100644
--- a/include/oneapi/tbb/detail/_config.h
+++ b/include/oneapi/tbb/detail/_config.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2023 Intel Corporation
+ Copyright (c) 2005-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.
@@ -335,7 +335,7 @@
#define __TBB_TSX_INTRINSICS_PRESENT (__RTM__ || __INTEL_COMPILER || (_MSC_VER>=1700 && (__TBB_x86_64 || __TBB_x86_32)))
-#define __TBB_WAITPKG_INTRINSICS_PRESENT ((__INTEL_COMPILER >= 1900 || __TBB_GCC_VERSION >= 110000 || __TBB_CLANG_VERSION >= 120000) \
+#define __TBB_WAITPKG_INTRINSICS_PRESENT ((__INTEL_COMPILER >= 1900 || (__TBB_GCC_VERSION >= 110000 && __TBB_GNU_ASM_VERSION >= 2032) || __TBB_CLANG_VERSION >= 120000) \
&& (_WIN32 || _WIN64 || __unix__ || __APPLE__) && (__TBB_x86_32 || __TBB_x86_64) && !__ANDROID__)
/** Internal TBB features & modes **/
@@ -521,6 +521,11 @@
#define __TBB_PREVIEW_FLOW_GRAPH_NODE_SET (TBB_PREVIEW_FLOW_GRAPH_FEATURES)
#endif
+#ifndef __TBB_PREVIEW_FLOW_GRAPH_TRY_PUT_AND_WAIT
+#define __TBB_PREVIEW_FLOW_GRAPH_TRY_PUT_AND_WAIT (TBB_PREVIEW_FLOW_GRAPH_FEATURES \
+ || TBB_PREVIEW_FLOW_GRAPH_TRY_PUT_AND_WAIT)
+#endif
+
#if TBB_PREVIEW_CONCURRENT_HASH_MAP_EXTENSIONS
#define __TBB_PREVIEW_CONCURRENT_HASH_MAP_EXTENSIONS 1
#endif
diff --git a/include/oneapi/tbb/detail/_flow_graph_body_impl.h b/include/oneapi/tbb/detail/_flow_graph_body_impl.h
index 8ac11211f6..21da06ce03 100644
--- a/include/oneapi/tbb/detail/_flow_graph_body_impl.h
+++ b/include/oneapi/tbb/detail/_flow_graph_body_impl.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2023 Intel Corporation
+ Copyright (c) 2005-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.
@@ -21,7 +21,7 @@
#error Do not #include this internal file directly; use public TBB headers instead.
#endif
-// included in namespace tbb::detail::d1 (in flow_graph.h)
+// included in namespace tbb::detail::d2 (in flow_graph.h)
typedef std::uint64_t tag_value;
@@ -53,7 +53,7 @@ namespace graph_policy_namespace {
// K == type of field used for key-matching. Each tag-matching port will be provided
// functor that, given an object accepted by the port, will return the
/// field of type K being used for matching.
- template::type > >
+ template::type > >
__TBB_requires(tbb::detail::hash_compare)
struct key_matching {
typedef K key_type;
@@ -77,7 +77,7 @@ template< typename Output >
class input_body : no_assign {
public:
virtual ~input_body() {}
- virtual Output operator()(flow_control& fc) = 0;
+ virtual Output operator()(d1::flow_control& fc) = 0;
virtual input_body* clone() = 0;
};
@@ -86,7 +86,7 @@ template< typename Output, typename Body>
class input_body_leaf : public input_body