Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b6365732a | ||
|
|
68c6b62b4b |
@@ -1 +0,0 @@
|
||||
8.1.1
|
||||
@@ -1,7 +0,0 @@
|
||||
# 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
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
name: Ask a question
|
||||
about: Use this template for any questions
|
||||
title: ''
|
||||
labels: 'question'
|
||||
assignees: ''
|
||||
---
|
||||
@@ -1,32 +0,0 @@
|
||||
---
|
||||
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.
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
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.
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
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.
|
||||
@@ -1,6 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
@@ -1,27 +0,0 @@
|
||||
# Copyright (c) 2023 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# PR template regexp's for issue labeler
|
||||
bug fix:
|
||||
- '\[(x|X)\]\sbug\sfix'
|
||||
enhancement:
|
||||
- '\[(x|X)\]\snew\sfeature'
|
||||
tests:
|
||||
- '\[(x|X)\]\stests'
|
||||
infrastructure:
|
||||
- '\[(x|X)\]\sinfrastructure'
|
||||
documentation:
|
||||
- '\[(x|X)\]\sdocumentation'
|
||||
allocator:
|
||||
- '\[(x|X)\]\sallocator'
|
||||
@@ -1,17 +0,0 @@
|
||||
# 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.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
allocator:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: ['src/tbbmalloc/**/*', 'src/tbbmalloc_proxy/**/*', 'test/tbbmalloc/**/*']
|
||||
@@ -1,38 +0,0 @@
|
||||
### Description
|
||||
_Add a comprehensive description of proposed changes_
|
||||
|
||||
|
||||
Fixes # - _issue number(s) if exists_
|
||||
|
||||
### Type of change
|
||||
|
||||
_Choose one or multiple, leave empty if none of the other choices apply_
|
||||
|
||||
_Add a respective label(s) to PR if you have permissions_
|
||||
|
||||
- [ ] bug fix - _change that fixes an issue_
|
||||
- [ ] new feature - _change that adds functionality_
|
||||
- [ ] tests - _change in tests_
|
||||
- [ ] infrastructure - _change in infrastructure and CI_
|
||||
- [ ] documentation - _documentation update_
|
||||
|
||||
### Tests
|
||||
|
||||
- [ ] added - _required for new features and some bug fixes_
|
||||
- [ ] not needed
|
||||
|
||||
### Documentation
|
||||
|
||||
- [ ] updated in # - _add PR number_
|
||||
- [ ] needs to be updated
|
||||
- [ ] not needed
|
||||
|
||||
### Breaks backward compatibility
|
||||
- [ ] Yes
|
||||
- [ ] No
|
||||
- [ ] Unknown
|
||||
|
||||
### Notify the following users
|
||||
_List users with `@` to send notifications_
|
||||
|
||||
### Other information
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2021-2025 Intel Corporation
|
||||
# Copyright (c) 2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -16,8 +16,7 @@
|
||||
|
||||
SCAN_TARGET=$1
|
||||
|
||||
SKIP_PATTERN='*/.github/*,*/test/common/doctest.*'
|
||||
IGNORE_WORDS='parms,affinitized'
|
||||
SKIP_PATTERN='*/.github/*'
|
||||
|
||||
# Ignored cases
|
||||
IGNORE_COMMAND="sed -e /.*\\sOd\\s*=.*/d \
|
||||
@@ -35,7 +34,6 @@ IGNORE_COMMAND="sed -e /.*\\sOd\\s*=.*/d \
|
||||
-e /.*\\sFo\\s*=.*/d \
|
||||
-e /.*pipeline_filters.h.*nd\\s*=.*/d \
|
||||
-e /.*ittnotify.h.*unx\\s*=.*/d \
|
||||
-e /.*ittnotify.*.h.*hist\\s*=.*/d \
|
||||
-e /.*bzlib.cpp.*MSDOS\\s*=.*/d \
|
||||
-e /.*test_task.cpp.*tE\\s*=.*/d \
|
||||
-e /.*backend.cpp.*resSize\\s*=.*/d \
|
||||
@@ -51,11 +49,9 @@ IGNORE_COMMAND="sed -e /.*\\sOd\\s*=.*/d \
|
||||
-e /.*count_strings.cpp.*ths\\s*=.*/d \
|
||||
-e /.*polygon_overlay\/README.md.*ist\\s*=.*/d \
|
||||
-e /.*_pipeline_filters.h.*nd\\s*=.*/d \
|
||||
-e /.*sub_string_finder\/README.md.*ba\\s*=.*/d
|
||||
-e /.*frontend.cpp.*SEH\\s*=.*/d
|
||||
-e /.*assert_impl.h.*statics\\s*=.*/d"
|
||||
-e /.*sub_string_finder\/README.md.*ba\\s*=.*/d"
|
||||
|
||||
SCAN_RESULT=`codespell --quiet-level=2 --skip "${SKIP_PATTERN}" -L "${IGNORE_WORDS}" ${SCAN_TARGET}`
|
||||
SCAN_RESULT=`codespell --quiet-level=2 --skip "${SKIP_PATTERN}" ${SCAN_TARGET}`
|
||||
SCAN_RESULT=`echo -e "${SCAN_RESULT}" | ${IGNORE_COMMAND}`
|
||||
echo "${SCAN_RESULT}"
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# Copyright (c) 2021-2025 Intel Corporation
|
||||
# Copyright (c) 2026 UXL Foundation Contributors
|
||||
# Copyright (c) 2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -26,401 +25,106 @@ on:
|
||||
- synchronize
|
||||
- reopened
|
||||
|
||||
permissions: read-all
|
||||
|
||||
env:
|
||||
BUILD_CONCURRENCY: 2
|
||||
MACOS_BUILD_CONCURRENCY: 3
|
||||
TEST_TIMEOUT: 180
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ !contains(github.ref, 'refs/heads/master') }}
|
||||
|
||||
jobs:
|
||||
codespell:
|
||||
runs-on: [ubuntu-22.04]
|
||||
runs-on: [ubuntu-20.04]
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run scan
|
||||
run: |
|
||||
set -e -x -o pipefail
|
||||
sudo apt update && sudo apt install -y codespell
|
||||
${GITHUB_WORKSPACE}/.github/scripts/codespell.sh `pwd`
|
||||
|
||||
examples_clang-format:
|
||||
runs-on: [ubuntu-22.04]
|
||||
runs-on: [ubuntu-20.04]
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run scan
|
||||
run: |
|
||||
set -e -x -o pipefail
|
||||
command -v clang-format
|
||||
cp -r examples examples_formatted
|
||||
find examples_formatted -regex '.*\.\(cpp\|hpp\)' -exec clang-format -style=file -i {} \;
|
||||
find examples_formatted -regex '.*\.\(cpp\|hpp\)' -exec clang-format-9 -style=file -i {} \;
|
||||
diff -r examples examples_formatted
|
||||
|
||||
documentation:
|
||||
needs: [codespell]
|
||||
env:
|
||||
BUILD_TYPE: oss
|
||||
runs-on: [ubuntu-latest]
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install prerequisites
|
||||
run: |
|
||||
set -e -x -o pipefail
|
||||
pip3 install -U Jinja2
|
||||
pip3 install git+https://github.com/executablebooks/sphinx-book-theme.git
|
||||
pip3 install sphinx_design
|
||||
echo GITHUB_SHA_SHORT=${GITHUB_SHA::8} >> $GITHUB_ENV
|
||||
mkdir html
|
||||
- name: Build documentation
|
||||
run: |
|
||||
set -e -x -o pipefail
|
||||
export BUILD_TYPE=${BUILD_TYPE} && sphinx-build doc html
|
||||
tar -czvf html.tar.gz html/
|
||||
- name: Save docs
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: oneTBB-html-docs-${{ env.GITHUB_SHA_SHORT }}
|
||||
path: html.tar.gz
|
||||
|
||||
pages:
|
||||
if: ${{ github.ref == 'refs/heads/master' }}
|
||||
permissions:
|
||||
contents: write
|
||||
pages: write
|
||||
id-token: write
|
||||
runs-on: ubuntu-latest
|
||||
needs: [documentation]
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: Checkout gh-pages
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: gh-pages
|
||||
path: gh-pages
|
||||
- name: Set env
|
||||
run: echo GITHUB_SHA_SHORT=${GITHUB_SHA::8} >> $GITHUB_ENV
|
||||
- name: Download documetation
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
name: oneTBB-html-docs-${{ env.GITHUB_SHA_SHORT }}
|
||||
- name: Publish to github pages
|
||||
run: |
|
||||
set -e -x -o pipefail
|
||||
tar -xvf html.tar.gz
|
||||
cd gh-pages
|
||||
rm -rf *
|
||||
touch .nojekyll # https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/
|
||||
cp -r ../html/* .
|
||||
git config user.name github-actions
|
||||
git config user.email github-actions@github.com
|
||||
git add .
|
||||
git commit --reset-author --amend -m "Update from GitHub Actions"
|
||||
git push --force origin gh-pages
|
||||
|
||||
copyright_check:
|
||||
if: ${{ github.ref != 'refs/heads/master' }}
|
||||
runs-on: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
- name: Run check
|
||||
run: |
|
||||
set -e -x -o pipefail
|
||||
base_sha=${{ github.event.pull_request.base.sha }}
|
||||
current_year=$(date +%Y)
|
||||
apache_copyright_line="Licensed under the Apache License"
|
||||
uxl_copyright_re="Copyright \(c\) [0-9]+ UXL Foundation Contributors"
|
||||
intel_copyright_re="Copyright.*[0-9]\{4\}.*Intel"
|
||||
check_failed=false
|
||||
|
||||
new_files=$(git diff --find-renames --diff-filter=A --name-only "$base_sha" || true)
|
||||
modified_files=$(git diff --find-renames --diff-filter=M --name-only "$base_sha" || true)
|
||||
|
||||
if [ -n "$new_files" ]; then
|
||||
new_with_apache=$(grep -lF "$apache_copyright_line" $new_files || true)
|
||||
for file in $new_with_apache; do
|
||||
uxl_match=$(grep -cE "$uxl_copyright_re" "$file" || true)
|
||||
if [ "$uxl_match" -eq 0 ]; then
|
||||
echo "ERROR: New file is missing UXL copyright: $file"
|
||||
check_failed=true
|
||||
else
|
||||
year_match=$(grep -cE "Copyright \(c\) ${current_year} UXL Foundation Contributors" "$file" || true)
|
||||
if [ "$year_match" -eq 0 ]; then
|
||||
echo "ERROR: New file must have current year (${current_year}) in UXL copyright: $file"
|
||||
check_failed=true
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -n "$modified_files" ]; then
|
||||
modified_with_apache=$(grep -lF "$apache_copyright_line" $modified_files || true)
|
||||
for file in $modified_with_apache; do
|
||||
uxl_match=$(grep -cE "$uxl_copyright_re" "$file" || true)
|
||||
if [ "$uxl_match" -eq 0 ]; then
|
||||
echo "ERROR: Modified file is missing single year UXL copyright: $file"
|
||||
check_failed=true
|
||||
continue
|
||||
fi
|
||||
original_uxl=$(git show "${base_sha}:${file}" 2>/dev/null | grep -oE "$uxl_copyright_re" || true)
|
||||
current_uxl=$(grep -oE "$uxl_copyright_re" "$file" || true)
|
||||
if [ -n "$original_uxl" ] && [ "$original_uxl" != "$current_uxl" ]; then
|
||||
echo "ERROR: UXL copyright year must not be changed in: $file"
|
||||
check_failed=true
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
all_changed_files=$(git diff --find-renames --diff-filter=AM --name-only "$base_sha" || true)
|
||||
if [ -n "$all_changed_files" ]; then
|
||||
all_with_apache=$(grep -lF "$apache_copyright_line" $all_changed_files || true)
|
||||
for file in $all_with_apache; do
|
||||
original_intel=$(git show "${base_sha}:${file}" 2>/dev/null | grep "$intel_copyright_re" || true)
|
||||
current_intel=$(grep "$intel_copyright_re" "$file" || true)
|
||||
if [ -n "$original_intel" ] && [ "$original_intel" != "$current_intel" ]; then
|
||||
echo "ERROR: Intel copyright must not be modified in: $file"
|
||||
check_failed=true
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$check_failed" = true ]; then
|
||||
exit 1
|
||||
fi
|
||||
python_module_test_ubuntu_latest:
|
||||
runs-on: [ubuntu-latest]
|
||||
python_module_test_ubuntu18-04:
|
||||
runs-on: [ubuntu-18.04]
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run testing
|
||||
run: |
|
||||
set -e -x -o pipefail
|
||||
mkdir build && cd build
|
||||
cmake -DTBB4PY_BUILD=ON -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc ..
|
||||
make VERBOSE=1 -j${BUILD_CONCURRENCY} python_build
|
||||
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 }}${{ matrix.cmake_static }}
|
||||
name: ${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }}
|
||||
runs-on: ['${{ matrix.os }}']
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-18.04
|
||||
c_compiler: gcc
|
||||
cxx_compiler: g++
|
||||
std: 14
|
||||
build_type: relwithdebinfo
|
||||
preview: 'OFF'
|
||||
- os: ubuntu-22.04
|
||||
- os: ubuntu-20.04
|
||||
c_compiler: gcc
|
||||
cxx_compiler: g++
|
||||
std: 17
|
||||
build_type: release
|
||||
preview: 'ON'
|
||||
- os: ubuntu-24.04-arm
|
||||
c_compiler: gcc-14
|
||||
cxx_compiler: g++-14
|
||||
- os: ubuntu-20.04
|
||||
c_compiler: gcc-10
|
||||
cxx_compiler: g++-10
|
||||
std: 20
|
||||
build_type: debug
|
||||
preview: 'ON'
|
||||
- os: ubuntu-24.04-arm
|
||||
c_compiler: clang
|
||||
cxx_compiler: clang++
|
||||
std: 20
|
||||
build_type: release
|
||||
preview: 'ON'
|
||||
- os: ubuntu-22.04-arm
|
||||
c_compiler: gcc
|
||||
cxx_compiler: g++
|
||||
std: 20
|
||||
build_type: release
|
||||
preview: 'ON'
|
||||
cmake_static: -DBUILD_SHARED_LIBS=OFF
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y pkg-config libhwloc-dev hwloc
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run testing
|
||||
shell: bash
|
||||
run: |
|
||||
set -e -x -o pipefail
|
||||
set -x
|
||||
mkdir build && cd build
|
||||
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_TEST_PREVIEW=${{ matrix.preview }} -DTCM_BUILD=OFF ..
|
||||
make VERBOSE=1 -j${BUILD_CONCURRENCY}
|
||||
ctest --timeout ${TEST_TIMEOUT} --output-on-failure
|
||||
|
||||
linux-tcm-testing:
|
||||
name: tcm_test_${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}
|
||||
runs-on: ['${{ matrix.os }}']
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
c_compiler: clang
|
||||
cxx_compiler: clang++
|
||||
std: 20
|
||||
build_type: relwithdebinfo
|
||||
- os: ubuntu-24.04
|
||||
c_compiler: gcc
|
||||
cxx_compiler: g++
|
||||
std: 17
|
||||
build_type: debug
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y pkg-config libhwloc-dev hwloc
|
||||
- name: Run testing
|
||||
shell: bash
|
||||
run: |
|
||||
set -e -x -o pipefail
|
||||
mkdir build && cd build
|
||||
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
||||
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
|
||||
-DTCM_BUILD=ON -DTBB_BUILD=OFF ..
|
||||
make VERBOSE=1 -j${BUILD_CONCURRENCY}
|
||||
ctest --timeout ${TEST_TIMEOUT} --output-on-failure
|
||||
|
||||
linux-tcm-integration-testing:
|
||||
name: tcm_integration_test_${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}
|
||||
runs-on: ['${{ matrix.os }}']
|
||||
timeout-minutes: 45
|
||||
env:
|
||||
TCM_ENABLE: 1
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
c_compiler: clang
|
||||
cxx_compiler: clang++
|
||||
std: 23
|
||||
build_type: debug
|
||||
- os: ubuntu-24.04
|
||||
c_compiler: gcc
|
||||
cxx_compiler: g++
|
||||
std: 20
|
||||
build_type: relwithdebinfo
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y pkg-config libhwloc-dev hwloc
|
||||
- name: Run testing
|
||||
shell: bash
|
||||
run: |
|
||||
set -e -x -o pipefail
|
||||
mkdir build && cd build
|
||||
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
||||
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
|
||||
-DTCM_BUILD=ON -DTBB_TCM_TESTING=ON ..
|
||||
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
||||
-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 }}${{ matrix.cmake_static }}
|
||||
name: ${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }}
|
||||
runs-on: ['${{ matrix.os }}']
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: macos-15
|
||||
c_compiler: clang
|
||||
cxx_compiler: clang++
|
||||
std: 17
|
||||
build_type: debug
|
||||
preview: 'ON'
|
||||
- os: macos-14
|
||||
- os: macos-10.15
|
||||
c_compiler: clang
|
||||
cxx_compiler: clang++
|
||||
std: 14
|
||||
build_type: relwithdebinfo
|
||||
preview: 'ON'
|
||||
- os: macos-15-intel
|
||||
c_compiler: clang
|
||||
cxx_compiler: clang++
|
||||
std: 20
|
||||
build_type: release
|
||||
preview: 'ON'
|
||||
cmake_static: -DBUILD_SHARED_LIBS=OFF
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run testing
|
||||
shell: bash
|
||||
run: |
|
||||
set -e -x -o pipefail
|
||||
set -x
|
||||
mkdir build && cd build
|
||||
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_TEST_PREVIEW=${{ matrix.preview }} ..
|
||||
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
||||
-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
|
||||
|
||||
@@ -432,158 +136,33 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-2025
|
||||
generator: Visual Studio 18 2026
|
||||
- os: windows-2016
|
||||
generator: Visual Studio 15 2017
|
||||
c_compiler: cl
|
||||
cxx_compiler: cl
|
||||
std: 14
|
||||
build_type: relwithdebinfo
|
||||
preview: 'ON'
|
||||
job_name: windows_cl2026_cxx14_relwithdebinfo_preview=ON
|
||||
- os: windows-11-arm
|
||||
generator: Visual Studio 17 2022
|
||||
c_compiler: cl
|
||||
cxx_compiler: cl
|
||||
std: 20
|
||||
build_type: release
|
||||
preview: 'ON'
|
||||
job_name: windows_11_arm_cl2022_cxx20_release_preview=ON-DBUILD_SHARED_LIBS=OFF
|
||||
cmake_static: -DBUILD_SHARED_LIBS=OFF
|
||||
- os: windows-2022
|
||||
generator: Visual Studio 17 2022
|
||||
job_name: windows_cl2017_cxx14_relwithdebinfo_preview=ON
|
||||
- os: windows-2019
|
||||
generator: Visual Studio 16 2019
|
||||
c_compiler: cl
|
||||
cxx_compiler: cl
|
||||
std: 17
|
||||
build_type: relwithdebinfo
|
||||
preview: 'OFF'
|
||||
job_name: windows_cl2022_cxx17_relwithdebinfo_preview=OFF
|
||||
job_name: windows_cl2019_cxx17_relwithdebinfo_preview=OFF
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run testing
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "${{ matrix.generator }}" -A x64 -DCMAKE_CXX_STANDARD=${{ matrix.std }} ${{ matrix.cmake_static }} `
|
||||
cmake -G "${{ matrix.generator }}" -A x64 -DCMAKE_CXX_STANDARD=${{ matrix.std }} `
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} `
|
||||
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_TEST_PREVIEW=${{ matrix.preview }} ..
|
||||
if (!$?) {
|
||||
throw "CMake configuration step failed, exit code $LastExitCode"
|
||||
}
|
||||
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} ..
|
||||
cmake --build . --config ${{ matrix.build_type }} -j -v
|
||||
if (!$?) {
|
||||
throw "CMake build step failed, exit code $LastExitCode"
|
||||
}
|
||||
ctest -C ${{ matrix.build_type }} --timeout ${env:TEST_TIMEOUT} --output-on-failure
|
||||
if (!$?) {
|
||||
throw "CTest failed, exit code $LastExitCode"
|
||||
}
|
||||
|
||||
windows-tcm-testing:
|
||||
name: tcm_test_${{ matrix.job_name }}
|
||||
runs-on: ['${{ matrix.os }}']
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-2025
|
||||
c_compiler: cl
|
||||
cxx_compiler: cl
|
||||
std: 23
|
||||
build_type: debug
|
||||
job_name: windows_cl2026_cxx14_debug
|
||||
- os: windows-2022
|
||||
c_compiler: cl
|
||||
cxx_compiler: cl
|
||||
std: 17
|
||||
build_type: relwithdebinfo
|
||||
job_name: windows_cl2022_cxx17_relwithdebinfo
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
vcpkg install hwloc
|
||||
- name: Run testing
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.std }} `
|
||||
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} `
|
||||
-DTCM_BUILD=ON -DTBB_BUILD=OFF `
|
||||
-DCMAKE_TOOLCHAIN_FILE="${env:VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" ..
|
||||
if (!$?) {
|
||||
throw "CMake configuration step failed, exit code $LastExitCode"
|
||||
}
|
||||
cmake --build . --config ${{ matrix.build_type }} --parallel -v
|
||||
if (!$?) {
|
||||
throw "CMake build step failed, exit code $LastExitCode"
|
||||
}
|
||||
ctest -C ${{ matrix.build_type }} --timeout ${env:TEST_TIMEOUT} --output-on-failure
|
||||
if (!$?) {
|
||||
throw "CTest failed, exit code $LastExitCode"
|
||||
}
|
||||
|
||||
windows-tcm-integration_testing:
|
||||
name: tcm_integration_test_${{ matrix.job_name }}
|
||||
runs-on: ['${{ matrix.os }}']
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-2025
|
||||
c_compiler: cl
|
||||
cxx_compiler: cl
|
||||
std: 20
|
||||
build_type: relwithdebinfo
|
||||
job_name: windows_cl2026_cxx14_relwithdebinfo
|
||||
- os: windows-2022
|
||||
c_compiler: cl
|
||||
cxx_compiler: cl
|
||||
std: 17
|
||||
build_type: debug
|
||||
job_name: windows_cl2022_cxx17_debug
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
vcpkg install hwloc
|
||||
- name: Run testing
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.std }} `
|
||||
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} `
|
||||
-DTCM_BUILD=ON -DTBB_TCM_TESTING=ON `
|
||||
-DCMAKE_TOOLCHAIN_FILE="${env:VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" ..
|
||||
if (!$?) {
|
||||
throw "CMake configuration step failed, exit code $LastExitCode"
|
||||
}
|
||||
cmake --build . --config ${{ matrix.build_type }} --parallel -v
|
||||
if (!$?) {
|
||||
throw "CMake build step failed, exit code $LastExitCode"
|
||||
}
|
||||
ctest -C ${{ matrix.build_type }} --timeout ${env:TEST_TIMEOUT} --output-on-failure
|
||||
if (!$?) {
|
||||
throw "CTest failed, exit code $LastExitCode"
|
||||
}
|
||||
|
||||
linux-examples-testing:
|
||||
name: examples_${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }}
|
||||
@@ -593,39 +172,34 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-18.04
|
||||
c_compiler: gcc
|
||||
cxx_compiler: g++
|
||||
std: 14
|
||||
build_type: relwithdebinfo
|
||||
preview: 'OFF'
|
||||
- os: ubuntu-22.04
|
||||
- os: ubuntu-20.04
|
||||
c_compiler: gcc
|
||||
cxx_compiler: g++
|
||||
std: 17
|
||||
build_type: release
|
||||
preview: 'ON'
|
||||
- os: ubuntu-24.04
|
||||
c_compiler: gcc
|
||||
cxx_compiler: g++
|
||||
- os: ubuntu-20.04
|
||||
c_compiler: gcc-10
|
||||
cxx_compiler: g++-10
|
||||
std: 20
|
||||
build_type: debug
|
||||
preview: 'ON'
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run testing
|
||||
shell: bash
|
||||
run: |
|
||||
set -e -x -o pipefail
|
||||
set -x
|
||||
mkdir build && cd build
|
||||
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
||||
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
|
||||
-DTBB_TEST_PREVIEW=${{ matrix.preview }} -DTBB_TEST=OFF -DTBB_EXAMPLES=ON ..
|
||||
-DTBB_CPF=${{ matrix.preview }} -DTBB_TEST=OFF -DTBB_EXAMPLES=ON ..
|
||||
cmake --build . -v --target light_test_examples
|
||||
|
||||
macos-examples-testing:
|
||||
@@ -636,27 +210,22 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: macos-15
|
||||
- os: macos-10.15
|
||||
c_compiler: clang
|
||||
cxx_compiler: clang++
|
||||
std: 14
|
||||
build_type: relwithdebinfo
|
||||
preview: 'ON'
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run testing
|
||||
shell: bash
|
||||
run: |
|
||||
set -e -x -o pipefail
|
||||
set -x
|
||||
mkdir build && cd build
|
||||
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
||||
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
|
||||
-DTBB_TEST_PREVIEW=${{ matrix.preview }} -DTBB_TEST=OFF -DTBB_EXAMPLES=ON ..
|
||||
-DTBB_CPF=${{ matrix.preview }} -DTBB_TEST=OFF -DTBB_EXAMPLES=ON ..
|
||||
cmake --build . -v --target light_test_examples
|
||||
|
||||
windows-examples-testing:
|
||||
@@ -667,119 +236,29 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-11-arm
|
||||
generator: Visual Studio 17 2022
|
||||
- os: windows-2016
|
||||
generator: Visual Studio 15 2017
|
||||
c_compiler: cl
|
||||
cxx_compiler: cl
|
||||
std: 14
|
||||
build_type: relwithdebinfo
|
||||
preview: 'ON'
|
||||
job_name: examples_windows_11_arm_cl2022_cxx14_relwithdebinfo_preview=ON
|
||||
- os: windows-2022
|
||||
generator: Visual Studio 17 2022
|
||||
job_name: examples_windows_cl2017_cxx14_relwithdebinfo_preview=ON
|
||||
- os: windows-2019
|
||||
generator: Visual Studio 16 2019
|
||||
c_compiler: cl
|
||||
cxx_compiler: cl
|
||||
std: 17
|
||||
build_type: relwithdebinfo
|
||||
preview: 'OFF'
|
||||
job_name: examples_windows_cl2022_cxx17_relwithdebinfo_preview=OFF
|
||||
job_name: examples_windows_cl2019_cxx17_relwithdebinfo_preview=OFF
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run testing
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "${{ matrix.generator }}" -A x64 -DCMAKE_CXX_STANDARD=${{ matrix.std }} `
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} `
|
||||
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_TEST_PREVIEW=${{ matrix.preview }} -DTBB_TEST=OFF -DTBB_EXAMPLES=ON ..
|
||||
if (!$?) {
|
||||
throw "CMake configuration step of examples failed, exit code $LastExitCode"
|
||||
}
|
||||
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} -DTBB_TEST=OFF -DTBB_EXAMPLES=ON ..
|
||||
cmake --build . -v --target light_test_examples
|
||||
if (!$?) {
|
||||
throw "CMake build step of examples failed, exit code $LastExitCode"
|
||||
}
|
||||
|
||||
linux-doc-examples-testing:
|
||||
name: doc_examples_${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_${{ matrix.cmake_extra }}
|
||||
runs-on: ['${{ matrix.os }}']
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
c_compiler: clang
|
||||
cxx_compiler: clang++
|
||||
generator: Ninja
|
||||
std: 20
|
||||
build_type: relwithdebinfo
|
||||
cmake_extra: -DTBB_TEST_CXX20_MODULES=ON
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y ninja-build
|
||||
if [[ "${{ matrix.cxx_compiler }}" == "clang++" ]]; then
|
||||
sudo apt-get install -y libomp-dev
|
||||
fi
|
||||
- name: Test doc examples
|
||||
run: |
|
||||
set -e -x -o pipefail
|
||||
mkdir build && cd build
|
||||
cmake -G "${{ matrix.generator }}" -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type}} \
|
||||
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
|
||||
${{ matrix.cmake_extra }} -DTBB_TEST=OFF -DTBB_DOC_EXAMPLES=ON ..
|
||||
cmake --build . -v --parallel --target build-doc-examples
|
||||
ctest -C ${{ matrix.build_type }} --timeout ${env:TEST_TIMEOUT} --output-on-failure -L doc-examples
|
||||
|
||||
windows-doc-examples-testing:
|
||||
name: doc_examples_${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_${{ matrix.cmake_extra }}
|
||||
runs-on: ['${{ matrix.os }}']
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-2022
|
||||
generator: "Visual Studio 17 2022"
|
||||
c_compiler: cl
|
||||
cxx_compiler: cl
|
||||
std: 20
|
||||
build_type: relwithdebinfo
|
||||
cmake_extra: -DTBB_TEST_CXX20_MODULES=ON
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Test doc examples
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake -G "${{ matrix.generator }}" -A x64 -DCMAKE_CXX_STANDARD=${{ matrix.std }} `
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type}} -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} `
|
||||
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} ${{ matrix.cmake_extra }} -DTBB_TEST=OFF -DTBB_DOC_EXAMPLES=ON ..
|
||||
if (!$?) {
|
||||
throw "CMake configuration step of examples from documentation failed, exit code $LastExitCode"
|
||||
}
|
||||
cmake --build . --config ${{ matrix.build_type }} -v --parallel --target build-doc-examples
|
||||
if (!$?) {
|
||||
throw "CMake build step of examples from documentation failed, exit code $LastExitCode"
|
||||
}
|
||||
ctest -C ${{ matrix.build_type }} --timeout ${env:TEST_TIMEOUT} --output-on-failure -L doc-examples
|
||||
if (!$?) {
|
||||
throw "CTest of examples from documentation failed, exit code $LastExitCode"
|
||||
}
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
# Copyright (c) 2024-2025 Intel Corporation
|
||||
# Copyright (c) 2026 UXL Foundation Contributors
|
||||
#
|
||||
# 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" ]
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'include/**'
|
||||
- 'test/**'
|
||||
- 'python/**'
|
||||
- '.github/workflows/codeql.yml'
|
||||
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@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
|
||||
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@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
|
||||
|
||||
# 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@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
@@ -1,102 +0,0 @@
|
||||
# Copyright (c) 2024-2025 Intel Corporation
|
||||
# Copyright (c) 2025 UXL Foundation Contributors
|
||||
#
|
||||
# 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: Coverity Scan
|
||||
|
||||
on:
|
||||
|
||||
# Only run on push to master branch
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
permissions: read-all
|
||||
|
||||
env:
|
||||
BUILD_CONCURRENCY: 4
|
||||
COVERITY_PROJECT_LIN: oneapi-src%2FoneTBB
|
||||
COVERITY_PROJECT_WIN: uxlfoundation%2FoneTBB
|
||||
|
||||
jobs:
|
||||
coverity_linux:
|
||||
name: Coverity Linux
|
||||
if: github.repository == 'uxlfoundation/oneTBB'
|
||||
runs-on: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Download Linux 64 Coverity Tool
|
||||
run: |
|
||||
curl https://scan.coverity.com/download/cxx/linux64 --output ${GITHUB_WORKSPACE}/cov-linux64-tool.tar.gz \
|
||||
--data "token=${{secrets.COVERITY_TOKEN}}&project=${{env.COVERITY_PROJECT_LIN}}"
|
||||
mkdir cov-linux64-tool
|
||||
tar -xzf cov-linux64-tool.tar.gz --strip 1 -C cov-linux64-tool
|
||||
- name: Build with cov-build
|
||||
run: |
|
||||
export PATH="${PWD}/cov-linux64-tool/bin:${PATH}"
|
||||
mkdir build && cd build
|
||||
cmake -DCMAKE_CXX_STANDARD=20 -DCMAKE_BUILD_TYPE=relwithdebinfo \
|
||||
-DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DTBB_TEST_PREVIEW=ON ..
|
||||
cov-build --dir cov-int make VERBOSE=1 -j${{env.BUILD_CONCURRENCY}}
|
||||
- name: Archive Coverity build results
|
||||
run: |
|
||||
cd build
|
||||
tar -czvf cov-int.tgz cov-int
|
||||
- name: Submit Coverity results for analysis
|
||||
run: |
|
||||
cd build
|
||||
curl \
|
||||
--form token="${{ secrets.COVERITY_TOKEN }}" \
|
||||
--form email="${{ secrets.COVERITY_EMAIL }}" \
|
||||
--form file=@cov-int.tgz \
|
||||
--form version="${GITHUB_SHA}" \
|
||||
--form description="" \
|
||||
"https://scan.coverity.com/builds?project=${{env.COVERITY_PROJECT_LIN}}"
|
||||
coverity_windows:
|
||||
name: Coverity Windows
|
||||
if: github.repository == 'uxlfoundation/oneTBB'
|
||||
runs-on: [windows-latest]
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Download Windows 64 Coverity Tool
|
||||
run: |
|
||||
curl https://scan.coverity.com/download/cxx/win64 -o cov-win64-tool.zip -d "token=${{secrets.COVERITY_TOKEN_WIN}}&project=${{env.COVERITY_PROJECT_WIN}}"
|
||||
7z x cov-win64-tool.zip
|
||||
del cov-win64-tool.zip
|
||||
move cov-analysis-win64* cov-win64-tool
|
||||
- name: Setup MSBuild
|
||||
uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3.0.0
|
||||
- name: Build with cov-build
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH="${PWD}/cov-win64-tool/bin:${PATH}"
|
||||
cmake -DCMAKE_CXX_STANDARD=14 -DCMAKE_BUILD_TYPE=relwithdebinfo \
|
||||
-DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -DTBB_TEST_PREVIEW=ON .
|
||||
cov-configure --msvc
|
||||
cov-build --dir cov-int msbuild.exe ALL_BUILD.vcxproj -m -v:n
|
||||
- name: Archive Coverity build results
|
||||
run: |
|
||||
7z a -r cov-int.zip cov-int
|
||||
- name: Submit Coverity results for analysis
|
||||
run: |
|
||||
curl --form token="${{ secrets.COVERITY_TOKEN_WIN }}" --form email="${{ secrets.COVERITY_EMAIL }}" --form file=@cov-int.zip --form version="${GITHUB_SHA}" --form description="" "https://scan.coverity.com/builds?project=${{env.COVERITY_PROJECT_WIN}}"
|
||||
@@ -1,42 +0,0 @@
|
||||
# Copyright (c) 2023-2025 Intel Corporation
|
||||
# Copyright (c) 2026 UXL Foundation Contributors
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
name: "Issue Labeler"
|
||||
on:
|
||||
issues:
|
||||
types: [opened, edited]
|
||||
pull_request:
|
||||
types: [opened, edited]
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
issues: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: github/issue-labeler@c1b0f9f52a63158c4adc09425e858e87b32e9685 # v3.4
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
configuration-path: .github/issue_labeler.yml
|
||||
enable-versioned-regex: 0
|
||||
@@ -1,36 +0,0 @@
|
||||
# Copyright (c) 2023-2025 Intel Corporation
|
||||
# Copyright (c) 2026 UXL Foundation Contributors
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
name: "Pull Request Labeler"
|
||||
on:
|
||||
- pull_request_target
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0
|
||||
with:
|
||||
configuration-path: .github/labeler.yml
|
||||
@@ -1,89 +0,0 @@
|
||||
# Copyright (c) 2024-2025 Intel Corporation
|
||||
# Copyright (c) 2026 UXL Foundation Contributors
|
||||
#
|
||||
# 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: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4
|
||||
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
|
||||
@@ -1,189 +0,0 @@
|
||||
# Copyright (c) 2021-2025 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# DISCLAIMER: Bazel support is community-based. The maintainers do not
|
||||
# use Bazel internally. The Bazel build can have security risks or
|
||||
# optimization gaps.
|
||||
|
||||
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
|
||||
load("@rules_license//rules:license.bzl", "license")
|
||||
|
||||
package(
|
||||
default_applicable_licenses = [":license"],
|
||||
)
|
||||
|
||||
exports_files([
|
||||
"LICENSE",
|
||||
])
|
||||
|
||||
license(
|
||||
name = "license",
|
||||
license_kinds = ["@rules_license//licenses/spdx:Apache-2.0"],
|
||||
license_text = "LICENSE.txt",
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "tbb",
|
||||
srcs = glob([
|
||||
"src/tbb/*.cpp",
|
||||
"src/tbb/*.h",
|
||||
]) + select({
|
||||
"@platforms//cpu:x86_64": glob(["src/tbb/tools_api/**/*.h"]),
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
hdrs = glob([
|
||||
"include/tbb/*.h",
|
||||
"include/oneapi/*.h",
|
||||
"include/oneapi/tbb/*.h",
|
||||
"include/oneapi/tbb/detail/*.h",
|
||||
]),
|
||||
copts = ["-w"] + select({
|
||||
"@platforms//os:windows": [""],
|
||||
"@platforms//cpu:x86_64": ["-mwaitpkg"],
|
||||
"//conditions:default": [""],
|
||||
}),
|
||||
defines =
|
||||
select({
|
||||
"@platforms//cpu:x86_64": ["__TBB_NO_IMPLICIT_LINKAGE"],
|
||||
"//conditions:default": [
|
||||
"USE_PTHREAD",
|
||||
],
|
||||
}) +
|
||||
select({
|
||||
"@platforms//os:osx": ["_XOPEN_SOURCE"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
includes = [
|
||||
"include",
|
||||
],
|
||||
linkopts =
|
||||
select({
|
||||
"@platforms//os:windows": [],
|
||||
"@platforms//os:linux": [
|
||||
"-ldl",
|
||||
"-pthread",
|
||||
"-lrt",
|
||||
],
|
||||
"//conditions:default": ["-pthread"],
|
||||
}),
|
||||
local_defines = select({
|
||||
"@platforms//cpu:x86_64": [
|
||||
"__TBB_USE_ITT_NOTIFY",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}) + [
|
||||
"__TBB_BUILD",
|
||||
],
|
||||
textual_hdrs = select({
|
||||
"@platforms//cpu:x86_64": [
|
||||
"src/tbb/tools_api/ittnotify_static.c",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "tbbmalloc",
|
||||
srcs =
|
||||
glob([
|
||||
"src/tbbmalloc/*.h",
|
||||
"src/tbb/*.h",
|
||||
"src/tbbmalloc_proxy/*.h",
|
||||
]) + [
|
||||
"src/tbbmalloc/backend.cpp",
|
||||
"src/tbbmalloc/backref.cpp",
|
||||
"src/tbbmalloc/frontend.cpp",
|
||||
"src/tbbmalloc/large_objects.cpp",
|
||||
"src/tbbmalloc/tbbmalloc.cpp",
|
||||
],
|
||||
hdrs = glob([
|
||||
"include/tbb/*.h",
|
||||
"include/oneapi/tbb/detail/*.h",
|
||||
"include/oneapi/tbb/*.h",
|
||||
]),
|
||||
includes = [
|
||||
"include",
|
||||
],
|
||||
local_defines = [
|
||||
"__TBBMALLOC_BUILD",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "tbbmalloc_proxy",
|
||||
srcs = [
|
||||
"src/tbbmalloc_proxy/function_replacement.cpp",
|
||||
"src/tbbmalloc_proxy/proxy.cpp",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
":tbbmalloc",
|
||||
],
|
||||
)
|
||||
|
||||
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 = [
|
||||
"test/tbb/test_task.cpp",
|
||||
] + glob([
|
||||
"test/common/*.h",
|
||||
]),
|
||||
includes = ["test"],
|
||||
deps = [
|
||||
":tbb",
|
||||
],
|
||||
)
|
||||
@@ -1,108 +0,0 @@
|
||||
# Bazel* build support
|
||||
|
||||
The main build system of oneTBB is CMake*.
|
||||
[Bazel*](https://bazel.build/) support is community-based.
|
||||
The Bazel configuration may not include recommended compiler and/or linker flags used in the official CMake configuration.
|
||||
|
||||
---
|
||||
**NOTE**
|
||||
|
||||
Bazel is not recommended for use by oneTBB maintainers. Thus, it is not used internally.
|
||||
|
||||
---
|
||||
|
||||
|
||||
The Bazel oneTBB build is currently only intended for a subset of oneTBB that suffices restricted use cases.
|
||||
Pull requests to improve the Bazel build experience are welcome.
|
||||
|
||||
The standard Bazel approach to handling third-party libraries is static linking. It is the best practice within the Bazel ecosystem.
|
||||
|
||||
## Using oneTBB as a dependency
|
||||
|
||||
### Traditional WORKSPACE approach
|
||||
|
||||
This example demonstrates how to use oneTBB as a dependency within a Bazel project.
|
||||
|
||||
The following file structure is assumed:
|
||||
|
||||
```
|
||||
example
|
||||
├── .bazelrc
|
||||
├── BUILD.bazel
|
||||
├── main.cpp
|
||||
└── WORKSPACE.bazel
|
||||
```
|
||||
|
||||
_WORKSPACE.bazel_:
|
||||
```python
|
||||
load("@platforms//tools/build_defs/repo:git.bzl", "git_repository")
|
||||
|
||||
git_repository(
|
||||
name = "oneTBB",
|
||||
branch = "master",
|
||||
remote = "https://github.com/uxlfoundation/oneTBB/",
|
||||
)
|
||||
```
|
||||
|
||||
In the *WORKSPACE* file, the oneTBB GitHub* repository is fetched.
|
||||
|
||||
_BUILD.bazel_:
|
||||
|
||||
```python
|
||||
cc_binary(
|
||||
name = "Demo",
|
||||
srcs = ["main.cpp"],
|
||||
deps = ["@oneTBB//:tbb"],
|
||||
)
|
||||
```
|
||||
|
||||
The *BUILD* file defines a binary named `Demo` that has a dependency to oneTBB.
|
||||
|
||||
_main.cpp_:
|
||||
|
||||
```c++
|
||||
#include "oneapi/tbb/version.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
std::cout << "Hello from oneTBB "
|
||||
<< TBB_VERSION_MAJOR << "."
|
||||
<< TBB_VERSION_MINOR << "."
|
||||
<< TBB_VERSION_PATCH
|
||||
<< "!" << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
## Compiler support
|
||||
|
||||
The Bazel build uses the compiler flag `-mwaitpkg` in non-Windows* builds.
|
||||
This flag is supported by the GNU* Compiler Collection (GCC) version 9.3, Clang* 12, and newer versions of those tools.
|
||||
|
||||
|
||||
---
|
||||
**NOTE**
|
||||
|
||||
To use the Bazel build with earlier versions of GCC, remove `-mwaitpkg` flag as it leads to errors during compilation.
|
||||
|
||||
---
|
||||
@@ -1,5 +1,4 @@
|
||||
# Copyright (c) 2020-2025 Intel Corporation
|
||||
# Copyright (c) 2026 UXL Foundation Contributors
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -13,23 +12,10 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# If the running version of CMake is older than 3.12, the extra ... dots will be seen as version component separators,
|
||||
# resulting in the ...<max> part being ignored and preserving the pre-3.12 behavior of basing policies on <min>.
|
||||
cmake_minimum_required(VERSION 3.5.0...3.31.3)
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
|
||||
# Enable CMake policies
|
||||
|
||||
if (POLICY CMP0063)
|
||||
# The NEW behavior for this policy is to honor the visibility properties for all target types.
|
||||
cmake_policy(SET CMP0063 NEW)
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
|
||||
endif()
|
||||
|
||||
if (POLICY CMP0068)
|
||||
# RPATH settings do not affect install_name on macOS since CMake 3.9
|
||||
cmake_policy(SET CMP0068 NEW)
|
||||
endif()
|
||||
|
||||
if (POLICY CMP0091)
|
||||
# The NEW behavior for this policy is to not place MSVC runtime library flags in the default
|
||||
# CMAKE_<LANG>_FLAGS_<CONFIG> cache entries and use CMAKE_MSVC_RUNTIME_LIBRARY abstraction instead.
|
||||
@@ -38,11 +24,6 @@ elseif (DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
|
||||
message(FATAL_ERROR "CMAKE_MSVC_RUNTIME_LIBRARY was defined while policy CMP0091 is not available. Use CMake 3.15 or newer.")
|
||||
endif()
|
||||
|
||||
if (POLICY CMP0148)
|
||||
# CMake 3.27: The FindPythonInterp and FindPythonLibs modules are removed
|
||||
cmake_policy(SET CMP0148 OLD)
|
||||
endif()
|
||||
|
||||
if (TBB_WINDOWS_DRIVER AND (NOT ("${CMAKE_MSVC_RUNTIME_LIBRARY}" STREQUAL MultiThreaded OR "${CMAKE_MSVC_RUNTIME_LIBRARY}" STREQUAL MultiThreadedDebug)))
|
||||
message(FATAL_ERROR "Enabled TBB_WINDOWS_DRIVER requires CMAKE_MSVC_RUNTIME_LIBRARY to be set to MultiThreaded or MultiThreadedDebug.")
|
||||
endif()
|
||||
@@ -57,13 +38,19 @@ if (APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Until CMake 3.4.0 FindThreads.cmake requires C language enabled.
|
||||
# Enable C language before CXX to avoid possible override of CMAKE_SIZEOF_VOID_P.
|
||||
if (CMAKE_VERSION VERSION_LESS 3.4)
|
||||
enable_language(C)
|
||||
endif()
|
||||
|
||||
file(READ include/oneapi/tbb/version.h _tbb_version_info)
|
||||
string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" _tbb_ver_major "${_tbb_version_info}")
|
||||
string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" _tbb_ver_minor "${_tbb_version_info}")
|
||||
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}")
|
||||
string(REGEX REPLACE "..(..)." "\\1" TBB_BINARY_MINOR_VERSION "${TBB_INTERFACE_VERSION}")
|
||||
set(TBB_BINARY_MINOR_VERSION ${_tbb_ver_minor})
|
||||
set(TBBMALLOC_BINARY_VERSION 2)
|
||||
set(TBBBIND_BINARY_VERSION 3)
|
||||
|
||||
@@ -73,7 +60,6 @@ unset(_tbb_ver_minor)
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
include(GNUInstallDirs)
|
||||
include(CMakeDependentOption)
|
||||
|
||||
# ---------------------------------------------------------------------------------------------------------
|
||||
# Handle C++ standard version.
|
||||
@@ -98,11 +84,6 @@ endif()
|
||||
|
||||
set(CMAKE_CXX_EXTENSIONS OFF) # use -std=c++... instead of -std=gnu++...
|
||||
# ---------------------------------------------------------------------------------------------------------
|
||||
# Setup symbol visibility properties.
|
||||
|
||||
set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
|
||||
set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
|
||||
# ---------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Detect architecture (bitness).
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
@@ -117,50 +98,14 @@ option(TBB_STRICT "Treat compiler warnings as errors" ON)
|
||||
option(TBB_WINDOWS_DRIVER "Build as Universal Windows Driver (UWD)" OFF)
|
||||
option(TBB_NO_APPCONTAINER "Apply /APPCONTAINER:NO (for testing binaries for Windows Store)" OFF)
|
||||
option(TBB4PY_BUILD "Enable tbb4py build" OFF)
|
||||
option(TBB_BUILD "Enable tbb build" ON)
|
||||
option(TBBMALLOC_BUILD "Enable tbbmalloc build" ON)
|
||||
cmake_dependent_option(TBBMALLOC_PROXY_BUILD "Enable tbbmalloc_proxy build" ON "TBBMALLOC_BUILD" OFF)
|
||||
option(TBB_CPF "Enable preview features of the library" OFF)
|
||||
option(TBB_FIND_PACKAGE "Enable search for external oneTBB using find_package instead of build from sources" OFF)
|
||||
option(TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH "Disable HWLOC automatic search by pkg-config tool" ${CMAKE_CROSSCOMPILING})
|
||||
option(TBB_ENABLE_IPO "Enable Interprocedural Optimization (IPO) during the compilation" ON)
|
||||
option(TBB_CONTROL_FLOW_GUARD "Enable Control Flow Guard (CFG) during the compilation" OFF)
|
||||
option(TBB_FUZZ_TESTING "Enable fuzz testing" OFF)
|
||||
option(TBB_INSTALL "Enable installation" ON)
|
||||
option(TBB_FILE_TRIM "Enable __FILE__ trim" 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()
|
||||
if (TCM_BUILD)
|
||||
set(TCM_BUILD_OPTION_EXPLICITLY_SET TRUE)
|
||||
endif()
|
||||
option(TCM_BUILD "Enable Thread Composability Manager (TCM) build" ON)
|
||||
|
||||
if (WIN32)
|
||||
if (TBB_VERIFY_DEPENDENCY_SIGNATURE)
|
||||
message(STATUS "Dependency signature verification during dynamic linking in run-time is ENABLED.")
|
||||
elseif (NOT DEFINED TBB_VERIFY_DEPENDENCY_SIGNATURE)
|
||||
message(WARNING
|
||||
"Dependency signature verification during dynamic linking in run-time is disabled by "
|
||||
"default. This may lead to security vulnerabilities. See installation section in "
|
||||
"oneTBB documentation for more details.")
|
||||
else()
|
||||
message(STATUS "Dependency signature verification during dynamic linking in run-time is DISABLED")
|
||||
endif()
|
||||
option(TBB_VERIFY_DEPENDENCY_SIGNATURE
|
||||
"Verify signature of a dependency during its dynamic linking at run-time on Windows*" OFF)
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED BUILD_SHARED_LIBS)
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
endif()
|
||||
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
message(WARNING "You are building oneTBB as a static library. This is highly discouraged and such configuration is not supported. Consider building a dynamic library to avoid unforeseen issues.")
|
||||
endif()
|
||||
|
||||
@@ -171,14 +116,6 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
endif()
|
||||
|
||||
if (CMAKE_BUILD_TYPE)
|
||||
string(TOLOWER ${CMAKE_BUILD_TYPE} _tbb_build_type)
|
||||
if (_tbb_build_type STREQUAL "debug")
|
||||
set(TBB_ENABLE_IPO OFF)
|
||||
endif()
|
||||
unset(_tbb_build_type)
|
||||
endif()
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# Files and folders naming
|
||||
set(CMAKE_DEBUG_POSTFIX _debug)
|
||||
@@ -227,22 +164,10 @@ foreach(output_type LIBRARY ARCHIVE PDB RUNTIME)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (CMAKE_CONFIGURATION_TYPES)
|
||||
# We can't use generator expressions in a cmake variable name.
|
||||
set(TBB_TEST_WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${TBB_OUTPUT_DIR_BASE}_$<LOWER_CASE:$<CONFIG>>)
|
||||
else()
|
||||
set(TBB_TEST_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
endif()
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# Common dependencies
|
||||
#force -pthread during compilation for Emscripten
|
||||
if (EMSCRIPTEN AND NOT EMSCRIPTEN_WITHOUT_PTHREAD)
|
||||
set(THREADS_HAVE_PTHREAD_ARG TRUE)
|
||||
endif()
|
||||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||
find_package(Threads REQUIRED)
|
||||
# -------------------------------------------------------------------
|
||||
@@ -252,20 +177,6 @@ foreach(FILE_WITH_EXTRA_TARGETS ${FILES_WITH_EXTRA_TARGETS})
|
||||
include(${FILE_WITH_EXTRA_TARGETS})
|
||||
endforeach()
|
||||
|
||||
if (TBB_FILE_TRIM)
|
||||
file(RELATIVE_PATH TBB_RELATIVE_BIN_PATH ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})
|
||||
file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} NATIVE_TBB_PROJECT_ROOT_DIR)
|
||||
if (TBB_RELATIVE_BIN_PATH)
|
||||
file(TO_NATIVE_PATH ${TBB_RELATIVE_BIN_PATH} NATIVE_TBB_RELATIVE_BIN_PATH)
|
||||
else()
|
||||
file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR} NATIVE_TBB_RELATIVE_BIN_PATH)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if (TBB_CONTROL_FLOW_GUARD)
|
||||
message(STATUS "Control Flow Guard (CFG) enabled")
|
||||
endif()
|
||||
|
||||
set(TBB_COMPILER_SETTINGS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/compilers/${CMAKE_CXX_COMPILER_ID}.cmake)
|
||||
if (EXISTS ${TBB_COMPILER_SETTINGS_FILE})
|
||||
include(${TBB_COMPILER_SETTINGS_FILE})
|
||||
@@ -273,87 +184,54 @@ else()
|
||||
message(WARNING "TBB compiler settings not found ${TBB_COMPILER_SETTINGS_FILE}")
|
||||
endif()
|
||||
|
||||
# - Enabling LTO on Android causes the NDK bug.
|
||||
# NDK throws the warning: "argument unused during compilation: '-Wa,--noexecstack'"
|
||||
# - For some reason GCC does not instrument code with Thread Sanitizer when lto is enabled and C linker is used.
|
||||
if (TBB_ENABLE_IPO AND BUILD_SHARED_LIBS AND NOT ANDROID_PLATFORM AND NOT TBB_SANITIZE MATCHES "thread")
|
||||
# For older cmake versions without CheckIPOSupported and when ipo detection is broken,
|
||||
# try to enable IPO unconditionally.
|
||||
if (CMAKE_VERSION VERSION_LESS 3.9 OR TBB_IPO_DETECTION_BROKEN)
|
||||
set(TBB_IPO_FLAGS TRUE)
|
||||
else()
|
||||
cmake_policy(SET CMP0069 NEW)
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT TBB_IPO_PROPERTY)
|
||||
if (NOT TBB_IPO_PROPERTY)
|
||||
message(WARNING "IPO disabled: not supported by this compiler.")
|
||||
endif()
|
||||
endif()
|
||||
if (TBB_IPO_PROPERTY OR TBB_IPO_FLAGS)
|
||||
message(STATUS "IPO enabled")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (TBB_FIND_PACKAGE AND TBB_DIR)
|
||||
if (TBB_FIND_PACKAGE OR 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")
|
||||
find_package(TBB REQUIRED)
|
||||
else()
|
||||
if (TBB_BUILD)
|
||||
add_subdirectory(src/tbb)
|
||||
endif()
|
||||
if (TBBMALLOC_BUILD)
|
||||
add_subdirectory(src/tbb)
|
||||
if (NOT "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips")
|
||||
add_subdirectory(src/tbbmalloc)
|
||||
if(TBBMALLOC_PROXY_BUILD AND NOT "${MSVC_CXX_ARCHITECTURE_ID}" MATCHES "ARM64")
|
||||
add_subdirectory(src/tbbmalloc_proxy)
|
||||
add_subdirectory(src/tbbmalloc_proxy)
|
||||
if (APPLE)
|
||||
message(STATUS "TBBBind build target is disabled due to unsupported environment")
|
||||
else()
|
||||
add_subdirectory(src/tbbbind)
|
||||
endif()
|
||||
endif()
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
message(STATUS "TBBBind build targets are disabled due to unsupported environment")
|
||||
else()
|
||||
add_subdirectory(src/tbbbind)
|
||||
endif()
|
||||
if (TBB_INSTALL)
|
||||
# -------------------------------------------------------------------
|
||||
# Installation instructions
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
install(DIRECTORY include/
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
COMPONENT devel)
|
||||
# -------------------------------------------------------------------
|
||||
# Installation instructions
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
install(EXPORT ${PROJECT_NAME}Targets
|
||||
NAMESPACE TBB::
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
|
||||
COMPONENT devel)
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
|
||||
"include(\${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}Targets.cmake)\n")
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
|
||||
"include(CMakeFindDependencyMacro)\nfind_dependency(Threads)\n")
|
||||
endif()
|
||||
install(DIRECTORY include/
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
COMPONENT devel)
|
||||
|
||||
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
COMPATIBILITY AnyNewerVersion)
|
||||
install(EXPORT ${PROJECT_NAME}Targets
|
||||
NAMESPACE TBB::
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
|
||||
COMPONENT devel)
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
|
||||
"include(\${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}Targets.cmake)\n")
|
||||
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
|
||||
COMPONENT devel)
|
||||
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
COMPATIBILITY AnyNewerVersion)
|
||||
|
||||
install(FILES "README.md"
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
||||
COMPONENT devel)
|
||||
# -------------------------------------------------------------------
|
||||
endif()
|
||||
endif()
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
|
||||
COMPONENT devel)
|
||||
|
||||
if (TBB_TEST OR TCM_TEST)
|
||||
enable_testing()
|
||||
install(FILES "README.md"
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
||||
COMPONENT devel)
|
||||
# -------------------------------------------------------------------
|
||||
endif()
|
||||
|
||||
if (TBB_TEST)
|
||||
enable_testing()
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
|
||||
@@ -361,18 +239,6 @@ if (TBB_EXAMPLES)
|
||||
add_subdirectory(examples)
|
||||
endif()
|
||||
|
||||
|
||||
if (TBB_DOC_EXAMPLES)
|
||||
set(TBB_DOC_EXAMPLES_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/doc/main/examples_testing")
|
||||
if (NOT EXISTS ${TBB_DOC_EXAMPLES_DIRECTORY})
|
||||
message(FATAL_ERROR "Documentation examples are not found while testing was enabled")
|
||||
else()
|
||||
message(STATUS "Enabling testing for examples from documentation")
|
||||
enable_testing()
|
||||
add_subdirectory(${TBB_DOC_EXAMPLES_DIRECTORY})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (TBB_BENCH)
|
||||
if (NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/benchmark)
|
||||
message(FATAL_ERROR "Benchmarks are not supported yet")
|
||||
@@ -383,28 +249,11 @@ if (TBB_BENCH)
|
||||
endif()
|
||||
|
||||
if (ANDROID_PLATFORM)
|
||||
if ("${ANDROID_STL}" STREQUAL "c++_shared")
|
||||
if (${ANDROID_NDK_MAJOR} GREATER_EQUAL "25")
|
||||
if(ANDROID_ABI STREQUAL "arm64-v8a")
|
||||
set(ANDROID_TOOLCHAIN_NAME "aarch64-linux-android")
|
||||
elseif(ANDROID_ABI STREQUAL "x86_64")
|
||||
set(ANDROID_TOOLCHAIN_NAME "x86_64-linux-android")
|
||||
elseif(ANDROID_ABI STREQUAL "armeabi-v7a")
|
||||
set(ANDROID_TOOLCHAIN_NAME "arm-linux-androideabi")
|
||||
elseif(ANDROID_ABI STREQUAL "x86")
|
||||
set(ANDROID_TOOLCHAIN_NAME "i686-linux-android")
|
||||
endif()
|
||||
|
||||
configure_file(
|
||||
"${ANDROID_TOOLCHAIN_ROOT}/sysroot/usr/lib/${ANDROID_TOOLCHAIN_NAME}/libc++_shared.so"
|
||||
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libc++_shared.so"
|
||||
COPYONLY)
|
||||
else()
|
||||
configure_file(
|
||||
"${ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${ANDROID_ABI}/libc++_shared.so"
|
||||
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libc++_shared.so"
|
||||
COPYONLY)
|
||||
endif()
|
||||
if (${ANDROID_STL} STREQUAL "c++_shared")
|
||||
configure_file(
|
||||
"${ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${ANDROID_ABI}/libc++_shared.so"
|
||||
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libc++_shared.so"
|
||||
COPYONLY)
|
||||
endif()
|
||||
# This custom target may be implemented without separate CMake script, but it requires
|
||||
# ADB(Android Debug Bridge) executable file availability, so to incapsulate this requirement
|
||||
@@ -417,16 +266,5 @@ if (TBB4PY_BUILD)
|
||||
add_subdirectory(python)
|
||||
endif()
|
||||
|
||||
if (TCM_BUILD)
|
||||
set(TCM_SUBDIR_NAME thread_composability_manager)
|
||||
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${TCM_SUBDIR_NAME}")
|
||||
add_subdirectory(${TCM_SUBDIR_NAME})
|
||||
elseif (TCM_BUILD_OPTION_EXPLICITLY_SET)
|
||||
message(FATAL_ERROR "Build of Thread Composability Manager (TCM) is disabled since "
|
||||
"${TCM_SUBDIR_NAME} subdirectory does not exist")
|
||||
endif()
|
||||
unset(TCM_SUBDIR_NAME)
|
||||
endif()
|
||||
|
||||
# Keep it the last instruction.
|
||||
add_subdirectory(cmake/post_install)
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
# Where component owners are known, add them here.
|
||||
|
||||
/oneTBB/src/tbb/ @kboyarinov
|
||||
/oneTBB/src/tbb/ @dnmokhov
|
||||
/oneTBB/include/oneapi/tbb/parallel_* @kboyarinov
|
||||
/oneTBB/include/oneapi/tbb/parallel_* @dnmokhov
|
||||
/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/doc @omalyshe
|
||||
/oneTBB/src/tbbbind/ @isaevil
|
||||
/oneTBB/src/tbbmalloc/ @lplewa
|
||||
/oneTBB/src/tbbmalloc_proxy/ @lplewa
|
||||
/oneTBB/cmake/ @isaevil
|
||||
/oneTBB/*CMakeLists.txt @isaevil
|
||||
/oneTBB/python/ @isaevil
|
||||
/oneTBB/rfcs/ @vossmjp
|
||||
/oneTBB/rfcs/ @akukanov
|
||||
|
||||
# Bazel build related files.
|
||||
/oneTBB/.bazelversion @Vertexwahn
|
||||
/oneTBB/Bazel.md @Vertexwahn
|
||||
/oneTBB/BUILD.bazel @Vertexwahn
|
||||
/oneTBB/MODULE.bazel @Vertexwahn
|
||||
@@ -1,134 +0,0 @@
|
||||
|
||||
# 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
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
<!--
|
||||
******************************************************************************
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/-->
|
||||
|
||||
# How to Contribute
|
||||
As an open source project, we welcome community contributions to oneAPI Threading Building Blocks (oneTBB). This document explains how to participate in project conversations, log bugs and enhancement requests, and submit code patches to the project.
|
||||
|
||||
## Licensing
|
||||
|
||||
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/uxlfoundation/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/uxlfoundation/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
|
||||
|
||||
As a contributor, you'll want to be familiar with the oneTBB project and the repository layout. You should also know how to use it as explained in the [oneTBB documentation](https://uxlfoundation.github.io/oneTBB/) and how to set up your build development environment to configure, build, and test oneTBB as explained in the [oneTBB Build System Description](cmake/README.md).
|
||||
|
||||
## Pull Requests
|
||||
|
||||
You can find all [open oneTBB pull requests](https://github.com/uxlfoundation/oneTBB/pulls) on GitHub.
|
||||
|
||||
### Before contributing changes directly to the oneTBB repository
|
||||
|
||||
* Make sure you can build the product and run all the tests with your patch.
|
||||
* For a larger feature, provide a relevant test.
|
||||
* Document your code. The oneTBB project uses reStructuredText for documentation.
|
||||
* If your documentation has code samples or examples, place them into the corresponding example folder.
|
||||
* Update the copyright year in the first line of the changing file(s).
|
||||
For example, if you commit your changes in 2025:
|
||||
* the copyright year should be `2005-2025` for existing files
|
||||
* the copyright year should be `2025` for new files
|
||||
* Submit a pull request into the master branch. You can submit changes with a pull request (preferred) or by sending an email patch.
|
||||
|
||||
Code changes that are known or suspected to break support for any currently supported hardware are not allowed.
|
||||
Contributors should make a reasonable effort to ensure compatibility with these platforms. If a contribution
|
||||
inadvertently affects hardware support, the community will work together to address and resolve the issue.
|
||||
|
||||
Continuous Integration (CI) testing is enabled for the repository. Your pull request must pass all checks before it can be merged. We will review your contribution and may provide feedback to guide you if any additional fixes or modifications are necessary. When reviewed and accepted, your pull request will be merged into our GitHub repository.
|
||||
@@ -1,147 +0,0 @@
|
||||
# Install
|
||||
|
||||
## Install from Release Packages
|
||||
|
||||
To install oneTBB from the release packages, use the following commands:
|
||||
|
||||
```bash
|
||||
tar -xvf oneapi-tbb-xxx.xx.x-*.tgz
|
||||
source env/vars.sh
|
||||
```
|
||||
## Install from Sources
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Make sure you have installed CMake version 3.1 (or newer) on your system. oneTBB uses CMake build configuration.
|
||||
- Configure and build oneTBB. To work with build configurations, see [Build System Description](cmake/README.md).
|
||||
|
||||
|
||||
### Configure oneTBB
|
||||
|
||||
At the command prompt, type:
|
||||
```
|
||||
cmake <options> <repo_root>
|
||||
```
|
||||
|
||||
You may want to use some additional options for configuration:
|
||||
|
||||
| Option | Purpose | Description |
|
||||
|---------------------------------------------|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `-G <generator>` | Specify project generator | For more information, run cmake `–help`. |
|
||||
| `-DCMAKE_BUILD_TYPE=Debug` | Specify for Debug build | Not applicable for multi-configuration generators such as Visual Studio generator. |
|
||||
| `-DTBB_VERIFY_DEPENDENCY_SIGNATURE=ON\|OFF` | Controls signature verification of dynamic dependencies loaded during runtime | If set to ON, only the signed dynamic dependencies are loaded. This is the recommended behavior. By default, the value is unspecified. Therefore, the warning is printed. To suppress the warning, set the value explicitly. |
|
||||
|
||||
For a more detailed list of available CMake configuration options see [Build System
|
||||
Description](./cmake/README.md)
|
||||
|
||||
### Build oneTBB
|
||||
|
||||
To build the system, run:
|
||||
```
|
||||
cmake --build . <options>
|
||||
```
|
||||
|
||||
Some useful build options:
|
||||
- `--target <target>` - specific target, "all" is default.
|
||||
- `--config <Release|Debug>` - build configuration, applicable only for multi-config generators such as Visual Studio generator.
|
||||
|
||||
|
||||
### Install and Pack oneTBB
|
||||
|
||||
---
|
||||
**NOTE**
|
||||
|
||||
Be careful about installing prefix. It defaults to `/usr/local` on UNIX* and `c:/Program Files/${PROJECT_NAME}` on Windows* OS.
|
||||
You can define custom `CMAKE_INSTALL_PREFIX` during configuration:
|
||||
|
||||
```
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/my/install/prefix ..
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Installation can also be done using:
|
||||
|
||||
```
|
||||
cmake --install <project-binary-dir>
|
||||
```
|
||||
|
||||
Special ``--install`` target can alternatively be used for installation, e.g. ``make install``.
|
||||
|
||||
You can use the ``install`` components for partial installation.
|
||||
|
||||
The following install components are supported:
|
||||
- `runtime` - oneTBB runtime package (core shared libraries and `.dll` files on Windows* OS).
|
||||
- `devel` - oneTBB development package (header files, CMake integration files, library symbolic links, and `.lib` files on Windows* OS).
|
||||
- `tbb4py` - [oneTBB Module for Python](https://github.com/uxlfoundation/oneTBB/blob/master/python/README.md).
|
||||
|
||||
If you want to install specific components after configuration and build, run:
|
||||
|
||||
```bash
|
||||
cmake -DCOMPONENT=<component> [-DBUILD_TYPE=<build-type>] -P cmake_install.cmake
|
||||
```
|
||||
|
||||
Simple packaging using CPack is supported.
|
||||
The following commands allow you to create a simple portable package that includes header files, libraries, and integration files for CMake:
|
||||
|
||||
```bash
|
||||
cmake <options> ..
|
||||
cpack
|
||||
```
|
||||
|
||||
### Installation from vcpkg
|
||||
|
||||
You can download and install oneTBB using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
|
||||
```sh
|
||||
git clone https://github.com/Microsoft/vcpkg.git
|
||||
cd vcpkg
|
||||
./bootstrap-vcpkg.sh #.\bootstrap-vcpkg.bat(for Windows)
|
||||
./vcpkg integrate install
|
||||
./vcpkg install tbb
|
||||
```
|
||||
|
||||
The oneTBB port in vcpkg is kept up to date by Microsoft* team members and community contributors. If the version is out of date, create an issue or pull request on the [vcpkg repository](https://github.com/Microsoft/vcpkg).
|
||||
|
||||
### Example
|
||||
|
||||
#### Single-Configuration Generators
|
||||
|
||||
The following example demonstrates how to install oneTBB for single-configuration generators (e.g. GNU Make, Ninja, etc.).
|
||||
```bash
|
||||
# Do our experiments in /tmp
|
||||
cd /tmp
|
||||
# Clone oneTBB repository
|
||||
git clone https://github.com/uxlfoundation/oneTBB.git
|
||||
cd oneTBB
|
||||
# Create binary directory for out-of-source build
|
||||
mkdir build && cd build
|
||||
# Configure: customize CMAKE_INSTALL_PREFIX and disable TBB_TEST to avoid tests build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/tmp/my_installed_onetbb -DTBB_TEST=OFF ..
|
||||
# Build
|
||||
cmake --build .
|
||||
# Install
|
||||
cmake --install .
|
||||
# Well done! Your installed oneTBB is in /tmp/my_installed_onetbb
|
||||
```
|
||||
|
||||
#### Multi-Configuration Generators
|
||||
|
||||
The following example demonstrates how to install oneTBB for multi-configuration generators such as Visual Studio*.
|
||||
|
||||
Choose the configuration during the build and install steps:
|
||||
```batch
|
||||
REM Do our experiments in %TMP%
|
||||
cd %TMP%
|
||||
REM Clone oneTBB repository
|
||||
git clone https://github.com/uxlfoundation/oneTBB.git
|
||||
cd oneTBB
|
||||
REM Create binary directory for out-of-source build
|
||||
mkdir build && cd build
|
||||
REM Configure: customize CMAKE_INSTALL_PREFIX and disable TBB_TEST to avoid tests build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=%TMP%\my_installed_onetbb -DTBB_TEST=OFF ..
|
||||
REM Build "release with debug information" configuration
|
||||
cmake --build . --config relwithdebinfo
|
||||
REM Install "release with debug information" configuration
|
||||
cmake --install . --config relwithdebinfo
|
||||
REM Well done! Your installed oneTBB is in %TMP%\my_installed_onetbb
|
||||
```
|
||||
@@ -1,141 +0,0 @@
|
||||
<!--
|
||||
******************************************************************************
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/-->
|
||||
|
||||
# Introduction
|
||||
|
||||
This document defines roles in the oneTBB project.
|
||||
|
||||
# Roles and Responsibilities
|
||||
|
||||
oneTBB project defines three main roles:
|
||||
* [Contributor](#contributor)
|
||||
* [Code Owner](#code-Owner)
|
||||
* [Maintainer](#maintainer)
|
||||
|
||||
[permissions]: https://docs.github.com/en/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization#permissions-for-each-role
|
||||
|
||||
| | Contributor | Code Owner | Maintainer |
|
||||
| :------------------------------------------------------------------------------------------------------------------------------------------ | :---------------------: | :---------------------: | :---------------------: |
|
||||
| _Responsibilities_ | | | |
|
||||
| Follow the [Code of Conduct](./CODE_OF_CONDUCT.md) | ✓ | ✓ | ✓ |
|
||||
| Follow [Contribution Guidelines](./CONTRIBUTING.md) | ✓ | ✓ | ✓ |
|
||||
| Ensure [Contribution Guidelines](./CONTRIBUTING.md) are followed | ✗ | ✓ | ✓ |
|
||||
| Co-own component or aspect of the library,<br> including contributing: bug fixes, implementing features,<br> and performance optimizations | ✗ | ✓ | ✓ |
|
||||
| Co-own on technical direction of component or<br> aspect of the library including work on RFCs | ✗ | ✓ | ✓ |
|
||||
| Co-own the project as a whole,<br> including determining strategy and policy for the project | ✗ | ✗ | ✓ |
|
||||
| _Privileges_ | | | |
|
||||
| Permission granted | [Read][permissions] | [Write][permissions] | [Maintain][permissions] |
|
||||
| Eligible to become | Code Owner | Maintainer | ✗ |
|
||||
| Can recommend Contributors<br> to become Code Owner | ✗ | ✓ | ✓ |
|
||||
| Can participate in promotions of<br> Code Owners and Maintainers | ✗ | ✗ | ✓ |
|
||||
| Can suggest Milestones during planning | ✓ | ✓ | ✓ |
|
||||
| Can choose Milestones for specific component | ✗ | ✓ | ✓ |
|
||||
| Make a decision on project's Milestones during planning | ✗ | ✗ | ✓ |
|
||||
| Can propose new RFC or<br> participate in review of existing RFC | ✓ | ✓ | ✓ |
|
||||
| Can request rework of RFCs<br> in represented area of responsibility | ✗ | ✓ | ✓ |
|
||||
| Can request rework of RFCs<br> in any part of the project | ✗ | ✗ | ✓ |
|
||||
| Can manage release process of the project | ✗ | ✗ | ✓ |
|
||||
| Can represent the project in public as a Maintainer | ✗ | ✗ | ✓ |
|
||||
|
||||
These roles are merit based. Refer to the corresponding section for specific
|
||||
requirements and the nomination process.
|
||||
|
||||
## Contributor
|
||||
|
||||
A Contributor invests time and resources to improve oneTBB project.
|
||||
Anyone can become a Contributor by bringing value in any following way:
|
||||
* Answer questions from community members.
|
||||
* Propose changes to the design.
|
||||
* Provide feedback on design proposals.
|
||||
* Review and/or test pull requests.
|
||||
* Test releases and report bugs.
|
||||
* Contribute code, including bug fixes, features implementations,
|
||||
and performance optimizations.
|
||||
|
||||
## Code Owner
|
||||
|
||||
A Code Owner has responsibility for a specific project component or a functional
|
||||
area. Code Owners are collectively responsible
|
||||
for developing and maintaining their component or functional areas, including
|
||||
reviewing all changes to corresponding areas of responsibility and indicating
|
||||
whether those changes are ready to be merged. Code Owners have a track record of
|
||||
contribution and review in the project.
|
||||
|
||||
**Requirements:**
|
||||
* Track record of accepted code contributions to a specific project component.
|
||||
* Track record of contributions to the code review process.
|
||||
* Demonstrate in-depth knowledge of the architecture of a specific project
|
||||
component.
|
||||
* Commit to being responsible for that specific area.
|
||||
|
||||
How to become a Code Owner?
|
||||
1. A Contributor is nominated by opening a PR modifying the MAINTAINERS.md file
|
||||
including name, Github username, and affiliation.
|
||||
2. At least two specific component Maintainers approve the PR.
|
||||
3. [CODEOWNERS](./CODEOWNERS) file is updated to represent corresponding areas of responsibility.
|
||||
|
||||
## Maintainer
|
||||
Maintainers are the most established contributors responsible for the
|
||||
project technical direction. They participate in making decisions about the
|
||||
strategy and priorities of the project.
|
||||
|
||||
**Requirements:**
|
||||
* Have experience as a Code Owner.
|
||||
* Track record of major project contributions to a specific project component.
|
||||
* Demonstrate deep knowledge of a specific project component.
|
||||
* Demonstrate broad knowledge of the project across multiple areas.
|
||||
* Commit to using privileges responsibly for the good of the project.
|
||||
* Be able to exercise judgment for the good of the project, independent of
|
||||
their employer, friends, or team.
|
||||
|
||||
Process of becoming a maintainer:
|
||||
1. A Maintainer may nominate a current code owner to become a new Maintainer by
|
||||
opening a PR against MAINTAINERS.md file.
|
||||
2. A majority of the current Maintainers must then approve the PR.
|
||||
|
||||
# Code Owners and Maintainers List
|
||||
|
||||
## oneTBB core (API, Architecture, Tests)
|
||||
|
||||
| Name | Github ID | Affiliation | Role |
|
||||
| --------------------- | --------------------- | ----------------- | ---------- |
|
||||
| Ilya Isaev | @isaevil | Intel Corporation | Code Owner |
|
||||
| Alexey Kukanov | @akukanov | Intel Corporation | Code Owner |
|
||||
| Konstantin Boyarinov | @kboyarinov | Intel Corporation | Maintainer |
|
||||
| Aleksei Fedotov | @aleksei-fedotov | Intel Corporation | Maintainer |
|
||||
| Michael Voss | @vossmjp | Intel Corporation | Maintainer |
|
||||
| Dmitri Mokhov | @dnmokhov | Intel Corporation | Maintainer |
|
||||
|
||||
## oneTBB TBBMALLOC (API, Architecture, Tests)
|
||||
|
||||
| Name | Github ID | Affiliation | Role |
|
||||
| --------------------- | --------------------- | ----------------- | ---------- |
|
||||
| Łukasz Plewa | @lplewa | Intel Corporation | Maintainer |
|
||||
|
||||
|
||||
## oneTBB Documentation
|
||||
|
||||
| Name | Github ID | Affiliation | Role |
|
||||
| ---------------------- | --------------------- | ----------------- | ---------- |
|
||||
| Alexandra Epanchinzeva | @aepanchi | Independent | Code Owner |
|
||||
| Olga Malysheva | @omalyshe | Intel Corporation | Code Owner |
|
||||
|
||||
|
||||
## oneTBB Release Management
|
||||
|
||||
| Name | Github ID | Affiliation | Role |
|
||||
| ------------------ | --------------------- | ----------------- | ---------- |
|
||||
| Olga Malysheva | @omalyshe | Intel Corporation | Maintainer |
|
||||
@@ -1,26 +0,0 @@
|
||||
# Copyright (c) 2021-2025 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# DISCLAIMER: Bazel support is community-based. The maintainers do not
|
||||
# use Bazel internally. The Bazel build can have security risks or
|
||||
# optimization gaps.
|
||||
|
||||
module(
|
||||
name = "onetbb",
|
||||
compatibility_level = 1,
|
||||
)
|
||||
|
||||
bazel_dep(name = "platforms", version = "0.0.11")
|
||||
bazel_dep(name = "rules_cc", version = "0.1.1")
|
||||
bazel_dep(name = "rules_license", version = "1.0.0")
|
||||
@@ -1,71 +1,51 @@
|
||||
# oneAPI Threading Building Blocks (oneTBB) <img align="right" width="200" height="100" src="https://raw.githubusercontent.com/uxlfoundation/artwork/e98f1a7a3d305c582d02c5f532e41487b710d470/foundation/uxl-foundation-logo-horizontal-color.svg">
|
||||
[](LICENSE.txt) [](https://github.com/uxlfoundation/oneTBB/actions/workflows/ci.yml?query=branch%3Amaster)
|
||||
[](https://github.com/uxlfoundation/oneTBB/discussions)
|
||||
[](https://www.bestpractices.dev/projects/9125)
|
||||
[](https://securityscorecards.dev/viewer/?uri=github.com/uxlfoundation/oneTBB)
|
||||
[](https://gurubase.io/g/onetbb)
|
||||
[](https://scan.coverity.com/projects/oneapi-src-onetbb)
|
||||
[](https://scan.coverity.com/projects/uxlfoundation-onetbb)
|
||||
# oneAPI Threading Building Blocks
|
||||
[](LICENSE.txt) [](https://github.com/oneapi-src/oneTBB/actions/workflows/ci.yml?query=branch%3Amaster)
|
||||
|
||||
oneTBB is a flexible C++ library that simplifies the work of adding parallelism
|
||||
to complex applications, even if you are not a threading expert.
|
||||
|
||||
The library lets you easily write parallel programs that take full advantage of the multi-core performance. Such programs are portable,
|
||||
composable and have a future-proof scalability. oneTBB provides you with functions, interfaces, and classes to parallelize and scale the code.
|
||||
All you have to do is to use the templates.
|
||||
|
||||
The library differs from typical threading packages in the following ways:
|
||||
* oneTBB enables you to specify logical parallelism instead of threads.
|
||||
* oneTBB targets threading for performance.
|
||||
* oneTBB is compatible with other threading packages.
|
||||
* oneTBB emphasizes scalable, data parallel programming.
|
||||
* oneTBB relies on generic programming.
|
||||
|
||||
|
||||
Refer to oneTBB [examples](examples) and [samples](https://github.com/oneapi-src/oneAPI-samples/tree/master/Libraries/oneTBB) to see how you can use the library.
|
||||
|
||||
oneTBB is a part of 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.
|
||||
oneAPI Threading Building Blocks (oneTBB) lets you easily write parallel C++ programs that take
|
||||
full advantage of multicore performance, that are portable, composable and have future-proof scalability.
|
||||
|
||||
## Release Information
|
||||
|
||||
See [Release Notes](RELEASE_NOTES.md) and [System Requirements](SYSTEM_REQUIREMENTS.md).
|
||||
Here are [Release Notes]( https://software.intel.com/en-us/articles/intel-oneapi-threading-building-blocks-release-notes) and
|
||||
[System Requirements](https://software.intel.com/en-us/articles/intel-oneapi-threading-building-blocks-system-requirements).
|
||||
|
||||
## Documentation
|
||||
* [oneTBB Specification](https://oneapi-spec.uxlfoundation.org/specifications/oneapi/latest/elements/onetbb/source/nested-index)
|
||||
* [oneTBB Developer Guide and Reference](https://uxlfoundation.github.io/oneTBB)
|
||||
* [Migrating from TBB to oneTBB](https://uxlfoundation.github.io/oneTBB/main/tbb_userguide/Migration_Guide.html)
|
||||
* [README for the CMake build system](cmake/README.md)
|
||||
* [oneTBB Versioning Policies](VERSIONING.md)
|
||||
* [oneTBB Testing Approach](https://uxlfoundation.github.io/oneTBB/main/intro/testing_approach.html)
|
||||
* [Basic support for the Bazel build system](Bazel.md)
|
||||
* [oneTBB Discussions](https://github.com/uxlfoundation/oneTBB/discussions)
|
||||
* [WASM Support](WASM_Support.md)
|
||||
|
||||
## 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.
|
||||
* [oneTBB Specification](https://spec.oneapi.com/versions/latest/elements/oneTBB/source/nested-index.html)
|
||||
* [oneTBB Developer Guide and Reference](https://software.intel.com/en-us/oneapi-tbb-documentation)
|
||||
* [Migrating from TBB to oneTBB](https://software.intel.com/content/www/us/en/develop/documentation/onetbb-documentation/top/onetbb-developer-guide/migrating-from-threading-building-blocks-tbb.html)
|
||||
* README for build system: [cmake/README.md](cmake/README.md)
|
||||
|
||||
## Support
|
||||
See our [documentation](./SUPPORT.md) to learn how to request help.
|
||||
Please report issues and suggestions via
|
||||
[GitHub issues](https://github.com/oneapi-src/oneTBB/issues) or start a topic on the
|
||||
[oneTBB forum](https://community.intel.com/t5/Intel-oneAPI-Threading-Building/bd-p/oneapi-threading-building-blocks).
|
||||
|
||||
## How to Contribute
|
||||
We welcome community contributions, so check our [Contributing Guidelines](CONTRIBUTING.md)
|
||||
to learn more.
|
||||
To contribute to oneTBB, please open a GitHub pull request (preferred) or send us a patch by e-mail.
|
||||
|
||||
Use GitHub Issues for feature requests, bug reports, and minor inquiries. For broader questions and development-related discussions, use GitHub Discussions.
|
||||
Please use the sign-off line at the end of the patch.
|
||||
Your signature certifies that you wrote the patch or
|
||||
otherwise have the right to pass it on as an open-source patch.
|
||||
The rules are pretty simple:
|
||||
if you can certify the https://developercertificate.org then you just add a line to every git commit message:
|
||||
```
|
||||
Signed-off-by: Name Surname <user@email.com>
|
||||
```
|
||||
Use your real name (sorry, no pseudonyms or anonymous contributions).
|
||||
|
||||
If you set your `user.name` and `user.email` git configs, you can sign your
|
||||
commit automatically with `git commit -s`.
|
||||
|
||||
## 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.
|
||||
|
||||
## Security
|
||||
To report security issues please go to https://intel.com/security.
|
||||
|
||||
## Engineering team contacts
|
||||
* [E-mail us.](mailto:inteltbbdevelopers@intel.com)
|
||||
|
||||
------------------------------------------------------------------------
|
||||
\* All names and brands may be claimed as the property of others.
|
||||
Intel and the Intel logo are trademarks of Intel Corporation or its subsidiaries in the U.S. and/or other countries.
|
||||
|
||||
\* Other names and brands may be claimed as the property of others.
|
||||
|
||||
@@ -1,466 +0,0 @@
|
||||
<!--
|
||||
******************************************************************************
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/-->
|
||||
|
||||
# oneTBB 2023.1 Release Notes
|
||||
|
||||
## :rocket: Preview Features
|
||||
- NUMA Optimization: Use new interleaved memory allocation APIs to explicitly control memory placement across NUMA nodes. The ``allocate_numa_interleaved`` and ``deallocate_numa_interleaved`` functions allocate and deallocate memory across multiple NUMA nodes, helping increase bandwidth and avoid bottlenecks from single-node allocation.
|
||||
- C++20 Modules: This release adds experimental support for C++20 modules with the introduction of ``include/oneapi/tbb.cppm``. Developers can use this instead of traditional headers to reduce compilation times and improve encapsulation.
|
||||
|
||||
## :tada: New Features
|
||||
- oneTBB repository now contains Thread Composability Manager (TCM) source code - a project that helps in limiting oversubscription that can arise when multiple parallel runtimes are used within an application. More information is available at https://uxlfoundation.github.io/oneTBB/main/tbb_userguide/appendix_B.html#avoid-cpu-overutilization
|
||||
|
||||
## :rotating_light: Known Limitations
|
||||
- The ``oneapi::tbb::info`` namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
|
||||
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
|
||||
- The NUMA topology may be detected incorrectly on Windows* OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
|
||||
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
|
||||
- When CPU resource coordination is enabled by setting the TCM_ENABLE environment variable to 1, tasks from a lower-priority ``task_arena`` might be executed before tasks from a higher-priority ``task_arena``.
|
||||
- Using oneTBB on WASM* may cause applications to run in a single thread. See [Limitations of WASM Support](https://github.com/uxlfoundation/oneTBB/blob/master/WASM_Support.md#limitations).
|
||||
|
||||
> **_NOTE:_** To see known limitations that impact all versions of oneTBB, refer to [oneTBB Documentation](https://uxlfoundation.github.io/oneTBB/main/intro/limitations.html).
|
||||
|
||||
## :hammer: Issues Fixed
|
||||
- Added IPO build support for modern Intel compilers with old CMake under Linux*.
|
||||
|
||||
## :octocat: Open-Source Contributions Integrated
|
||||
- Improved support for GNU* Hurd*. Contributed by Petter Reinholdtsen (https://github.com/uxlfoundation/oneTBB/pull/2028, https://github.com/uxlfoundation/oneTBB/pull/2038, https://github.com/uxlfoundation/oneTBB/pull/2026).
|
||||
- Fixed Windows* build on ARM64* when using MSVC. contributed by navvyswethgraphics (https://github.com/uxlfoundation/oneTBB/pull/2030).
|
||||
|
||||
|
||||
# oneTBB 2023.0 Release Notes
|
||||
|
||||
## :rocket: Preview Features
|
||||
- Introduced ability to wait for a single task in a ``task_group`` instead of waiting for all tasks to finish. This increases reactivity and decreases latency in key user workloads.
|
||||
- Introduced ``flow::resource_limited_node`` and ``flow::resource_limiter`` classes. These nodes only execute when they can successfully acquire the necessary resources from the resource limiters associated with the node. This feature is used to guard access to shared resources, while maximizing available parallelism in the graph.
|
||||
- Introduced ``task_arena`` core type selector to better support hybrid architectures with several core types. Users use this new flexible API to more tightly constrain execution to set preferences for the specific core types that match their workload.
|
||||
- Added global control parameter to set default block time behavior on server HW. This allows developers to revert to older blocking behavior if their applications are not able to fully utilize all cores, thereby reducing idle spinning.
|
||||
|
||||
|
||||
## :tada: New Features
|
||||
- Added new API to create a set of NUMA bound task arenas, simplifying common patterns used to optimize for NUMA architectures.
|
||||
- Extended Flow Graph functional node deduction guides to support non-static member function and member object pointers as a node bodies.
|
||||
- The Flow Graph join_node and indexer_node now support 10 or more input ports.
|
||||
- Explicit deduction guides for ``blocked_nd_range`` are now a fully supported feature.
|
||||
- Added native WASM exception handling support.
|
||||
- Added support for Python 3.14.
|
||||
|
||||
|
||||
## :rotating_light: Known Limitations
|
||||
- The ``oneapi::tbb::info`` namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
|
||||
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
|
||||
- The NUMA topology may be detected incorrectly on Windows* OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
|
||||
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
|
||||
- When CPU resource coordination is enabled by setting the TCM_ENABLE environment variable to 1, tasks from a lower-priority ``task_arena`` might be executed before tasks from a higher-priority ``task_arena``.
|
||||
- Using oneTBB on WASM* may cause applications to run in a single thread. See [Limitations of WASM Support](https://github.com/uxlfoundation/oneTBB/blob/master/WASM_Support.md#limitations).
|
||||
|
||||
> **_NOTE:_** To see known limitations that impact all versions of oneTBB, refer to [oneTBB Documentation](https://uxlfoundation.github.io/oneTBB/main/intro/limitations.html).
|
||||
|
||||
|
||||
## :hammer: Issues Fixed
|
||||
- Significantly improved scalability for concurrent ordered containers on systems with many threads. This change results in greater than 3x performance for some use cases.
|
||||
- Fixed ODR violations when public inline functions expose entities with internal linkage.
|
||||
|
||||
## :octocat: Open-Source Contributions Integrated
|
||||
- Updated tbb4py installation approach to be aligned with PEP517. Contributed by Ben Greiner (https://github.com/uxlfoundation/oneTBB/pull/1941).
|
||||
- Improved usage of <windows.h> in oneTBB code. Contributed by Aras Pranckevičius (https://github.com/uxlfoundation/oneTBB/pull/1932).
|
||||
- Fixed CMake build issue with Clang on Windows*. Contributed by JustinZhu (https://github.com/uxlfoundation/oneTBB/pull/1936).
|
||||
|
||||
|
||||
# oneTBB 2022.3 Release Notes
|
||||
|
||||
## :rocket: Preview Features
|
||||
- Introduced API for setting dynamic task dependencies in task_group. This allows successor tasks to execute only after all their predecessors have completed.
|
||||
|
||||
|
||||
## :tada: New Features
|
||||
- Extended task_arena with API support for enqueuing functions into a task_group and waiting for the task_group to complete.
|
||||
- Introduced API for setting and getting the assertion handler. This allows applications to set their own assertion handling functions.
|
||||
|
||||
|
||||
## :rotating_light: Known Limitations
|
||||
- The ``oneapi::tbb::info`` namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
|
||||
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
|
||||
- The NUMA topology may be detected incorrectly on Windows* OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
|
||||
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
|
||||
- C++ exception handling mechanism on Windows* OS on ARM64* might corrupt memory if an exception is thrown from any oneTBB parallel algorithm (see Windows* OS on ARM64* compiler issue: https://developercommunity.visualstudio.com/t/ARM64-incorrect-stack-unwinding-for-alig/1544293.
|
||||
- When CPU resource coordination is enabled by setting the TCM_ENABLE environment variable to 1, tasks from a lower-priority ``task_arena`` might be executed before tasks from a higher-priority ``task_arena``.
|
||||
- When CPU resource coordination is enabled, cgroups CPU quota and period limitations settings are ignored.
|
||||
- Using oneTBB on WASM* may cause applications to run in a single thread. See [Limitations of WASM Support](https://github.com/uxlfoundation/oneTBB/blob/master/WASM_Support.md#limitations).
|
||||
|
||||
> **_NOTE:_** To see known limitations that impact all versions of oneTBB, refer to [oneTBB Documentation](https://uxlfoundation.github.io/oneTBB/main/intro/limitations.html).
|
||||
|
||||
|
||||
## :hammer: Issues Fixed
|
||||
- Fixed overwrite_node and write_once_node to prevent premature trigger of continue_node successors.
|
||||
- Fixed keys duplication in concurrent_hash_map when the container is initialized using a pair of iterators, or std::initializer_list (https://github.com/uxlfoundation/oneTBB/issues/1764).
|
||||
- Improved support for profiling tools by allowing the oneTBB notifications to be ignored by tools and by better timing of task completion notifications.
|
||||
- Fixed incorrect deallocation of tasks in task_group (https://github.com/uxlfoundation/oneTBB/issues/1834).
|
||||
- Improved performance scalability of spin_mutex::lock, spin_mutex::try_lock and queuing_mutex::scoped_lock::try_acquire.
|
||||
- Fixed potential oversubscription issue by respecting CPU quota and period limitations provided via cgroups settings on Linux* (https://github.com/uxlfoundation/oneTBB/issues/190, https://github.com/uxlfoundation/oneTBB/issues/1760).
|
||||
|
||||
## :octocat: Open-Source Contributions Integrated
|
||||
- Fixed CMake build issue on some architectures. Contributed by lmarz (https://github.com/uxlfoundation/oneTBB/pull/1768).
|
||||
- Fixed stack size assertion failure when running with ASAN. Contributed by omegacoleman (https://github.com/uxlfoundation/oneTBB/pull/1782).
|
||||
- Improved Bazel support on non-x86 architectures. Contributed by Caleb Zulawski (https://github.com/uxlfoundation/oneTBB/pull/1790).
|
||||
- Fixed potential crash caused by nullptr dereference for the tag_matching join_node. Contributed by Federico Ficarelli (https://github.com/uxlfoundation/oneTBB/pull/1800).
|
||||
- Fixed false positive GCC* warnings. Contributed by Zizheng Guo (https://github.com/uxlfoundation/oneTBB/pull/1752).
|
||||
- Fixed ASAN detection for Clang*. Contributed by Federico Ficarelli (https://github.com/uxlfoundation/oneTBB/pull/1842).
|
||||
|
||||
|
||||
# oneTBB 2022.2 Release Notes
|
||||
|
||||
## :tada: New Features
|
||||
- Improved Hybrid CPU and NUMA Platforms API Support: Enhanced API availability for better compatibility with Hybrid CPU and NUMA platforms.
|
||||
- Added support for verifying signatures of dynamic dependencies at runtime. To enable this feature, specify
|
||||
``-DTBB_VERIFY_DEPENDENCY_SIGNATURE=ON`` when invoking CMake.
|
||||
- Added support for printing warning messages about issues in dynamic dependency loading. To see these messages in the console, build the library with the ``TBB_DYNAMIC_LINK_WARNING`` macro defined.
|
||||
- Added a Natvis file for custom visualization of TBB containers when debugging with Microsoft* Visual Studio.
|
||||
- Refined Environment Setup: Replaced CPATH with ``C_INCLUDE_PATH and CPLUS_INCLUDE_PATH`` in environment setup to avoid unintended compiler warnings caused by globally applied include paths.
|
||||
|
||||
|
||||
## :rotating_light: Known Limitations
|
||||
- The ``oneapi::tbb::info`` namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
|
||||
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
|
||||
- The NUMA topology may be detected incorrectly on Windows* OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
|
||||
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
|
||||
- C++ exception handling mechanism on Windows* OS on ARM64* might corrupt memory if an exception is thrown from any oneTBB parallel algorithm (see Windows* OS on ARM64* compiler issue: https://developercommunity.visualstudio.com/t/ARM64-incorrect-stack-unwinding-for-alig/1544293.
|
||||
- When CPU resource coordination is enabled, tasks from a lower-priority ``task_arena`` might be executed before tasks from a higher-priority ``task_arena``.
|
||||
- Using oneTBB on WASM* may cause applications to run in a single thread. See [Limitations of WASM Support](https://github.com/uxlfoundation/oneTBB/blob/master/WASM_Support.md#limitations).
|
||||
|
||||
> **_NOTE:_** To see known limitations that impact all versions of oneTBB, refer to [oneTBB Documentation](https://uxlfoundation.github.io/oneTBB/main/intro/limitations.html).
|
||||
|
||||
|
||||
## :octocat: Open-Source Contributions Integrated
|
||||
- Fixed a CMake configuration error on systems with non-English locales. Contributed by moritz-h (https://github.com/uxlfoundation/oneTBB/pull/1606).
|
||||
- Made the install destination of import libraries on Windows* configurable. Contributed by Bora Yalçıner (https://github.com/uxlfoundation/oneTBB/pull/1613).
|
||||
- Resolved an in-source CMake build error. Contributed by Dmitrii Golovanov (https://github.com/uxlfoundation/oneTBB/pull/1670).
|
||||
- Migrated the build system to Bazel* version 8.1.1. Contributed by Julian Amann (https://github.com/uxlfoundation/oneTBB/pull/1694).
|
||||
- Fixed build errors on MinGW* and FreeBSD*. Contributed by John Ericson (https://github.com/uxlfoundation/oneTBB/pull/1696).
|
||||
- Addressed build errors on macOS* when using the GCC compiler. Contributed by Oleg Butakov (https://github.com/uxlfoundation/oneTBB/pull/1603).
|
||||
|
||||
# oneTBB 2022.1 Release Notes
|
||||
|
||||
## :tada: New Features
|
||||
- The oneTBB repository migrated to the new [UXL Foundation](https://github.com/uxlfoundation/oneTBB) organization.
|
||||
- ``blocked_nd_range`` is now a fully supported feature.
|
||||
- Introduced the ``ONETBB_SPEC_VERSION`` macro to specify the version of oneAPI specification implemented by the current version of the library.
|
||||
|
||||
|
||||
## :rocket: Preview Features
|
||||
- Added the explicit deduction guides to ``blocked_nd_range`` to support C++17 Class Template Argument Deduction.
|
||||
- Extended ``task_arena`` API to select TBB workers leave policy and to hint the start and the end of parallel computations.
|
||||
|
||||
|
||||
## :rotating_light: Known Limitations
|
||||
- The ``oneapi::tbb::info`` namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
|
||||
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
|
||||
- The NUMA topology may be detected incorrectly on Windows* OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
|
||||
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
|
||||
- C++ exception handling mechanism on Windows* OS on ARM64* might corrupt memory if an exception is thrown from any oneTBB parallel algorithm (see Windows* OS on ARM64* compiler issue: https://developercommunity.visualstudio.com/t/ARM64-incorrect-stack-unwinding-for-alig/1544293.
|
||||
- When CPU resource coordination is enabled, tasks from a lower-priority ``task_arena`` might be executed before tasks from a higher-priority ``task_arena``.
|
||||
- Using oneTBB on WASM* may cause applications to run in a single thread. See [Limitations of WASM Support](https://github.com/uxlfoundation/oneTBB/blob/master/WASM_Support.md#limitations).
|
||||
|
||||
> **_NOTE:_** To see known limitations that impact all versions of oneTBB, refer to [oneTBB Documentation](https://uxlfoundation.github.io/oneTBB/main/intro/limitations.html).
|
||||
|
||||
|
||||
## :hammer: Issues Fixed
|
||||
- Fixed deadlock when using `tbb::concurrent_vector::grow_by()` (https://github.com/uxlfoundation/oneTBB/issues/1531).
|
||||
- Fixed assertion in the Debug version of oneTBB on systems with multiple processor groups.
|
||||
- Fixed issues with Flow Graph priorities when using limited concurrency nodes (https://github.com/uxlfoundation/oneTBB/issues/1595).
|
||||
- Improved support of ``tbb::task_arena::constraints`` functionality on Windows* systems with multiple processor groups.
|
||||
- Fixed ``concurrent_queue`` and ``concurrent_bounded_queue`` capacity preserving on copying, moving, and swapping (https://github.com/uxlfoundation/oneTBB/issues/1598).
|
||||
- Fixed ``parallel_for_each`` compilation issues on GCC 9 in C++20 mode (https://github.com/uxlfoundation/oneTBB/issues/1552).
|
||||
|
||||
|
||||
## :octocat: Open-Source Contributions Integrated
|
||||
- Fixed linkage errors when the application is built with the hidden symbols visibility. Contributed by Vladislav Shchapov (https://github.com/uxlfoundation/oneTBB/pull/1114).
|
||||
- On Linux* OS, for external thread, determined stack size using POSIX* API instead of relying on the stack size of a worker thread. Contributed by bongkyu7-kim (https://github.com/uxlfoundation/oneTBB/pull/1485).
|
||||
- Added a CMake option to use relative paths instead of full paths in debug information. Contributed by Fang Xu (https://github.com/uxlfoundation/oneTBB/pull/1401).
|
||||
- Improved OpenBSD* support by removing the use of direct syscalls. Contributed by Brad Smith (https://github.com/uxlfoundation/oneTBB/pull/1499).
|
||||
- Fixed build issues on ARM64* when using Bazel. Contributed by snadampal (https://github.com/uxlfoundation/oneTBB/pull/1571).
|
||||
- Suppressed deprecation warnings for CMake versions earlier than 3.10 when using the latest CMake. Contributed by Vladislav Shchapov (https://github.com/uxlfoundation/oneTBB/pull/1585).
|
||||
|
||||
# oneTBB 2022.0 Release Notes
|
||||
|
||||
## :rocket: Preview Features
|
||||
- Extended the Flow Graph receiving nodes with a new ``try_put_and_wait`` API that submits a message to the graph and waits for its completion.
|
||||
|
||||
## :rotating_light: Known Limitations
|
||||
- The ``oneapi::tbb::info`` namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
|
||||
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
|
||||
- The NUMA topology may be detected incorrectly on Windows* OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
|
||||
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
|
||||
- C++ exception handling mechanism on Windows* OS on ARM64* might corrupt memory if an exception is thrown from any oneTBB parallel algorithm (see Windows* OS on ARM64* compiler issue: https://developercommunity.visualstudio.com/t/ARM64-incorrect-stack-unwinding-for-alig/1544293.
|
||||
- When CPU resource coordination is enabled, tasks from a lower-priority ``task_arena`` might be executed before tasks from a higher-priority ``task_arena``.
|
||||
- Using oneTBB on WASM*, may cause applications to run in a single thread. See [Limitations of WASM Support](https://github.com/oneapi-src/oneTBB/blob/master/WASM_Support.md#limitations).
|
||||
|
||||
> **_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: Issues Fixed
|
||||
- Fixed the missed signal for thread request for enqueue operation.
|
||||
- Significantly improved scalability of ``task_group``, ``flow_graph``, and ``parallel_for_each``.
|
||||
- Removed usage of ``std::aligned_storage`` deprecated in C++23 (Inspired by Valery Matskevich https://github.com/oneapi-src/oneTBB/pull/1394).
|
||||
- Fixed the issue where ``oneapi::tbb::info`` interfaces might interfere with the process affinity mask on the Windows* OS systems with multiple processor groups.
|
||||
|
||||
|
||||
## :octocat: Open-Source Contributions Integrated
|
||||
- Detect the GNU Binutils version to determine WAITPKG support better. Contributed by Martijn Courteaux (https://github.com/oneapi-src/oneTBB/pull/1347).
|
||||
- Fixed the build on non-English locales. Contributed by Vladislav Shchapov (https://github.com/oneapi-src/oneTBB/pull/1450).
|
||||
- Improved Bazel support. Contributed by Julian Amann (https://github.com/oneapi-src/oneTBB/pull/1434).
|
||||
|
||||
# oneTBB 2021.13 Release Notes
|
||||
|
||||
## :tada: New Features
|
||||
- Extended the parallel_reduce and parallel_deterministic_reduce functional form API to better support rvalues reduction (https://github.com/uxlfoundation/oneTBB/pull/1299).
|
||||
|
||||
## :rotating_light: Known Limitations
|
||||
- The ``oneapi::tbb::info`` namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
|
||||
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
|
||||
- The NUMA topology may be detected incorrectly on Windows* OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
|
||||
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
|
||||
- C++ exception handling mechanism on Windows* OS on ARM64* might corrupt memory if an exception is thrown from any oneTBB parallel algorithm (see Windows* OS on ARM64* compiler issue: https://developercommunity.visualstudio.com/t/ARM64-incorrect-stack-unwinding-for-alig/1544293.
|
||||
- When CPU resource coordination is enabled, tasks from a lower-priority ``task_arena`` might be executed before tasks from a higher-priority ``task_arena``.
|
||||
- Using oneTBB on WASM* may cause applications to run in a single thread. See [Limitations of WASM Support](https://github.com/uxlfoundation/oneTBB/blob/master/WASM_Support.md#limitations).
|
||||
|
||||
> **_NOTE:_** To see known limitations that impact all versions of oneTBB, refer to [oneTBB Documentation](https://uxlfoundation.github.io/oneTBB/main/intro/limitations.html).
|
||||
|
||||
## :hammer: Issues Fixed
|
||||
- Improved security by excluding CWD from search of load-time dependencies.
|
||||
- Improved performance on Apple* platforms by aligning block-time behavior with other OS.
|
||||
- Improved performance on non-hybrid CPU hardware by reworking block-time behavior.
|
||||
- Improved performance on ARM64 platform by fixing backoff behavior for spin loops.
|
||||
- Improved performance when constraints API is used on server CPU HW with multiple NUMA nodes.
|
||||
|
||||
## :octocat: Open-Source Contributions Integrated
|
||||
- Improved WASM support by fixing a segmentation fault happening if global tbb::task_scheduler_observer is used. Contributed by Santiago Ospina De Los Ríos https://github.com/oneapi-src/oneTBB/pull#1346).
|
||||
|
||||
# oneTBB 2021.12 Release Notes
|
||||
|
||||
## :rotating_light: Known Limitations
|
||||
- The ``oneapi::tbb::info`` namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
|
||||
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
|
||||
- The NUMA topology may be detected incorrectly on Windows* OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
|
||||
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
|
||||
- C++ exception handling mechanism on Windows* OS on ARM64* might corrupt memory if an exception is thrown from any oneTBB parallel algorithm (see Windows* OS on ARM64* compiler issue: https://developercommunity.visualstudio.com/t/ARM64-incorrect-stack-unwinding-for-alig/1544293.
|
||||
- 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: Issues Fixed
|
||||
- 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).
|
||||
|
||||
# oneTBB 2021.11 Release Notes
|
||||
|
||||
## :rotating_light: Known Limitations
|
||||
- The ``oneapi::tbb::info`` namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
|
||||
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
|
||||
- The NUMA topology may be detected incorrectly on Windows* OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
|
||||
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
|
||||
- C++ exception handling mechanism on Windows* OS on ARM64* might corrupt memory if an exception is thrown from any oneTBB parallel algorithm (see Windows* OS on ARM64* compiler issue: https://developercommunity.visualstudio.com/t/ARM64-incorrect-stack-unwinding-for-alig/1544293).
|
||||
- Using ``TBBConfig.cmake`` in 32-bit environment may cause incorrect linkage with 64-bit oneTBB library. As a workaround, set ``CMAKE_PREFIX_PATH``:
|
||||
- On Linux* OS: to ``TBBROOT/lib32/``
|
||||
- On Windows* OS: to ``TBBROOT/lib32/;TBBROOT/bin32/``
|
||||
|
||||
> **_NOTE:_** To see known limitations that impact all versions of oneTBB, refer to [oneTBB Documentation](https://oneapi-src.github.io/oneTBB/main/intro/limitations.html).
|
||||
|
||||
|
||||
## :hammer: Issues Fixed
|
||||
- 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``.
|
||||
|
||||
# oneTBB 2021.10 Release Notes
|
||||
|
||||
## :tada: New Features
|
||||
- Since C++17, parallel algorithms and Flow Graph nodes are allowed to accept pointers to the member functions and member objects as the user-provided callables.
|
||||
- Added missed member functions, such as assignment operators and swap function, to the ``concurrent_queue`` and ``concurrent_bounded_queue`` containers.
|
||||
|
||||
## :rotating_light: Known Limitations
|
||||
- A static assert will cause compilation failures in oneTBB headers when compiling with clang 12.0.0 or newer if using the LLVM standard library with ``-ffreestanding`` and C++11/14 compiler options.
|
||||
- An application using Parallel STL algorithms in libstdc++ versions 9 and 10 may fail to compile due to incompatible interface changes between earlier versions of Threading Building Blocks (TBB) and oneAPI Threading Building Blocks (oneTBB). Disable support for Parallel STL algorithms by defining ``PSTL_USE_PARALLEL_POLICIES`` (in libstdc++ 9) or ``_GLIBCXX_USE_TBB_PAR_BACKEND`` (in libstdc++ 10) macro to zero before inclusion of the first standard header file in each translation unit.
|
||||
- On Linux* OS, if oneAPI Threading Building Blocks (oneTBB) or Threading Building Blocks (TBB) are installed in a system folder like ``/usr/lib64``, the application may fail to link due to the order in which the linker searches for libraries. Use the ``-L`` linker option to specify the correct location of oneTBB library. This issue does not affect the program execution.
|
||||
- The ``oneapi::tbb::info`` namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc* version lower than 2.5.
|
||||
- Using a hwloc* version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows* OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
|
||||
- The NUMA* topology may be detected incorrectly on Windows* OS machines where the number of NUMA* node threads exceeds the size of 1 processor group.
|
||||
- On Windows* OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying ``/wd4324`` to the compiler command line.
|
||||
- oneTBB does not support ``fork()``, to work-around the issue, consider using task_scheduler_handle to join oneTBB worker threads before using fork().
|
||||
- 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).
|
||||
|
||||
## :hammer: Issues Fixed
|
||||
- Fixed the hang in the reserve method of concurrent unordered containers ([GitHub* #1056](http://github.com/oneapi-src/oneTBB/issues/1056)).
|
||||
- Fixed the C++20 three-way comparison feature detection ([GitHub* #1093](http://github.com/oneapi-src/oneTBB/issues/1093)).
|
||||
- Fixed oneTBB integration with CMake* in the Conda* environment.
|
||||
|
||||
# oneTBB 2021.9 Release Notes
|
||||
|
||||
## :tada: New Features
|
||||
- Hybrid CPU support is now a fully supported feature.
|
||||
|
||||
## :rotating_light: Known Limitations
|
||||
- A static assert will cause compilation failures in oneTBB headers when compiling with clang 12.0.0 or newer if using the LLVM standard library with -ffreestanding and C++11/14 compiler options.
|
||||
- An application using Parallel STL algorithms in libstdc++ versions 9 and 10 may fail to compile due to incompatible interface changes between earlier versions of Threading Building Blocks (TBB) and oneAPI Threading Building Blocks (oneTBB). Disable support for Parallel STL algorithms by defining PSTL_USE_PARALLEL_POLICIES (in libstdc++ 9) or _GLIBCXX_USE_TBB_PAR_BACKEND (in libstdc++ 10) macro to zero before inclusion of the first standard header file in each translation unit.
|
||||
- On Linux* OS, if oneAPI Threading Building Blocks (oneTBB) or Threading Building Blocks (TBB) are installed in a system folder like /usr/lib64, the application may fail to link due to the order in which the linker searches for libraries. Use the -L linker option to specify the correct location of oneTBB library. This issue does not affect the program execution.
|
||||
- The oneapi::tbb::info namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
|
||||
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
|
||||
- The NUMA topology may be detected incorrectly on Windows OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
|
||||
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
|
||||
- oneTBB does not support fork(), to work-around the issue, consider using task_scheduler_handle to join oneTBB worker threads before using fork().
|
||||
- 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).
|
||||
|
||||
## :hammer: Issues Fixed
|
||||
- Improved robustness of thread creation algorithm on Linux* OS.
|
||||
- Enabled full support of Thread Sanitizer on macOS*
|
||||
- Fixed the issue with destructor calls for uninitialized objects in oneapi::tbb::parallel_for_each algorithm (GitHub* #691)
|
||||
- Fixed the issue with tbb::concurrent_lru_cache when items history capacity is zero (GitHub* #265)
|
||||
- Fixed compilation issues on modern GCC* versions
|
||||
|
||||
## :octocat: Open-Source Contributions Integrated
|
||||
- Fixed the issue reported by the Address Sanitizer. Contributed by Rui Ueyama (https://github.com/oneapi-src/oneTBB/pull/959).
|
||||
- Fixed the input_type alias exposed by flow_graph::join_node. Contributed by Deepan (https://github.com/oneapi-src/oneTBB/pull/868).
|
||||
|
||||
# oneTBB 2021.8 Release Notes
|
||||
|
||||
## :rotating_light: Known Limitations
|
||||
- A static assert causes compilation failures in oneTBB headers when compiling with Clang* 12.0.0 or newer if using the LLVM* standard library with -ffreestanding and C++11/14 compiler options.
|
||||
- An application using Parallel STL algorithms in libstdc++ versions 9 and 10 may fail to compile due to incompatible interface changes between earlier versions of Threading Building Blocks (TBB) and oneAPI Threading Building Blocks (oneTBB). Disable support for Parallel STL algorithms by defining PSTL_USE_PARALLEL_POLICIES (in libstdc++ 9) or _GLIBCXX_USE_TBB_PAR_BACKEND (in libstdc++ 10) macro to zero before inclusion of the first standard header file in each translation unit.
|
||||
- On Linux* OS, if oneAPI Threading Building Blocks (oneTBB) or Threading Building Blocks (TBB) are installed in a system folder like /usr/lib64, the application may fail to link due to the order in which the linker searches for libraries. Use the -L linker option to specify the correct location of oneTBB library. This issue does not affect the program execution.
|
||||
- The oneapi::tbb::info namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
|
||||
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows* OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
|
||||
- The NUMA topology may be detected incorrectly on Windows OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
|
||||
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
|
||||
- oneTBB does not support fork(), to work-around the issue, consider using task_scheduler_handle to join oneTBB worker threads before using fork().
|
||||
- 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).
|
||||
|
||||
## :hammer: Issues Fixed
|
||||
- Fixed oneapi::tbb::concurrent_bounded_queue::pop return type (GitHub* [#807](https://github.com/oneapi-src/oneTBB/issues/807)).
|
||||
- Fixed oneapi::tbb::concurrent_queue and oneapi::tbb::concurrent_bounded_queue with non-default constructible value types (GitHub* [#885](https://github.com/oneapi-src/oneTBB/issues/885)).
|
||||
- Fixed incorrect splitting of iteration space in case there is no support for proportional splitting in custom ranges.
|
||||
|
||||
## :octocat: Open-Source Contributions Integrated
|
||||
- Fix for full LTO* build, library and tests, on UNIX* OS systems. Contributed by Vladislav Shchapov (https://github.com/oneapi-src/oneTBB/pull/798).
|
||||
|
||||
# oneTBB 2021.7 Release Notes
|
||||
|
||||
## :rotating_light: Known Limitations
|
||||
- A static assert causes compilation failures in oneTBB headers when compiling with Clang* 12.0.0 or newer if using the LLVM* standard library with -ffreestanding and C++11/14 compiler options.
|
||||
- An application using Parallel STL algorithms in libstdc++ versions 9 and 10 may fail to compile due to incompatible interface changes between earlier versions of Threading Building Blocks (TBB) and oneAPI Threading Building Blocks (oneTBB). Disable support for Parallel STL algorithms by defining PSTL_USE_PARALLEL_POLICIES (in libstdc++ 9) or _GLIBCXX_USE_TBB_PAR_BACKEND (in libstdc++ 10) macro to zero before inclusion of the first standard header file in each translation unit.
|
||||
- On Linux* OS, if oneAPI Threading Building Blocks (oneTBB) or Threading Building Blocks (TBB) are installed in a system folder like /usr/lib64, the application may fail to link due to the order in which the linker searches for libraries. Use the -L linker option to specify the correct location of oneTBB library. This issue does not affect the program execution.
|
||||
- The oneapi::tbb::info namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
|
||||
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows* OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
|
||||
- The NUMA topology may be detected incorrectly on Windows OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
|
||||
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
|
||||
- oneTBB does not support fork(), to work-around the issue, consider using task_scheduler_handle to join oneTBB worker threads before using fork().
|
||||
- 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).
|
||||
|
||||
## :hammer: Issues Fixed
|
||||
- Memory allocator crash when allocating ~1TB on 64-bit systems (GitHub* [#838](https://github.com/oneapi-src/oneTBB/issues/838)).
|
||||
- Fixed thread distribution over NUMA nodes on Windows* OS systems.
|
||||
- For oneapi::tbb::suspend, it is guaranteed that the user-specified callable object is executed by the calling thread.
|
||||
|
||||
## :octocat: Open-Source Contributions Integrated
|
||||
- Fix for full LTO* build, library and tests, on UNIX* OS systems. Contributed by Vladislav Shchapov (https://github.com/oneapi-src/oneTBB/pull/798).
|
||||
|
||||
# oneTBB 2021.6 Release Notes
|
||||
|
||||
## :tada: New Features
|
||||
- Improved support and use of the latest C++ standards for parallel_sort that allows using this algorithm with user-defined and standard library-defined objects with modern semantics.
|
||||
- The following features are now fully functional: task_arena extensions, collaborative_call_once, adaptive mutexes, heterogeneous overloads for concurrent_hash_map, and task_scheduler_handle.
|
||||
- Added support for Windows* Server 2022 and Python 3.10.
|
||||
|
||||
## :rotating_light: Known Limitations
|
||||
- An application using Parallel STL algorithms in libstdc++ versions 9 and 10 may fail to compile due to incompatible interface changes between earlier versions of Threading Building Blocks (TBB) and oneAPI Threading Building Blocks (oneTBB). Disable support for Parallel STL algorithms by defining PSTL_USE_PARALLEL_POLICIES (in libstdc++ 9) or _GLIBCXX_USE_TBB_PAR_BACKEND (in libstdc++ 10) macro to zero before inclusion of the first standard header file in each translation unit.
|
||||
- On Linux* OS, if oneAPI Threading Building Blocks (oneTBB) or Threading Building Blocks (TBB) are installed in a system folder like /usr/lib64, the application may fail to link due to the order in which the linker searches for libraries. Use the -L linker option to specify the correct location of oneTBB library. This issue does not affect the program execution.
|
||||
- The oneapi::tbb::info namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
|
||||
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
|
||||
- The NUMA topology may be detected incorrectly on Windows OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
|
||||
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
|
||||
- oneTBB does not support fork(), to work-around the issue, consider using task_scheduler_handle to join oneTBB worker threads before using fork().
|
||||
- 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).
|
||||
|
||||
## :hammer: Issues Fixed
|
||||
- Memory allocator crash on a system with an incomplete /proc/meminfo (GitHub* [#584](https://github.com/oneapi-src/oneTBB/issues/584)).
|
||||
- Incorrect blocking of task stealing (GitHub* #[478](https://github.com/oneapi-src/oneTBB/issues/478)).
|
||||
- Hang due to incorrect decrement of a limiter_node (GitHub* [#634](https://github.com/oneapi-src/oneTBB/issues/634)).
|
||||
- Memory corruption in some rare cases when passing big messages in a flow graph (GitHub* [#639](https://github.com/oneapi-src/oneTBB/issues/639)).
|
||||
- Possible deadlock in a throwable flow graph node with a lightweight policy. The lightweight policy is now ignored for functors that can throw exceptions (GitHub* [#420](https://github.com/oneapi-src/oneTBB/issues/420)).
|
||||
- Crash when obtaining a range from empty ordered and unordered containers (GitHub* [#641](https://github.com/oneapi-src/oneTBB/issues/641)).
|
||||
- Deadlock in a concurrent_vector resize() that could happen when the new size is less than the previous size (GitHub* [#733](https://github.com/oneapi-src/oneTBB/issues/733)).
|
||||
|
||||
## :octocat: Open-Source Contributions Integrated
|
||||
- Improved aligned memory allocation. Contributed by Andrey Semashev (https://github.com/oneapi-src/oneTBB/pull/671).
|
||||
- Optimized usage of atomic_fence on IA-32 and Intel(R) 64 architectures. Contributed by Andrey Semashev (https://github.com/oneapi-src/oneTBB/pull/328).
|
||||
- Fixed incorrect definition of the assignment operator in containers. Contributed by Andrey Semashev (https://github.com/oneapi-src/oneTBB/issues/372).
|
||||
|
||||
# oneTBB 2021.5 Release Notes
|
||||
|
||||
## :rocket: Preview Features
|
||||
- Extended task_group interface with a new run_and_wait overload to accept task_handle.
|
||||
|
||||
## :tada: New Features
|
||||
- Enabled Microsoft Visual Studio* 2022 and Python 3.9 support.
|
||||
|
||||
## :rotating_light: Known Limitations
|
||||
- An application using Parallel STL algorithms in libstdc++ versions 9 and 10 may fail to compile due to incompatible interface changes between earlier versions of Threading Building Blocks (TBB) and oneAPI Threading Building Blocks (oneTBB). Disable support for Parallel STL algorithms by defining PSTL_USE_PARALLEL_POLICIES (in libstdc++ 9) or _GLIBCXX_USE_TBB_PAR_BACKEND (in libstdc++ 10) macro to zero before inclusion of the first standard header file in each translation unit.
|
||||
- On Linux* OS, if oneAPI Threading Building Blocks (oneTBB) or Threading Building Blocks (TBB) are installed in a system folder like /usr/lib64, the application may fail to link due to the order in which the linker searches for libraries. Use the -L linker option to specify the correct location of oneTBB library. This issue does not affect the program execution.
|
||||
- The oneapi::tbb::info namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
|
||||
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
|
||||
- The NUMA topology may be detected incorrectly on Windows OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
|
||||
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
|
||||
- oneTBB does not support fork(), to work-around the issue, consider using task_scheduler_handle to join oneTBB worker threads before using fork().
|
||||
- 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).
|
||||
|
||||
## :hammer: Issues Fixed
|
||||
- Reworked synchronization mechanism to reduce contention when multiple task_arena's are used concurrently.
|
||||
- Fixed possible correctness issue in queuing_rw_mutex on non-Intel platforms.
|
||||
- Fixed GCC* 11 warnings.
|
||||
- Fixed sporadic memory corruption.
|
||||
|
||||
# oneTBB 2021.4 Release Notes
|
||||
|
||||
## :rocket: Preview Features
|
||||
- Introduced the collaborative_call_once algorithm that executes the callable object exactly once, but allows other threads to join oneTBB parallel construction used inside this callable object. Inspired by Ben FrantzDale and Henry Heffan.
|
||||
|
||||
## :rotating_light: Known Limitations
|
||||
- An application using Parallel STL algorithms in libstdc++ versions 9 and 10 may fail to compile due to incompatible interface changes between earlier versions of Threading Building Blocks (TBB) and oneAPI Threading Building Blocks (oneTBB). Disable support for Parallel STL algorithms by defining PSTL_USE_PARALLEL_POLICIES (in libstdc++ 9) or _GLIBCXX_USE_TBB_PAR_BACKEND (in libstdc++ 10) macro to zero before inclusion of the first standard header file in each translation unit.
|
||||
- On Linux* OS, if oneAPI Threading Building Blocks (oneTBB) or Threading Building Blocks (TBB) are installed in a system folder like /usr/lib64, the application may fail to link due to the order in which the linker searches for libraries. Use the -L linker option to specify the correct location of oneTBB library. This issue does not affect the program execution.
|
||||
- The oneapi::tbb::info namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
|
||||
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
|
||||
- The NUMA topology may be detected incorrectly on Windows OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
|
||||
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
|
||||
- oneTBB does not support fork(), to work-around the issue, consider using task_scheduler_handle to join oneTBB worker threads before using fork().
|
||||
|
||||
## :hammer: Issues Fixed
|
||||
- Enabled full support of Address Sanitizer and Thread Sanitizer.
|
||||
- Fixed a race condition in tbbmalloc that may cause a crash in realloc() when using tbbmalloc_proxy.
|
||||
- Enabled GCC* 11 support.
|
||||
- Fixed limiter_node behavior when an integral type is used as an argument for the DecrementType template parameter.
|
||||
- Fixed a possible memory leak when the static or affinity partitioners are used.
|
||||
- Fixed possible system oversubscription when using a process mask and an explicit number of threads in the task arena.
|
||||
|
||||
## :octocat: Open-Source Contributions Integrated
|
||||
- Enabled PowerPC* Linux* OS support. Contributed by Mircho Rodozov (https://github.com/oneapi-src/oneTBB/pull/461)
|
||||
- Improved UNIX* system support and enabled QNX Neutrino* RTOS support. Contributed by Pablo Romero (https://github.com/oneapi-src/oneTBB/pull/440)
|
||||
- Enabled experimental Bazel* build system support. Contributed by Julian Amann (https://github.com/oneapi-src/oneTBB/pull/442)
|
||||
- Enabled oneTBB build for Windows* OS on ARM64*. Contributed by Michael Vitrano (https://github.com/oneapi-src/oneTBB/pull/507)
|
||||
- Added MinGW* and export attributes support. Contributed by Long Nguyen (https://github.com/oneapi-src/oneTBB/pull/351)
|
||||
@@ -1,66 +0,0 @@
|
||||
# Security Policy
|
||||
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.
|
||||
|
||||
## 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: **security@uxlfoundation.org**.
|
||||
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/uxlfoundation/oneTBB/releases/latest
|
||||
[2]: https://github.com/uxlfoundation/oneTBB/security/advisories/new
|
||||
[3]: https://github.com/uxlfoundation/oneTBB/security/advisories
|
||||
@@ -1,35 +0,0 @@
|
||||
<!--
|
||||
******************************************************************************
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/-->
|
||||
|
||||
# oneTBB Support
|
||||
|
||||
We are committed to providing support and assistance to help you make the most out of oneTBB.
|
||||
Use the following methods if you face any challenges.
|
||||
|
||||
## Issues
|
||||
|
||||
If you have a problem, check out the [GitHub Issues](https://github.com/uxlfoundation/oneTBB/issues) to see if the issue you want to address is already reported.
|
||||
You may find users that have encountered the same bug or have similar ideas for changes or updates.
|
||||
|
||||
You can use issues to report a problem, make a feature request, or add comments on an existing issue.
|
||||
|
||||
## Discussions
|
||||
|
||||
Visit the [GitHub Discussions](https://github.com/uxlfoundation/oneTBB/discussions) to engage with the community, ask questions, or help others.
|
||||
|
||||
## Email
|
||||
|
||||
Reach out to us privately via [email](mailto:inteltbbdevelopers@intel.com).
|
||||
@@ -1,88 +0,0 @@
|
||||
<!--
|
||||
******************************************************************************
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/-->
|
||||
|
||||
# System Requirements <!-- omit in toc -->
|
||||
This document provides details about hardware, operating system, and software prerequisites for the oneAPI Threading Building Blocks (oneTBB).
|
||||
|
||||
## Table of Contents <!-- omit in toc -->
|
||||
- [Supported Hardware](#supported-hardware)
|
||||
- [Software](#software)
|
||||
- [Supported Operating Systems](#supported-operating-systems)
|
||||
- [Community-Supported Platforms](#community-supported-platforms)
|
||||
- [Supported Compilers](#supported-compilers)
|
||||
- [Limitations](#limitations)
|
||||
|
||||
|
||||
## Supported Hardware
|
||||
- Intel(R) Celeron(R) processor family
|
||||
- Intel(R) Core* processor family
|
||||
- Intel(R) Xeon(R) processor family
|
||||
- Intel(R) Atom* processor family
|
||||
- Non-Intel(R) processors compatible with the processors listed above
|
||||
|
||||
Changes to the list of supported hardware will be announced in advance with a deprecation period preceding removal or reduction of support.
|
||||
|
||||
## Software
|
||||
|
||||
### Supported Operating Systems
|
||||
- Systems with Microsoft* Windows* operating systems:
|
||||
- Microsoft* Windows* 10
|
||||
- Microsoft* Windows* 11
|
||||
- Microsoft* Windows* Server 2019
|
||||
- Microsoft* Windows* Server 2022
|
||||
- Microsoft* Windows* Server 2025
|
||||
- Systems with Linux* operating systems:
|
||||
- Amazon* Linux 2023
|
||||
- Debian* 12, 13
|
||||
- Fedora* 43, 44
|
||||
- Rocky* Linux* 9, 10
|
||||
- Red Hat* Enterprise Linux* 8, 9, 10
|
||||
- SuSE* Linux* Enterprise Server 15 SP6 and SP7
|
||||
- SuSE* Linux* Enterprise Server 16
|
||||
- Ubuntu* 24.04, 26.04
|
||||
- Systems with macOS* operating systems:
|
||||
- macOS* 12.x, 13.x, 14.x, 15.x
|
||||
- Systems with Android* operating systems:
|
||||
- Android* 9
|
||||
|
||||
### Community-Supported Platforms
|
||||
- MinGW*
|
||||
- FreeBSD*
|
||||
- Microsoft* Windows* on ARM*/ARM64*
|
||||
- macOS* on ARM64*
|
||||
|
||||
### Supported Compilers
|
||||
- Intel* oneAPI DPC++/C++ Compiler
|
||||
- Microsoft* Visual C++ 14.2 (Microsoft* Visual Studio* 2019, Windows* OS only)
|
||||
- Microsoft* Visual C++ 14.3 (Microsoft* Visual Studio* 2022, Windows* OS only)
|
||||
- Microsoft* Visual C++ 14.5 (Microsoft* Visual Studio* 2026, Windows* OS only)
|
||||
- For each supported Linux* operating system, the standard gcc version provided with that operating system is supported:
|
||||
- GNU Compilers (gcc) 8.x – 16.x
|
||||
- GNU C Library (glibc) version 2.28 – 2.43
|
||||
- Clang* 7.x - 22.x
|
||||
|
||||
## Limitations
|
||||
There are some cases where we cannot provide support for your platforms. It includes:
|
||||
|
||||
1. The platform is out of official support (met end of life). When you use an unsupported platform, you can face a security risk that can be difficult to resolve.
|
||||
2. We do not have the infrastructure to test a platform. Therefore we cannot guarantee that oneTBB works correctly on that platform.
|
||||
3. Changes affect more code than just platform-specific macros.
|
||||
4. The platform is incompatible with oneTBB. Some platforms may have limitations that prevent oneTBB from working correctly. We cannot provide support in these cases as the issue is beyond our control.
|
||||
5. The platform is modified or customized. If you made significant updates to your platform, it might be hard for us to find the root cause of the issue. Therefore, we may not be able to provide support as the modification could affect the oneTBB functionality.
|
||||
|
||||
|
||||
We understand that these limitations can be frustrating. Thus, we suggest creating a branch specifically for the unsupported platform, allowing other users to contribute to or use your implementation.
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
# oneTBB Versioning Policies
|
||||
|
||||
There are several types of "versioning" used by the oneTBB project.
|
||||
|
||||
1. The *oneTBB specification version*
|
||||
2. The *official oneTBB library version*
|
||||
3. The *library interface version*
|
||||
4. *API versioning* used to maintain backwards compatibility
|
||||
|
||||
The oneTBB project uses semantic versioning (https://semver.org/) and as a oneAPI Library,
|
||||
the oneTBB project makes commitments around compatibility as described
|
||||
[here](https://www.intel.com/content/www/us/en/docs/oneapi/programming-guide/2024-1/oneapi-library-compatibility.html).
|
||||
With semantic versioning, a MAJOR version increment generally means an incompatible API change,
|
||||
while a MINOR version increment means added functionality that is implemented in a backwards compatible manner.
|
||||
|
||||
## The oneTBB Specification Version
|
||||
|
||||
The oneTBB project is governed by the [UXL foundation](https://uxlfoundation.org/) and has
|
||||
[an open specification](https://oneapi-spec.uxlfoundation.org/specifications/oneapi/latest/elements/onetbb/source/nested-index).
|
||||
Each release of the specification has a version number.
|
||||
|
||||
[As described in the specification](https://oneapi-spec.uxlfoundation.org/specifications/oneapi/latest/elements/onetbb/source/configuration/version_information),
|
||||
the value of the `ONETBB_SPEC_VERSION` macro in `oneapi/tbb/version.h` is latest specification of oneTBB fully
|
||||
supported by the implementation.
|
||||
|
||||
## The oneTBB Library Version
|
||||
|
||||
The oneTBB library version can be thought of as the name of the release. If you want to find a specific
|
||||
release in the repository (https://github.com/uxlfoundation/oneTBB), the tag you would look for corresponds
|
||||
to the oneTBB library version.
|
||||
|
||||
[As described in the specification](https://oneapi-spec.uxlfoundation.org/specifications/oneapi/latest/elements/onetbb/source/configuration/version_information),
|
||||
the macros `TBB_VERSION_MAJOR`, `TBB_VERSION_MINOR`, `TBB_VERSION_STRING` in `oneapi/tbb/version.h`
|
||||
provide the library version of the implementation that is being compiled against. The function
|
||||
`const char* TBB_runtime_version();` can be used to query the library version of the oneTBB binary library that is
|
||||
loaded at runtime.
|
||||
|
||||
## The oneTBB Interface Version
|
||||
|
||||
The oneTBB interface version is the public contract about the interface to the library including the
|
||||
functions exported by the binary library and the types defined in the headers. The oneTBB library is designed
|
||||
for backwards compatibility. It works well in the scenarios where components compile/link against a TBB version
|
||||
X.Y. And then at runtime, the application loads a library version X.Z, where X.Z >= X.Y.
|
||||
|
||||
A minor version may add new functionality in the headers or in the binary library, including new entry points to the
|
||||
binary library. An application compiled against an older minor version could not have used this new functionality
|
||||
and therefore can safely use the newer binary library.
|
||||
|
||||
[As described in the specification](https://oneapi-spec.uxlfoundation.org/specifications/oneapi/latest/elements/onetbb/source/configuration/version_information),
|
||||
the macros `TBB_INTERFACE_VERSION_MAJOR`, `TBB_INTERFACE_VERSION_MINOR`, `TBB_INTERFACE_VERSION` in `oneapi/tbb/version.h`
|
||||
can be used to determine the interface version of the implementation that is being compiled against. The function
|
||||
`int TBB_runtime_interface_version();` can be used to query the interface version of the oneTBB binary library that is
|
||||
loaded at runtime.
|
||||
|
||||
### Shared Library Practices for Linux
|
||||
|
||||
On Linux we use a symlink system for binary libraries in the oneTBB distribution, and also explicitly set a soname.
|
||||
The actual shared library is libtbb.so.X.Y but it is built with a –soname that uses only the major version number,
|
||||
libtbb.so.X. In addition, there is a symlink from libtbb.so.X -> libtbb.so.X.Y and a symlink from
|
||||
libtbb.so -> libtbb.so.X. Therefore, whether you build against libtbb.so, libtbb.so.X or libtbb.so.X.Y, your
|
||||
application will have a dependency on libtbb.so.X.
|
||||
|
||||
A common development process is to compile and link against a library version X.Y. This creates
|
||||
a dependency on libtbb.so.X. The packaged project then redistributes a TBB shared library that
|
||||
is X.Z, where X.Z >= X.Y.
|
||||
|
||||
In the (unusual) case where the package does not redistribute a TBB library and instead depends on a version already
|
||||
available on the install platform, it is safest to build against the oldest version you expect to encounter; in the
|
||||
extreme this would be X.1. Of course, building against X.1 means no additional functionalility added in any later minor
|
||||
release can be used during the development of the application.
|
||||
|
||||
### Shared Library Practices for Windows
|
||||
|
||||
On Windows, the TBB binary library has only the major version number, tbb12.dll.
|
||||
|
||||
## API versioning used to maintain backwards compatibility
|
||||
|
||||
This section is targeted at oneTBB contributors and will likely not be of interest to users of the
|
||||
oneTBB library.
|
||||
|
||||
As mentioned previously, minor release may add new functionality, including modified definitions of classes
|
||||
in the headers or new entry points into the binary library. To safely add this new functionality in a way
|
||||
that avoids conflicts, oneTBB has namespaces for class definitions in the headers (that start with the
|
||||
letter "d") and namespaces for symbols exported by the binary runtime library (that start with the
|
||||
letter "r").
|
||||
|
||||
Below is an example of
|
||||
[a function exported](https://github.com/uxlfoundation/oneTBB/blob/45c2298727d09556a523d6aeaec84ef23872eccf/src/tbb/parallel_pipeline.cpp#L446)
|
||||
by the oneTBB runtime library:
|
||||
|
||||
namespace tbb {
|
||||
namespace detail {
|
||||
namespace r1 {
|
||||
void __TBB_EXPORTED_FUNC parallel_pipeline(d1::task_group_context& cxt,
|
||||
std::size_t max_token,
|
||||
const d1::filter_node& fn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
This function is in the runtime namespace `r1` and takes `d1` versions of `task_group_context` and
|
||||
`filter_node` classes as arguments. Backward incompatible changes added to the library can be added
|
||||
to namespaces with incremented version numbers.
|
||||
|
||||
Rules for the `d` namespace include:
|
||||
|
||||
- If the layout of public class X is changed incompatibly, the “d” namespace number should be incremented.
|
||||
- If there are existing entry points using the current version of class X, the old version of X should
|
||||
be kept in the previous “d” namespace.
|
||||
|
||||
## API and ABI changes by release
|
||||
|
||||
For a detailed table of API and ABI changes across all oneTBB releases, see:
|
||||
[API and ABI Changes by Release](https://uxlfoundation.github.io/oneTBB/main/intro/api_abi_changes.html)
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
<!--
|
||||
******************************************************************************
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/-->
|
||||
|
||||
# WASM Support
|
||||
|
||||
oneTBB extends its capabilities by offering robust support for ``WASM`` (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.
|
||||
|
||||
Using oneTBB with WASM, you can take full advantage of parallelism and concurrency while working on web-based applications, interactive websites, and a variety of other WASM-compatible platforms.
|
||||
|
||||
oneTBB offers WASM support through the integration with [Emscripten*](https://emscripten.org/docs/introducing_emscripten/index.html), a powerful toolchain for compiling C and C++ code into WASM-compatible runtimes.
|
||||
|
||||
## Build
|
||||
|
||||
**Prerequisites:** Download and install Emscripten*. See the [instructions](https://emscripten.org/docs/getting_started/downloads.html).
|
||||
|
||||
To build the system, run:
|
||||
|
||||
```
|
||||
mkdir build && cd build
|
||||
emcmake cmake .. -DCMAKE_CXX_COMPILER=em++ -DCMAKE_C_COMPILER=emcc -DTBB_STRICT=OFF -DCMAKE_CXX_FLAGS=-Wno-unused-command-line-argument -DTBB_DISABLE_HWLOC_AUTOMATIC_SEARCH=ON -DBUILD_SHARED_LIBS=OFF -DTBB_EXAMPLES=ON -DTBB_TEST=ON
|
||||
```
|
||||
To compile oneTBB without ``pthreads``, set the flag ``-DEMSCRIPTEN_WITHOUT_PTHREAD=true`` in the command above. By default, oneTBB uses the ``pthreads``.
|
||||
```
|
||||
cmake --build . <options>
|
||||
cmake --install . <options>
|
||||
```
|
||||
Where:
|
||||
|
||||
* ``emcmake`` - a tool that sets up the environment for Emscripten*.
|
||||
* ``-DCMAKE_CXX_COMPILER=em++`` - specifies the C++ compiler as Emscripten* C++ compiler.
|
||||
* ``-DCMAKE_C_COMPILER=emcc`` - specifies the C compiler as Emscripten* C compiler.
|
||||
|
||||
|
||||
> **_NOTE:_** See [CMake documentation](https://github.com/uxlfoundation/oneTBB/blob/master/cmake/README.md) to learn about other options.
|
||||
|
||||
|
||||
## Run Test
|
||||
|
||||
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<int> 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.
|
||||
@@ -1,19 +0,0 @@
|
||||
# Copyright (c) 2021-2025 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# DISCLAIMER: Bazel support is community-based. The maintainers do not
|
||||
# use Bazel internally. The Bazel build can have security risks or
|
||||
# optimization gaps.
|
||||
|
||||
# WORKSPACE marker file needed by Bazel
|
||||
@@ -1,42 +1,29 @@
|
||||
# Build System Description
|
||||
# Build system description
|
||||
|
||||
The project uses CMake* build configuration.
|
||||
The project uses CMake build configuration.
|
||||
|
||||
The following controls are available during the configure stage:
|
||||
```
|
||||
TBB_TEST:BOOL - Enable testing (ON by default)
|
||||
TBB_EXAMPLES:BOOL - Enable build of TBB examples (OFF by default)
|
||||
TBB_STRICT:BOOL - Treat compiler warnings as errors (ON by default)
|
||||
TBB_SANITIZE:STRING - Sanitizer parameter, passed to compiler/linker
|
||||
TBB_SIGNTOOL:FILEPATH - Tool for digital signing, used in post-install step for libraries if provided.
|
||||
TBB_SIGNTOOL:FILEPATH - Tool for digital signing, used in post install step for libraries if provided.
|
||||
TBB_SIGNTOOL_ARGS:STRING - Additional arguments for TBB_SIGNTOOL, used if TBB_SIGNTOOL is set.
|
||||
BUILD_SHARED_LIBS:BOOL - Standard CMake variable controlling whether oneTBB is built as shared libraries (ON by default).
|
||||
Setting it to OFF produces static archives; this configuration is highly discouraged and is not
|
||||
supported. See "Building oneTBB as a Static Library" below.
|
||||
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)
|
||||
TBB_INSTALL:BOOL - Enable installation (ON by default)
|
||||
TBB4PY_BUILD:BOOL - Enable Intel(R) oneAPI Threading Building Blocks (oneTBB) Python module build (OFF by default)
|
||||
TBB_CPF:BOOL - Enable preview features of the library (OFF by default)
|
||||
TBB_INSTALL_VARS:BOOL - Enable auto-generated vars installation(packages generated by `cpack` and `make install` will also include the vars script)(OFF by default)
|
||||
TBB_VALGRIND_MEMCHECK:BOOL - Enable scan for memory leaks using Valgrind (OFF by default)
|
||||
TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH - Disable HWLOC automatic search by pkg-config tool (OFF by default)
|
||||
TBB_ENABLE_IPO - Enable Interprocedural Optimization (IPO) during the compilation (ON by default)
|
||||
TBB_CONTROL_FLOW_GUARD:BOOL - Enable Control Flow Guard (CFG) during the compilation (OFF by default)
|
||||
TBB_BUILD_APPLE_FRAMEWORKS - Enable the Apple* frameworks instead of dylibs, only available on the Apple platform. (OFF by default)
|
||||
TBB_FILE_TRIM - Enable __FILE__ trim, replace a build-time full path with a relative path in the debug info and macro __FILE__; use it to make
|
||||
reproducible location-independent builds (ON by default)
|
||||
TBB_VERIFY_DEPENDENCY_SIGNATURE - On Windows* enable verification of signatures for dependencies linked at run-time. (ON by default)
|
||||
TBB_FUZZ_TESTING:BOOL - Enable fuzz testing (OFF by default)
|
||||
TCM_BUILD - Enable Thread Composability Manager (TCM) build (ON by default)
|
||||
```
|
||||
|
||||
## Configure, Build, and Test
|
||||
## Configure, build and test
|
||||
|
||||
### Prerequisites
|
||||
|
||||
* CMake >= 3.1
|
||||
|
||||
### Preparation
|
||||
|
||||
To perform an out-of-source build, create a build directory and go there:
|
||||
In order to perform out-of-source build you have to create a build directory and go there:
|
||||
|
||||
```bash
|
||||
mkdir /tmp/my-build
|
||||
@@ -50,47 +37,22 @@ cmake <options> <repo_root>
|
||||
```
|
||||
|
||||
Some useful options:
|
||||
- `-G <generator>` - specify particular project generator. See `cmake --help` for details.
|
||||
- `-DCMAKE_BUILD_TYPE=Debug` - specify for Debug build. It is not applicable for multi-config generators, e.g., Microsoft* Visual Studio* generator.
|
||||
- `-G <generator>` - specify particular project generator, see `cmake --help` for details.
|
||||
- `-DCMAKE_BUILD_TYPE=Debug` - specify for Debug build, it isn't applicable for multi-config generators, e.g. for Visual Studio generator).
|
||||
|
||||
#### TBBBind Library Configuration
|
||||
#### TBBBind library configuration
|
||||
|
||||
> **_TIP:_** It is recommended to install the HWLOC* library. See [oneTBB documentation](https://uxlfoundation.github.io/oneTBB/GSG/next_steps.html#hybrid-cpu-and-numa-support) for details.
|
||||
The TBBbind library has two versions: `tbbbind` and `tbbbind_2_0`. Each of these versions is linked with corresponding HWLOC library version: `tbbbind` links with HWLOC 1.11.x , `tbbbind_2_0` links with HWLOC 2.x.
|
||||
|
||||
The TBBbind library has three versions: `tbbbind`, `tbbbind_2_0`, and `tbbbind_2_5`. Each of these versions is linked with the corresponding HWLOC* library version:
|
||||
- `tbbbind` links with `HWLOC 2.x` which was built as an archive library on Linux* (.a file) or a static library on Windows* (.lib file)
|
||||
- `tbbbind_2_0` links with `HWLOC 2.1–2.4`
|
||||
- `tbbbind_2_5` links with `HWLOC 2.5` and later
|
||||
To enable the TBBBind library build or special tests that performed inside the HWLOC environment, please specify the following CMake variables:
|
||||
|
||||
The search for a suitable version of the HWLOC library is enabled by default. If you want to use a specific version of the library, you can specify the path to it manually using the following CMake variables:
|
||||
- `CMAKE_HWLOC_<HWLOC_VER>_LIBRARY_PATH` - path to the corresponding HWLOC version shared library on Linux or path to `.lib` file on Windows.
|
||||
- `CMAKE_HWLOC_<HWLOC_VER>_INCLUDE_PATH` - path to the corresponding HWLOC version includes directory.
|
||||
|
||||
- `CMAKE_HWLOC_<HWLOC_VER>_LIBRARY_PATH` - path to the corresponding HWLOC version shared library on Linux* OS or path to `.lib` file on Windows* OS
|
||||
- `CMAKE_HWLOC_<HWLOC_VER>_INCLUDE_PATH` - path to the corresponding HWLOC version including directory
|
||||
|
||||
|
||||
---
|
||||
**NOTE:** Automatic HWLOC searching requires CMake version 3.6 or higher.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Windows* OS requires an additional variable for correct TBBBind library building:
|
||||
Windows requires one additional variable for correct TBBBind library building:
|
||||
- `CMAKE_HWLOC_<HWLOC_VER>_DLL_PATH` - path to the corresponding HWLOC version `.dll` file.
|
||||
|
||||
The `HWLOC_VER` substring used earlier can be replaced with one of the three values:
|
||||
- `STATIC` for the `tbbbind` library configuration
|
||||
- `2` for the `tbbbind_2_0` library configuration
|
||||
- `2_5` for the `tbbbind_2_5` library configuration
|
||||
|
||||
If you specify variables for several TBBBind versions, the building process for all of these versions is performed during a single build session.
|
||||
|
||||
---
|
||||
**TIP**
|
||||
|
||||
Specify the `TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH` to turn off the HWLOC library's automatic search.
|
||||
|
||||
---
|
||||
|
||||
`HWLOC_VER` variable used above can be replaced with one of the two values: `1_11` for the `tbbbind` library configuration and `2` for the `tbbbind_2_0` library configuration.
|
||||
|
||||
### Build
|
||||
|
||||
@@ -99,28 +61,21 @@ cmake --build . <options>
|
||||
```
|
||||
|
||||
Some useful options:
|
||||
- `--target <target>` - specific target, "all" is the default.
|
||||
- `--config <Release|Debug>` - build configuration, applicable only for multi-config generators, e.g., Visual Studio* generator.
|
||||
- `--target <target>` - specific target, "all" is default.
|
||||
- `--config <Release|Debug>` - build configuration, applicable only for multi-config generators, e.g. Visual Studio generator.
|
||||
|
||||
The binaries are placed to `./<compiler-id>_<compiler-ver>_cxx<stdver>_<build-type>`. For example, `./gnu_4.8_cxx11_release`.
|
||||
Binaries are placed to `./<compiler-id>_<compiler-ver>_cxx<stdver>_<build-type>` (for example, `./gnu_4.8_cxx11_release`)
|
||||
|
||||
#### Build For 32-bit
|
||||
#### Build for 32-bit
|
||||
|
||||
* **Intel(R) Compiler**. Source Intel(R) C++ Compiler with `ia32` and build as usual.
|
||||
* **MSVC**. Use switch for [generator](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html) (e.g., `-A Win32` for [VS2019](https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2016%202019.html)) during the configuration stage and then build as usual.
|
||||
* **GCC/Clang**. Specify `-m32` during the configuration. It can be `CXXFLAGS=-m32 cmake ..` or `cmake -DCMAKE_CXX_FLAGS=-m32 ..`
|
||||
* For any other compiler, which builds for 64-bit by default, specify a 32-bit compiler key during the configuration as above.
|
||||
* Intel Compiler: just source Intel(R) C++ Compiler with `ia32` and build as usual.
|
||||
* MSVC: use switch for [generator](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html) (e.g. `-A Win32` for [VS2019](https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2016%202019.html)) during the configuration stage and then build as usual.
|
||||
* GCC/Clang: specify `-m32` during the configuration: `CXXFLAGS=-m32 cmake ..` or `cmake -DCMAKE_CXX_FLAGS=-m32 ..`
|
||||
* Any other compiler which builds for 64-bit by default: specify 32-bit compiler key during the configuration as above.
|
||||
|
||||
#### Windows* OS-Specific Builds
|
||||
#### Windows specific builds (CMake 3.15 or newer is required)
|
||||
|
||||
---
|
||||
**NOTE**
|
||||
|
||||
The following builds require CMake version 3.15 or higher.
|
||||
|
||||
---
|
||||
|
||||
* **Dynamic linkage with C Runtime Library (CRT)**. The default behavior can be explicitly specified by setting `CMAKE_MSVC_RUNTIME_LIBRARY` to `MultiThreadedDLL` or `MultiThreadedDebugDLL`.
|
||||
* Dynamic linkage with CRT: default behavior, can be explicitly specified by setting `CMAKE_MSVC_RUNTIME_LIBRARY` to `MultiThreadedDLL` or `MultiThreadedDebugDLL`.
|
||||
```bash
|
||||
cmake .. # dynamic linkage is used by default
|
||||
```
|
||||
@@ -130,160 +85,51 @@ cmake -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL ..
|
||||
```bash
|
||||
cmake -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL -DCMAKE_BUILD_TYPE=Debug ..
|
||||
```
|
||||
* **Static linkage with CRT**. Set `CMAKE_MSVC_RUNTIME_LIBRARY` to `MultiThreaded` or `MultiThreadedDebug`.
|
||||
* Static linkage with CRT: set `CMAKE_MSVC_RUNTIME_LIBRARY` to `MultiThreaded` or `MultiThreadedDebug`.
|
||||
```bash
|
||||
cmake -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded ..
|
||||
```
|
||||
```bash
|
||||
cmake -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug -DCMAKE_BUILD_TYPE=Debug ..
|
||||
```
|
||||
* **Windows OS 10 Universal Windows application build**. Set `CMAKE_SYSTEM_NAME` to `WindowsStore` and `CMAKE_SYSTEM_VERSION` to `10.0`.
|
||||
|
||||
---
|
||||
**NOTE**
|
||||
|
||||
Set `TBB_NO_APPCONTAINER` to `ON` to apply the `/APPCONTAINER:NO` option during the compilation (used for testing).
|
||||
|
||||
---
|
||||
* Windows 10 Universal Windows application build: set `CMAKE_SYSTEM_NAME` to `WindowsStore` and `CMAKE_SYSTEM_VERSION` to `10.0`.
|
||||
|
||||
_Note: set `TBB_NO_APPCONTAINER` to `ON` in order to apply `/APPCONTAINER:NO` option during the compilation (used for testing)._
|
||||
```bash
|
||||
cmake -DCMAKE_SYSTEM_NAME:STRING=WindowsStore -DCMAKE_SYSTEM_VERSION:STRING=10.0 ..
|
||||
```
|
||||
|
||||
* **Universal Windows OS Driver build**. Set `TBB_WINDOWS_DRIVER` to `ON` and use static linkage with CRT.
|
||||
* Universal Windows Driver build: set `TBB_WINDOWS_DRIVER` to `ON` and use static linkage with CRT (see above).
|
||||
|
||||
```bash
|
||||
cmake -DTBB_WINDOWS_DRIVER=ON -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded ..
|
||||
```
|
||||
|
||||
#### Example
|
||||
|
||||
```bash
|
||||
cmake -DCMAKE_CXX_COMPILER=icpx -DCMAKE_C_COMPILER=icx -DTBB_TEST=off -DCMAKE_HWLOC_2_5_LIBRARY_PATH=<path_to_hwloc_library_file>/libhwloc.so.15
|
||||
-DCMAKE_HWLOC_2_5_INCLUDE_PATH=<path_to_hwloc_header_directory> -DCMAKE_INSTALL_PREFIX=<path_to_install_oneTBB>/oneTBB_install ..
|
||||
make -j8 && make install
|
||||
```
|
||||
|
||||
---
|
||||
**NOTE**
|
||||
|
||||
The library path points to a file, while the include path points to a directory and not to ``hwloc.h``.
|
||||
|
||||
---
|
||||
|
||||
### Test
|
||||
|
||||
#### Build test
|
||||
To build a test, use the default target ``all``:
|
||||
Using default ('all') target:
|
||||
```
|
||||
cmake --build .
|
||||
```
|
||||
|
||||
Or use a specific test target:
|
||||
or using specific test target:
|
||||
```
|
||||
cmake --build . --target <test> # e.g. test_version
|
||||
```
|
||||
|
||||
#### Run Test
|
||||
#### Run test
|
||||
|
||||
You can run a test by using CTest:
|
||||
Using CTest:
|
||||
```bash
|
||||
ctest
|
||||
```
|
||||
|
||||
Or by using the ``test`` target:
|
||||
or using 'test' target:
|
||||
```bash
|
||||
cmake --build . --target test # currently does not work on Windows* OS
|
||||
cmake --build . --target test # currently doesn't work on Windows
|
||||
```
|
||||
|
||||
|
||||
## Building oneTBB as a Static Library
|
||||
|
||||
---
|
||||
**CAUTION**
|
||||
|
||||
Static linking of oneTBB is highly discouraged and has limited support.
|
||||
|
||||
---
|
||||
**IMPORTANT**
|
||||
|
||||
oneTBB manages a resource that is owned by the whole program - the machine's hardware threads - so its task scheduler and worker thread pool are intended to be a process-wide singleton.
|
||||
|
||||
---
|
||||
|
||||
See [Static Linking of oneTBB](https://uxlfoundation.github.io/oneTBB/main/intro/static_linking.html) for the rationale, the features that become unavailable, and the risks of ending up with more than one copy of oneTBB in a process. If you choose this configuration, validating your application is your responsibility.
|
||||
|
||||
oneTBB is built as a shared library by default. To build static archives instead, set `BUILD_SHARED_LIBS` to `OFF` during the configuration:
|
||||
|
||||
```bash
|
||||
mkdir build && cd build
|
||||
cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=<install_dir> ..
|
||||
cmake --build . --parallel
|
||||
cmake --install .
|
||||
```
|
||||
|
||||
The configuration step prints the following warning, which is expected:
|
||||
|
||||
```
|
||||
You are building oneTBB as a static library. This is highly discouraged and such
|
||||
configuration is not supported. Consider building a dynamic library to avoid
|
||||
unforeseen issues.
|
||||
```
|
||||
|
||||
The build produces archives instead of shared libraries:
|
||||
|
||||
Platform | Release | Debug
|
||||
--- | --- | ---
|
||||
Linux* OS, macOS* | `libtbb.a`, `libtbbmalloc.a` | `libtbb_debug.a`, `libtbbmalloc_debug.a`
|
||||
Windows* OS | `tbb12.lib`, `tbbmalloc.lib` | `tbb12_debug.lib`, `tbbmalloc_debug.lib`
|
||||
|
||||
### Effects on the Build Configuration
|
||||
|
||||
Setting `BUILD_SHARED_LIBS` to `OFF` also changes the following:
|
||||
|
||||
`CMAKE_POSITION_INDEPENDENT_CODE` is set to `ON` so that the archive can be linked into a shared object.
|
||||
It is only defaulted, so an explicit value specified during the configuration is respected.
|
||||
|
||||
The `tbbbind` proxy libraries are loaded at run time, which a static build does not support, so they
|
||||
are skipped and the configuration step reports `TBBBind build targets are disabled due to
|
||||
unsupported environment`. As a result, `tbb::info` and `tbb::task_arena::constraints` cannot
|
||||
report or apply topology-based constraints. See [TBBBind Library Configuration](#tbbbind-library-configuration).
|
||||
|
||||
`tbbmalloc_proxy` is not built even though `TBBMALLOC_PROXY_BUILD` is `ON` by default.
|
||||
The proxy replaces the memory allocation functions of the C library, which requires a
|
||||
shared library. The scalable allocator is still available through the explicit interfaces,
|
||||
such as `tbb::scalable_allocator` and `scalable_malloc`.
|
||||
|
||||
oneTBB loads the TCM library dynamically, so a static build cannot coordinate with
|
||||
other threading runtimes through it, regardless of `TCM_BUILD` or the `TCM_ENABLE`
|
||||
environment variable.
|
||||
|
||||
IPO is applied only to shared library builds, so `TBB_ENABLE_IPO=ON` has no effect and a
|
||||
static oneTBB may be marginally slower than the shared one.
|
||||
|
||||
On Windows* OS, `BUILD_SHARED_LIBS` controls how oneTBB itself is linked, not how oneTBB
|
||||
links the CRT. To link the CRT statically as well, set `CMAKE_MSVC_RUNTIME_LIBRARY`.
|
||||
See [Windows* OS-Specific Builds](#windows-os-specific-builds).
|
||||
|
||||
### Consuming a Static Build
|
||||
|
||||
Consuming a static build works the same way as a shared one. The generated `TBBConfig.cmake` adds a `Threads` dependency for static builds, so the platform thread library is linked transitively:
|
||||
|
||||
```cmake
|
||||
find_package(TBB REQUIRED)
|
||||
target_link_libraries(my_app PRIVATE TBB::tbb)
|
||||
```
|
||||
|
||||
See [TBBConfig - Integration of Binary Packages](#tbbconfig---integration-of-binary-packages) for details about the configuration module.
|
||||
|
||||
---
|
||||
**WARNING**
|
||||
|
||||
Static builds receive only light validation coverage. The tests that depend on HWLOC or on `tbbmalloc_proxy` are excluded automatically, so a passing `ctest` run does not indicate the same coverage as it does for a shared build.
|
||||
|
||||
---
|
||||
|
||||
## Sanitizers - Configure, Build, and Run
|
||||
## Sanitizers - сonfigure, build and run
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
@@ -293,7 +139,7 @@ make -j
|
||||
ctest -V
|
||||
```
|
||||
|
||||
## Valgrind Memcheck - Configure, Build, and Run
|
||||
## Valgrind memcheck - configure, build and run
|
||||
|
||||
### Prerequisites
|
||||
* Valgrind tool executable
|
||||
@@ -305,9 +151,7 @@ cmake -DTBB_VALGRIND_MEMCHECK=ON ..
|
||||
make -j memcheck-<test name> # or memcheck-all to scan all tests
|
||||
```
|
||||
|
||||
## Test Specification
|
||||
|
||||
Use Doxygen* to generate oneTBB test specification:
|
||||
## Test specification (Doxygen)
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
@@ -316,12 +160,35 @@ cmake -DTBB_TEST_SPEC=ON ..
|
||||
make test_spec
|
||||
```
|
||||
|
||||
## TBBConfig - Integration of Binary Packages
|
||||
## Intallation and packaging
|
||||
|
||||
It is a configuration module that is used for the integration of prebuilt oneTBB. It consists of two files (``TBBConfig.cmake`` and ``TBBConfigVersion.cmake``) and can be used via the [find_package](https://cmake.org/cmake/help/latest/command/find_package.html) function.
|
||||
**NOTE: be careful about installation: avoid commands like `make install` unless you fully understand the consequences.**
|
||||
|
||||
To use this module in your CMake project:
|
||||
1. Let CMake know where to search for TBBConfig, e.g. specify the location of ``TBBConfig.cmake`` in `TBB_DIR` (for more details about search paths, see [find_package](https://cmake.org/cmake/help/latest/command/find_package.html)).
|
||||
The following install components are supported:
|
||||
- `runtime` - oneTBB runtime package (core shared libraries and `.dll` files on Windows).
|
||||
- `devel` - oneTBB development package (header files, CMake integration files, library symbolic links and `.lib` files on Windows).
|
||||
- `tbb4py` - [oneTBB Module for Python](#onetbb-python-module-support).
|
||||
|
||||
How to install specific components after configuration and build:
|
||||
|
||||
```bash
|
||||
cmake -DCOMPONENT=<component> [-DBUILD_TYPE=<build-type>] -P cmake_install.cmake
|
||||
```
|
||||
|
||||
Simple packaging using CPack is supported.
|
||||
The following commands allow to create a simple portable package which includes header files, libraries and integration files for CMake:
|
||||
|
||||
```bash
|
||||
cmake <options> ..
|
||||
cpack
|
||||
```
|
||||
|
||||
## TBBConfig - integration of binary packages
|
||||
|
||||
It is a configuration module that is used for integration of prebuilt oneTBB. It consists of two files (TBBConfig.cmake and TBBConfigVersion.cmake) and can be used via [find_package](https://cmake.org/cmake/help/latest/command/find_package.html) function.
|
||||
|
||||
How to use this module in your CMake project:
|
||||
1. Let CMake know where to search for TBBConfig, e.g. specify location of TBBConfig.cmake in `TBB_DIR` (for more details about search paths see [find_package](https://cmake.org/cmake/help/latest/command/find_package.html)).
|
||||
2. Use [find_package](https://cmake.org/cmake/help/latest/command/find_package.html) to find oneTBB.
|
||||
3. Use provided variables and/or imported targets (described below) to work with the found oneTBB.
|
||||
|
||||
@@ -336,14 +203,14 @@ target_link_libraries(foo TBB::tbb)
|
||||
oneTBB components can be passed to [find_package](https://cmake.org/cmake/help/latest/command/find_package.html) after keyword ``COMPONENTS`` or ``REQUIRED``.
|
||||
Use basic names of components (`tbb`, `tbbmalloc`, etc.).
|
||||
|
||||
If components are not specified, then the default set is used: `tbb`, `tbbmalloc`, and ``tbbmalloc_proxy``.
|
||||
If components are not specified then the default set is used: `tbb`, `tbbmalloc` and ``tbbmalloc_proxy``.
|
||||
|
||||
If `tbbmalloc_proxy` is requested, the `tbbmalloc` component is also added and set as a dependency for `tbbmalloc_proxy`.
|
||||
If `tbbmalloc_proxy` is requested, `tbbmalloc` component will also be added and set as dependency for `tbbmalloc_proxy`.
|
||||
|
||||
TBBConfig creates [imported targets](https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#imported-targets>) as
|
||||
shared libraries using the following format: `TBB::<component>`. For example, `TBB::tbb` or `TBB::tbbmalloc`.
|
||||
shared libraries using the following format: `TBB::<component>` (for example, `TBB::tbb`, `TBB::tbbmalloc`).
|
||||
|
||||
To search only for release oneTBB version, set `TBB_FIND_RELEASE_ONLY` to `TRUE` before calling `find_package`. This variable helps to avoid simultaneous linkage of release and debug oneTBB versions when CMake configuration is `Debug,` but a third-party component depends on the release oneTBB version.
|
||||
Set `TBB_FIND_RELEASE_ONLY` to `TRUE` before calling `find_package` in order to search only for release oneTBB version. This variable helps to avoid simultaneous linkage of release and debug oneTBB versions when CMake configuration is `Debug` but a third-party component depends on release oneTBB version.
|
||||
|
||||
Variables set during TBB configuration:
|
||||
|
||||
@@ -354,14 +221,14 @@ Variable | Description
|
||||
`TBB_VERSION` | oneTBB version (format: `<major>.<minor>.<patch>.<tweak>`)
|
||||
`TBB_IMPORTED_TARGETS` | All created oneTBB imported targets (not supported for builds from source code)
|
||||
|
||||
Starting from [oneTBB 2021.1](https://github.com/uxlfoundation/oneTBB/releases/tag/v2021.1), GitHub* release TBBConfig files in the binary packages are located under `<tbb-root>/lib/cmake/TBB`.
|
||||
Starting from [oneTBB 2021.1](https://github.com/oneapi-src/oneTBB/releases/tag/v2021.1) GitHub release TBBConfig files in the binary packages are located under `<tbb-root>/lib/cmake/TBB`.
|
||||
For example, `TBB_DIR` should be set to `<tbb-root>/lib/cmake/TBB`.
|
||||
|
||||
TBBConfig files are automatically created during the build from source code and can be installed together with the library.
|
||||
Also, oneTBB provides a helper function that creates TBBConfig files from predefined templates. See `tbb_generate_config` in `cmake/config_generation.cmake`.
|
||||
Also oneTBB provides a helper function that creates TBBConfig files from predefined templates: see `tbb_generate_config` in `cmake/config_generation.cmake`.
|
||||
|
||||
## oneTBB Python Module Support
|
||||
The `TBB4PY_BUILD` Cmake option provides the ability to build a Python module for oneTBB.
|
||||
## oneTBB Python Module support
|
||||
`TBB4PY_BUILD` Cmake option provides ability to build Python module for oneTBB.
|
||||
|
||||
### Targets:
|
||||
- `irml` - build IPC RML server
|
||||
@@ -371,30 +238,30 @@ The `TBB4PY_BUILD` Cmake option provides the ability to build a Python module fo
|
||||
- Python version 3.5 or newer
|
||||
- SWIG version 3.0.6 or newer
|
||||
|
||||
## CMake Files
|
||||
## CMake files
|
||||
|
||||
### Compile and Link Options
|
||||
### Compile/link options
|
||||
|
||||
Compile and link options may be specific for certain compilers. This part is handled in `cmake/compilers/*` files.
|
||||
|
||||
Options in TBB CMake are handled via variables in two ways for convenience:
|
||||
|
||||
* by options group
|
||||
* by the specific option
|
||||
* by specific option
|
||||
|
||||
#### Options Group
|
||||
#### Options group
|
||||
|
||||
Naming convention is the following: `TBB_<SCOPE>_<STAGE>_<CATEGORY>`, where:
|
||||
Naming convention is the following: `TBB_<SCOPE>_<STAGE>_<CATEGORY>`, where
|
||||
|
||||
* `<SCOPE>` can be:
|
||||
* `<SCOPE>` could be
|
||||
* `LIB` - options applied during libraries build.
|
||||
* `TEST` - options applied during test build.
|
||||
* `BENCH` - options applied during benchmarks build.
|
||||
* `COMMON` - options applied during all (libraries, test, benchmarks) builds.
|
||||
* `<STAGE>` can be:
|
||||
* `<STAGE>` could be
|
||||
* `COMPILE` - options applied during the compilation.
|
||||
* `LINK` - options applied during the linkage.
|
||||
* `<CATEGORY>` can be:
|
||||
* `<CATEGORY>` could be
|
||||
* `FLAGS` - list of flags
|
||||
* `LIBS` - list of libraries
|
||||
|
||||
@@ -402,17 +269,16 @@ Naming convention is the following: `TBB_<SCOPE>_<STAGE>_<CATEGORY>`, where:
|
||||
|
||||
Variable | Description
|
||||
--- | ---
|
||||
`TBB_COMMON_COMPILE_FLAGS` | Applied to libraries, tests, and benchmarks as compile options
|
||||
`TBB_COMMON_COMPILE_FLAGS` | Applied to libraries, tests and benchmarks as compile options
|
||||
`TBB_LIB_LINK_FLAGS` | Applied to libraries as link options
|
||||
`TBB_LIB_LINK_LIBS ` | Applied to libraries as link libraries
|
||||
`TBB_TEST_COMPILE_FLAGS` | Applied to tests as compile options
|
||||
|
||||
Specify the `LINK` options prefixed with a dash(-) for MSVC(Visual Studio) compiler with CMake < 3.13 to avoid issues caused by `target_link_libraries` CMake command usage.
|
||||
|
||||
#### Specific Options
|
||||
#### Specific options
|
||||
|
||||
If the option is used only in part of the places (library, tests, benchmarks) and adding this option to the group of other options is not possible,
|
||||
If the option used only in part of the places (library, tests, benchmarks) as well as adding this option to the group of other options is not possible,
|
||||
then the option must be named using common sense.
|
||||
|
||||
Warning suppressions should be added to the `TBB_WARNING_SUPPRESS` variable, which is applied during the compilation of libraries, tests, and benchmarks.
|
||||
Additional warnings should be added to the `TBB_WARNING_TEST_FLAGS` variable, which is applied during the compilation of tests.
|
||||
Warnings supperssions should be added into `TBB_WARNING_SUPPRESS` variable which is applied during the compilation of libraries, tests and benchmarks.
|
||||
Additional warnings should be added into `TBB_WARNING_TEST_FLAGS` variable which is applied during the compilation of tests.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2020-2025 Intel Corporation
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -31,20 +31,10 @@ if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
|
||||
tbb_remove_compile_flag(-Werror)
|
||||
endif()
|
||||
|
||||
# Enable Intel(R) Transactional Synchronization Extensions (-mrtm) and WAITPKG instructions support (-mwaitpkg) on relevant processors
|
||||
if (CMAKE_OSX_ARCHITECTURES)
|
||||
set(_tbb_target_architectures "${CMAKE_OSX_ARCHITECTURES}")
|
||||
else()
|
||||
set(_tbb_target_architectures "${CMAKE_SYSTEM_PROCESSOR}")
|
||||
# Enable Intel(R) Transactional Synchronization Extensions (-mrtm) on relevant processors
|
||||
if (NOT "${CMAKE_OSX_ARCHITECTURES}" MATCHES "^arm64$" AND CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|AMD64)") # OSX systems are 64-bit only
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm)
|
||||
endif()
|
||||
if ("${_tbb_target_architectures}" MATCHES "(x86_64|amd64|AMD64)") # OSX systems are 64-bit only
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},12.0>>:-mwaitpkg>)
|
||||
endif()
|
||||
unset(_tbb_target_architectures)
|
||||
|
||||
if (TBB_FILE_TRIM AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10 AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -ffile-prefix-map=${NATIVE_TBB_PROJECT_ROOT_DIR}/= -ffile-prefix-map=${NATIVE_TBB_RELATIVE_BIN_PATH}/=)
|
||||
endif ()
|
||||
|
||||
# TBB malloc settings
|
||||
set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# Copyright (c) 2020-2025 Intel Corporation
|
||||
# Copyright (c) 2025 UXL Foundation Contributors
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -13,40 +12,15 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
if (EMSCRIPTEN)
|
||||
set(TBB_EMSCRIPTEN 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_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} -fexceptions)
|
||||
set(TBB_TEST_LINK_FLAGS ${TBB_TEST_LINK_FLAGS} -fexceptions -sINITIAL_MEMORY=65536000 -sALLOW_MEMORY_GROWTH=1 -sMALLOC=mimalloc -sEXIT_RUNTIME=1 -sTOTAL_STACK=${TBB_EMSCRIPTEN_STACK_SIZE})
|
||||
unset(TBB_EMSCRIPTEN_STACK_SIZE)
|
||||
endif()
|
||||
|
||||
if (MINGW)
|
||||
set(TBB_LINK_DEF_FILE_FLAG "")
|
||||
set(TBB_DEF_FILE_PREFIX "")
|
||||
elseif (APPLE)
|
||||
if (APPLE)
|
||||
set(TBB_LINK_DEF_FILE_FLAG -Wl,-exported_symbols_list,)
|
||||
set(TBB_DEF_FILE_PREFIX mac${TBB_ARCH})
|
||||
|
||||
# For correct ucontext.h structures layout
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -D_XOPEN_SOURCE)
|
||||
elseif (MSVC)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/MSVC.cmake)
|
||||
return()
|
||||
else()
|
||||
# On Windows, use Windows .def file format, not Linux version-script
|
||||
if(WIN32)
|
||||
set(TBB_LINK_DEF_FILE_FLAG ${CMAKE_LINK_DEF_FILE_FLAG})
|
||||
set(TBB_DEF_FILE_PREFIX win${TBB_ARCH})
|
||||
else()
|
||||
set(TBB_LINK_DEF_FILE_FLAG -Wl,--version-script=)
|
||||
set(TBB_DEF_FILE_PREFIX lin${TBB_ARCH})
|
||||
endif()
|
||||
set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},10.0>>:-ffp-model=precise>)
|
||||
set(TBB_LINK_DEF_FILE_FLAG -Wl,--version-script=)
|
||||
set(TBB_DEF_FILE_PREFIX lin${TBB_ARCH})
|
||||
endif()
|
||||
|
||||
# Depfile options (e.g. -MD) are inserted automatically in some cases.
|
||||
@@ -64,65 +38,22 @@ if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
|
||||
endif()
|
||||
|
||||
# Enable Intel(R) Transactional Synchronization Extensions (-mrtm) and WAITPKG instructions support (-mwaitpkg) on relevant processors
|
||||
if (APPLE AND CMAKE_OSX_ARCHITECTURES)
|
||||
set(_tbb_target_architectures "${CMAKE_OSX_ARCHITECTURES}")
|
||||
else()
|
||||
set(_tbb_target_architectures "${CMAKE_SYSTEM_PROCESSOR}")
|
||||
endif()
|
||||
if ("${_tbb_target_architectures}" MATCHES "(AMD64|amd64|i.86|x86)" AND NOT EMSCRIPTEN)
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64)")
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},12.0>>:-mwaitpkg>)
|
||||
endif()
|
||||
|
||||
# Clang flags to prevent compiler from optimizing out security checks
|
||||
# Don't use -fPIC, -fstack-clash-protection, -fcf-protection on Windows (not supported by Clang with MSVC toolchain)
|
||||
# Also disable CRT security warnings on Windows (getenv, strncpy, etc. are deprecated but TBB uses them)
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS}
|
||||
-Wformat -Wformat-security -Werror=format-security
|
||||
$<$<PLATFORM_ID:Windows>:-D_CRT_SECURE_NO_WARNINGS>
|
||||
$<$<NOT:$<PLATFORM_ID:Windows>>:-fPIC>
|
||||
$<$<NOT:$<PLATFORM_ID:Emscripten>>:-fstack-protector-strong>)
|
||||
set(TBB_COMMON_LINK_LIBS dl)
|
||||
|
||||
if (NOT APPLE AND NOT ANDROID_PLATFORM AND CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)" AND NOT WIN32)
|
||||
set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} -fstack-clash-protection)
|
||||
if (NOT EMSCRIPTEN)
|
||||
# Some versions of Clang implicitly set -march=i686 when compiling for x86 and some don't.
|
||||
# -fcf-protection requires i686, so check -fcf-protection explicitly.
|
||||
include(CheckCXXSourceCompiles)
|
||||
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
|
||||
set(CMAKE_REQUIRED_FLAGS "-fcf-protection=full")
|
||||
check_cxx_source_compiles("int main(int, char*[]) { return 0; }" CF_PROTECTION_FULL_SUPPORTED)
|
||||
unset(CMAKE_TRY_COMPILE_TARGET_TYPE)
|
||||
unset(CMAKE_REQUIRED_FLAGS)
|
||||
|
||||
if (CF_PROTECTION_FULL_SUPPORTED)
|
||||
set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} -fcf-protection=full)
|
||||
else()
|
||||
message(WARNING "Compiler does not support -fcf-protection=full.")
|
||||
endif()
|
||||
endif()
|
||||
if (ANDROID_PLATFORM)
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2>)
|
||||
endif()
|
||||
|
||||
# -z switch is not supported on MacOS and Windows
|
||||
if (NOT APPLE AND NOT WIN32)
|
||||
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,relro,-z,now,-z,noexecstack)
|
||||
# Enabling LTO on Android causes the NDK bug.
|
||||
# NDK throws the warning: "argument unused during compilation: '-Wa,--noexecstack'"
|
||||
if (NOT ANDROID_PLATFORM)
|
||||
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
|
||||
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
|
||||
endif()
|
||||
|
||||
set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS})
|
||||
|
||||
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__)
|
||||
endif()
|
||||
|
||||
if (TBB_FILE_TRIM AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -ffile-prefix-map=${NATIVE_TBB_PROJECT_ROOT_DIR}/= -ffile-prefix-map=${NATIVE_TBB_RELATIVE_BIN_PATH}/=)
|
||||
endif ()
|
||||
|
||||
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
|
||||
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
|
||||
|
||||
# TBB malloc settings
|
||||
set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# Copyright (c) 2020-2025 Intel Corporation
|
||||
# Copyright (c) 2026 UXL Foundation Contributors
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -13,10 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
if (MINGW)
|
||||
set(TBB_LINK_DEF_FILE_FLAG "")
|
||||
set(TBB_DEF_FILE_PREFIX "")
|
||||
elseif (APPLE)
|
||||
if (APPLE)
|
||||
set(TBB_LINK_DEF_FILE_FLAG -Wl,-exported_symbols_list,)
|
||||
set(TBB_DEF_FILE_PREFIX mac${TBB_ARCH})
|
||||
|
||||
@@ -36,45 +32,12 @@ 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 "LC_ALL=C" "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})
|
||||
if ("${ASSEMBLER_VERSION_LINE}" MATCHES "GNU assembler version")
|
||||
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})")
|
||||
endif()
|
||||
|
||||
# Enable Intel(R) Transactional Synchronization Extensions (-mrtm) and WAITPKG instructions support (-mwaitpkg) on relevant processors
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)" AND NOT EMSCRIPTEN)
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64)")
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$<AND:$<NOT:$<CXX_COMPILER_ID:Intel>>,$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},11.0>>>:-mwaitpkg>)
|
||||
endif()
|
||||
|
||||
set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS})
|
||||
set(TBB_COMMON_LINK_LIBS dl)
|
||||
|
||||
# Ignore -Werror set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled.
|
||||
if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
|
||||
@@ -84,47 +47,16 @@ endif()
|
||||
if (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL Intel)
|
||||
# gcc 6.0 and later have -flifetime-dse option that controls elimination of stores done outside the object lifetime
|
||||
set(TBB_DSE_FLAG $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},6.0>>:-flifetime-dse=1>)
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},8.0>>:-fstack-clash-protection>)
|
||||
|
||||
# Suppress GCC 12.x-15.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} $<$<AND:$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},12.0>>,$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},16.0>>:-Wno-stringop-overflow>)
|
||||
endif()
|
||||
|
||||
# Workaround for heavy tests and too many symbols in debug (rellocation truncated to fit: R_MIPS_CALL16)
|
||||
if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips")
|
||||
set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} -DTBB_TEST_LOW_WORKLOAD $<$<CONFIG:DEBUG>:-fPIE -mxgot>)
|
||||
set(TBB_TEST_LINK_FLAGS ${TBB_TEST_LINK_FLAGS} $<$<CONFIG:DEBUG>:-pie>)
|
||||
set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} -DTBB_TEST_LOW_WORKLOAD $<$<CONFIG:DEBUG>:-mxgot>)
|
||||
endif()
|
||||
|
||||
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
|
||||
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
|
||||
|
||||
|
||||
if (MINGW AND CMAKE_SYSTEM_PROCESSOR MATCHES "i.86")
|
||||
list (APPEND TBB_COMMON_COMPILE_FLAGS -msse2)
|
||||
endif ()
|
||||
|
||||
# Gnu flags to prevent compiler from optimizing out security checks
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fno-strict-overflow -fno-delete-null-pointer-checks -fwrapv)
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security
|
||||
-fstack-protector-strong )
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)" AND NOT EMSCRIPTEN)
|
||||
set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},8.0>>:-fcf-protection=full>)
|
||||
endif ()
|
||||
set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},8.0>>:-fstack-clash-protection>)
|
||||
|
||||
# -z switch is not supported on MacOS and MinGW
|
||||
if (NOT APPLE AND NOT MINGW)
|
||||
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,relro,-z,now,-z,noexecstack)
|
||||
endif()
|
||||
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 (TBB_FILE_TRIM AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8 AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -ffile-prefix-map=${NATIVE_TBB_PROJECT_ROOT_DIR}/= -ffile-prefix-map=${NATIVE_TBB_RELATIVE_BIN_PATH}/=)
|
||||
endif ()
|
||||
|
||||
# TBB malloc settings
|
||||
set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions)
|
||||
set(TBB_OPENMP_FLAG -fopenmp)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2020-2024 Intel Corporation
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -21,17 +21,15 @@ 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>)
|
||||
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 ()
|
||||
|
||||
$<$<NOT:$<CONFIG:Debug>>:-fno-omit-frame-pointer -qno-opt-report-embed -D_FORTIFY_SOURCE=2>)
|
||||
set(TBB_OPENMP_FLAG -qopenmp)
|
||||
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-ipo>)
|
||||
else()
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/GNU.cmake)
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<EQUAL:${TBB_ARCH},32>:-falign-stack=maintain-16-byte>)
|
||||
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -static-intel)
|
||||
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -static-intel -Wl,-z,relro,-z,now,)
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fstack-protector -Wformat -Wformat-security
|
||||
$<$<NOT:$<CONFIG:Debug>>:-qno-opt-report-embed -D_FORTIFY_SOURCE=2>
|
||||
$<$<EQUAL:${TBB_ARCH},32>:-falign-stack=maintain-16-byte>)
|
||||
set(TBB_OPENMP_FLAG -qopenmp)
|
||||
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-ipo>)
|
||||
endif()
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# Copyright (c) 2020-2024 Intel Corporation
|
||||
# Copyright (c) 2026 UXL Foundation Contributors
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -15,19 +14,14 @@
|
||||
|
||||
if (WIN32)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/MSVC.cmake)
|
||||
set(TBB_OPENMP_FLAG /Qopenmp)
|
||||
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:/Qipo>)
|
||||
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:/INCREMENTAL:NO>)
|
||||
else()
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/Clang.cmake)
|
||||
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-ipo>)
|
||||
# "--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)
|
||||
# Under Linux, ipo detection for 2024+ versions of Intel compilers is supported starting cmake 3.30.1.
|
||||
if (CMAKE_VERSION VERSION_LESS 3.30.1 AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 2023)
|
||||
set(TBB_IPO_DETECTION_BROKEN TRUE)
|
||||
endif()
|
||||
endif()
|
||||
set(TBB_IPO_LINK_FLAGS ${TBB_IPO_LINK_FLAGS} ${TBB_IPO_COMPILE_FLAGS})
|
||||
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64)")
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm -mwaitpkg)
|
||||
endif()
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# Copyright (c) 2020-2025 Intel Corporation
|
||||
# Copyright (c) 2026 UXL Foundation Contributors
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -20,12 +19,10 @@ set(TBB_DEF_FILE_PREFIX win${TBB_ARCH})
|
||||
# TODO: consider use of CMP0092 CMake policy.
|
||||
string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
|
||||
set(TBB_WARNING_LEVEL $<$<NOT:$<CXX_COMPILER_ID:Intel>>:/W4> $<$<BOOL:${TBB_STRICT}>:/WX>)
|
||||
|
||||
# Warning suppression C4324: structure was padded due to alignment specifier
|
||||
set(TBB_WARNING_LEVEL $<$<NOT:$<CXX_COMPILER_ID:Intel>>:/W4> $<$<BOOL:${TBB_STRICT}>:/WX>)
|
||||
set(TBB_WARNING_SUPPRESS /wd4324)
|
||||
|
||||
set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} /bigobj)
|
||||
set(TBB_TEST_COMPILE_FLAGS /bigobj)
|
||||
if (MSVC_VERSION LESS_EQUAL 1900)
|
||||
# Warning suppression C4503 for VS2015 and earlier:
|
||||
# decorated name length exceeded, name was truncated.
|
||||
@@ -33,14 +30,8 @@ if (MSVC_VERSION LESS_EQUAL 1900)
|
||||
# https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4503
|
||||
set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} /wd4503)
|
||||
endif()
|
||||
set(TBB_LIB_COMPILE_FLAGS -D_CRT_SECURE_NO_WARNINGS /GS /Gy /sdl $<$<VERSION_LESS:${MSVC_VERSION},1930>:/ZH:SHA_256>)
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} /volatile:iso /FS /EHsc)
|
||||
|
||||
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} LINKER:/DEPENDENTLOADFLAG:0x2000 LINKER:/DYNAMICBASE LINKER:/NXCOMPAT)
|
||||
|
||||
if (TBB_ARCH EQUAL 32)
|
||||
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} LINKER:/SAFESEH )
|
||||
endif()
|
||||
set(TBB_LIB_COMPILE_FLAGS -D_CRT_SECURE_NO_WARNINGS /GS)
|
||||
set(TBB_COMMON_COMPILE_FLAGS /volatile:iso /FS)
|
||||
|
||||
# Ignore /WX set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled.
|
||||
if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
|
||||
@@ -49,7 +40,7 @@ endif()
|
||||
|
||||
if (WINDOWS_STORE OR TBB_WINDOWS_DRIVER)
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} /D_WIN32_WINNT=0x0A00)
|
||||
set(TBB_COMMON_LINK_FLAGS -NODEFAULTLIB:kernel32.lib -INCREMENTAL:NO)
|
||||
set(TBB_COMMON_LINK_FLAGS /NODEFAULTLIB:kernel32.lib /INCREMENTAL:NO)
|
||||
set(TBB_COMMON_LINK_LIBS OneCore.lib)
|
||||
endif()
|
||||
|
||||
@@ -64,7 +55,7 @@ if (WINDOWS_STORE)
|
||||
string(REGEX REPLACE "WindowsApp.lib" "" CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES}")
|
||||
|
||||
if (TBB_NO_APPCONTAINER)
|
||||
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -APPCONTAINER:NO)
|
||||
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} /APPCONTAINER:NO)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -78,27 +69,7 @@ if (TBB_WINDOWS_DRIVER)
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} /D _UNICODE /DUNICODE /DWINAPI_FAMILY=WINAPI_FAMILY_APP /D__WRL_NO_DEFAULT_LIB__)
|
||||
endif()
|
||||
|
||||
if (TBB_FILE_TRIM AND NOT CMAKE_CXX_COMPILER_ID MATCHES "(Intel|IntelLLVM|Clang)")
|
||||
add_compile_options(
|
||||
"$<$<COMPILE_LANGUAGE:CXX>:/d1trimfile:${NATIVE_TBB_PROJECT_ROOT_DIR}\\>"
|
||||
"$<$<COMPILE_LANGUAGE:CXX>:/d1trimfile:${CMAKE_SOURCE_DIR}/>")
|
||||
endif()
|
||||
|
||||
if (TBB_CONTROL_FLOW_GUARD)
|
||||
set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} /guard:cf)
|
||||
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} LINKER:/guard:cf)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "(Clang|IntelLLVM)")
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64|i.86)")
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm -mwaitpkg)
|
||||
endif()
|
||||
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
|
||||
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
|
||||
else()
|
||||
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:/GL>)
|
||||
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-LTCG> $<$<NOT:$<CONFIG:Debug>>:-INCREMENTAL:NO>)
|
||||
endif()
|
||||
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:/GL>)
|
||||
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:/LTCG /INCREMENTAL:NO>)
|
||||
|
||||
set(TBB_OPENMP_FLAG /openmp)
|
||||
set(TBB_OPENMP_NO_LINK_FLAG TRUE) # TBB_OPENMP_FLAG will be used only on compilation but not on linkage
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
# Copyright (c) 2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/compilers/GNU.cmake)
|
||||
|
||||
# Remove dl library not present in QNX systems
|
||||
unset(TBB_COMMON_LINK_LIBS)
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2020-2023 Intel Corporation
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -22,7 +22,7 @@ function(tbb_generate_config)
|
||||
set(options HANDLE_SUBDIRS)
|
||||
set(oneValueArgs INSTALL_DIR
|
||||
SYSTEM_NAME
|
||||
LIB_REL_PATH INC_REL_PATH
|
||||
LIB_REL_PATH INC_REL_PATH DLL_REL_PATH
|
||||
VERSION
|
||||
TBB_BINARY_VERSION
|
||||
TBBMALLOC_BINARY_VERSION
|
||||
@@ -35,14 +35,11 @@ function(tbb_generate_config)
|
||||
file(MAKE_DIRECTORY ${config_install_dir})
|
||||
|
||||
file(TO_CMAKE_PATH "${tbb_gen_cfg_LIB_REL_PATH}" TBB_LIB_REL_PATH)
|
||||
file(TO_CMAKE_PATH "${tbb_gen_cfg_DLL_REL_PATH}" TBB_DLL_REL_PATH)
|
||||
file(TO_CMAKE_PATH "${tbb_gen_cfg_INC_REL_PATH}" TBB_INC_REL_PATH)
|
||||
|
||||
set(TBB_VERSION ${tbb_gen_cfg_VERSION})
|
||||
|
||||
set(_tbb_pc_lib_name tbb)
|
||||
set(_prefix_for_pc_file "\${pcfiledir}/../../")
|
||||
set(_includedir_for_pc_file "\${prefix}/include")
|
||||
|
||||
set(TBB_COMPONENTS_BIN_VERSION "
|
||||
set(_tbb_bin_version ${tbb_gen_cfg_TBB_BINARY_VERSION})
|
||||
set(_tbbmalloc_bin_version ${tbb_gen_cfg_TBBMALLOC_BINARY_VERSION})
|
||||
@@ -53,61 +50,37 @@ set(_tbbbind_bin_version ${tbb_gen_cfg_TBBBIND_BINARY_VERSION})
|
||||
if (tbb_gen_cfg_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(TBB_LIB_PREFIX "lib")
|
||||
set(TBB_LIB_EXT "so.\${_\${_tbb_component}_bin_version}")
|
||||
|
||||
set (TBB_HANDLE_IMPLIB "
|
||||
set (_tbb_release_dll \${_tbb_release_lib})
|
||||
set (_tbb_debug_dll \${_tbb_debug_lib})
|
||||
")
|
||||
set(TBB_IMPLIB_RELEASE "")
|
||||
set(TBB_IMPLIB_DEBUG "")
|
||||
if (tbb_gen_cfg_HANDLE_SUBDIRS)
|
||||
set(TBB_HANDLE_SUBDIRS "set(_tbb_subdir gcc4.8)")
|
||||
|
||||
set(_libdir_for_pc_file "\${prefix}/lib/intel64/gcc4.8")
|
||||
set(_tbb_pc_extra_libdir "-L\${prefix}/lib")
|
||||
configure_file(${_tbb_gen_cfg_path}/../integration/pkg-config/tbb.pc.in ${config_install_dir}/tbb.pc @ONLY)
|
||||
|
||||
set(_libdir_for_pc_file "\${prefix}/lib/ia32/gcc4.8")
|
||||
set(_tbb_pc_extra_libdir "-L\${prefix}/lib32")
|
||||
configure_file(${_tbb_gen_cfg_path}/../integration/pkg-config/tbb.pc.in ${config_install_dir}/tbb32.pc @ONLY)
|
||||
set(TBB_HANDLE_SUBDIRS "
|
||||
if (CMAKE_SIZEOF_VOID_P STREQUAL \"8\")
|
||||
set(_tbb_subdir intel64/gcc4.8)
|
||||
else ()
|
||||
set(_tbb_subdir ia32/gcc4.8)
|
||||
endif()
|
||||
")
|
||||
endif()
|
||||
elseif (tbb_gen_cfg_SYSTEM_NAME STREQUAL "Darwin")
|
||||
set(TBB_LIB_PREFIX "lib")
|
||||
set(TBB_LIB_EXT "\${_\${_tbb_component}_bin_version}.dylib")
|
||||
|
||||
set (TBB_HANDLE_IMPLIB "
|
||||
set (_tbb_release_dll \${_tbb_release_lib})
|
||||
set (_tbb_debug_dll \${_tbb_debug_lib})
|
||||
")
|
||||
set(_libdir_for_pc_file "\${prefix}/lib")
|
||||
configure_file(${_tbb_gen_cfg_path}/../integration/pkg-config/tbb.pc.in ${config_install_dir}/tbb.pc @ONLY)
|
||||
set(TBB_IMPLIB_RELEASE "")
|
||||
set(TBB_IMPLIB_DEBUG "")
|
||||
elseif (tbb_gen_cfg_SYSTEM_NAME STREQUAL "Windows")
|
||||
set(TBB_LIB_PREFIX "")
|
||||
set(TBB_LIB_EXT "lib")
|
||||
set(TBB_LIB_EXT "dll")
|
||||
set(TBB_COMPILE_DEFINITIONS "
|
||||
INTERFACE_COMPILE_DEFINITIONS \"__TBB_NO_IMPLICIT_LINKAGE=1\"")
|
||||
|
||||
# .lib - installed to TBB_LIB_REL_PATH (e.g. <prefix>/lib) and are passed as IMPORTED_IMPLIB_<CONFIG> property to target
|
||||
# .dll - installed to <prefix>/bin or <prefix>/redist and are passed as IMPORTED_LOCATION_<CONFIG> property to target
|
||||
set (TBB_HANDLE_IMPLIB "
|
||||
find_file(_tbb_release_dll
|
||||
NAMES \${_tbb_component}\${_bin_version}.dll
|
||||
PATHS \${_tbb_root}
|
||||
PATH_SUFFIXES \"redist/\${_tbb_intel_arch}/\${_tbb_subdir}\" \"bin\${_tbb_arch_suffix}/\${_tbb_subdir}\" \"bin\${_tbb_arch_suffix}/\" \"bin\"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
if (EXISTS \"\${_tbb_debug_lib}\")
|
||||
find_file(_tbb_debug_dll
|
||||
NAMES \${_tbb_component}\${_bin_version}_debug.dll
|
||||
PATHS \${_tbb_root}
|
||||
PATH_SUFFIXES \"redist/\${_tbb_intel_arch}/\${_tbb_subdir}\" \"bin\${_tbb_arch_suffix}/\${_tbb_subdir}\" \"bin\${_tbb_arch_suffix}/\" \"bin\"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
endif()
|
||||
")
|
||||
set(TBB_IMPLIB_RELEASE "
|
||||
IMPORTED_IMPLIB_RELEASE \"\${_tbb_release_lib}\"")
|
||||
set(TBB_IMPLIB_DEBUG "
|
||||
IMPORTED_IMPLIB_DEBUG \"\${_tbb_debug_lib}\"")
|
||||
# .lib files installed to TBB_LIB_REL_PATH (e.g. <prefix>/lib);
|
||||
# .dll files installed to TBB_DLL_REL_PATH (e.g. <prefix>/bin);
|
||||
# Expand TBB_LIB_REL_PATH here in IMPORTED_IMPLIB property and
|
||||
# redefine it with TBB_DLL_REL_PATH value to properly fill IMPORTED_LOCATION property in TBBConfig.cmake.in template.
|
||||
set(TBB_IMPLIB_RELEASE "
|
||||
IMPORTED_IMPLIB_RELEASE \"\${_tbb_root}/${TBB_LIB_REL_PATH}/\${_tbb_subdir}/\${_tbb_component}\${_bin_version}.lib\"")
|
||||
set(TBB_IMPLIB_DEBUG "
|
||||
IMPORTED_IMPLIB_DEBUG \"\${_tbb_root}/${TBB_LIB_REL_PATH}/\${_tbb_subdir}/\${_tbb_component}\${_bin_version}_debug.lib\"")
|
||||
set(TBB_LIB_REL_PATH ${TBB_DLL_REL_PATH})
|
||||
|
||||
if (tbb_gen_cfg_HANDLE_SUBDIRS)
|
||||
set(TBB_HANDLE_SUBDIRS "
|
||||
@@ -115,16 +88,13 @@ set(_tbb_subdir vc14)
|
||||
if (WINDOWS_STORE)
|
||||
set(_tbb_subdir \${_tbb_subdir}_uwp)
|
||||
endif()
|
||||
|
||||
if (CMAKE_SIZEOF_VOID_P STREQUAL \"8\")
|
||||
set(_tbb_subdir intel64/\${_tbb_subdir})
|
||||
else ()
|
||||
set(_tbb_subdir ia32/\${_tbb_subdir})
|
||||
endif()
|
||||
")
|
||||
set(_tbb_pc_lib_name ${_tbb_pc_lib_name}${TBB_BINARY_VERSION})
|
||||
|
||||
set(_libdir_for_pc_file "\${prefix}/lib/intel64/vc14")
|
||||
set(_tbb_pc_extra_libdir "-L\${prefix}/lib")
|
||||
configure_file(${_tbb_gen_cfg_path}/../integration/pkg-config/tbb.pc.in ${config_install_dir}/tbb.pc @ONLY)
|
||||
|
||||
set(_libdir_for_pc_file "\${prefix}/lib/ia32/vc14")
|
||||
set(_tbb_pc_extra_libdir "-L\${prefix}/lib32")
|
||||
configure_file(${_tbb_gen_cfg_path}/../integration/pkg-config/tbb.pc.in ${config_install_dir}/tbb32.pc @ONLY)
|
||||
endif()
|
||||
|
||||
set(TBB_HANDLE_BIN_VERSION "
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2020-2025 Intel Corporation
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -12,32 +12,23 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
list(APPEND HWLOC_REQUIRED_VERSIONS static 2 2_5)
|
||||
list(APPEND HWLOC_REQUIRED_VERSIONS 1_11 2 2_4)
|
||||
|
||||
foreach(hwloc_version ${HWLOC_REQUIRED_VERSIONS})
|
||||
set(HWLOC_TARGET_NAME HWLOC::hwloc_${hwloc_version})
|
||||
|
||||
string(TOUPPER ${hwloc_version} hwloc_version)
|
||||
|
||||
if (NOT WIN32 OR hwloc_version MATCHES "STATIC")
|
||||
if (NOT WIN32)
|
||||
set(CMAKE_HWLOC_${hwloc_version}_DLL_PATH STUB)
|
||||
endif()
|
||||
set(HWLOC_TARGET_NAME HWLOC::hwloc_${hwloc_version})
|
||||
|
||||
if (NOT TARGET ${HWLOC_TARGET_NAME} AND
|
||||
CMAKE_HWLOC_${hwloc_version}_LIBRARY_PATH AND
|
||||
CMAKE_HWLOC_${hwloc_version}_DLL_PATH AND
|
||||
CMAKE_HWLOC_${hwloc_version}_INCLUDE_PATH
|
||||
)
|
||||
if (HWLOC_TARGET_NAME MATCHES "static")
|
||||
set(_hwloc_library_type "STATIC")
|
||||
else()
|
||||
set(_hwloc_library_type "SHARED")
|
||||
endif()
|
||||
add_library(${HWLOC_TARGET_NAME} ${_hwloc_library_type} IMPORTED)
|
||||
|
||||
add_library(${HWLOC_TARGET_NAME} SHARED IMPORTED)
|
||||
set_target_properties(${HWLOC_TARGET_NAME} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CMAKE_HWLOC_${hwloc_version}_INCLUDE_PATH}")
|
||||
if (WIN32 AND NOT hwloc_version MATCHES "STATIC")
|
||||
if (WIN32)
|
||||
set_target_properties(${HWLOC_TARGET_NAME} PROPERTIES
|
||||
IMPORTED_LOCATION "${CMAKE_HWLOC_${hwloc_version}_DLL_PATH}"
|
||||
IMPORTED_IMPLIB "${CMAKE_HWLOC_${hwloc_version}_LIBRARY_PATH}")
|
||||
@@ -53,20 +44,23 @@ foreach(hwloc_version ${HWLOC_REQUIRED_VERSIONS})
|
||||
endforeach()
|
||||
|
||||
unset(HWLOC_TARGET_NAME)
|
||||
unset(_hwloc_library_type)
|
||||
|
||||
if (NOT HWLOC_TARGET_EXPLICITLY_DEFINED AND
|
||||
NOT TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH
|
||||
# No hwloc auto detection for cross compilation
|
||||
NOT CMAKE_CROSSCOMPILING
|
||||
)
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND AND NOT CMAKE_VERSION VERSION_LESS 3.6)
|
||||
pkg_search_module(HWLOC hwloc IMPORTED_TARGET)
|
||||
if (TARGET PkgConfig::HWLOC)
|
||||
if(HWLOC_VERSION VERSION_LESS 2.5)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_search_module(HWLOC hwloc)
|
||||
if (HWLOC_FOUND)
|
||||
if (HWLOC_VERSION VERSION_LESS 2)
|
||||
set(TBBBIND_LIBRARY_NAME tbbbind)
|
||||
elseif(HWLOC_VERSION VERSION_LESS 2.4)
|
||||
set(TBBBIND_LIBRARY_NAME tbbbind_2_0)
|
||||
else()
|
||||
set(TBBBIND_LIBRARY_NAME tbbbind_2_5)
|
||||
set(TBBBIND_LIBRARY_NAME tbbbind_2_4)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2020-2023 Intel Corporation
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -31,18 +31,10 @@ endif()
|
||||
|
||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/memcheck)
|
||||
|
||||
function(_tbb_run_memcheck test_target subdir)
|
||||
function(_tbb_run_memcheck test_target)
|
||||
set(target_name memcheck-${test_target})
|
||||
if(${subdir} STREQUAL "tbbmalloc")
|
||||
# Valgring intercepts all allocation symbols with its own by default,
|
||||
# so it disables using tbbmalloc. In case of tbbmalloc tests
|
||||
# intercept allocation symbols only in the default system libraries,
|
||||
# but not in any other shared library or the executable
|
||||
# defining public malloc or operator new related functions.
|
||||
set(option "--soname-synonyms=somalloc=nouserintercepts")
|
||||
endif()
|
||||
add_custom_target(${target_name}
|
||||
COMMAND ${VALGRIND_EXE} ${option} --leak-check=full --show-leak-kinds=all --log-file=${CMAKE_BINARY_DIR}/memcheck/${target_name}.log -v $<TARGET_FILE:${test_target}>)
|
||||
COMMAND ${VALGRIND_EXE} --leak-check=full --show-leak-kinds=all --log-file=${CMAKE_BINARY_DIR}/memcheck/${target_name}.log -v $<TARGET_FILE:${test_target}>)
|
||||
add_dependencies(memcheck-all ${target_name})
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2020-2023 Intel Corporation
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -18,7 +18,4 @@ set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
|
||||
set(CPACK_PACKAGE_VERSION "${TBB_VERSION}")
|
||||
string(TOLOWER ${CPACK_PACKAGE_NAME}-${PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}_${TBB_OUTPUT_DIR_BASE}_${CMAKE_BUILD_TYPE} CPACK_PACKAGE_FILE_NAME)
|
||||
set(CPACK_GENERATOR ZIP)
|
||||
# Note: this is an internal non-documented variable set by CPack
|
||||
if (NOT CPack_CMake_INCLUDED)
|
||||
include(CPack)
|
||||
endif()
|
||||
include(CPack)
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
# Add code signing as post-install step.
|
||||
if (DEFINED TBB_SIGNTOOL)
|
||||
file(TO_CMAKE_PATH "${TBB_SIGNTOOL}" TBB_SIGNTOOL)
|
||||
install(CODE "
|
||||
file(GLOB_RECURSE FILES_TO_SIGN \${CMAKE_INSTALL_PREFIX}/*${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
execute_process(COMMAND ${TBB_SIGNTOOL} \${FILES_TO_SIGN} ${TBB_SIGNTOOL_ARGS})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2020-2025 Intel Corporation
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -12,11 +12,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
if (POLICY CMP0148)
|
||||
# CMake 3.27: The FindPythonInterp and FindPythonLibs modules are removed
|
||||
cmake_policy(SET CMP0148 OLD)
|
||||
endif()
|
||||
|
||||
find_package(PythonInterp 3.5 REQUIRED)
|
||||
|
||||
file(GLOB_RECURSE MODULES_LIST "${PYTHON_MODULE_BUILD_PATH}/*TBB.py*" )
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
# Copyright (c) 2023 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
include(CheckSymbolExists)
|
||||
|
||||
if (UNIX)
|
||||
set(CMAKE_REQUIRED_FLAGS -Wno-deprecated-declarations)
|
||||
if (APPLE)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS -D_XOPEN_SOURCE)
|
||||
endif()
|
||||
|
||||
check_symbol_exists("getcontext" "ucontext.h" _tbb_have_ucontext)
|
||||
if (NOT _tbb_have_ucontext)
|
||||
set(TBB_RESUMABLE_TASKS_USE_THREADS "__TBB_RESUMABLE_TASKS_USE_THREADS=1")
|
||||
endif()
|
||||
|
||||
unset(_tbb_have_ucontext)
|
||||
unset(CMAKE_REQUIRED_DEFINITIONS)
|
||||
unset(CMAKE_REQUIRED_FLAGS)
|
||||
endif()
|
||||
@@ -1,5 +1,4 @@
|
||||
# Copyright (c) 2020-2022 Intel Corporation
|
||||
# Copyright (c) 2025 UXL Foundation Contributors
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -15,7 +14,7 @@
|
||||
|
||||
set(TBB_SANITIZE ${TBB_SANITIZE} CACHE STRING "Sanitizer parameter passed to compiler/linker" FORCE)
|
||||
# Possible values of sanitizer parameter for cmake-gui for convenience, user still can use any other value.
|
||||
set_property(CACHE TBB_SANITIZE PROPERTY STRINGS "thread" "memory" "leak" "address")
|
||||
set_property(CACHE TBB_SANITIZE PROPERTY STRINGS "thread" "memory" "leak" "address -fno-omit-frame-pointer")
|
||||
|
||||
if (NOT TBB_SANITIZE)
|
||||
return()
|
||||
@@ -23,14 +22,6 @@ endif()
|
||||
|
||||
set(TBB_SANITIZE_OPTION -fsanitize=${TBB_SANITIZE})
|
||||
|
||||
if (TBB_SANITIZE MATCHES "thread")
|
||||
set(TBB_SANITIZE_OPTION "${TBB_SANITIZE_OPTION} -Wno-tsan")
|
||||
endif()
|
||||
|
||||
if (TBB_SANITIZE MATCHES "address")
|
||||
set(TBB_SANITIZE_OPTION "${TBB_SANITIZE_OPTION} -fno-omit-frame-pointer")
|
||||
endif()
|
||||
|
||||
# It is required to add sanitizer option to CMAKE_REQUIRED_LIBRARIES to make check_cxx_compiler_flag working properly:
|
||||
# sanitizer option should be passed during the compilation phase as well as during the compilation.
|
||||
set(CMAKE_REQUIRED_LIBRARIES "${TBB_SANITIZE_OPTION} ${CMAKE_REQUIRED_LIBRARIES}")
|
||||
@@ -43,10 +34,5 @@ if (NOT ${FLAG_DISPLAY_NAME})
|
||||
"please try another compiler or omit TBB_SANITIZE variable")
|
||||
endif()
|
||||
|
||||
set(TBB_TESTS_ENVIRONMENT ${TBB_TESTS_ENVIRONMENT}
|
||||
"TSAN_OPTIONS=suppressions=${CMAKE_CURRENT_SOURCE_DIR}/cmake/suppressions/tsan.suppressions"
|
||||
"LSAN_OPTIONS=suppressions=${CMAKE_CURRENT_SOURCE_DIR}/cmake/suppressions/lsan.suppressions")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TBB_SANITIZE_OPTION}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TBB_SANITIZE_OPTION}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${TBB_SANITIZE_OPTION}")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2020-2023 Intel Corporation
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -20,6 +20,7 @@ set(TBB_ROOT_REL_PATH "../../..")
|
||||
# Paths relative to TBB root directory
|
||||
set(INC_REL_PATH "include")
|
||||
set(LIB_REL_PATH "lib")
|
||||
set(DLL_REL_PATH "redist")
|
||||
|
||||
# Parse version info
|
||||
file(READ ${CMAKE_CURRENT_LIST_DIR}/../../include/oneapi/tbb/version.h _tbb_version_info)
|
||||
@@ -44,6 +45,6 @@ set(COMMON_ARGS
|
||||
)
|
||||
|
||||
tbb_generate_config(INSTALL_DIR ${INSTALL_DIR}/linux SYSTEM_NAME Linux HANDLE_SUBDIRS ${COMMON_ARGS})
|
||||
tbb_generate_config(INSTALL_DIR ${INSTALL_DIR}/windows SYSTEM_NAME Windows HANDLE_SUBDIRS ${COMMON_ARGS})
|
||||
tbb_generate_config(INSTALL_DIR ${INSTALL_DIR}/darwin SYSTEM_NAME Darwin ${COMMON_ARGS})
|
||||
tbb_generate_config(INSTALL_DIR ${INSTALL_DIR}/windows SYSTEM_NAME Windows HANDLE_SUBDIRS DLL_REL_PATH ${DLL_REL_PATH} ${COMMON_ARGS})
|
||||
tbb_generate_config(INSTALL_DIR ${INSTALL_DIR}/darwin SYSTEM_NAME Darwin ${COMMON_ARGS})
|
||||
message(STATUS "TBBConfig files were created in ${INSTALL_DIR}")
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# LSAN suppression for ltdl library known issue.
|
||||
leak:libltdl.so
|
||||
@@ -1,4 +0,0 @@
|
||||
# TSAN suppression for known issues.
|
||||
# Possible data race during ittnotify initialization. Low impact.
|
||||
race:__itt_nullify_all_pointers
|
||||
race:__itt_init_ittlib
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2017-2023 Intel Corporation
|
||||
# Copyright (c) 2017-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -43,38 +43,14 @@ if (NOT _tbbmalloc_proxy_ix EQUAL -1)
|
||||
set(TBB_FIND_REQUIRED_tbbmalloc ${TBB_FIND_REQUIRED_tbbmalloc_proxy})
|
||||
endif()
|
||||
unset(_tbbmalloc_proxy_ix)
|
||||
|
||||
if (CMAKE_SIZEOF_VOID_P STREQUAL "8")
|
||||
set(_tbb_intel_arch intel64)
|
||||
else ()
|
||||
set(_tbb_intel_arch ia32)
|
||||
set(_tbb_arch_suffix 32)
|
||||
endif()
|
||||
|
||||
@TBB_HANDLE_SUBDIRS@
|
||||
foreach (_tbb_component ${TBB_FIND_COMPONENTS})
|
||||
unset(_tbb_release_dll CACHE)
|
||||
unset(_tbb_debug_dll CACHE)
|
||||
unset(_tbb_release_lib CACHE)
|
||||
unset(_tbb_debug_lib CACHE)
|
||||
|
||||
set(TBB_${_tbb_component}_FOUND 0)
|
||||
@TBB_HANDLE_BIN_VERSION@
|
||||
|
||||
find_library(_tbb_release_lib
|
||||
NAMES @TBB_LIB_PREFIX@${_tbb_component}${_bin_version}.@TBB_LIB_EXT@
|
||||
PATHS ${_tbb_root}
|
||||
PATH_SUFFIXES "@TBB_LIB_REL_PATH@/${_tbb_intel_arch}/${_tbb_subdir}" "@TBB_LIB_REL_PATH@${_tbb_arch_suffix}/${_tbb_subdir}" "@TBB_LIB_REL_PATH@${_tbb_arch_suffix}" "@TBB_LIB_REL_PATH@"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
get_filename_component(_tbb_release_lib "${_tbb_root}/@TBB_LIB_REL_PATH@/${_tbb_subdir}/@TBB_LIB_PREFIX@${_tbb_component}${_bin_version}.@TBB_LIB_EXT@" ABSOLUTE)
|
||||
|
||||
if (NOT TBB_FIND_RELEASE_ONLY)
|
||||
find_library(_tbb_debug_lib
|
||||
NAMES @TBB_LIB_PREFIX@${_tbb_component}${_bin_version}_debug.@TBB_LIB_EXT@
|
||||
PATHS ${_tbb_root}
|
||||
PATH_SUFFIXES "@TBB_LIB_REL_PATH@/${_tbb_intel_arch}/${_tbb_subdir}" "@TBB_LIB_REL_PATH@${_tbb_arch_suffix}/${_tbb_subdir}" "@TBB_LIB_REL_PATH@${_tbb_arch_suffix}" "@TBB_LIB_REL_PATH@"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
get_filename_component(_tbb_debug_lib "${_tbb_root}/@TBB_LIB_REL_PATH@/${_tbb_subdir}/@TBB_LIB_PREFIX@${_tbb_component}${_bin_version}_debug.@TBB_LIB_EXT@" ABSOLUTE)
|
||||
endif()
|
||||
|
||||
if (EXISTS "${_tbb_release_lib}" OR EXISTS "${_tbb_debug_lib}")
|
||||
@@ -87,17 +63,15 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})
|
||||
unset(_tbb_current_realpath)
|
||||
unset(_tbb_include_dir)
|
||||
|
||||
@TBB_HANDLE_IMPLIB@
|
||||
|
||||
if (EXISTS "${_tbb_release_dll}")
|
||||
if (EXISTS "${_tbb_release_lib}")
|
||||
set_target_properties(TBB::${_tbb_component} PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${_tbb_release_dll}"@TBB_IMPLIB_RELEASE@)
|
||||
IMPORTED_LOCATION_RELEASE "${_tbb_release_lib}"@TBB_IMPLIB_RELEASE@)
|
||||
set_property(TARGET TBB::${_tbb_component} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
endif()
|
||||
|
||||
if (EXISTS "${_tbb_debug_dll}")
|
||||
if (EXISTS "${_tbb_debug_lib}")
|
||||
set_target_properties(TBB::${_tbb_component} PROPERTIES
|
||||
IMPORTED_LOCATION_DEBUG "${_tbb_debug_dll}"@TBB_IMPLIB_DEBUG@)
|
||||
IMPORTED_LOCATION_DEBUG "${_tbb_debug_lib}"@TBB_IMPLIB_DEBUG@)
|
||||
set_property(TARGET TBB::${_tbb_component} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
endif()
|
||||
|
||||
@@ -119,10 +93,6 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})
|
||||
endif()
|
||||
endforeach()
|
||||
list(REMOVE_DUPLICATES TBB_IMPORTED_TARGETS)
|
||||
unset(_tbb_release_dll)
|
||||
unset(_tbb_debug_dll)
|
||||
unset(_tbb_release_lib)
|
||||
unset(_tbb_debug_lib)
|
||||
unset(_tbb_root)
|
||||
unset(_tbb_intel_arch)
|
||||
unset(_tbb_arch_suffix)
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
# Copyright (c) 2023 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Prevent double invocation.
|
||||
if (RISCV_TOOLCHAIN_INCLUDED)
|
||||
return()
|
||||
endif()
|
||||
set(RISCV_TOOLCHAIN_INCLUDED TRUE)
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_VERSION 1)
|
||||
set(CMAKE_SYSTEM_PROCESSOR riscv)
|
||||
|
||||
# User can use -DCMAKE_FIND_ROOT_PATH to specific toolchain path
|
||||
set(CMAKE_C_COMPILER ${CMAKE_FIND_ROOT_PATH}/bin/riscv64-unknown-linux-gnu-clang)
|
||||
set(CMAKE_CXX_COMPILER ${CMAKE_FIND_ROOT_PATH}/bin/riscv64-unknown-linux-gnu-clang++)
|
||||
set(CMAKE_LINKER ${CMAKE_FIND_ROOT_PATH}/bin/riscv64-unknown-linux-gnu-ld)
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
|
||||
# Most linux on riscv64 support rv64imafd_zba_zbb extensions
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=rv64imafd_zba_zbb -mabi=lp64d " CACHE INTERNAL "")
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2020-2024 Intel Corporation
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -18,57 +18,27 @@ macro(tbb_remove_compile_flag flag)
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_OPTIONS ${_tbb_compile_options})
|
||||
unset(_tbb_compile_options)
|
||||
if (CMAKE_CXX_FLAGS)
|
||||
string(REGEX REPLACE "(^|[ \t\r\n]+)${flag}($|[ \t\r\n]+)" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(tbb_install_target target)
|
||||
if (TBB_INSTALL)
|
||||
install(TARGETS ${target}
|
||||
EXPORT TBBTargets
|
||||
LIBRARY
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
NAMELINK_SKIP
|
||||
COMPONENT runtime
|
||||
RUNTIME
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
COMPONENT runtime
|
||||
ARCHIVE
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
COMPONENT devel
|
||||
FRAMEWORK
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
COMPONENT runtime
|
||||
OPTIONAL)
|
||||
install(TARGETS ${target}
|
||||
EXPORT TBBTargets
|
||||
LIBRARY
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
NAMELINK_SKIP
|
||||
COMPONENT runtime
|
||||
RUNTIME
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
COMPONENT runtime
|
||||
ARCHIVE
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
COMPONENT devel)
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
install(TARGETS ${target}
|
||||
LIBRARY
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
NAMELINK_ONLY
|
||||
COMPONENT devel)
|
||||
endif()
|
||||
if (MSVC AND BUILD_SHARED_LIBS)
|
||||
install(FILES $<TARGET_PDB_FILE:${target}>
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
COMPONENT devel
|
||||
OPTIONAL)
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(tbb_handle_ipo target)
|
||||
if (TBB_IPO_PROPERTY)
|
||||
set_target_properties(${target} PROPERTIES
|
||||
INTERPROCEDURAL_OPTIMIZATION TRUE
|
||||
INTERPROCEDURAL_OPTIMIZATION_DEBUG FALSE
|
||||
)
|
||||
elseif (TBB_IPO_FLAGS)
|
||||
target_compile_options(${target} PRIVATE ${TBB_IPO_COMPILE_FLAGS})
|
||||
if (COMMAND target_link_options)
|
||||
target_link_options(${target} PRIVATE ${TBB_IPO_LINK_FLAGS})
|
||||
else()
|
||||
target_link_libraries(${target} PRIVATE ${TBB_IPO_LINK_FLAGS})
|
||||
endif()
|
||||
endif()
|
||||
install(TARGETS ${target}
|
||||
LIBRARY
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
NAMELINK_ONLY
|
||||
COMPONENT devel)
|
||||
endmacro()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2020-2024 Intel Corporation
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -26,20 +26,12 @@ get_filename_component(TBB_VARS_TEMPLATE_NAME ${PROJECT_SOURCE_DIR}/integration/
|
||||
string(REPLACE ".in" "" TBB_VARS_NAME ${TBB_VARS_TEMPLATE_NAME})
|
||||
|
||||
macro(tbb_gen_vars target)
|
||||
if (NOT TBB_BUILD_APPLE_FRAMEWORKS)
|
||||
set(BIN_PATH $<TARGET_FILE_DIR:${target}>)
|
||||
else()
|
||||
# For Apple* frameworks, the binaries are placed in a framework bundle.
|
||||
# When using an Apple* framework, you refer to the bundle, not the binary inside, so we take the bundle's path and go up one level.
|
||||
# This path will then be used to generate the vars file, and the contents of the vars file will use the bundle's parent directory.
|
||||
set(BIN_PATH $<TARGET_BUNDLE_DIR:${target}>/..)
|
||||
endif()
|
||||
if (${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
|
||||
add_custom_command(TARGET ${target} POST_BUILD COMMAND
|
||||
${CMAKE_COMMAND}
|
||||
-DBINARY_DIR=${CMAKE_BINARY_DIR}
|
||||
-DSOURCE_DIR=${PROJECT_SOURCE_DIR}
|
||||
-DBIN_PATH=${BIN_PATH}
|
||||
-DBIN_PATH=$<TARGET_FILE_DIR:${target}>
|
||||
-DVARS_TEMPLATE=${TBB_VARS_TEMPLATE}
|
||||
-DVARS_NAME=${TBB_VARS_NAME}
|
||||
-DTBB_INSTALL_VARS=${TBB_INSTALL_VARS}
|
||||
|
||||
|
Before Width: | Height: | Size: 52 KiB |
@@ -1,20 +0,0 @@
|
||||
.. _Get_Started_Guide:
|
||||
|
||||
Get Started with |full_name|
|
||||
=============================
|
||||
|
||||
.. include:: /GSG/intro_gsg.rst
|
||||
|
||||
To start using oneTBB, follow the next steps:
|
||||
*********************************************
|
||||
|
||||
#. See the :ref:`System Requirements<system_requirements>`.
|
||||
#. :ref:`Install oneTBB<installation>`.
|
||||
#. Run your program using oneTBB following the :ref:`Next Steps <next_steps>`.
|
||||
#. Learn how to :ref:`Integrate oneTBB into your project <integrate>` using CMake* and pkg-config tool.
|
||||
#. See :ref:`oneTBB Samples <samples>`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
.. _installation:
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
See the `installation instructions <https://github.com/uxlfoundation/oneTBB/blob/master/INSTALL.md>`_
|
||||
that will help you to install |short_name| successfully.
|
||||
@@ -1,80 +0,0 @@
|
||||
.. _integrate:
|
||||
|
||||
Integrate oneTBB
|
||||
================
|
||||
|
||||
If you want to improve the performance and scalability of your application, you can integrate oneTBB into your project.
|
||||
For example, you may want to integrate oneTBB if your application needs to process large amounts of data in parallel.
|
||||
|
||||
To integrate oneTBB, you need to:
|
||||
|
||||
* Link oneTBB with the project's source code.
|
||||
* Provide the necessary compiler and linker flags.
|
||||
|
||||
However, you can use CMake* and the pkg-config tool to simplify the process of integrating oneTBB into your project and handling its dependencies.
|
||||
See the instructions below to learn how to use the tools.
|
||||
|
||||
Integrate oneTBB with CMake*
|
||||
****************************
|
||||
|
||||
CMake* is a cross-platform build tool that helps you manage dependencies and build systems.
|
||||
Integrating oneTBB into your project using CMake*:
|
||||
|
||||
* Simplifies the process of building and linking against the library.
|
||||
* Ensures that your project can be built and run on multiple platforms.
|
||||
* Lets you manage oneTBB dependencies.
|
||||
|
||||
To add oneTBB to another project using CMake*, add the following commands to your ``CMakeLists.txt`` file:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
find_package(TBB REQUIRED)
|
||||
target_link_libraries(my_executable TBB::tbb)
|
||||
|
||||
Additionally, you can also enable experimental C++20 modules support for TBB using the following commands
|
||||
(see :ref:`cxx20_modules_support` for details):
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
get_target_property(_tbb_include_dir TBB::tbb INTERFACE_INCLUDE_DIRECTORIES)
|
||||
target_sources(my_executable PRIVATE
|
||||
FILE_SET cxx_modules TYPE CXX_MODULES
|
||||
BASE_DIRS ${_tbb_include_dir}
|
||||
FILES ${_tbb_include_dir}/oneapi/tbb.cppm
|
||||
)
|
||||
|
||||
After that, configure your project with CMake* as usual.
|
||||
|
||||
|
||||
Compile a Program Using pkg-config
|
||||
***********************************
|
||||
|
||||
The pkg-config tool is used to simplify the compilation line by retrieving information about packages
|
||||
from special metadata files. It helps avoid large hard-coded paths and makes compilation more portable.
|
||||
|
||||
To compile a test program ``test.cpp`` with oneTBB on Linux* OS,
|
||||
provide the full path to search for included files and libraries, or provide a line as the following:
|
||||
|
||||
.. code-block::
|
||||
|
||||
g++ -o test test.cpp $(pkg-config --libs --cflags tbb)
|
||||
|
||||
Where:
|
||||
|
||||
``--cflags`` provides oneTBB library include path:
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ pkg-config --cflags tbb
|
||||
-I<path-to>/tbb/latest/lib/pkgconfig/../../include
|
||||
|
||||
``--libs`` provides the Intel(R) oneTBB library name and the search path to find it:
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ pkg-config –libs tbb
|
||||
-L<path to>tbb/latest/lib/pkgconfig/../../lib/intel64/gcc4.8 -ltbb
|
||||
|
||||
.. note::
|
||||
|
||||
For Windows* OS, additionally, use the ``--msvc-syntax`` option flag that converts the compiling and linking flags in an appropriate mode.
|
||||
@@ -1,29 +0,0 @@
|
||||
|short_name| Get Started Guide provides the information you need to begin working with oneTBB.
|
||||
It is helpful for new users of parallel programming and experienced developers that want to improve code performance.
|
||||
|
||||
It is recommended for you to have a basic knowledge of C++ programming and some experience with parallel programming concepts.
|
||||
|
||||
|full_name| is a runtime-based parallel programming model for C++ code that uses tasks.
|
||||
The template-based runtime library can help you harness the latent performance of multi-core processors.
|
||||
|
||||
oneTBB enables you to simplify parallel programming by breaking computation into parallel running tasks. Within a single process,
|
||||
parallelism is carried out by mapping tasks to threads. Threads are an operating system mechanism that allows the same or different sets of instructions
|
||||
to be executed simultaneously. Using threads can make your program work faster and more efficiently.
|
||||
|
||||
Here you can see one of the possible executions of tasks by threads.
|
||||
|
||||
.. figure:: /GSG/Images/how-oneTBB-works.png
|
||||
:scale: 70%
|
||||
:align: center
|
||||
|
||||
Use oneTBB to write scalable applications that:
|
||||
|
||||
* Specify logical parallel structure instead of threads.
|
||||
* Emphasize data-parallel programming.
|
||||
* Take advantage of concurrent collections and parallel algorithms.
|
||||
|
||||
oneTBB supports nested parallelism and load balancing. It means that you can use the library without worrying about oversubscribing a system, which happens when more tasks are assigned to a system than it can handle efficiently.
|
||||
|
||||
oneTBB is used in different areas, such as scientific simulations, gaming, data analysis, etc.
|
||||
|
||||
It is available as a stand-alone product and as part of the |toolkit|.
|
||||
@@ -1,145 +0,0 @@
|
||||
.. _next_steps:
|
||||
|
||||
Next Steps
|
||||
===========
|
||||
|
||||
After installing oneTBB, complete the following steps to start working with the library.
|
||||
|
||||
Set the Environment Variables
|
||||
*****************************
|
||||
|
||||
After installing |short_name|, set the environment variables:
|
||||
|
||||
#. Go to the oneTBB installation directory.
|
||||
|
||||
#. Set the environment variables using the script in ``<install_dir>`` by running:
|
||||
|
||||
* On Linux* OS: ``vars.{sh|csh} in <install_dir>/tbb/latest/env``
|
||||
* On Windows* OS: ``vars.bat in <install_dir>/tbb/latest/env``
|
||||
|
||||
.. tip::
|
||||
|
||||
oneTBB can coordinate with Intel(R) OpenMP on CPU resources usage to avoid
|
||||
excessive oversubscription when both runtimes are used within a process. To
|
||||
enable this feature set ``TCM_ENABLE`` environment variable to ``1``. For
|
||||
more details, see :ref:`avoid_cpu_overutilization`.
|
||||
|
||||
|
||||
Build and Run a Sample
|
||||
**********************
|
||||
|
||||
.. tab-set::
|
||||
|
||||
.. tab-item:: Windows* OS
|
||||
|
||||
#. Create a new C++ project using your IDE. In this example, Microsoft* Visual Studio* Code is used.
|
||||
#. Create an ``example.cpp`` file in the project.
|
||||
#. Copy and paste the code below. It is a typical example of a |short_name| algorithm. The sample calculates a sum of all integer numbers from 1 to 100.
|
||||
|
||||
.. code::
|
||||
|
||||
#include <oneapi/tbb.h>
|
||||
|
||||
int main (){
|
||||
int sum = oneapi::tbb::parallel_reduce(
|
||||
oneapi::tbb::blocked_range<int>(1,101), 0,
|
||||
[](oneapi::tbb::blocked_range<int> const& r, int init) -> int {
|
||||
for (int v = r.begin(); v != r.end(); v++) {
|
||||
init += v;
|
||||
}
|
||||
return init;
|
||||
},
|
||||
[](int lhs, int rhs) -> int {
|
||||
return lhs + rhs;
|
||||
}
|
||||
);
|
||||
|
||||
printf("Sum: %d\n", sum);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#. Open the ``tasks.json`` file in the ``.vscode`` directory and paste the following lines to the args array:
|
||||
|
||||
* ``-Ipath/to/oneTBB/include`` to add oneTBB include directory.
|
||||
* ``path/to/oneTBB/`` to add oneTBB.
|
||||
|
||||
For example:
|
||||
|
||||
.. code-block::
|
||||
|
||||
{
|
||||
"tasks": [
|
||||
{
|
||||
"label": "build & run",
|
||||
"type": "cppbuild",
|
||||
"group": {
|
||||
"args": [
|
||||
"/IC:\\Program Files (x86)\\Intel\\oneAPI\\tbb\\2022.0.0\\include",
|
||||
"C:\\Program Files (x86)\\Intel\\oneAPI\\tbb\\2022.0.0\\lib\\tbb12.lib"
|
||||
|
||||
|
||||
#. Build the project.
|
||||
#. Run the example.
|
||||
#. If oneTBB is configured correctly, the output displays ``Sum: 5050``.
|
||||
|
||||
.. tab-item:: Linux* OS
|
||||
|
||||
#. Create an ``example.cpp`` file in the project.
|
||||
#. Copy and paste the code below. It is a typical example of a |short_name| algorithm. The sample calculates a sum of all integer numbers from 1 to 100.
|
||||
|
||||
.. code::
|
||||
|
||||
#include <oneapi/tbb.h>
|
||||
|
||||
int main(){
|
||||
int sum = oneapi::tbb::parallel_reduce(
|
||||
oneapi::tbb::blocked_range<int>(1,101), 0,
|
||||
[](oneapi::tbb::blocked_range<int> const& r, int init) -> int {
|
||||
for (int v = r.begin(); v != r.end(); v++) {
|
||||
init += v;
|
||||
}
|
||||
return init;
|
||||
},
|
||||
[](int lhs, int rhs) -> int {
|
||||
return lhs + rhs;
|
||||
}
|
||||
);
|
||||
|
||||
printf("Sum: %d\n", sum);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#. Compile the code using oneTBB. For example,
|
||||
|
||||
.. code-block::
|
||||
|
||||
g++ -std=c++11 example.cpp -o example -ltbb
|
||||
|
||||
|
||||
#. Run the executable:
|
||||
|
||||
.. code-block::
|
||||
|
||||
./example
|
||||
|
||||
#. If oneTBB is configured correctly, the output displays ``Sum: 5050``.
|
||||
|
||||
|
||||
|
||||
Enable Hybrid CPU and NUMA Support
|
||||
***********************************
|
||||
|
||||
To support Hybrid CPU and NUMA platforms, oneTBB relies on the HWLOC* library.
|
||||
|
||||
The HWLOC functionality is accessed through a set of proxy libraries whose names begin with the ``tbbbind`` prefix. oneTBB automatically loads them at runtime when needed. To find and load these libraries successfully, locate them in the same directory as the oneTBB library itself (e.g., alongside ``libtbb.so`` or ``tbb.dll``).
|
||||
|
||||
Starting with oneTBB 2022.2, the default ``tbbbind`` library is statically linked with HWLOC 2.x. This version is used if a system-provided HWLOC cannot be found.
|
||||
|
||||
If you prefer to use a system-provided or custom-built version of HWLOC, make sure it is available in the search paths used by the dynamic loader. Consult your platform’s dynamic loader documentation for details about these paths (e.g., ``LD_LIBRARY_PATH`` on Linux* OS or ``PATH`` on Windows* OS).
|
||||
|
||||
To use a specific HWLOC version, place one of the following tbbbind variants in the same directory as the oneTBB library:
|
||||
|
||||
* ``tbbbind_2_5`` — depends on HWLOC version 2.5 or higher. Use this version if hybrid CPU support is required.
|
||||
* ``tbbbind_2_0`` — depends on HWLOC versions 2.1 to 2.4.
|
||||
|
||||
.. tip:: To confirm that tbbbind is loaded successfully at runtime, set the environment variable ``TBB_VERSION=1`` before launching your application.
|
||||
@@ -1,49 +0,0 @@
|
||||
.. _samples:
|
||||
|
||||
oneTBB Samples
|
||||
==============
|
||||
|
||||
To become an expert in using oneTBB, explore its samples and examples to learn how
|
||||
to properly utilize the features and functionality of oneTBB and avoid common mistakes that may impede your performance.
|
||||
|
||||
The following samples are available:
|
||||
|
||||
* **Containers**
|
||||
|
||||
* `concurrent_hash_map <https://github.com/uxlfoundation/oneTBB/tree/master/examples/concurrent_hash_map>`_
|
||||
* `concurrent_priority_queue <https://github.com/uxlfoundation/oneTBB/tree/master/examples/concurrent_priority_queue>`_
|
||||
|
||||
* `Flow Graph <https://github.com/uxlfoundation/oneTBB/tree/master/examples/graph>`_
|
||||
* `A solution to the binpacking problem using a queue_node, a buffer_node, and function_node. <https://github.com/uxlfoundation/oneTBB/tree/master/examples/graph/binpack>`_
|
||||
* `Cholesky Factorization algorithm <https://github.com/uxlfoundation/oneTBB/tree/master/examples/graph/cholesky>`_
|
||||
* `An implementation of dining philosophers in graph using the reserving join_node <https://github.com/uxlfoundation/oneTBB/tree/master/examples/graph/dining_philosophers>`_
|
||||
* `A parallel implementation of bzip2 block-sorting file compressor <https://github.com/uxlfoundation/oneTBB/tree/master/examples/graph/fgbzip2>`_
|
||||
* `An example of a collection of digital logic gates that can be easily composed into larger circuits <https://github.com/uxlfoundation/oneTBB/tree/master/examples/graph/logic_sim>`_
|
||||
* `An example of a Kohonen Self-Organizing Map using cancellation <https://github.com/uxlfoundation/oneTBB/tree/master/examples/graph/som>`_
|
||||
* `Split computational kernel for execution between CPU and GPU <https://github.com/uxlfoundation/oneTBB/tree/master/examples/sycl/tbb-async-sycl>`_
|
||||
|
||||
* **Algorithms**
|
||||
|
||||
* `parallel_for <https://github.com/uxlfoundation/oneTBB/tree/master/examples/parallel_for>`_
|
||||
* `Game of life overlay <https://github.com/uxlfoundation/oneTBB/tree/master/examples/parallel_for/game_of_life>`_
|
||||
* `Polygon overlay <https://github.com/uxlfoundation/oneTBB/tree/master/examples/parallel_for/polygon_overlay>`_
|
||||
* `Parallel seismic wave simulation <https://github.com/uxlfoundation/oneTBB/tree/master/examples/parallel_for/seismic>`_
|
||||
* `Parallel 2-D raytracer/renderer <https://github.com/uxlfoundation/oneTBB/tree/master/examples/parallel_for/tachyon>`_
|
||||
* `Find largest matching substrings <https://github.com/uxlfoundation/oneTBB/tree/master/examples/getting_started>`_
|
||||
* `Resumable task: Split computational kernel for execution between CPU and GPU <https://github.com/uxlfoundation/oneTBB/tree/master/examples/sycl/tbb-resumable-tasks-sycl>`_
|
||||
* `parallel_for_each <https://github.com/uxlfoundation/oneTBB/tree/master/examples/parallel_for_each>`_
|
||||
* `parallel_pipeline <https://github.com/uxlfoundation/oneTBB/tree/master/examples/parallel_pipeline>`_
|
||||
* `parallel_reduce <https://github.com/uxlfoundation/oneTBB/tree/master/examples/parallel_reduce>`_
|
||||
|
||||
* **Task Scheduler**
|
||||
|
||||
* `task_arena <https://github.com/uxlfoundation/oneTBB/tree/master/examples/task_arena>`_
|
||||
* `task_group <https://github.com/uxlfoundation/oneTBB/tree/master/examples/task_group>`_
|
||||
* `Execute similar computational kernels, with one task executing the SYCL* code and the other task executing the oneTBB code <https://github.com/uxlfoundation/oneTBB/tree/master/examples/sycl/tbb-task-sycl>`_
|
||||
|
||||
* **Other**
|
||||
|
||||
* `Compute Fibonacci numbers in different ways <https://github.com/uxlfoundation/oneTBB/tree/master/examples/test_all>`_
|
||||
|
||||
|
||||
.. note:: You can also refer to the `oneAPI Samples <https://oneapi-src.github.io/oneAPI-samples/>`_ to learn more about the ecosystem.
|
||||
@@ -1,7 +0,0 @@
|
||||
.. _System_Requirements:
|
||||
|
||||
System Requirements
|
||||
*******************
|
||||
|
||||
|full_name| supports a broad list of hardware platforms, operating systems, and compilers.
|
||||
For details, see `oneTBB System Requirements <https://github.com/uxlfoundation/oneTBB/blob/master/SYSTEM_REQUIREMENTS.md>`_.
|
||||
@@ -1,36 +0,0 @@
|
||||
#===============================================================================
|
||||
# Copyright (C) 2022 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#===============================================================================
|
||||
|
||||
# Minimal makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line, and also
|
||||
# from the environment for the first two.
|
||||
SPHINXOPTS ?=
|
||||
SPHINXBUILD ?= sphinx-build
|
||||
SOURCEDIR = .
|
||||
BUILDDIR = build
|
||||
|
||||
# Put it first so that "make" without argument is like "make help".
|
||||
help:
|
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
.PHONY: help Makefile
|
||||
|
||||
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||
%: Makefile
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
@@ -1,34 +0,0 @@
|
||||
# How to build oneTBB documentation
|
||||
|
||||
Our documentation is written in restructured text markup (.rst) and built using [Sphinx](http://www.sphinx-doc.org/en/master/).
|
||||
|
||||
This document explains how to build oneTBB documentation locally.
|
||||
|
||||
## Prerequisites
|
||||
- Python 3.7.0 or higher
|
||||
- Sphinx
|
||||
|
||||
## Build documentation
|
||||
|
||||
Do the following to generate HTML output of the documentation:
|
||||
|
||||
1. Clone oneTBB repository:
|
||||
|
||||
```
|
||||
git clone https://github.com/uxlfoundation/oneTBB.git
|
||||
```
|
||||
|
||||
2. Go to the `doc` folder:
|
||||
|
||||
```
|
||||
cd oneTBB/doc
|
||||
```
|
||||
|
||||
3. Run in the command line:
|
||||
|
||||
```
|
||||
make html
|
||||
```
|
||||
|
||||
|
||||
That's it! Your built documentation is located in the ``build/html`` folder.
|
||||
@@ -1,37 +0,0 @@
|
||||
window.MathJax = {
|
||||
TeX: {
|
||||
Macros: {
|
||||
src: '\\operatorname{src}',
|
||||
srclayer: '\\operatorname{src\\_layer}',
|
||||
srciter: '\\operatorname{src\\_iter}',
|
||||
srciterc: '\\operatorname{src\\_iter\\_c}',
|
||||
weights: '\\operatorname{weights}',
|
||||
weightslayer: '\\operatorname{weights\\_layer}',
|
||||
weightsiter: '\\operatorname{weights\\_iter}',
|
||||
weightspeephole: '\\operatorname{weights\\_peephole}',
|
||||
weightsprojection: '\\operatorname{weights\\_projection}',
|
||||
bias: '\\operatorname{bias}',
|
||||
dst: '\\operatorname{dst}',
|
||||
dstlayer: '\\operatorname{dst\\_layer}',
|
||||
dstiter: '\\operatorname{dst\\_iter}',
|
||||
dstiterc: '\\operatorname{dst\\_iter\\_c}',
|
||||
diffsrc: '\\operatorname{diff\\_src}',
|
||||
diffsrclayer: '\\operatorname{diff\\_src\\_layer}',
|
||||
diffsrciter: '\\operatorname{diff\\_src\\_iter}',
|
||||
diffsrciterc: '\\operatorname{diff\\_src\\_iter\\_c}',
|
||||
diffweights: '\\operatorname{diff\\_weights}',
|
||||
diffweightslayer: '\\operatorname{diff\\_weights\\_layer}',
|
||||
diffweightsiter: '\\operatorname{diff\\_weights\\_iter}',
|
||||
diffweightspeephole: '\\operatorname{diff\\_weights\\_peephole}',
|
||||
diffweightsprojection: '\\operatorname{diff\\_weights\\_projection}',
|
||||
diffbias: '\\operatorname{diff\\_bias}',
|
||||
diffdst: '\\operatorname{diff\\_dst}',
|
||||
diffdstlayer: '\\operatorname{diff\\_dst\\_layer}',
|
||||
diffdstiter: '\\operatorname{diff\\_dst\\_iter}',
|
||||
diffdstiterc: '\\operatorname{diff\\_dst\\_iter\\_c}',
|
||||
diffgamma: '\\operatorname{diff\\_\\gamma}',
|
||||
diffbeta: '\\operatorname{diff\\_\\beta}',
|
||||
workspace: '\\operatorname{workspace}'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 467 B |
|
Before Width: | Height: | Size: 7.2 KiB |
@@ -1,13 +0,0 @@
|
||||
/* override table width restrictions */
|
||||
@media screen and (min-width: 767px) {
|
||||
|
||||
.wy-table-responsive table td {
|
||||
/* !important prevents the common CSS stylesheets from overriding
|
||||
this as on RTD they are loaded after this stylesheet */
|
||||
white-space: normal !important;
|
||||
}
|
||||
|
||||
.wy-table-responsive {
|
||||
overflow: visible !important;
|
||||
}
|
||||
}
|
||||
@@ -1,367 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# This file does only contain a selection of the most common options. For a
|
||||
# full list see the documentation:
|
||||
# http://www.sphinx-doc.org/en/master/config
|
||||
|
||||
# -- Path setup --------------------------------------------------------------
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#
|
||||
import os
|
||||
from docutils import nodes
|
||||
# import sys
|
||||
# sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
SOURCE_DIR = os.path.dirname(__file__)
|
||||
LATEX_DIR = os.path.join(SOURCE_DIR, '_latex')
|
||||
PREAMBLE_FILE = os.path.join(LATEX_DIR, 'preamble.tex')
|
||||
TITLE_PAGE_FILE = os.path.join(LATEX_DIR, 'title_page.tex')
|
||||
|
||||
BUILD_TYPE = os.getenv("BUILD_TYPE")
|
||||
|
||||
# Set up tags for conditional content
|
||||
# Tags allow using .. only:: directives in RST files
|
||||
if BUILD_TYPE == 'oss' or BUILD_TYPE is None:
|
||||
tags.add('oss')
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
|
||||
project = u'Intel® oneAPI Threading Building Blocks (oneTBB)'
|
||||
else:
|
||||
project = u'oneTBB'
|
||||
copyright = u'UXL Foundation Contributors'
|
||||
author = u''
|
||||
|
||||
# The short X.Y version
|
||||
version = u''
|
||||
# The full version, including alpha/beta/rc tags
|
||||
release = u''
|
||||
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#
|
||||
# needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.doctest',
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.todo',
|
||||
'sphinx.ext.coverage',
|
||||
'sphinx.ext.imgmath',
|
||||
'sphinx.ext.ifconfig',
|
||||
'sphinx.ext.viewcode',
|
||||
'sphinx.ext.githubpages',
|
||||
'sphinx_design'
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['main/_templates']
|
||||
|
||||
# The suffix(es) of source filenames.
|
||||
# You can specify multiple suffix as a list of string:
|
||||
#
|
||||
# source_suffix = ['.rst', '.md']
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The master toctree document.
|
||||
#master_doc = 'main/title_main'
|
||||
master_doc = 'index'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = 'en'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This pattern also affects html_static_path and html_extra_path.
|
||||
# Base exclude patterns - specification files that should never be built
|
||||
exclude_patterns = [
|
||||
'main/specification/source/nested-*.rst',
|
||||
'main/specification/source/uncategorized.rst',
|
||||
'main/specification/source/uncategorized/**',
|
||||
'main/specification/source/low_level_task_api.rst',
|
||||
'main/specification/source/low_level_tasking/**',
|
||||
]
|
||||
|
||||
# Specification is only included in OSS builds (GitHub Pages)
|
||||
# Intel builds (oneapi/dita) automatically exclude the entire specification directory
|
||||
if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
|
||||
exclude_patterns.append('main/specification/**')
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = None
|
||||
|
||||
# Syntax highlighting for the :: directive
|
||||
highlight_language = 'cpp'
|
||||
|
||||
if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
|
||||
rst_prolog = """
|
||||
.. |full_name| replace:: Intel\ |reg|\ oneAPI Threading Building Blocks (oneTBB)
|
||||
.. |short_name| replace:: oneTBB
|
||||
.. |product| replace:: oneTBB
|
||||
.. |reg| unicode:: U+000AE
|
||||
.. |copy| unicode:: U+000A9
|
||||
.. |toolkit| replace:: Intel\ |reg|\ oneAPI Toolkit (oneAPI Kit)
|
||||
.. |dpcpp| replace:: Intel\ |reg|\ oneAPI DPC++/C++ Compiler
|
||||
"""
|
||||
else:
|
||||
rst_prolog = """
|
||||
.. |full_name| replace:: oneAPI Threading Building Blocks (oneTBB)
|
||||
.. |short_name| replace:: oneTBB
|
||||
.. |product| replace:: oneTBB
|
||||
.. |reg| unicode:: U+000AE
|
||||
.. |copy| unicode:: U+000A9
|
||||
.. |toolkit| replace:: Intel\ |reg|\ oneAPI Toolkit (oneAPI Kit)
|
||||
.. |dpcpp| replace:: Intel\ |reg|\ oneAPI DPC++/C++ Compiler
|
||||
"""
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#
|
||||
|
||||
html_theme = 'sphinx_book_theme'
|
||||
|
||||
if BUILD_TYPE == 'dita':
|
||||
html_theme_options = {
|
||||
'repository_url': 'https://github.com/uxlfoundation/oneTBB',
|
||||
'path_to_docs': 'doc',
|
||||
'repository_branch': 'master'
|
||||
}
|
||||
else:
|
||||
html_theme_options = {
|
||||
'repository_url': 'https://github.com/uxlfoundation/oneTBB',
|
||||
'path_to_docs': 'doc',
|
||||
'use_issues_button': True,
|
||||
'use_edit_page_button': True,
|
||||
'repository_branch': 'master',
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
|
||||
html_context = {
|
||||
'css_files': [
|
||||
'_static/theme_overrides.css', # override wide tables in RTD theme
|
||||
],
|
||||
}
|
||||
else:
|
||||
html_js_files = ['custom.js']
|
||||
|
||||
html_theme_options["logo"] = {"text": "oneTBB Documentation"}
|
||||
|
||||
html_logo = '_static/oneAPI-rgb-rev-100.png'
|
||||
html_favicon = '_static/favicons.png'
|
||||
|
||||
|
||||
# Custom sidebar templates, must be a dictionary that maps document names
|
||||
# to template names.
|
||||
#
|
||||
# The default sidebars (for documents that don't match any pattern) are
|
||||
# defined by theme itself. Builtin themes are using these templates by
|
||||
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
|
||||
# 'searchbox.html']``.
|
||||
#
|
||||
# html_sidebars = {}
|
||||
|
||||
|
||||
# -- Options for HTMLHelp output ---------------------------------------------
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'sphinx-infodevdoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output ------------------------------------------------
|
||||
|
||||
#latex_engine = 'xelatex'
|
||||
#PDF_TITLE = 'Information Development Template'
|
||||
#
|
||||
#with open(PREAMBLE_FILE, 'r', encoding='utf-8') as f:
|
||||
# PREAMBLE = f.read()
|
||||
#
|
||||
#with open(TITLE_PAGE_FILE, 'r', encoding='utf-8') as f:
|
||||
# TITLE_PAGE = f.read().replace('<PDF_TITLE>', PDF_TITLE)
|
||||
#
|
||||
#
|
||||
#latex_elements = {
|
||||
# # The paper size ('letterpaper' or 'a4paper').
|
||||
# #
|
||||
# 'extraclassoptions': 'openany,oneside',
|
||||
# 'babel' : '\\usepackage[english]{babel}',
|
||||
# 'papersize': 'a4paper',
|
||||
# 'releasename':" ",
|
||||
# # Sonny, Lenny, Glenn, Conny, Rejne, Bjarne and Bjornstrup
|
||||
# # 'fncychap': '\\usepackage[Lenny]{fncychap}',
|
||||
# 'fncychap': '',
|
||||
# #'fontpkg': '\\usepackage{amsmath,amsfonts,amssymb,amsthm}',
|
||||
#
|
||||
# 'figure_align':'htbp',
|
||||
# # The font size ('10pt', '11pt' or '12pt').
|
||||
# #
|
||||
# 'pointsize': '12pt',
|
||||
#
|
||||
# # Additional stuff for the LaTeX preamble.
|
||||
# #
|
||||
# 'preamble': PREAMBLE,
|
||||
#
|
||||
# 'maketitle': TITLE_PAGE,
|
||||
# # Latex figure (float) alignment
|
||||
# #
|
||||
# # 'figure_align': 'htbp',
|
||||
# 'sphinxsetup': \
|
||||
# 'hmargin={0.7in,0.7in}, vmargin={1in,1in}, \
|
||||
# verbatimwithframe=true, \
|
||||
# TitleColor={rgb}{0,0.686,0.941}, \
|
||||
# HeaderFamily=\\rmfamily\\bfseries, \
|
||||
# InnerLinkColor={rgb}{0,0.686,0.941}, \
|
||||
# OuterLinkColor={rgb}{0,0.686,0.941}',
|
||||
#
|
||||
# 'tableofcontents':' '
|
||||
#}
|
||||
#
|
||||
#latex_logo = '_latex/intel_logo.png'
|
||||
## Grouping the document tree into LaTeX files. List of tuples
|
||||
## (source start file, target name, title,
|
||||
## author, documentclass [howto, manual, or own class]).
|
||||
#latex_documents = [
|
||||
# (master_doc, 'sphinx-infodev.tex', u'sphinx-infodev Documentation',
|
||||
# u'Intel', 'manual'),
|
||||
#]
|
||||
|
||||
#breathe_projects = { #todd-mod
|
||||
# project: "../doxygen/xml"
|
||||
#}
|
||||
#breathe_default_project = project
|
||||
|
||||
# Setup the exhale extension
|
||||
#exhale_args = { #todd-mod
|
||||
# # These arguments are required
|
||||
# "containmentFolder": "./api",
|
||||
# "rootFileName": "library_root.rst",
|
||||
# "rootFileTitle": "Library API",
|
||||
# "doxygenStripFromPath": "..",
|
||||
# "fullApiSubSectionTitle": 'Full API'
|
||||
#}
|
||||
|
||||
|
||||
# -- Options for manual page output ------------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
(master_doc, 'sphinx-infodev', u'sphinx-infodev Documentation',
|
||||
[author], 1)
|
||||
]
|
||||
|
||||
|
||||
# -- Options for Texinfo output ----------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
(master_doc, 'sphinx-infodev', u'sphinx-infodev Documentation',
|
||||
author, 'sphinx-infodev', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
|
||||
# -- Options for Epub output -------------------------------------------------
|
||||
|
||||
# Bibliographic Dublin Core info.
|
||||
epub_title = project
|
||||
|
||||
# The unique identifier of the text. This can be a ISBN number
|
||||
# or the project homepage.
|
||||
#
|
||||
# epub_identifier = ''
|
||||
|
||||
# A unique identification for the text.
|
||||
#
|
||||
# epub_uid = ''
|
||||
|
||||
# A list of files that should not be packed into the epub file.
|
||||
epub_exclude_files = ['search.html']
|
||||
|
||||
|
||||
# -- Extension configuration -------------------------------------------------
|
||||
|
||||
# -- Options for intersphinx extension ---------------------------------------
|
||||
|
||||
# Example configuration for intersphinx: refer to the Python standard library.
|
||||
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
|
||||
|
||||
# -- Options for todo extension ----------------------------------------------
|
||||
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = True
|
||||
|
||||
|
||||
# -- Custom role for oneTBB specification links ------------------------------
|
||||
|
||||
def onetbb_spec_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
|
||||
"""
|
||||
Custom role that generates internal :doc: links for OSS builds,
|
||||
and external links for oneAPI/DITA builds.
|
||||
|
||||
Usage: :onetbb-spec:`link text <path>`
|
||||
"""
|
||||
from sphinx.util.nodes import split_explicit_title
|
||||
|
||||
# Parse the role syntax
|
||||
has_explicit_title, title, target = split_explicit_title(text)
|
||||
|
||||
if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
|
||||
# Generate external link for oneAPI/DITA builds
|
||||
url = f'https://uxlfoundation.github.io/oneTBB/main/specification/source/{target}.html'
|
||||
node = nodes.reference(rawtext, title, refuri=url, **options)
|
||||
return [node], []
|
||||
else:
|
||||
# Generate internal :doc: link for OSS builds
|
||||
doc_path = f'/main/specification/source/{target}'
|
||||
|
||||
# Create a pending_xref node that Sphinx will resolve
|
||||
from sphinx.addnodes import pending_xref
|
||||
|
||||
refnode = pending_xref(
|
||||
rawtext,
|
||||
refdomain='std',
|
||||
reftype='doc',
|
||||
reftarget=doc_path,
|
||||
refexplicit=has_explicit_title,
|
||||
refwarn=True
|
||||
)
|
||||
refnode += nodes.inline(rawtext, title)
|
||||
|
||||
return [refnode], []
|
||||
|
||||
|
||||
def setup(app):
|
||||
"""Setup function to register the custom role"""
|
||||
app.add_role('onetbb-spec', onetbb_spec_role)
|
||||
return {'version': '0.1', 'parallel_read_safe': True, 'parallel_write_safe': True}
|
||||
@@ -1,15 +0,0 @@
|
||||
|full_name|
|
||||
===========
|
||||
|
||||
.. include:: index/index_intro.rst
|
||||
|
||||
|
||||
The following are some important topics for the ``novice user``:
|
||||
|
||||
* :ref:`Get_Started_Guide` gives you a brief explanation of what oneTBB is.
|
||||
* :ref:`Benefits` describes how |short_name| differs from typical threading packages.
|
||||
* :ref:`Package_Contents` describes dynamic library files and header files for Windows*, Linux*, and macOS* operating systems used in |short_name|.
|
||||
|
||||
.. include:: index/useful_topics.rst
|
||||
|
||||
.. include:: index/toctree.rst
|
||||
@@ -1,5 +0,0 @@
|
||||
.. _index_intro:
|
||||
|
||||
This document contains information about |short_name|.
|
||||
It is a flexible performance library that let you break computation into parallel running tasks.
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
.. _toctree:
|
||||
|
||||
.. toctree::
|
||||
:caption: About
|
||||
:hidden:
|
||||
:maxdepth: 1
|
||||
|
||||
/main/intro/help_support
|
||||
/main/intro/notation
|
||||
/main/intro/intro_os
|
||||
/main/intro/Benefits
|
||||
/main/intro/testing_approach
|
||||
/main/intro/limitations.rst
|
||||
/main/intro/static_linking
|
||||
/main/intro/api_abi_changes
|
||||
|
||||
|
||||
.. toctree::
|
||||
:caption: Get Started
|
||||
:hidden:
|
||||
:maxdepth: 1
|
||||
|
||||
/GSG/get_started
|
||||
/GSG/system_requirements
|
||||
/GSG/installation
|
||||
/GSG/next_steps
|
||||
/GSG/integrate
|
||||
/GSG/samples
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
:hidden:
|
||||
:caption: Developer Guide
|
||||
|
||||
/main/tbb_userguide/title
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
:hidden:
|
||||
:caption: Developer Reference
|
||||
|
||||
/main/reference/reference
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
:hidden:
|
||||
:caption: Specification
|
||||
|
||||
/main/specification/source/index
|
||||
@@ -1,5 +0,0 @@
|
||||
.. _Usefull_Topics:
|
||||
|
||||
The following is an important topic for the ``experienced user``:
|
||||
|
||||
:ref:`Migration_Guide` describes how to migrate from TBB to oneTBB.
|
||||
@@ -1 +0,0 @@
|
||||
{% extends "!layout.html" %}
|
||||
@@ -1,68 +0,0 @@
|
||||
# Copyright (c) 2025 Intel Corporation
|
||||
# Copyright (c) 2026 UXL Foundation Contributors
|
||||
#
|
||||
# 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.
|
||||
|
||||
cmake_minimum_required(VERSION 3.5.0...3.31.3)
|
||||
project(doc_examples_testing LANGUAGES CXX)
|
||||
|
||||
set(_reference_examples_path "${CMAKE_CURRENT_SOURCE_DIR}/../reference/examples")
|
||||
set(_userguide_examples_path "${CMAKE_CURRENT_SOURCE_DIR}/../tbb_userguide/examples")
|
||||
|
||||
# Examples that require special handling and are excluded from the generic build
|
||||
set(_doc_examples_exclude_regex
|
||||
"cxx20_module_example\\.cpp$" # requires C++20 modules support
|
||||
)
|
||||
|
||||
add_custom_target(build-doc-examples
|
||||
COMMENT "Build oneTBB documentation samples")
|
||||
set(doc_examples_test_label "doc-examples")
|
||||
|
||||
macro(add_doc_example _doc_example_path)
|
||||
get_filename_component(_doc_example_name "${_doc_example_path}" NAME_WE)
|
||||
add_executable(${_doc_example_name} EXCLUDE_FROM_ALL "${_doc_example_path}")
|
||||
|
||||
add_dependencies(${_doc_example_name} TBB::tbb TBB::tbbmalloc TBB::tbbmalloc_proxy)
|
||||
target_link_libraries(${_doc_example_name} TBB::tbb TBB::tbbmalloc TBB::tbbmalloc_proxy)
|
||||
|
||||
add_dependencies(build-doc-examples ${_doc_example_name})
|
||||
add_test(NAME ${_doc_example_name} COMMAND ${_doc_example_name})
|
||||
set_tests_properties(${_doc_example_name} PROPERTIES LABELS "${doc_examples_test_label}")
|
||||
endmacro()
|
||||
|
||||
file(GLOB_RECURSE DOC_EXAMPLES_LIST "${_reference_examples_path}/*.cpp" "${_userguide_examples_path}/*.cpp")
|
||||
list(FILTER DOC_EXAMPLES_LIST EXCLUDE REGEX "${_doc_examples_exclude_regex}")
|
||||
|
||||
foreach(_doc_example_path IN LISTS DOC_EXAMPLES_LIST)
|
||||
add_doc_example(${_doc_example_path})
|
||||
endforeach()
|
||||
|
||||
if (TBB_TEST_CXX20_MODULES)
|
||||
if (CMAKE_VERSION VERSION_LESS 3.28)
|
||||
message(WARNING "CMake 3.28 or higher is required for C++20 modules, skipping cxx20_module_example")
|
||||
else()
|
||||
add_doc_example("${_userguide_examples_path}/cxx20_module_example.cpp")
|
||||
target_sources(cxx20_module_example PRIVATE
|
||||
FILE_SET CXX_MODULES
|
||||
BASE_DIRS ${CMAKE_SOURCE_DIR}/include
|
||||
FILES ${CMAKE_SOURCE_DIR}/include/oneapi/tbb.cppm
|
||||
)
|
||||
target_compile_features(cxx20_module_example PRIVATE cxx_std_20)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(OpenMP)
|
||||
if (OpenMP_FOUND)
|
||||
target_compile_options(tbb_mixing_other_runtimes_example PRIVATE "${OpenMP_CXX_FLAGS}")
|
||||
target_link_options(tbb_mixing_other_runtimes_example PRIVATE "${OpenMP_CXX_FLAGS}")
|
||||
endif()
|
||||
@@ -1,88 +0,0 @@
|
||||
.. _Benefits:
|
||||
|
||||
|short_name| Benefits
|
||||
=====================
|
||||
|
||||
|
||||
|full_name| is a library that helps you leverage multi-core performance
|
||||
without having to be a threading expert. Typically you can improve
|
||||
performance for multi-core processors by implementing the key points
|
||||
explained in the early sections of the Developer Guide. As your
|
||||
expertise grows, you may want to dive into more complex subjects that
|
||||
are covered in advanced sections.
|
||||
|
||||
|
||||
There are a variety of approaches to parallel programming, ranging from
|
||||
using platform-dependent threading primitives to exotic new languages.
|
||||
The advantage of oneTBB is that it works at a higher level than raw
|
||||
threads, yet does not require exotic languages or compilers. You can use
|
||||
it with any compiler supporting ISO C++. The library differs from
|
||||
typical threading packages in the following ways:
|
||||
|
||||
|
||||
- **oneTBB enables you to specify logical parallelism instead of
|
||||
threads**. Most threading packages require you to specify threads.
|
||||
Programming directly in terms of threads can be tedious and lead to
|
||||
inefficient programs, because threads are low-level, heavy constructs
|
||||
that are close to the hardware. Direct programming with threads
|
||||
forces you to efficiently map logical tasks onto threads. In
|
||||
contrast, the oneTBB run-time library automatically maps logical
|
||||
parallelism onto threads in a way that makes efficient use of
|
||||
processor resources.
|
||||
|
||||
|
||||
- **oneTBB targets threading for performance**. Most general-purpose
|
||||
threading packages support many different kinds of threading, such as
|
||||
threading for asynchronous events in graphical user interfaces. As a
|
||||
result, general-purpose packages tend to be low-level tools that
|
||||
provide a foundation, not a solution. Instead, oneTBB focuses on the
|
||||
particular goal of parallelizing computationally intensive work,
|
||||
delivering higher-level, simpler solutions.
|
||||
|
||||
|
||||
- **oneTBB is compatible with other threading packages.** Because the
|
||||
library is not designed to address all threading problems, it can
|
||||
coexist seamlessly with other threading packages.
|
||||
|
||||
|
||||
- **oneTBB emphasizes scalable, data parallel programming**. Breaking a
|
||||
program up into separate functional blocks, and assigning a separate
|
||||
thread to each block is a solution that typically does not scale well
|
||||
since typically the number of functional blocks is fixed. In
|
||||
contrast, oneTBB emphasizes *data-parallel* programming, enabling
|
||||
multiple threads to work on different parts of a collection.
|
||||
Data-parallel programming scales well to larger numbers of processors
|
||||
by dividing the collection into smaller pieces. With data-parallel
|
||||
programming, program performance increases as you add processors.
|
||||
|
||||
|
||||
- **oneTBB relies on generic programming**. Traditional libraries
|
||||
specify interfaces in terms of specific types or base classes.
|
||||
Instead, oneAPI Threading Building Blocks uses generic programming.
|
||||
The essence of generic programming is writing the best possible
|
||||
algorithms with the fewest constraints. The C++ Standard Template
|
||||
Library (STL) is a good example of generic programming in which the
|
||||
interfaces are specified by *requirements* on types. For example, C++
|
||||
STL has a template function ``sort`` that sorts a sequence abstractly
|
||||
defined in terms of iterators on the sequence. The requirements on
|
||||
the iterators are:
|
||||
|
||||
|
||||
- Provide random access
|
||||
|
||||
|
||||
- The expression ``*i<*j`` is true if the item pointed to by
|
||||
iterator ``i`` should precede the item pointed to by iterator
|
||||
``j``, and false otherwise.
|
||||
|
||||
|
||||
- The expression ``swap(*i,*j)`` swaps two elements.
|
||||
|
||||
|
||||
Specification in terms of requirements on types enables the template to
|
||||
sort many different representations of sequences, such as vectors and
|
||||
deques. Similarly, the oneTBB templates specify requirements on types,
|
||||
not particular types, and thus adapt to different data representations.
|
||||
Generic programming enables oneTBB to deliver high performance
|
||||
algorithms with broad applicability.
|
||||
|
||||
|
Before Width: | Height: | Size: 8.1 KiB |
@@ -1,427 +0,0 @@
|
||||
.. _api_abi_changes:
|
||||
|
||||
API and ABI Change Log
|
||||
======================
|
||||
|
||||
This document tracks API and ABI changes across oneTBB releases. Each release may introduce new APIs,
|
||||
modify existing ones, or add new symbols to the binary interface. Generally, we strive to maintain backward
|
||||
compatibility, but some releases may include changes that require attention when upgrading. If a release adds
|
||||
new entry points to the binary library, this is a backwards compatible change, since applications compiled
|
||||
with an older set of headers will not be affected by the presence of new symbols in the library. However, if
|
||||
a release includes layout changes to classes defined in the headers, this can lead to compatibility issues
|
||||
for applications that are partially recompiled with a mix of use of new and old headers. In such cases,
|
||||
it is recommended to recompile the entire application with the new version of oneTBB to ensure compatibility.
|
||||
|
||||
Through the most recent oneTBB release, we have maintained backwards compatibility. However, there have been
|
||||
layout changes in the 2023.0.0 and 2022.0.0 releases, which can lead to compatibility issues for applications
|
||||
that are partially recompiled with different versions of the library headers. We therefore increased the major
|
||||
version number for those releases to highlight the potential for compatibility issues and to encourage users to
|
||||
recompile their entire application and any plugins when upgrading to those versions.
|
||||
|
||||
Summary Table
|
||||
-------------
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: auto
|
||||
|
||||
* - Release Version
|
||||
- Binary Version / Interface Version
|
||||
- Date
|
||||
- Release Notes
|
||||
- API Changes
|
||||
- ABI Changes
|
||||
|
||||
* - :ref:`2023.0.0 <version-2023.0.0>`
|
||||
- 12.18 / 12180
|
||||
- April 2026
|
||||
- `Release Notes <https://github.com/uxlfoundation/oneTBB/blob/master/RELEASE_NOTES.md#onetbb-20230-release-notes>`_
|
||||
- Yes
|
||||
- Layout changes
|
||||
|
||||
* - :ref:`2022.3.0 <version-2022.3.0>`
|
||||
- 12.17 / 12170
|
||||
- Oct 2025
|
||||
- `Release Notes <https://github.com/uxlfoundation/oneTBB/blob/master/RELEASE_NOTES.md#onetbb-20223-release-notes>`_
|
||||
- Yes
|
||||
- New entry points
|
||||
|
||||
* - :ref:`2022.2.0 <version-2022.2.0>`
|
||||
- 12.16 / 12160
|
||||
- Jun 2025
|
||||
- `Release Notes <https://github.com/uxlfoundation/oneTBB/blob/master/RELEASE_NOTES.md#onetbb-20222-release-notes>`_
|
||||
- No
|
||||
- No
|
||||
|
||||
* - :ref:`2022.1.0 <version-2022.1.0>`
|
||||
- 12.15 / 12150
|
||||
- Mar 2025
|
||||
- `Release Notes <https://github.com/uxlfoundation/oneTBB/blob/master/RELEASE_NOTES.md#onetbb-20221-release-notes>`_
|
||||
- Yes
|
||||
- New entry points
|
||||
|
||||
* - :ref:`2022.0.0 <version-2022.0.0>`
|
||||
- 12.14 / 12140
|
||||
- Oct 2024
|
||||
- `Release Notes <https://github.com/uxlfoundation/oneTBB/blob/master/RELEASE_NOTES.md#onetbb-20220-release-notes>`_
|
||||
- Yes
|
||||
- New entry points and layout changes
|
||||
|
||||
* - :ref:`2021.13.0 <version-2021.13.0>`
|
||||
- 12.13 / 12130
|
||||
- Jun 2024
|
||||
- `Release Notes <https://github.com/uxlfoundation/oneTBB/blob/master/RELEASE_NOTES.md#onetbb-202113-release-notes>`_
|
||||
- Yes
|
||||
- No
|
||||
|
||||
* - :ref:`2021.12.0 <version-2021.12.0>`
|
||||
- 12.12 / 12120
|
||||
- Apr 2024
|
||||
- `Release Notes <https://github.com/uxlfoundation/oneTBB/blob/master/RELEASE_NOTES.md#onetbb-202112-release-notes>`_
|
||||
- No
|
||||
- No
|
||||
|
||||
* - :ref:`2021.11.0 <version-2021.11.0>`
|
||||
- 12.11 / 12110
|
||||
- Nov 2023
|
||||
- `Release Notes <https://github.com/uxlfoundation/oneTBB/blob/master/RELEASE_NOTES.md#onetbb-202111-release-notes>`_
|
||||
- No
|
||||
- No
|
||||
|
||||
* - :ref:`2021.10.0 <version-2021.10.0>`
|
||||
- 12.10 / 12100
|
||||
- Jul 2023
|
||||
- `Release Notes <https://github.com/uxlfoundation/oneTBB/blob/master/RELEASE_NOTES.md#onetbb-202110-release-notes>`_
|
||||
- Yes
|
||||
- No
|
||||
|
||||
* - :ref:`2021.9.0 <version-2021.9.0>`
|
||||
- 12.9 / 12090
|
||||
- Apr 2023
|
||||
- `Release Notes <https://github.com/uxlfoundation/oneTBB/blob/master/RELEASE_NOTES.md#onetbb-20219-release-notes>`_
|
||||
- Yes
|
||||
- No
|
||||
|
||||
* - :ref:`2021.8.0 <version-2021.8.0>`
|
||||
- 12.8 / 12080
|
||||
- Feb 2023
|
||||
- `Release Notes <https://github.com/uxlfoundation/oneTBB/blob/master/RELEASE_NOTES.md#onetbb-20218-release-notes>`_
|
||||
- Yes
|
||||
- No
|
||||
|
||||
* - :ref:`2021.7.0 <version-2021.7.0>`
|
||||
- 12.7 / 12070
|
||||
- Oct 2022
|
||||
- `Release Notes <https://github.com/uxlfoundation/oneTBB/blob/master/RELEASE_NOTES.md#onetbb-20217-release-notes>`_
|
||||
- No
|
||||
- No
|
||||
|
||||
* - :ref:`2021.6.0 <version-2021.6.0>`
|
||||
- 12.6 / 12060
|
||||
- Sep 2022
|
||||
- `Release Notes <https://github.com/uxlfoundation/oneTBB/blob/master/RELEASE_NOTES.md#onetbb-20216-release-notes>`_
|
||||
- Yes
|
||||
- No
|
||||
|
||||
* - :ref:`2021.5.0 <version-2021.5.0>`
|
||||
- 12.5 / 12050
|
||||
- Dec 2021
|
||||
- `Release Notes <https://github.com/uxlfoundation/oneTBB/blob/master/RELEASE_NOTES.md#onetbb-20215-release-notes>`_
|
||||
- Yes
|
||||
- No
|
||||
|
||||
* - :ref:`2021.4.0 <version-2021.4.0>`
|
||||
- 12.4 / 12040
|
||||
- Oct 2021
|
||||
- `Release Notes <https://github.com/uxlfoundation/oneTBB/blob/master/RELEASE_NOTES.md#onetbb-20214-release-notes>`_
|
||||
- Yes
|
||||
- New entry points
|
||||
|
||||
* - :ref:`2021.3.0 <version-2021.3.0>`
|
||||
- 12.3 / 12030
|
||||
- Jun 2021
|
||||
- `Release Notes <https://www.intel.com/content/www/us/en/developer/articles/release-notes/intel-oneapi-threading-building-blocks-release-notes.html>`_
|
||||
- Yes
|
||||
- New entry points
|
||||
|
||||
* - :ref:`2021.2.0 <version-2021.2.0>`
|
||||
- 12.2 / 12020
|
||||
- Apr 2021
|
||||
- `Release Notes <https://www.intel.com/content/www/us/en/developer/articles/release-notes/intel-oneapi-threading-building-blocks-release-notes.html>`_
|
||||
- Yes
|
||||
- New entry points
|
||||
|
||||
* - :ref:`2021.1.1 <version-2021.1.1>`
|
||||
- 12.1 / 12010
|
||||
- Dec 2020
|
||||
- `Release Notes <https://www.intel.com/content/www/us/en/developer/articles/release-notes/intel-oneapi-threading-building-blocks-release-notes.html>`_
|
||||
- Initial oneTBB API
|
||||
- Initial oneTBB ABI
|
||||
|
||||
Release Details
|
||||
---------------
|
||||
|
||||
.. _version-2023.0.0:
|
||||
|
||||
2023.0.0
|
||||
~~~~~~~~
|
||||
|
||||
**API Changes:**
|
||||
|
||||
- :onetbb-spec:`Function create_numa_task_arenas introduced to create a set of NUMA bound arenas <task_scheduler/task_arena/task_arena_cls>`
|
||||
- :doc:`Additional deduction guides for flow graph <../tbb_userguide/fg_ctad>`
|
||||
- :onetbb-spec:`Additional deduction guides for blocked_range_nd <algorithms/blocked_ranges/blocked_nd_range_cls>`
|
||||
- flow graph :onetbb-spec:`indexer_node <flow_graph/indexer_node_cls>` and :onetbb-spec:`join_node <flow_graph/join_node_cls>` now support 10 or more input ports
|
||||
- :doc:`Preview Feature: wait for single task in task_group <../reference/task_group_ext/wait_single_task>`
|
||||
- :doc:`Preview Feature: resource_limited_node and resource_limiter classes <../reference/fg_resource_limiting>`
|
||||
- :doc:`Preview Feature: advanced core-type selection <../reference/core_type_selector>`
|
||||
- :doc:`Preview Feature: global control parameter for default block time behavior <../reference/parallel_phase_for_task_arena>`
|
||||
|
||||
**ABI Changes:**
|
||||
|
||||
- ordered container layout changes for scalability improvements that impact concurrent_map, concurrent_multimap, concurrent_set,
|
||||
and concurrent_multiset
|
||||
|
||||
**Notes:**
|
||||
|
||||
The ABI is backwards compatible but issues can arise for partial recomplilation cases when objects with modified layouts are passed
|
||||
across compilation units built against headers with the older layout.
|
||||
|
||||
.. _version-2022.3.0:
|
||||
|
||||
2022.3.0
|
||||
~~~~~~~~
|
||||
|
||||
**API Changes:**
|
||||
|
||||
- :onetbb-spec:`task_arena::enqueue and task_arena::wait_for to enqueue to and wait for specific task_group <task_scheduler/task_arena/task_arena_cls>`
|
||||
- :doc:`custom assertion handler support <../reference/assertion_handler>`
|
||||
- :doc:`Preview Feature: dynamic task graph <../reference/task_group_dynamic_dependencies>`
|
||||
|
||||
**ABI Changes:**
|
||||
|
||||
- set/get_assertion_handler
|
||||
- current_task_ptr
|
||||
|
||||
**Notes:**
|
||||
|
||||
set/get_assertion_handler symbols are used by custom assertion handler support, current_task_ptr is used by preview of task_group dependencies
|
||||
|
||||
.. _version-2022.2.0:
|
||||
|
||||
2022.2.0
|
||||
~~~~~~~~
|
||||
|
||||
No API or ABI changes in this release.
|
||||
|
||||
.. _version-2022.1.0:
|
||||
|
||||
2022.1.0
|
||||
~~~~~~~~
|
||||
|
||||
**API Changes:**
|
||||
|
||||
- `Added explicit deduction guides for blocked_nd_range <https://github.com/uxlfoundation/oneTBB/tree/v2022.1.0/rfcs/experimental/blocked_nd_range_ctad>`_
|
||||
- `preview of parallel phase <https://github.com/uxlfoundation/oneTBB/tree/v2022.1.0/rfcs/experimental/parallel_phase_for_task_arena>`_
|
||||
|
||||
**ABI Changes:**
|
||||
|
||||
- enter/exit_parallel_phase
|
||||
|
||||
**Notes:**
|
||||
|
||||
enter/exit_parallel_phase is only used by preview of parallel phase. **WARNING:** there was temporary, inadvertent change that made the `unsafe_wait <https://oneapi-spec.uxlfoundation.org/specifications/oneapi/latest/elements/onetbb/source/task_scheduler/scheduling_controls/task_scheduler_handle_cls>`_ exception local for this release only.
|
||||
|
||||
.. _version-2022.0.0:
|
||||
|
||||
2022.0.0
|
||||
~~~~~~~~
|
||||
|
||||
**API Changes:**
|
||||
|
||||
- `Preview of flow graph try_put_and_wait <https://github.com/uxlfoundation/oneTBB/pull/1513>`_
|
||||
|
||||
**ABI Changes:**
|
||||
|
||||
- get_thread_reference_vertex
|
||||
- execution_slot
|
||||
|
||||
**Notes:**
|
||||
|
||||
`The layouts of task_group and flow::graph were changed to improve scalability. The binary library is backwards compatible
|
||||
but issues can arise for partial recomplilation cases (see linked discussion) <https://github.com/uxlfoundation/oneTBB/discussions/1371>`_. get_thread_reference_vertex and execution_slot added for scalability improvements.
|
||||
|
||||
.. _version-2021.13.0:
|
||||
|
||||
2021.13.0
|
||||
~~~~~~~~~
|
||||
|
||||
**API Changes:**
|
||||
|
||||
- `Better rvalues support for parallel_reduce and parallel_deterministic_reduce functional API <https://github.com/uxlfoundation/oneTBB/pull/1307>`_
|
||||
|
||||
**ABI Changes:**
|
||||
|
||||
No ABI changes in this release.
|
||||
|
||||
.. _version-2021.12.0:
|
||||
|
||||
2021.12.0
|
||||
~~~~~~~~~
|
||||
|
||||
No API or ABI changes in this release.
|
||||
|
||||
.. _version-2021.11.0:
|
||||
|
||||
2021.11.0
|
||||
~~~~~~~~~
|
||||
|
||||
No API or ABI changes in this release.
|
||||
|
||||
**Notes:**
|
||||
|
||||
Thread Composability Manager support introduced. It can be enabled by setting "TCM_ENABLE" environmental variable to 1
|
||||
|
||||
.. _version-2021.10.0:
|
||||
|
||||
2021.10.0
|
||||
~~~~~~~~~
|
||||
|
||||
**API Changes:**
|
||||
|
||||
- `parallel algorithms and Flow Graph nodes allowed to accept pointers to the member functions and member objects as the user-provided callables <https://github.com/uxlfoundation/oneTBB/pull/880>`_
|
||||
- `Added missed member functions, such as assignment operators and swap function, to the concurrent_queue and concurrent_bounded_queue containers <https://github.com/uxlfoundation/oneTBB/pull/1033>`_
|
||||
|
||||
**ABI Changes:**
|
||||
|
||||
No ABI changes in this release.
|
||||
|
||||
.. _version-2021.9.0:
|
||||
|
||||
2021.9.0
|
||||
~~~~~~~~
|
||||
|
||||
**API Changes:**
|
||||
|
||||
- `Hybrid core type constraints are fully supported and no longer guarded by preview macro <https://oneapi-spec.uxlfoundation.org/specifications/oneapi/v1.2-rev-1/elements/onetbb/source/task_scheduler/task_arena/task_arena_cls#_CPPv4N11constraints9core_typeE>`_
|
||||
|
||||
**ABI Changes:**
|
||||
|
||||
No ABI changes in this release.
|
||||
|
||||
**Notes:**
|
||||
|
||||
Hybrid CPU support is now production features, including use of symbols introduced in 2021.2.0
|
||||
|
||||
.. _version-2021.8.0:
|
||||
|
||||
2021.8.0
|
||||
~~~~~~~~
|
||||
|
||||
**API Changes:**
|
||||
|
||||
- `Fixed concurrent_bounded_queue return type to match specification <https://github.com/uxlfoundation/oneTBB/issues/807>`_
|
||||
|
||||
**ABI Changes:**
|
||||
|
||||
No ABI changes in this release.
|
||||
|
||||
.. _version-2021.7.0:
|
||||
|
||||
2021.7.0
|
||||
~~~~~~~~
|
||||
|
||||
No API or ABI changes in this release.
|
||||
|
||||
.. _version-2021.6.0:
|
||||
|
||||
2021.6.0
|
||||
~~~~~~~~
|
||||
|
||||
**API Changes:**
|
||||
|
||||
- `Improved support and use of the latest C++ standards for parallel_sort that allows using this algorithm with user-defined and standard library-defined objects with modern semantics <https://oneapi-spec.uxlfoundation.org/specifications/oneapi/v1.2-rev-1/elements/onetbb/source/algorithms/functions/parallel_sort_func>`_
|
||||
- The following features are now fully functional: `task_arena extensions <https://oneapi-spec.uxlfoundation.org/specifications/oneapi/v1.2-rev-1/elements/onetbb/source/task_scheduler/task_arena/task_arena_cls>`_, `collaborative_call_once <https://oneapi-spec.uxlfoundation.org/specifications/oneapi/latest/elements/onetbb/source/algorithms/functions/collaborative_call_once_func>`_, heterogeneous overloads for concurrent_hash_map, and `task_scheduler_handle <https://oneapi-spec.uxlfoundation.org/specifications/oneapi/v1.2-rev-1/elements/onetbb/source/task_scheduler/scheduling_controls/task_scheduler_handle_cls>`_
|
||||
|
||||
**ABI Changes:**
|
||||
|
||||
No ABI changes in this release.
|
||||
|
||||
.. _version-2021.5.0:
|
||||
|
||||
2021.5.0
|
||||
~~~~~~~~
|
||||
|
||||
**API Changes:**
|
||||
|
||||
- Preview of task_group interface with a new run_and_wait overload to accept task_handle
|
||||
|
||||
**ABI Changes:**
|
||||
|
||||
No ABI changes in this release.
|
||||
|
||||
.. _version-2021.4.0:
|
||||
|
||||
2021.4.0
|
||||
~~~~~~~~
|
||||
|
||||
**API Changes:**
|
||||
|
||||
- Preview of collaborative_call_once algorithm
|
||||
|
||||
**ABI Changes:**
|
||||
|
||||
- notify_waiters
|
||||
|
||||
.. _version-2021.3.0:
|
||||
|
||||
2021.3.0
|
||||
~~~~~~~~
|
||||
|
||||
**API Changes:**
|
||||
|
||||
- Extended the high-level task API to simplify migration from TBB to oneTBB
|
||||
- Added mutex and rw_mutex that are suitable for long critical sections and resistant to high contention
|
||||
- Added ability to customize the concurrent_hash_map mutex type
|
||||
- Added heterogeneous lookup, erase, and insert operations to concurrent_hash_map
|
||||
|
||||
**ABI Changes:**
|
||||
|
||||
- enqueue(d1::task&, d1::task_group_context&, d1::task_arena_base*)
|
||||
- is_writer for queuing_rw_mutex
|
||||
- wait_on_address
|
||||
- notify_by_address/address_all/address_one
|
||||
|
||||
.. _version-2021.2.0:
|
||||
|
||||
2021.2.0
|
||||
~~~~~~~~
|
||||
|
||||
**API Changes:**
|
||||
|
||||
- Three-way comparison operators for concurrent ordered containers and concurrent_vector
|
||||
- Preview of Hybrid core type constraints
|
||||
|
||||
**ABI Changes:**
|
||||
|
||||
- core_type_count
|
||||
- fill_core_type_indices
|
||||
- constraints_threads_per_core
|
||||
- constraints_default_concurrency
|
||||
|
||||
**Notes:**
|
||||
|
||||
New symbols used by preview of Hybrid CPU support (entered production in 2021.9).
|
||||
|
||||
.. _version-2021.1.1:
|
||||
|
||||
2021.1.1
|
||||
~~~~~~~~
|
||||
|
||||
**API Changes:**
|
||||
|
||||
- `Initial modernized oneTBB API <https://oneapi-spec.uxlfoundation.org/specifications/oneapi/v1.0-rev-3/elements/onetbb/source/nested-index#onetbb-section>`_
|
||||
|
||||
**ABI Changes:**
|
||||
|
||||
- Initial oneTBB ABI
|
||||
@@ -1,15 +0,0 @@
|
||||
.. _help_support:
|
||||
|
||||
Getting Help and Support
|
||||
========================
|
||||
|
||||
|
||||
.. container:: section
|
||||
|
||||
|
||||
.. rubric:: Getting Technical Support
|
||||
:class: sectiontitle
|
||||
|
||||
For general information about |short_name| technical support, product
|
||||
updates, user forums, FAQs, tips and tricks and other support
|
||||
questions, see `oneTBB Support <https://github.com/uxlfoundation/oneTBB/blob/master/SUPPORT.md>`_.
|
||||
@@ -1,35 +0,0 @@
|
||||
.. _intro:
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
|
||||
|full_name| is a library that supports scalable parallel programming using
|
||||
standard ISO C++ code. It does not require special languages or
|
||||
compilers. It is designed to promote scalable data parallel programming.
|
||||
Additionally, it fully supports nested parallelism, so you can build
|
||||
larger parallel components from smaller parallel components. To use the
|
||||
library, you specify tasks, not threads, and let the library map tasks
|
||||
onto threads in an efficient manner.
|
||||
|
||||
|
||||
Many of the library interfaces employ generic programming, in which
|
||||
interfaces are defined by requirements on types and not specific types.
|
||||
The C++ Standard Template Library (STL) is an example of generic
|
||||
programming. Generic programming enables oneTBB to be flexible yet
|
||||
efficient. The generic interfaces enable you to customize components to
|
||||
your specific needs.
|
||||
|
||||
|
||||
.. note::
|
||||
|full_name| requires C++11 standard compiler support.
|
||||
|
||||
|
||||
The net result is that oneTBB enables you to specify parallelism far
|
||||
more conveniently than using raw threads, and at the same time can
|
||||
improve performance.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
.. _limitations:
|
||||
|
||||
Known Limitations
|
||||
*****************
|
||||
|
||||
This page outlines the known limitations of oneTBB to help you better understand its capabilities.
|
||||
|
||||
Debug TBB In The SYCL Program
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
**Limitation:** The application may crash when using the Debug version of oneTBB in a SYCL program compiled with Intel(R) oneAPI DPC++/C++ Compiler. This happens because both ``tbb`` (Release version) and ``tbb_debug`` (Debug version) libraries load simultaneously, causing conflicts.
|
||||
|
||||
**Solution:** Do one of the following:
|
||||
|
||||
* Link the application with the Release version ``tbb`` instead of ``tbb_debug``.
|
||||
* Use the ``qtbb`` flag provided by the Intel(R) oneAPI DPC++/C++ Compiler.
|
||||
|
||||
Static Linking Possible But Not Recommended
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
**Limitation:** Building and using oneTBB as a static library reduces the benefits of the shared thread pool and limits library functionality.
|
||||
|
||||
**Risks:** See :ref:`Static Linking of oneTBB <static_linking>` for why the shared library is the preferred form, which features are unavailable in a static library, and the risks of having more than one copy of oneTBB in a process.
|
||||
|
||||
**Solution:** Prefer the shared library. If a static library is required, follow :ref:`Recommendations If You Must Link Statically <static_linking_recommendations>` and see `Building oneTBB as a Static Library <https://github.com/uxlfoundation/oneTBB/blob/master/cmake/README.md#building-onetbb-as-a-static-library>`_ for build instructions.
|
||||
|
||||
Freestanding Compilation Mode
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
**Limitation:** oneTBB does not support the freestanding compilation mode.
|
||||
|
||||
**Risk:** Compiling an application that utilizes oneTBB headers using the Intel(R) oneAPI DPC++/C++ Compiler may result in failure on Windows* OS if the ``/Qfreestanding`` compiler option is employed.
|
||||
|
||||
Static Assert
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
**Limitation:** A static assert causes the compilation failures in oneTBB headers if the following conditions are satisfied:
|
||||
|
||||
* Compilation is done with Clang 12.0.0 or a more recent version.
|
||||
* The LLVM standard library is employed, coupled with the use of the ``-ffreestanding`` flag and C++11/14 compiler options.
|
||||
|
||||
**Risk:** The compilation failures.
|
||||
|
||||
Interface Incompatibilities: TBB vs oneTBB
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
**Limitation:** An application using Parallel STL algorithms in the ``libstdc++`` versions 9 and 10 may fail to compile due to incompatible interface changes between earlier versions of Threading Building Blocks (TBB) and oneAPI Threading Building Blocks (oneTBB).
|
||||
|
||||
**Solution:** Disable support for Parallel STL algorithms by defining ``PSTL_USE_PARALLEL_POLICIES`` (in libstdc++ 9) or ``_GLIBCXX_USE_TBB_PAR_BACKEND`` (in libstdc++ 10) macro to zero before inclusion of the first standard header file in each translation unit.
|
||||
|
||||
Incorrect Installation Location
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
**Limitation:** On Linux* OS, if oneAPI Threading Building Blocks (oneTBB) or Threading Building Blocks (TBB) are installed in a system folder, such as ``/usr/lib64``, the application may fail to link due to the order in which the linker searches for libraries.
|
||||
|
||||
**Risk:** The issue does not affect the program execution.
|
||||
|
||||
**Solution:** Use the ``-L`` linker option to specify the correct location of oneTBB library.
|
||||
|
||||
``fork()`` Support
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
**Limitation:** oneTBB does not support ``fork()``.
|
||||
|
||||
**Solution:** To work-around the issue, consider using ``task_scheduler_handle`` to join oneTBB worker threads before using ``fork()``.
|
||||
|
||||
Dynamic Malloc Replacement and Topology API Incompatibilities
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
**Limitation:** On Linux* OS, using dynamic malloc replacement with ``tbb::info`` and ``tbb::task_arena::constraints`` APIs may result in runtime failures.
|
||||
|
||||
**Solution:** Set ``TBB_ENABLE_SANITIZERS=1`` in the environment. This informs that dynamic malloc replacement is used.
|
||||
@@ -1,106 +0,0 @@
|
||||
.. _notation:
|
||||
|
||||
Notational Conventions
|
||||
======================
|
||||
|
||||
|
||||
The following conventions may be used in this document.
|
||||
|
||||
|
||||
.. container:: tablenoborder
|
||||
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Convention
|
||||
- Explanation
|
||||
- Example
|
||||
* - \ *Italic*
|
||||
- Used for introducing new terms, denotation of terms, placeholders, or titles of manuals.
|
||||
- The filename consists of the *basename* and the *extension*.
|
||||
* - \ ``Monospace``
|
||||
- Indicates directory paths and filenames, commands and command line options, function names, methods, classes, data structures in body text, source code.
|
||||
- \ ``ippsapi.h`` \ ``\alt\include`` Use the okCreateObjs() function to... \ ``printf("hello, world\n");``
|
||||
* - [ ]
|
||||
- Items enclosed in brackets are optional.
|
||||
- Fa[c] Indicates Fa or Fac.
|
||||
* - { \| }
|
||||
- Braces and vertical bars indicate the choice of one item from a selection of two or more items.
|
||||
- X{K \| W \| P} Indicates XK, XW, or XP.
|
||||
* - "[" "]" "{" | " }" "|"
|
||||
- Writing a metacharacter in quotation marks negates the syntactical meaning stated above; | the character is taken as a literal.
|
||||
- "[" X "]" [ Y ] Denotes the letter X enclosed in brackets, optionally followed by the letter Y.
|
||||
* - ...
|
||||
- The ellipsis indicates that the previous item can be repeated several times.
|
||||
- \ ``filename`` ... Indicates that one or more filenames can be specified.
|
||||
* - ,...
|
||||
- The ellipsis preceded by a comma indicates that the previous item can be repeated several times, | separated by commas.
|
||||
- \ ``word`` ,... Indicates that one or more words can be specified. If more than one word is specified, the words are comma-separated.
|
||||
|
||||
|
||||
|
||||
|
||||
.. container:: section
|
||||
|
||||
|
||||
Class members are summarized by informal class declarations that
|
||||
describe the class as it seems to clients, not how it is actually
|
||||
implemented. For example, here is an informal declaration of class
|
||||
``Foo``:
|
||||
|
||||
|
||||
::
|
||||
|
||||
|
||||
class Foo {
|
||||
public:
|
||||
int x();
|
||||
int y;
|
||||
~Foo();
|
||||
};
|
||||
|
||||
|
||||
The actual implementation might look like:
|
||||
|
||||
|
||||
::
|
||||
|
||||
|
||||
namespace internal {
|
||||
class FooBase {
|
||||
protected:
|
||||
int x();
|
||||
};
|
||||
|
||||
|
||||
class Foo_v3: protected FooBase {
|
||||
private:
|
||||
int internal_stuff;
|
||||
public:
|
||||
using FooBase::x;
|
||||
int y;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
typedef internal::Foo_v3 Foo;
|
||||
|
||||
|
||||
The example shows two cases where the actual implementation departs
|
||||
from the informal declaration:
|
||||
|
||||
|
||||
- ``Foo`` is actually a typedef to ``Foo_v3``.
|
||||
|
||||
|
||||
- Method ``x()`` is inherited from a protected base class.
|
||||
|
||||
|
||||
- The destructor is an implicit method generated by the compiler.
|
||||
|
||||
|
||||
The informal declarations are intended to show you what you need to
|
||||
know to use the class without the distraction of irrelevant clutter
|
||||
particular to the implementation.
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
.. _static_linking:
|
||||
|
||||
Static Linking of oneTBB
|
||||
************************
|
||||
|
||||
|full_name| is designed, built, and distributed as a shared library. Building a static
|
||||
library is possible, but it is not a recommended configuration. CMake emits a warning, validation
|
||||
coverage is limited, and several features are unavailable by default. If a static oneTBB
|
||||
library is used by an application, you should carefully validate its performance and correctness.
|
||||
|
||||
Using a static library is not a problem in itself. The problems arise when a static oneTBB
|
||||
library is combined with another static or shared oneTBB library in the same application.
|
||||
In the good case, this is a potential performance problem due to oversubscription but in the
|
||||
worst case, something fails in a way that is hard to diagnose.
|
||||
|
||||
This page explains why the shared library is the recommended form, what can go wrong for
|
||||
performance and for correctness when more than one copy of oneTBB ends up in the same process,
|
||||
which features are unavailable in a static build, and how to produce a static build anyway.
|
||||
|
||||
Why a Shared Library Is Recommended
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
oneTBB's thread pool is used to manage a machine's hardware threads. To do that job well,
|
||||
the oneTBB task scheduler and its worker thread pool must have a single instance across
|
||||
the entire process. The most practical way to create a program-wide singleton is to put
|
||||
it in a shared library that every component links against.
|
||||
|
||||
Performance Risks of Multiple oneTBB Copies
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Performance problems can arise because each instance of oneTBB creates roughly as many worker
|
||||
threads as there are hardware threads. If a program contains ``k`` independent oneTBB schedulers,
|
||||
it gets ``k`` times as many software threads as hardware threads. This oversubscription may
|
||||
cause excessive context switching and cache contention.
|
||||
|
||||
This oversubscription issue is most noticeable when nested parallelism is used. If a oneTBB
|
||||
algorithm or task calls into a library that uses a different oneTBB instance, the number
|
||||
of threads increases and the tasks in each layer become isolated from each other, limiting
|
||||
flexibility in work stealing and load balancing. This is the case when parallelism at the
|
||||
application level is combined with parallelism at the library level.
|
||||
|
||||
Oversubscription also cannot be capped from a single place. A ``tbb::global_control`` object
|
||||
that limits ``max_allowed_parallelism`` constrains only the copy of oneTBB it was created in,
|
||||
so the other copies keep creating their own worker threads.
|
||||
|
||||
Correctness Risks of Multiple oneTBB Copies
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Beyond performance, mixing copies may break correctness. There are a number of subtle issues
|
||||
that can arise. One example is that oneTBB objects can carry state that belongs to the copy
|
||||
that created it, including task arenas, scheduler state stored in thread-local storage, etc.
|
||||
Passing a ``tbb::task_arena``, ``tbb::task_group``, ``tbb::flow::graph``, or other oneTBB
|
||||
object to a component that uses a different copy of oneTBB is undefined behavior.
|
||||
|
||||
Settings that are documented as process-wide also stop behaving that way. ``tbb::global_control``
|
||||
applies only to the scheduler instance it is created in, not to the other copies, so a component
|
||||
cannot rely on it to establish an application-wide policy.
|
||||
|
||||
Features Not Available in a Static Build
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A static build disables oneTBB's run-time dynamic loading, which several features depend on:
|
||||
|
||||
* The ``tbbbind`` libraries are not built, and oneTBB cannot load them at run time.
|
||||
``tbb::info`` and ``tbb::task_arena::constraints`` therefore cannot report or apply
|
||||
topology-based constraints.
|
||||
|
||||
* ``tbbmalloc_proxy`` is not built. The scalable allocator is still usable through the
|
||||
explicit interfaces, such as ``tbb::scalable_allocator``, ``tbb::cache_aligned_allocator``,
|
||||
and ``scalable_malloc``.
|
||||
|
||||
* oneTBB will not load the Thread Composability Manager (TCM) library at run time,
|
||||
so coordination with other threading runtimes through TCM is unavailable.
|
||||
|
||||
* IPO is enabled only for shared library builds, so a static oneTBB may be slower than
|
||||
the shared one even in the single-copy case.
|
||||
|
||||
.. _static_linking_recommendations:
|
||||
|
||||
Recommendations If You Must Link Statically
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If you still choose to statically link oneTBB into your application, follow these
|
||||
recommendations:
|
||||
|
||||
* Use only a single copy of oneTBB for the entire application if possible.
|
||||
|
||||
* Detect additional copies at run time. Setting the ``TBB_VERSION`` environment variable to
|
||||
``1`` makes each initialized oneTBB instance print its version information to ``stderr``,
|
||||
so more than one block of output means more than one copy is loaded. See
|
||||
:ref:`Mixing_Two_Runtimes` for an example of the output.
|
||||
|
||||
* Do not pass oneTBB objects, such as ``tbb::task_arena``, ``tbb::task_group``, or
|
||||
``tbb::flow::graph``, across component boundaries unless all of the components share the
|
||||
same copy of oneTBB.
|
||||
|
||||
* Validate the performance and correctness of the resulting application yourself. Static
|
||||
builds receive only light validation coverage.
|
||||
|
||||
Building oneTBB as a Static Library
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The CMake build system supports static library builds.
|
||||
|
||||
Configure the build with ``BUILD_SHARED_LIBS=OFF``. The configure step prints a warning
|
||||
stating that the configuration is highly discouraged, but the build proceeds.
|
||||
|
||||
For the full procedure, including the effects on the rest of the build configuration and how
|
||||
to consume the result, see `Building oneTBB as a Static Library
|
||||
<https://github.com/uxlfoundation/oneTBB/blob/master/cmake/README.md#building-onetbb-as-a-static-library>`_
|
||||
in the Build System Description.
|
||||
@@ -1,31 +0,0 @@
|
||||
.. _testing_approach:
|
||||
|
||||
Testing Approach
|
||||
================
|
||||
|
||||
There are four main types of errors/hazards you can encounter in the development of libraries for parallelism:
|
||||
|
||||
* Interface correspondence to specification
|
||||
* Memory errors
|
||||
* Data race
|
||||
* Race conditions and deadlocks
|
||||
|
||||
|short_name| testing approach is designed to provide high coverage of these error types.
|
||||
All types of errors are covered with unit testing and code review.
|
||||
|
||||
Code coverage metrics are tracked to ensure high code coverage with tests. Uncovered branches are analyzed manually.
|
||||
Memory errors and data races are additionally covered by special tools that include thread and memory sanitizers.
|
||||
|
||||
Race conditions and deadlocks are the most complicated errors.
|
||||
They are covered by:
|
||||
|
||||
* **Unit tests** that, however, have limited capability to catch such errors.
|
||||
* **Integration tests**. Multiple different functionalities are heavily combined to emulate user use cases that may trigger such errors based on prior knowledge and expertise.
|
||||
* **Stress testing with different possible combinations**. It ensures that even rarely triggered error conditions are caught by testing.
|
||||
|
||||
.. note:: Every fix is required to be covered by a regression test to guarantee the detection of such issues in the future.
|
||||
|
||||
Continuous Integration triggers all the tests on each commit. This ensures that:
|
||||
|
||||
* Issues are detected, starting from the early development phase and up to the moment of integration of changes into the library.
|
||||
* The highest quality of the library is maintained even in such error-prone domains as parallelism.
|
||||
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 283 KiB |
@@ -1,82 +0,0 @@
|
||||
.. _assertion_handler:
|
||||
|
||||
Custom Assertion Handler
|
||||
========================
|
||||
|
||||
.. note::
|
||||
The availability of the extension can be checked with the ``TBB_EXT_CUSTOM_ASSERTION_HANDLER`` macro defined in
|
||||
``oneapi/tbb/global_control.h`` and ``oneapi/tbb/version.h`` headers.
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
:depth: 2
|
||||
|
||||
Description
|
||||
***********
|
||||
|
||||
oneTBB implements assertion checking that detects errors in header files and library code. While most assertions are
|
||||
active in debug builds (controlled by ``TBB_USE_ASSERT``), some assertions remain present in release builds. By
|
||||
default, failed assertions display an error message and terminate the application. The custom assertion handler
|
||||
mechanism extends this by allowing developers to implement their own assertion handling functions. The API is
|
||||
semantically similar to the standard ``std::set_terminate`` and ``std::get_terminate`` functions.
|
||||
|
||||
API
|
||||
***
|
||||
|
||||
Header
|
||||
------
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
#include <oneapi/tbb/global_control.h>
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
#define TBB_EXT_CUSTOM_ASSERTION_HANDLER 202510
|
||||
|
||||
namespace oneapi {
|
||||
namespace tbb {
|
||||
namespace ext {
|
||||
using assertion_handler_type = void(*)(const char* location, int line,
|
||||
const char* expression, const char* comment);
|
||||
|
||||
assertion_handler_type set_assertion_handler(assertion_handler_type new_handler) noexcept;
|
||||
|
||||
assertion_handler_type get_assertion_handler() noexcept;
|
||||
}}}
|
||||
|
||||
Types
|
||||
-----
|
||||
|
||||
.. cpp:type:: assertion_handler_type
|
||||
|
||||
Type alias for the pointer to an assertion handler function.
|
||||
|
||||
Functions
|
||||
---------
|
||||
|
||||
.. cpp:function:: assertion_handler_type set_assertion_handler(assertion_handler_type new_handler) noexcept
|
||||
|
||||
Sets the provided assertion handler and returns the previous handler. If ``new_handler`` is ``nullptr``, resets to the
|
||||
default handler.
|
||||
|
||||
.. note:: ``new_handler`` must terminate the program without returning. Otherwise the behavior is undefined.
|
||||
|
||||
.. cpp:function:: assertion_handler_type get_assertion_handler() noexcept
|
||||
|
||||
Returns the current assertion handler.
|
||||
|
||||
Example
|
||||
*******
|
||||
|
||||
.. literalinclude:: ./examples/assertion_handler.cpp
|
||||
:language: c++
|
||||
:start-after: /*begin_assertion_handler_example*/
|
||||
:end-before: /*end_assertion_handler_example*/
|
||||
|
||||
.. rubric:: See also
|
||||
|
||||
* :onetbb-spec:`Enabling Debugging Features specification <configuration/enabling_debugging_features>`
|
||||
@@ -1,163 +0,0 @@
|
||||
.. _concurrent_lru_cache:
|
||||
|
||||
concurrent_lru_cache
|
||||
====================
|
||||
|
||||
.. note::
|
||||
To enable this feature, define the ``TBB_PREVIEW_CONCURRENT_LRU_CACHE`` macro to 1.
|
||||
|
||||
A Class Template for Least Recently Used cache with concurrent operations.
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
:depth: 1
|
||||
|
||||
Description
|
||||
***********
|
||||
|
||||
A ``concurrent_lru_cache`` container maps keys to values with the ability
|
||||
to limit the number of stored unused values. For each key, there is at most one item
|
||||
stored in the container.
|
||||
|
||||
The container permits multiple threads to concurrently retrieve items from it.
|
||||
|
||||
The container tracks which items are in use by returning a proxy
|
||||
``concurrent_lru_cache::handle`` object that refers to an item instead of its value.
|
||||
Once there are no ``handle`` objects holding reference to an item, it is considered unused.
|
||||
|
||||
The container stores all the items that are currently in use plus a limited
|
||||
number of unused items. Excessive unused items are erased according to
|
||||
least recently used policy.
|
||||
|
||||
When no item is found for a given key, the container calls the user-specified
|
||||
``value_function_type`` object to construct a value for the key, and stores that value.
|
||||
The ``value_function_type`` object must be thread-safe.
|
||||
|
||||
API
|
||||
***
|
||||
|
||||
Header
|
||||
------
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
#include "oneapi/tbb/concurrent_lru_cache.h"
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
namespace oneapi {
|
||||
namespace tbb {
|
||||
template <typename Key, typename Value, typename ValueFunctionType = Value (*)(Key)>
|
||||
class concurrent_lru_cache {
|
||||
public:
|
||||
using key_type = Key;
|
||||
using value_type = Value;
|
||||
using pointer = value_type*;
|
||||
using const_pointer = const value_type*;
|
||||
using reference = value_type&;
|
||||
using const_reference = const value_type&;
|
||||
|
||||
using value_function_type = ValueFunctionType;
|
||||
|
||||
class handle {
|
||||
public:
|
||||
handle();
|
||||
handle( handle&& other );
|
||||
|
||||
~handle();
|
||||
|
||||
handle& operator=( handle&& other );
|
||||
|
||||
operator bool() const;
|
||||
value_type& value();
|
||||
}; // class handle
|
||||
|
||||
concurrent_lru_cache( value_function_type f, std::size_t number_of_lru_history_items );
|
||||
~concurrent_lru_cache();
|
||||
|
||||
handle operator[]( key_type key );
|
||||
}; // class concurrent_lru_cache
|
||||
} // namespace tbb
|
||||
} // namespace oneapi
|
||||
|
||||
Member Functions
|
||||
----------------
|
||||
|
||||
.. cpp:function:: concurrent_lru_cache( value_function_type f, std::size_t number_of_lru_history_items );
|
||||
|
||||
**Effects**: Constructs an empty cache that can keep up to ``number_of_lru_history_items``
|
||||
unused values, with a function object ``f`` for constructing new values.
|
||||
|
||||
-------------------------------------------------------
|
||||
|
||||
.. cpp:function:: ~concurrent_lru_cache();
|
||||
|
||||
**Effects**: Destroys the ``concurrent_lru_cache``. Calls the destructors of the stored elements and
|
||||
deallocates the used storage.
|
||||
|
||||
The behavior is undefined in case of concurrent operations with ``*this``.
|
||||
|
||||
-------------------------------------------------------
|
||||
|
||||
.. cpp:function:: handle operator[]( key_type k );
|
||||
|
||||
**Effects**: Searches the container for an item that corresponds to the given key.
|
||||
If such an item is not found, the user-specified function object is called to
|
||||
construct a value that is inserted into the container.
|
||||
|
||||
**Returns**: a ``handle`` object holding reference to the matching value.
|
||||
|
||||
Member Objects
|
||||
--------------
|
||||
|
||||
``handle`` class
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
**Member Functions**
|
||||
|
||||
.. cpp:function:: handle();
|
||||
|
||||
**Effects**: Constructs a ``handle`` object that does not refer to any value.
|
||||
|
||||
--------------------------------------------------
|
||||
|
||||
.. cpp:function:: handle( handle&& other );
|
||||
|
||||
**Effects**: Transfers the reference to the value stored in ``concurrent_lru_cache``
|
||||
from ``other`` to the newly constructed object. Upon completion,
|
||||
``other`` no longer refers to any value.
|
||||
|
||||
---------------------------------------------------
|
||||
|
||||
.. cpp:function:: ~handle();
|
||||
|
||||
**Effects**: Releases the reference (if it exists) to a value stored in ``concurrent_lru_cache``.
|
||||
|
||||
The behavior is undefined for concurrent operations with ``*this``.
|
||||
|
||||
---------------------------------------------------
|
||||
|
||||
.. cpp:function:: handle& operator=( handle&& other );
|
||||
|
||||
**Effects**: Transfers the reference to a value stored in ``concurrent_lru_cache`` from ``other``
|
||||
to ``*this``. If existed, the previous reference held by ``*this`` is released. Upon
|
||||
completion ``other`` no longer refers to any value.
|
||||
|
||||
**Returns**: a reference to ``*this``.
|
||||
|
||||
---------------------------------------------------
|
||||
|
||||
.. cpp:function:: operator bool() const;
|
||||
|
||||
**Returns**: ``true`` if ``*this`` holds reference to a value, ``false`` otherwise.
|
||||
|
||||
---------------------------------------------------
|
||||
|
||||
.. cpp:function:: value_type& value();
|
||||
|
||||
**Returns**: a reference to a ``value_type`` object stored in ``concurrent_lru_cache``.
|
||||
|
||||
The behavior is undefined if ``*this`` does not refer to any value.
|
||||
@@ -1,104 +0,0 @@
|
||||
.. _constructors_for_fg_nodes:
|
||||
|
||||
Constructors for Flow Graph nodes
|
||||
=================================
|
||||
|
||||
.. note::
|
||||
To enable this feature, define the ``TBB_PREVIEW_FLOW_GRAPH_FEATURES`` macro to 1.
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
:depth: 1
|
||||
|
||||
Description
|
||||
***********
|
||||
|
||||
The "Helper Functions for Expressing Graphs" feature adds a set of new constructors
|
||||
that can be used to construct a node that ``follows`` or ``precedes`` a set of nodes.
|
||||
|
||||
Where possible, the constructors support Class Template Argument Deduction (since C++17).
|
||||
|
||||
API
|
||||
***
|
||||
|
||||
Header
|
||||
------
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
#include <oneapi/tbb/flow_graph.h>
|
||||
|
||||
Syntax
|
||||
------
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
// continue_node
|
||||
continue_node(follows(...), Body body, Policy = Policy());
|
||||
continue_node(precedes(...), Body body, Policy = Policy());
|
||||
|
||||
continue_node(follows(...), int number_of_predecessors, Body body, Policy = Policy());
|
||||
continue_node(precedes(...), int number_of_predecessors, Body body, Policy = Policy());
|
||||
|
||||
// function_node
|
||||
function_node(follows(...), std::size_t concurrency, Policy = Policy());
|
||||
function_node(precedes(...), std::size_t concurrency, Policy = Policy());
|
||||
|
||||
// input_node
|
||||
input_node(precedes(...), body);
|
||||
|
||||
// multifunction_node
|
||||
multifunction_node(follows(...), std::size_t concurrency, Body body);
|
||||
multifunction_node(precedes(...), std::size_t concurrency, Body body);
|
||||
|
||||
// async_node
|
||||
async_node(follows(...), std::size_t concurrency, Body body);
|
||||
async_node(precedes(...), std::size_t concurrency, Body body);
|
||||
|
||||
// overwrite_node
|
||||
explicit overwrite_node(follows(...));
|
||||
explicit overwrite_node(precedes(...));
|
||||
|
||||
// write_once_node
|
||||
explicit write_once_node(follows(...));
|
||||
explicit write_once_node(precedes(...));
|
||||
|
||||
// buffer_node
|
||||
explicit buffer_node(follows(...));
|
||||
explicit buffer_node(precedes(...));
|
||||
|
||||
// queue_node
|
||||
explicit queue_node(follows(...));
|
||||
explicit queue_node(precedes(...));
|
||||
|
||||
// priority_queue_node
|
||||
explicit priority_queue_node(follows(...), const Compare& comp = Compare());
|
||||
explicit priority_queue_node(precedes(...), const Compare& compare = Compare());
|
||||
|
||||
// sequencer_node
|
||||
sequencer_node(follows(...), const Sequencer& s);
|
||||
sequencer_node(precedes(...), const Sequencer& s);
|
||||
|
||||
// limiter_node
|
||||
limiter_node(follows(...), std::size_t threshold);
|
||||
limiter_node(precedes(...), std::size_t threshold);
|
||||
|
||||
// broadcast_node
|
||||
explicit broadcast_node(follows(...));
|
||||
explicit broadcast_node(precedes(...));
|
||||
|
||||
// join_node
|
||||
explicit join_node(follows(...), Policy = Policy());
|
||||
explicit join_node(precedes(...), Policy = Policy());
|
||||
|
||||
// split_node
|
||||
explicit split_node(follows(...));
|
||||
explicit split_node(precedes(...));
|
||||
|
||||
// indexer_node
|
||||
indexer_node(follows(...));
|
||||
indexer_node(precedes(...));
|
||||
|
||||
See Also
|
||||
********
|
||||
:ref:`follows_precedes`
|
||||
@@ -1,195 +0,0 @@
|
||||
.. _core_type_selector:
|
||||
|
||||
Core Type Selector for Task Arena Constraints
|
||||
=============================================
|
||||
|
||||
.. note::
|
||||
To enable this feature, set the ``TBB_PREVIEW_TASK_ARENA_CORE_TYPE_SELECTOR`` macro to 1. When available and enabled, the feature-test macro ``TBB_HAS_TASK_ARENA_CORE_TYPE_SELECTOR`` is defined.
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
:depth: 2
|
||||
|
||||
Description
|
||||
***********
|
||||
|
||||
On a system with hybrid CPU cores, it is generally best to allow the OS to schedule threads across
|
||||
all core types. However, advanced users may occasionally need to constrain the scheduling.
|
||||
The ``constraints::set_core_type(core_type_id)`` API supports only a single core type, which may not allow selecting a suitable subset on processors with more than two core types.
|
||||
|
||||
The core type selector addresses this by allowing a callable object (*selector*) to rank every
|
||||
available core type. The selector is called once for each core type returned by
|
||||
``tbb::info::core_types()``. Positive scores indicate core types that should be used, negative
|
||||
scores exclude core types, and a score of zero means "use only if multi-core-type constraints are
|
||||
not supported" (see `Selector Requirements`_ for details).
|
||||
|
||||
This feature extends the :onetbb-spec:`tbb::task_arena <task_scheduler/task_arena/task_arena_cls>`
|
||||
and the :onetbb-spec:`tbb::info <info_namespace>` specifications with the following API:
|
||||
|
||||
* Adds the ``selectable`` constant to ``task_arena``.
|
||||
* Adds a new ``task_arena`` constructor template that accepts a ``constraints`` object together with
|
||||
a selector.
|
||||
* Adds a new ``task_arena::initialize`` template that accepts a ``constraints`` object together with
|
||||
a selector.
|
||||
* Adds a new ``info::default_concurrency`` template that returns the effective concurrency for given
|
||||
constraints and selector.
|
||||
|
||||
API
|
||||
***
|
||||
|
||||
Header
|
||||
------
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
#define TBB_PREVIEW_TASK_ARENA_CORE_TYPE_SELECTOR 1
|
||||
#include <oneapi/tbb/task_arena.h>
|
||||
#include <oneapi/tbb/info.h>
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
namespace oneapi {
|
||||
namespace tbb {
|
||||
|
||||
class task_arena {
|
||||
public:
|
||||
static constexpr int selectable = /* unspecified */;
|
||||
|
||||
template <typename Selector>
|
||||
task_arena(constraints a_constraints, Selector a_selector,
|
||||
unsigned reserved_slots = 1,
|
||||
priority a_priority = priority::normal);
|
||||
|
||||
template <typename Selector>
|
||||
void initialize(constraints a_constraints, Selector a_selector,
|
||||
unsigned reserved_slots = 1,
|
||||
priority a_priority = priority::normal);
|
||||
}; // class task_arena
|
||||
|
||||
namespace info {
|
||||
template <typename Selector>
|
||||
int default_concurrency(task_arena::constraints c, Selector a_selector);
|
||||
} // namespace info
|
||||
|
||||
} // namespace tbb
|
||||
} // namespace oneapi
|
||||
|
||||
Member Constants
|
||||
----------------
|
||||
|
||||
.. cpp:var:: static constexpr int task_arena::selectable
|
||||
|
||||
A special value for ``constraints::core_type`` that indicates the core type(s) should be
|
||||
determined by the selector provided to the constructor or ``initialize``.
|
||||
|
||||
Member Functions
|
||||
----------------
|
||||
|
||||
.. cpp:function:: template <typename Selector> \
|
||||
task_arena::task_arena(constraints a_constraints, Selector a_selector, \
|
||||
unsigned reserved_slots = 1, \
|
||||
priority a_priority = priority::normal)
|
||||
|
||||
**Requirements**: ``Selector`` must be a callable type whose call operator accepts a
|
||||
``std::tuple<tbb::core_type_id, std::size_t, std::size_t>`` and returns a value convertible to ``int``.
|
||||
See `Selector Requirements`_ for the full contract.
|
||||
|
||||
Constructs a ``task_arena`` whose core type constraint is resolved by calling ``a_selector``
|
||||
on every available core type. The ``a_constraints.core_type`` field should be set to
|
||||
``task_arena::selectable``; other constraint fields (``numa_id``, ``max_concurrency``,
|
||||
``max_threads_per_core``) are applied as usual.
|
||||
|
||||
If ``a_constraints.core_type`` is not ``selectable``, the selector is ignored and the
|
||||
constructor behaves identically to the existing constraints-based constructor.
|
||||
|
||||
.. cpp:function:: template <typename Selector> \
|
||||
void task_arena::initialize(constraints a_constraints, Selector a_selector, \
|
||||
unsigned reserved_slots = 1, \
|
||||
priority a_priority = priority::normal)
|
||||
|
||||
Overrides the arena settings and forces initialization. Core type resolution follows the same
|
||||
rules as the constructor above.
|
||||
|
||||
Functions
|
||||
---------
|
||||
|
||||
.. cpp:function:: template <typename Selector> \
|
||||
int info::default_concurrency(task_arena::constraints c, Selector a_selector)
|
||||
|
||||
**Requirements**: ``Selector`` must be a callable type whose call operator accepts a
|
||||
``std::tuple<tbb::core_type_id, std::size_t, std::size_t>`` and returns a value convertible to ``int``.
|
||||
See `Selector Requirements`_ for the full contract.
|
||||
|
||||
Returns the number of threads that would be available for a ``task_arena`` created with the
|
||||
given constraints and selector. If ``c.core_type`` is ``selectable``, the selector is applied
|
||||
to resolve the core type constraint before computing concurrency; otherwise, the selector is
|
||||
ignored and the function behaves identically to the single-argument ``info::default_concurrency``.
|
||||
|
||||
Selector Requirements
|
||||
*********************
|
||||
|
||||
A selector is a callable object whose call operator has the following effective signature:
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
int operator()(std::tuple<tbb::core_type_id, std::size_t, std::size_t> core_type_info) const;
|
||||
|
||||
The tuple elements are:
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: 15 20 65
|
||||
|
||||
* - Index
|
||||
- Type
|
||||
- Description
|
||||
* - 0
|
||||
- ``tbb::core_type_id``
|
||||
- The core type identifier, as returned by ``tbb::info::core_types()``.
|
||||
* - 1
|
||||
- ``std::size_t``
|
||||
- Zero-based position of this core type in the vector returned by
|
||||
``tbb::info::core_types()`` (ordered from least to most performant).
|
||||
* - 2
|
||||
- ``std::size_t``
|
||||
- Total number of available core types (``tbb::info::core_types().size()``).
|
||||
|
||||
The selector is called once for each core type. Its return value is interpreted as follows:
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: 20 80
|
||||
|
||||
* - Score
|
||||
- Meaning
|
||||
* - Positive
|
||||
- The core type is selected for use by the arena. A higher score indicates a
|
||||
stronger preference; if the implementation can only use a single core type,
|
||||
it selects the one with the highest score.
|
||||
* - Zero
|
||||
- The core type is used **only** if multi-core-type constraints are not supported
|
||||
by the implementation. When there are positive scores and the rest are zero,
|
||||
the zeros act as a fallback to no constraint (rather than falling back
|
||||
to the single best-scored type).
|
||||
* - Negative
|
||||
- The core type is excluded from use by the arena.
|
||||
|
||||
If all scores are negative, no core type constraint is applied. That is equivalent to
|
||||
setting ``constraints::core_type`` to ``automatic``.
|
||||
|
||||
Example
|
||||
*******
|
||||
|
||||
.. literalinclude:: ./examples/core_type_selector.cpp
|
||||
:language: c++
|
||||
:start-after: /*begin_core_type_selector_example*/
|
||||
:end-before: /*end_core_type_selector_example*/
|
||||
|
||||
In this example, a selector excludes the least performant core type (index 0) and ranks the
|
||||
remaining types by their position. The ``task_arena`` is created with
|
||||
``constraints::core_type`` set to ``selectable``, so the selector is invoked to determine
|
||||
which core types the arena may use. The ``info::default_concurrency`` overload with a selector
|
||||
is used to query the effective concurrency before creating the arena.
|
||||
@@ -1,73 +0,0 @@
|
||||
.. _custom_mutex_chmap:
|
||||
|
||||
The customizing mutex type for ``concurrent_hash_map``
|
||||
======================================================
|
||||
|
||||
.. note::
|
||||
To enable this feature, define the ``TBB_PREVIEW_CONCURRENT_HASH_MAP_EXTENSIONS`` macro to 1.
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
:depth: 1
|
||||
|
||||
Description
|
||||
***********
|
||||
|
||||
oneTBB ``concurrnent_hash_map`` class uses reader-writer mutex
|
||||
to provide thread safety and avoid data races for insert, lookup, and erasure operations. This feature adds an extra template parameter
|
||||
for ``concurrent_hash_map`` that allows to customize the type of the reader-writer mutex.
|
||||
|
||||
API
|
||||
***
|
||||
|
||||
Header
|
||||
------
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
#include <oneapi/tbb/concurrent_hash_map.h>
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
namespace oneapi {
|
||||
namespace tbb {
|
||||
|
||||
template <typename Key, typename T,
|
||||
typename HashCompare = tbb_hash_compare<Key>,
|
||||
typename Allocator = tbb_allocator<std::pair<const Key, T>>,
|
||||
typename Mutex = spin_rw_mutex>
|
||||
class concurrent_hash_map {
|
||||
using mutex_type = Mutex;
|
||||
};
|
||||
|
||||
} // namespace tbb
|
||||
} // namespace oneapi
|
||||
|
||||
Type requirements
|
||||
-----------------
|
||||
|
||||
The type of the mutex passed as a template argument for ``concurrent_hash_map`` should
|
||||
meet the requirements of :onetbb-spec:`ReaderWriterMutex <named_requirements/mutexes/rw_mutex>`.
|
||||
It should also provide the following API:
|
||||
|
||||
.. cpp:function:: bool ReaderWriterMutex::scoped_lock::is_writer() const;
|
||||
|
||||
**Returns**: ``true`` if the ``scoped_lock`` object acquires the mutex as a writer, ``false`` otherwise.
|
||||
|
||||
The behavior is undefined if the ``scoped_lock`` object does not acquire the mutex.
|
||||
|
||||
``oneapi::tbb::spin_rw_mutex``, ``oneapi::tbb::speculative_spin_rw_mutex``, ``oneapi::tbb::queuing_rw_mutex``, ``oneapi::tbb::null_rw_mutex``,
|
||||
and ``oneapi::tbb::rw_mutex`` meet the requirements above.
|
||||
|
||||
.. rubric:: Example
|
||||
|
||||
The example below demonstrates how to wrap ``std::shared_mutex`` (C++17) to meet the requirements
|
||||
of `ReaderWriterMutex` and how to customize ``concurrent_hash_map`` to use this mutex.
|
||||
|
||||
.. literalinclude:: ./examples/custom_mutex_chmap_example.cpp
|
||||
:language: c++
|
||||
:start-after: /*begin_custom_mutex_chmap_example*/
|
||||
:end-before: /*end_custom_mutex_chmap_example*/
|
||||
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2026 UXL Foundation Contributors
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
/*begin_allocate_numa_interleaved_example*/
|
||||
#define TBB_PREVIEW_NUMA_ALLOCATION 1
|
||||
|
||||
#include <oneapi/tbb/numa_allocation.h>
|
||||
#include <oneapi/tbb/parallel_for.h>
|
||||
|
||||
int main() {
|
||||
std::size_t array_size = 10LLU * 1024 * 1024;
|
||||
double* ptr =
|
||||
(double*)oneapi::tbb::allocate_numa_interleaved(array_size * sizeof(double));
|
||||
if (!ptr)
|
||||
return -1;
|
||||
oneapi::tbb::parallel_for(std::size_t(0), array_size, [=](std::size_t i) {
|
||||
ptr[i] = i;
|
||||
});
|
||||
|
||||
oneapi::tbb::deallocate_numa_interleaved(ptr, array_size * sizeof(double));
|
||||
}
|
||||
/*end_allocate_numa_interleaved_example*/
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2026 UXL Foundation Contributors
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
/*begin_allocate_numa_interleaved_pool_example*/
|
||||
#define TBB_PREVIEW_MEMORY_POOL 1
|
||||
#define TBB_PREVIEW_NUMA_ALLOCATION 1
|
||||
|
||||
#include <oneapi/tbb/numa_allocation.h>
|
||||
#include <oneapi/tbb/memory_pool.h>
|
||||
#include <oneapi/tbb/parallel_for.h>
|
||||
|
||||
#include <array>
|
||||
#include <vector>
|
||||
|
||||
class numa_interleaved_provider {
|
||||
static constexpr std::size_t page_size = 4 * 1024;
|
||||
public:
|
||||
// Guarantee that each allocation is a multiple of the system page size,
|
||||
// so allocate_numa_interleaved() requirements are satisfied.
|
||||
typedef std::array<char, page_size> value_type;
|
||||
numa_interleaved_provider() {}
|
||||
// Like std::allocator<T>::allocate, these functions expect the number of
|
||||
// objects of the same size as sizeof(value_type).
|
||||
void* allocate(std::size_t num_of_objects) {
|
||||
return oneapi::tbb::allocate_numa_interleaved(num_of_objects * sizeof(value_type));
|
||||
}
|
||||
void deallocate(void* ptr, std::size_t num_of_objects) {
|
||||
oneapi::tbb::deallocate_numa_interleaved(ptr, num_of_objects * sizeof(value_type));
|
||||
}
|
||||
};
|
||||
|
||||
int main() {
|
||||
// Memory pool requests memory in big chunks, slices them internally and uses
|
||||
// memory caching, so may improve performance for many small allocations and
|
||||
// scenarios with the objects reuse.
|
||||
oneapi::tbb::memory_pool<numa_interleaved_provider> pool;
|
||||
|
||||
oneapi::tbb::parallel_for(0, 1024*1024, [&pool](std::size_t) {
|
||||
// Temporary arrays allocated from the pool will reside in different
|
||||
// NUMA domains for better overall memory throughput.
|
||||
// As the pool caches the memory, on average it is faster than
|
||||
// allocate_numa_interleaved()/deallocate_numa_interleaved().
|
||||
double* ptr = (double*)pool.malloc(10*1000*sizeof(double));
|
||||
// ...
|
||||
pool.free(ptr);
|
||||
});
|
||||
|
||||
// std::vector uses interleaved NUMA memory
|
||||
using pool_allocator_t = oneapi::tbb::memory_pool_allocator<double>;
|
||||
std::vector<double, pool_allocator_t> values(pool_allocator_t{pool});
|
||||
values.push_back(3.14);
|
||||
}
|
||||
/*end_allocate_numa_interleaved_pool_example*/
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2025 Intel Corporation
|
||||
Copyright (c) 2025 UXL Foundation Contributors
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
/*begin_assertion_handler_example*/
|
||||
#include <oneapi/tbb/global_control.h>
|
||||
#include <fstream>
|
||||
|
||||
auto default_handler = tbb::get_assertion_handler();
|
||||
|
||||
void wrapper_assertion_handler(const char* location, int line,
|
||||
const char* expression, const char* comment) {
|
||||
// Execute a custom step before the default handler: log the assertion
|
||||
std::ofstream log{"example.log", std::ios::app};
|
||||
log << "Function: " << location << ", line: " << line << ", assertion "
|
||||
<< expression << " failed: " << comment << "\n";
|
||||
log.close();
|
||||
|
||||
default_handler(location, line, expression, comment);
|
||||
}
|
||||
|
||||
int main() {
|
||||
// Set custom handler
|
||||
tbb::set_assertion_handler(wrapper_assertion_handler);
|
||||
|
||||
// Use oneTBB normally - any assertion failures will use custom handler
|
||||
// ...
|
||||
|
||||
// Restore the default handler
|
||||
tbb::set_assertion_handler(nullptr);
|
||||
}
|
||||
/*end_assertion_handler_example*/
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2026 UXL Foundation Contributors
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
/*begin_core_type_selector_example*/
|
||||
#define TBB_PREVIEW_TASK_ARENA_CORE_TYPE_SELECTOR 1
|
||||
|
||||
#include <oneapi/tbb/task_arena.h>
|
||||
#include <oneapi/tbb/info.h>
|
||||
#include <oneapi/tbb/parallel_for.h>
|
||||
|
||||
#include <cstdio>
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
||||
int main() {
|
||||
tbb::task_arena::constraints c;
|
||||
c.set_core_type(tbb::task_arena::selectable);
|
||||
auto selector = [](std::tuple<tbb::core_type_id, std::size_t, std::size_t> core_type) -> int {
|
||||
auto index = std::get<1>(core_type);
|
||||
auto total = std::get<2>(core_type);
|
||||
// Exclude the least performant type when there is more than one;
|
||||
// rank the rest by index (higher index = higher score).
|
||||
return (total > 1 && index == 0) ? -1 : static_cast<int>(index);
|
||||
};
|
||||
|
||||
// Query the effective concurrency for these constraints and selector.
|
||||
int concurrency = tbb::info::default_concurrency(c, selector);
|
||||
std::printf("Effective concurrency: %d\n", concurrency);
|
||||
|
||||
// Create a task arena that uses the selected core types.
|
||||
tbb::task_arena arena(c, selector);
|
||||
|
||||
std::vector<double> data(1000);
|
||||
|
||||
arena.execute([&data] {
|
||||
tbb::parallel_for(std::size_t(0), data.size(),
|
||||
[&data](std::size_t i) {
|
||||
data[i] = static_cast<double>(i * i);
|
||||
});
|
||||
});
|
||||
|
||||
std::printf("data[999] = %.0f\n", data[999]);
|
||||
}
|
||||
/*end_core_type_selector_example*/
|
||||
@@ -1,129 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2025 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.
|
||||
*/
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
|
||||
/*begin_custom_mutex_chmap_example*/
|
||||
#define TBB_PREVIEW_CONCURRENT_HASH_MAP_EXTENSIONS 1
|
||||
#include "oneapi/tbb/concurrent_hash_map.h"
|
||||
#include <shared_mutex>
|
||||
|
||||
class SharedMutexWrapper {
|
||||
public:
|
||||
// ReaderWriterMutex requirements
|
||||
|
||||
static constexpr bool is_rw_mutex = true;
|
||||
static constexpr bool is_recursive_mutex = false;
|
||||
static constexpr bool is_fair_mutex = false;
|
||||
|
||||
class scoped_lock {
|
||||
public:
|
||||
scoped_lock() : my_mutex_ptr(nullptr), my_writer_flag(false) {}
|
||||
scoped_lock(SharedMutexWrapper& mutex, bool write = true)
|
||||
: my_mutex_ptr(&mutex), my_writer_flag(write)
|
||||
{
|
||||
if (my_writer_flag) {
|
||||
my_mutex_ptr->my_mutex.lock();
|
||||
} else {
|
||||
my_mutex_ptr->my_mutex.lock_shared();
|
||||
}
|
||||
}
|
||||
|
||||
~scoped_lock() {
|
||||
if (my_mutex_ptr) release();
|
||||
}
|
||||
|
||||
void acquire(SharedMutexWrapper& mutex, bool write = true) {
|
||||
if (my_mutex_ptr) release();
|
||||
|
||||
my_mutex_ptr = &mutex;
|
||||
my_writer_flag = write;
|
||||
|
||||
if (my_writer_flag) {
|
||||
my_mutex_ptr->my_mutex.lock();
|
||||
} else {
|
||||
my_mutex_ptr->my_mutex.lock_shared();
|
||||
}
|
||||
}
|
||||
|
||||
bool try_acquire(SharedMutexWrapper& mutex, bool write = true) {
|
||||
if (my_mutex_ptr) release();
|
||||
|
||||
my_mutex_ptr = &mutex;
|
||||
|
||||
bool result = false;
|
||||
|
||||
if (my_writer_flag) {
|
||||
result = my_mutex_ptr->my_mutex.try_lock();
|
||||
} else {
|
||||
result = my_mutex_ptr->my_mutex.try_lock_shared();
|
||||
}
|
||||
|
||||
if (result) my_writer_flag = write;
|
||||
return result;
|
||||
}
|
||||
|
||||
void release() {
|
||||
if (my_writer_flag) {
|
||||
my_mutex_ptr->my_mutex.unlock();
|
||||
} else {
|
||||
my_mutex_ptr->my_mutex.unlock_shared();
|
||||
}
|
||||
}
|
||||
|
||||
bool upgrade_to_writer() {
|
||||
// std::shared_mutex does not have the upgrade/downgrade semantics
|
||||
if (my_writer_flag) return true; // Already a writer
|
||||
|
||||
my_mutex_ptr->my_mutex.unlock_shared();
|
||||
my_mutex_ptr->my_mutex.lock();
|
||||
return false; // The lock was reacquired
|
||||
}
|
||||
|
||||
bool downgrade_to_reader() {
|
||||
if (!my_writer_flag) return true; // Already a reader
|
||||
|
||||
my_mutex_ptr->my_mutex.unlock();
|
||||
my_mutex_ptr->my_mutex.lock_shared();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool is_writer() const {
|
||||
return my_writer_flag;
|
||||
}
|
||||
|
||||
private:
|
||||
SharedMutexWrapper* my_mutex_ptr;
|
||||
bool my_writer_flag;
|
||||
};
|
||||
private:
|
||||
std::shared_mutex my_mutex;
|
||||
}; // struct SharedMutexWrapper
|
||||
|
||||
int main() {
|
||||
using map_type = oneapi::tbb::concurrent_hash_map<int, int,
|
||||
oneapi::tbb::tbb_hash_compare<int>,
|
||||
oneapi::tbb::tbb_allocator<std::pair<const int, int>>,
|
||||
SharedMutexWrapper>;
|
||||
|
||||
map_type map; // This object will use SharedMutexWrapper for thread safety of insert/find/erase operations
|
||||
}
|
||||
/*end_custom_mutex_chmap_example*/
|
||||
|
||||
#else // C++17
|
||||
// Skip
|
||||
int main() {}
|
||||
#endif
|
||||