aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorAlexander Smirnov <alex@ydb.tech>2025-02-24 18:38:30 +0000
committerAlexander Smirnov <alex@ydb.tech>2025-02-24 18:38:30 +0000
commita674a8f6c0a31e5a5c3b28333d533ae31797ecaa (patch)
treed0743df9a014a294168c54e417a4565186a904ca /contrib
parent4b706240f28681a5580e79e1b333a695a628f719 (diff)
parent528c4caecb8037bbb191b114717af75bc26dbbea (diff)
downloadydb-a674a8f6c0a31e5a5c3b28333d533ae31797ecaa.tar.gz
Merge pull request #14964 from ydb-platform/merge-libs-250224-1527
Diffstat (limited to 'contrib')
-rw-r--r--contrib/libs/protobuf_old/protoherobora.py13
-rw-r--r--contrib/libs/tbb/.yandex_meta/__init__.py64
-rw-r--r--contrib/libs/tbb/.yandex_meta/devtools.copyrights.report82
-rw-r--r--contrib/libs/tbb/.yandex_meta/devtools.licenses.report3
-rw-r--r--contrib/libs/tbb/.yandex_meta/licenses.list.txt8
-rw-r--r--contrib/libs/tbb/.yandex_meta/override.nix14
-rw-r--r--contrib/libs/tbb/INSTALL.md13
-rw-r--r--contrib/libs/tbb/README.md3
-rw-r--r--contrib/libs/tbb/RELEASE_NOTES.md40
-rw-r--r--contrib/libs/tbb/SECURITY.md7
-rw-r--r--contrib/libs/tbb/SYSTEM_REQUIREMENTS.md59
-rw-r--r--contrib/libs/tbb/WASM_Support.md31
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/concurrent_hash_map.h14
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/concurrent_lru_cache.h14
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/concurrent_queue.h186
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/concurrent_vector.h2
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/detail/_aggregator.h7
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/detail/_concurrent_queue_base.h16
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/detail/_concurrent_skip_list.h1
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/detail/_concurrent_unordered_base.h20
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/detail/_config.h18
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_body_impl.h10
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_join_impl.h20
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_node_impl.h12
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_tagged_buffer_impl.h10
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/detail/_machine.h12
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/detail/_pipeline_filters.h10
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/detail/_pipeline_filters_deduction.h10
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/detail/_segment_table.h15
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/detail/_task.h4
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/detail/_template_helpers.h4
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/detail/_utils.h21
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/flow_graph.h42
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/info.h12
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/parallel_for.h20
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/parallel_for_each.h33
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/parallel_reduce.h38
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/parallel_scan.h25
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/partitioner.h7
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/profiling.h6
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/task_arena.h9
-rw-r--r--contrib/libs/tbb/include/oneapi/tbb/version.h6
-rw-r--r--contrib/libs/tbb/patches/config.patch14
-rw-r--r--contrib/libs/tbb/patches/ucontext-darwin.patch10
-rw-r--r--contrib/libs/tbb/src/tbb/arena.cpp10
-rw-r--r--contrib/libs/tbb/src/tbb/arena_slot.h2
-rw-r--r--contrib/libs/tbb/src/tbb/dynamic_link.cpp7
-rw-r--r--contrib/libs/tbb/src/tbb/itt_notify.h5
-rw-r--r--contrib/libs/tbb/src/tbb/main.cpp1
-rw-r--r--contrib/libs/tbb/src/tbb/rml_thread_monitor.h20
-rw-r--r--contrib/libs/tbb/src/tbb/semaphore.h53
-rw-r--r--contrib/libs/tbb/src/tbb/task_stream.h9
-rw-r--r--contrib/libs/tbb/src/tbb/tools_api/disable_warnings.h8
-rw-r--r--contrib/libs/tbb/src/tbb/tools_api/ittnotify.h168
-rw-r--r--contrib/libs/tbb/src/tbb/tools_api/ittnotify_config.h128
-rw-r--r--contrib/libs/tbb/src/tbb/tools_api/ittnotify_static.c384
-rw-r--r--contrib/libs/tbb/src/tbb/tools_api/ittnotify_static.h11
-rw-r--r--contrib/libs/tbb/src/tbb/tools_api/ittnotify_types.h2
-rw-r--r--contrib/libs/tbb/src/tbb/tools_api/legacy/ittnotify.h35
-rw-r--r--contrib/libs/tbb/ya.make6
-rw-r--r--contrib/python/pip/.dist-info/METADATA2
-rw-r--r--contrib/python/pip/pip/__init__.py2
-rw-r--r--contrib/python/pip/pip/_internal/build_env.py5
-rw-r--r--contrib/python/pip/pip/_internal/metadata/importlib/_dists.py3
-rw-r--r--contrib/python/pip/ya.make2
65 files changed, 1331 insertions, 497 deletions
diff --git a/contrib/libs/protobuf_old/protoherobora.py b/contrib/libs/protobuf_old/protoherobora.py
index 9b85a204bc..fe4a0174b4 100644
--- a/contrib/libs/protobuf_old/protoherobora.py
+++ b/contrib/libs/protobuf_old/protoherobora.py
@@ -132,6 +132,14 @@ def find_lld(args):
raise IndexError()
+def find_clang(args):
+ for x in args:
+ if 'clang++' in x:
+ return x
+
+ raise IndexError()
+
+
def fix_py2(cmd, have_comand_files=False, prefix='lib', suffix='a'):
args = cmd
@@ -156,7 +164,10 @@ def fix_py2(cmd, have_comand_files=False, prefix='lib', suffix='a'):
try:
where = os.path.dirname(cmd[cmd.index('--objcopy-exe') + 1]) + '/'
except ValueError:
- where = os.path.dirname(find_lld(cmd)) + '/'
+ try:
+ where = os.path.dirname(find_lld(cmd)) + '/'
+ except IndexError:
+ where = os.path.dirname(find_clang(cmd)) + '/'
for x in args:
if need_rename(x):
diff --git a/contrib/libs/tbb/.yandex_meta/__init__.py b/contrib/libs/tbb/.yandex_meta/__init__.py
new file mode 100644
index 0000000000..21e634041d
--- /dev/null
+++ b/contrib/libs/tbb/.yandex_meta/__init__.py
@@ -0,0 +1,64 @@
+from devtools.yamaker.modules import Linkable, Switch
+from devtools.yamaker.project import CMakeNinjaNixProject
+
+
+def post_install(self):
+ with self.yamakes["."] as m:
+ m.SRCS.remove("src/tbb/itt_notify.cpp")
+ m.CFLAGS.remove("-D__TBB_USE_ITT_NOTIFY")
+ m.after(
+ "SRCS",
+ Switch(
+ {
+ "CLANG OR CLANG_CL": Switch(
+ {
+ "ARCH_I386 OR ARCH_I686 OR ARCH_X86_64": Linkable(CFLAGS=["-mrtm", "-mwaitpkg"]),
+ }
+ ),
+ }
+ ),
+ )
+ m.after(
+ "SRCS",
+ Switch(
+ default=Linkable(CFLAGS=["-DUSE_PTHREAD"]),
+ OS_WINDOWS=Linkable(CFLAGS=["-DUSE_WINTHREAD"]),
+ ),
+ )
+ m.after(
+ "SRCS",
+ Switch(
+ {
+ "GCC": Linkable(CFLAGS=["-flifetime-dse=1", "-mrtm"]),
+ }
+ ),
+ )
+ m.after(
+ "SRCS",
+ Switch(
+ {
+ "NOT ARCH_ARM64": Linkable(
+ CFLAGS=["-D__TBB_USE_ITT_NOTIFY", "-DDO_ITT_NOTIFY"],
+ SRCS=["src/tbb/itt_notify.cpp"],
+ )
+ }
+ ),
+ )
+
+
+tbb = CMakeNinjaNixProject(
+ license="Apache-2.0",
+ arcdir="contrib/libs/tbb",
+ nixattr="tbb",
+ build_targets=["tbb"],
+ addincl_global={".": {"./include"}},
+ copy_sources=["include/"],
+ disable_includes=[
+ # if defined(__OpenBSD__) || __TBB_has_include(<sys/futex.h>)
+ "sys/futex.h",
+ # if __TBB_CPP17_MEMORY_RESOURCE_PRESENT
+ "memory_resource",
+ "tbb_misc.h",
+ ],
+ post_install=post_install,
+)
diff --git a/contrib/libs/tbb/.yandex_meta/devtools.copyrights.report b/contrib/libs/tbb/.yandex_meta/devtools.copyrights.report
index 8d1377e5a8..041a1b725e 100644
--- a/contrib/libs/tbb/.yandex_meta/devtools.copyrights.report
+++ b/contrib/libs/tbb/.yandex_meta/devtools.copyrights.report
@@ -47,6 +47,48 @@ BELONGS ya.make
src/tbb/small_object_pool_impl.h [2:2]
src/tbb/version.cpp [2:2]
+KEEP COPYRIGHT_SERVICE_LABEL 3866399ed19ebc1f304703a69bd54dfb
+BELONGS ya.make
+ License text:
+ Copyright (c) 2020-2023 Intel Corporation
+ Scancode info:
+ Original SPDX id: COPYRIGHT_SERVICE_LABEL
+ Score : 100.00
+ Match type : COPYRIGHT
+ Files with this license:
+ include/oneapi/tbb/detail/_task.h [2:2]
+
+KEEP COPYRIGHT_SERVICE_LABEL 386e9140344d54f8b754c4445aff38ff
+BELONGS ya.make
+ License text:
+ Copyright (c) 2005-2023 Intel Corporation
+ Scancode info:
+ Original SPDX id: COPYRIGHT_SERVICE_LABEL
+ Score : 100.00
+ Match type : COPYRIGHT
+ Files with this license:
+ include/oneapi/tbb/concurrent_queue.h [2:2]
+ include/oneapi/tbb/detail/_concurrent_unordered_base.h [2:2]
+ include/oneapi/tbb/detail/_config.h [2:2]
+ include/oneapi/tbb/detail/_flow_graph_body_impl.h [2:2]
+ include/oneapi/tbb/detail/_flow_graph_node_impl.h [2:2]
+ include/oneapi/tbb/detail/_flow_graph_tagged_buffer_impl.h [2:2]
+ include/oneapi/tbb/detail/_machine.h [2:2]
+ include/oneapi/tbb/detail/_pipeline_filters.h [2:2]
+ include/oneapi/tbb/detail/_pipeline_filters_deduction.h [2:2]
+ include/oneapi/tbb/detail/_template_helpers.h [2:2]
+ include/oneapi/tbb/detail/_utils.h [2:2]
+ include/oneapi/tbb/flow_graph.h [2:2]
+ include/oneapi/tbb/parallel_for.h [2:2]
+ include/oneapi/tbb/parallel_for_each.h [2:2]
+ include/oneapi/tbb/parallel_reduce.h [2:2]
+ include/oneapi/tbb/parallel_scan.h [2:2]
+ include/oneapi/tbb/partitioner.h [2:2]
+ include/oneapi/tbb/profiling.h [2:2]
+ include/oneapi/tbb/version.h [2:2]
+ src/tbb/dynamic_link.cpp [2:2]
+ src/tbb/tools_api/ittnotify_config.h [2:2]
+
KEEP COPYRIGHT_SERVICE_LABEL 3abceee12813f5f5c1ed7a506777af26
BELONGS ya.make
License text:
@@ -78,7 +120,6 @@ BELONGS ya.make
include/oneapi/tbb/concurrent_map.h [2:2]
include/oneapi/tbb/concurrent_set.h [2:2]
include/oneapi/tbb/detail/_node_handle.h [2:2]
- include/oneapi/tbb/info.h [2:2]
include/tbb/concurrent_map.h [2:2]
include/tbb/concurrent_set.h [2:2]
include/tbb/info.h [2:2]
@@ -94,52 +135,40 @@ BELONGS ya.make
Files with this license:
include/oneapi/tbb/cache_aligned_allocator.h [2:2]
include/oneapi/tbb/concurrent_hash_map.h [2:2]
+ include/oneapi/tbb/concurrent_lru_cache.h [2:2]
include/oneapi/tbb/concurrent_priority_queue.h [2:2]
- include/oneapi/tbb/concurrent_queue.h [2:2]
include/oneapi/tbb/concurrent_unordered_map.h [2:2]
include/oneapi/tbb/concurrent_unordered_set.h [2:2]
include/oneapi/tbb/concurrent_vector.h [2:2]
include/oneapi/tbb/detail/_aggregator.h [2:2]
include/oneapi/tbb/detail/_assert.h [2:2]
include/oneapi/tbb/detail/_concurrent_queue_base.h [2:2]
- include/oneapi/tbb/detail/_concurrent_unordered_base.h [2:2]
- include/oneapi/tbb/detail/_config.h [2:2]
- include/oneapi/tbb/detail/_flow_graph_body_impl.h [2:2]
include/oneapi/tbb/detail/_flow_graph_cache_impl.h [2:2]
include/oneapi/tbb/detail/_flow_graph_impl.h [2:2]
include/oneapi/tbb/detail/_flow_graph_item_buffer_impl.h [2:2]
include/oneapi/tbb/detail/_flow_graph_join_impl.h [2:2]
- include/oneapi/tbb/detail/_flow_graph_node_impl.h [2:2]
- include/oneapi/tbb/detail/_flow_graph_tagged_buffer_impl.h [2:2]
include/oneapi/tbb/detail/_flow_graph_trace_impl.h [2:2]
include/oneapi/tbb/detail/_flow_graph_types_impl.h [2:2]
- include/oneapi/tbb/detail/_machine.h [2:2]
- include/oneapi/tbb/detail/_pipeline_filters.h [2:2]
include/oneapi/tbb/detail/_scoped_lock.h [2:2]
include/oneapi/tbb/detail/_segment_table.h [2:2]
include/oneapi/tbb/enumerable_thread_specific.h [2:2]
- include/oneapi/tbb/flow_graph.h [2:2]
include/oneapi/tbb/memory_pool.h [2:2]
- include/oneapi/tbb/parallel_reduce.h [2:2]
- include/oneapi/tbb/partitioner.h [2:2]
- include/oneapi/tbb/profiling.h [2:2]
include/oneapi/tbb/queuing_mutex.h [2:2]
include/oneapi/tbb/queuing_rw_mutex.h [2:2]
include/oneapi/tbb/task_arena.h [2:2]
include/oneapi/tbb/task_group.h [2:2]
- include/oneapi/tbb/version.h [2:2]
src/tbb/allocator.cpp [2:2]
src/tbb/arena.cpp [2:2]
src/tbb/arena.h [2:2]
src/tbb/arena_slot.h [2:2]
src/tbb/co_context.h [2:2]
- src/tbb/dynamic_link.cpp [2:2]
src/tbb/dynamic_link.h [2:2]
src/tbb/exception.cpp [2:2]
src/tbb/global_control.cpp [2:2]
src/tbb/governor.cpp [2:2]
src/tbb/governor.h [2:2]
src/tbb/itt_notify.cpp [2:2]
+ src/tbb/itt_notify.h [2:2]
src/tbb/main.cpp [2:2]
src/tbb/market.cpp [2:2]
src/tbb/market.h [2:2]
@@ -162,7 +191,12 @@ BELONGS ya.make
src/tbb/task_group_context.cpp [2:2]
src/tbb/task_stream.h [2:2]
src/tbb/tls.h [2:2]
- src/tbb/tools_api/ittnotify_config.h [2:2]
+ src/tbb/tools_api/disable_warnings.h [2:2]
+ src/tbb/tools_api/ittnotify.h [2:2]
+ src/tbb/tools_api/ittnotify_static.c [2:2]
+ src/tbb/tools_api/ittnotify_static.h [2:2]
+ src/tbb/tools_api/ittnotify_types.h [2:2]
+ src/tbb/tools_api/legacy/ittnotify.h [2:2]
KEEP COPYRIGHT_SERVICE_LABEL 868e48910e495ab3c256b805ace087a1
BELONGS ya.make
@@ -185,6 +219,7 @@ BELONGS ya.make
Match type : COPYRIGHT
Files with this license:
include/oneapi/tbb/detail/_concurrent_skip_list.h [2:2]
+ include/oneapi/tbb/info.h [2:2]
KEEP COPYRIGHT_SERVICE_LABEL ca359ffcc18a725e17810fbe93800626
BELONGS ya.make
@@ -200,7 +235,6 @@ BELONGS ya.make
include/oneapi/tbb/blocked_range2d.h [2:2]
include/oneapi/tbb/blocked_range3d.h [2:2]
include/oneapi/tbb/combinable.h [2:2]
- include/oneapi/tbb/concurrent_lru_cache.h [2:2]
include/oneapi/tbb/detail/_aligned_space.h [2:2]
include/oneapi/tbb/detail/_allocator_traits.h [2:2]
include/oneapi/tbb/detail/_containers_helpers.h [2:2]
@@ -210,22 +244,16 @@ BELONGS ya.make
include/oneapi/tbb/detail/_flow_graph_nodes_deduction.h [2:2]
include/oneapi/tbb/detail/_hash_compare.h [2:2]
include/oneapi/tbb/detail/_intrusive_list_node.h [2:2]
- include/oneapi/tbb/detail/_pipeline_filters_deduction.h [2:2]
include/oneapi/tbb/detail/_range_common.h [2:2]
include/oneapi/tbb/detail/_rtm_mutex.h [2:2]
include/oneapi/tbb/detail/_rtm_rw_mutex.h [2:2]
include/oneapi/tbb/detail/_string_resource.h [2:2]
- include/oneapi/tbb/detail/_template_helpers.h [2:2]
- include/oneapi/tbb/detail/_utils.h [2:2]
include/oneapi/tbb/flow_graph_abstractions.h [2:2]
include/oneapi/tbb/global_control.h [2:2]
include/oneapi/tbb/null_mutex.h [2:2]
include/oneapi/tbb/null_rw_mutex.h [2:2]
- include/oneapi/tbb/parallel_for.h [2:2]
- include/oneapi/tbb/parallel_for_each.h [2:2]
include/oneapi/tbb/parallel_invoke.h [2:2]
include/oneapi/tbb/parallel_pipeline.h [2:2]
- include/oneapi/tbb/parallel_scan.h [2:2]
include/oneapi/tbb/parallel_sort.h [2:2]
include/oneapi/tbb/scalable_allocator.h [2:2]
include/oneapi/tbb/spin_mutex.h [2:2]
@@ -283,18 +311,11 @@ BELONGS ya.make
src/tbb/concurrent_monitor_mutex.h [2:2]
src/tbb/def/lin64-tbb.def [2:2]
src/tbb/intrusive_list.h [2:2]
- src/tbb/itt_notify.h [2:2]
src/tbb/mailbox.h [2:2]
src/tbb/main.h [2:2]
src/tbb/misc.cpp [2:2]
src/tbb/rml_base.h [2:2]
src/tbb/rml_tbb.h [2:2]
- src/tbb/tools_api/disable_warnings.h [2:2]
- src/tbb/tools_api/ittnotify.h [2:2]
- src/tbb/tools_api/ittnotify_static.c [2:2]
- src/tbb/tools_api/ittnotify_static.h [2:2]
- src/tbb/tools_api/ittnotify_types.h [2:2]
- src/tbb/tools_api/legacy/ittnotify.h [2:2]
src/tbb/waiters.h [2:2]
KEEP COPYRIGHT_SERVICE_LABEL da3083268e79dd67d6ab0935b4c82192
@@ -306,7 +327,6 @@ BELONGS ya.make
Score : 100.00
Match type : COPYRIGHT
Files with this license:
- include/oneapi/tbb/detail/_task.h [2:2]
src/tbb/task_dispatcher.cpp [2:2]
src/tbb/task_dispatcher.h [2:2]
src/tbb/thread_data.h [2:2]
diff --git a/contrib/libs/tbb/.yandex_meta/devtools.licenses.report b/contrib/libs/tbb/.yandex_meta/devtools.licenses.report
index 84dde01a48..7231077852 100644
--- a/contrib/libs/tbb/.yandex_meta/devtools.licenses.report
+++ b/contrib/libs/tbb/.yandex_meta/devtools.licenses.report
@@ -84,7 +84,7 @@ BELONGS ya.make
Match type : NOTICE
Links : http://www.apache.org/licenses/, http://www.apache.org/licenses/LICENSE-2.0, https://spdx.org/licenses/Apache-2.0
Files with this license:
- README.md [45:46]
+ README.md [48:49]
KEEP Apache-2.0 AND Apache-2.0 640d2de508aaacd65f56f04b562671d3
BELONGS ya.make
@@ -351,3 +351,4 @@ BELONGS ya.make
Files with this license:
CONTRIBUTING.md [4:14]
RELEASE_NOTES.md [4:14]
+ WASM_Support.md [4:14]
diff --git a/contrib/libs/tbb/.yandex_meta/licenses.list.txt b/contrib/libs/tbb/.yandex_meta/licenses.list.txt
index 1518c2cb94..c2abc130b0 100644
--- a/contrib/libs/tbb/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/tbb/.yandex_meta/licenses.list.txt
@@ -251,6 +251,10 @@ Licensing is very important to open source projects. It helps ensure the softwar
====================COPYRIGHT====================
+ Copyright (c) 2005-2023 Intel Corporation
+
+
+====================COPYRIGHT====================
Copyright (c) 2017-2021 Intel Corporation
@@ -275,4 +279,8 @@ Licensing is very important to open source projects. It helps ensure the softwar
====================COPYRIGHT====================
+ Copyright (c) 2020-2023 Intel Corporation
+
+
+====================COPYRIGHT====================
Copyright (c) 2021 Intel Corporation
diff --git a/contrib/libs/tbb/.yandex_meta/override.nix b/contrib/libs/tbb/.yandex_meta/override.nix
new file mode 100644
index 0000000000..928ebd5da0
--- /dev/null
+++ b/contrib/libs/tbb/.yandex_meta/override.nix
@@ -0,0 +1,14 @@
+pkgs: attrs: with pkgs; rec {
+ version = "2021.10.0";
+
+ src = fetchFromGitHub {
+ owner = "uxlfoundation";
+ repo = "oneTBB";
+ rev = "v${version}";
+ hash = "sha256-HhZ4TBXqIZKkMB6bafOs8kt4EqkqStFjpoVQ3G+Rn4M=";
+ };
+
+ patches = [];
+
+ nativeBuildInputs = [ cmake ];
+}
diff --git a/contrib/libs/tbb/INSTALL.md b/contrib/libs/tbb/INSTALL.md
index 6fff47a165..3c63c9fd84 100644
--- a/contrib/libs/tbb/INSTALL.md
+++ b/contrib/libs/tbb/INSTALL.md
@@ -77,6 +77,19 @@ cmake <options> ..
cpack
```
+## Installation from vcpkg
+
+You can download and install oneTBB using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
+```sh
+ git clone https://github.com/Microsoft/vcpkg.git
+ cd vcpkg
+ ./bootstrap-vcpkg.sh #.\bootstrap-vcpkg.bat(for Windows)
+ ./vcpkg integrate install
+ ./vcpkg install tbb
+```
+
+The oneTBB port in vcpkg is kept up to date by Microsoft* team members and community contributors. If the version is out of date, create an issue or pull request on the [vcpkg repository](https://github.com/Microsoft/vcpkg).
+
## Example of Installation
### Single-configuration generators
diff --git a/contrib/libs/tbb/README.md b/contrib/libs/tbb/README.md
index e51f1c4585..b96e1fb000 100644
--- a/contrib/libs/tbb/README.md
+++ b/contrib/libs/tbb/README.md
@@ -20,6 +20,8 @@ Refer to oneTBB [examples](examples) and [samples](https://github.com/oneapi-src
oneTBB is a part of [oneAPI](https://oneapi.io). The current branch implements version 1.1 of oneAPI Specification.
+> **_NOTE:_** Threading Building Blocks (TBB) is now called oneAPI Threading Building Blocks (oneTBB) to highlight that the tool is a part of the oneAPI ecosystem.
+
## Release Information
Here are [Release Notes](RELEASE_NOTES.md) and [System Requirements](SYSTEM_REQUIREMENTS.md).
@@ -31,6 +33,7 @@ Here are [Release Notes](RELEASE_NOTES.md) and [System Requirements](SYSTEM_REQU
* [oneTBB Testing Approach](https://oneapi-src.github.io/oneTBB/main/intro/testing_approach.html)
* [Basic support for the Bazel build system](Bazel.md)
* [oneTBB Discussions](https://github.com/oneapi-src/oneTBB/discussions)
+* [WASM Support](WASM_Support.md)
## Installation
See [Installation from Sources](INSTALL.md) to learn how to install oneTBB.
diff --git a/contrib/libs/tbb/RELEASE_NOTES.md b/contrib/libs/tbb/RELEASE_NOTES.md
index 6e7093059a..57258416fe 100644
--- a/contrib/libs/tbb/RELEASE_NOTES.md
+++ b/contrib/libs/tbb/RELEASE_NOTES.md
@@ -18,36 +18,26 @@
This document contains changes of oneTBB compared to the last release.
## Table of Contents <!-- omit in toc -->
-- [New Features](#new_features)
+- [New Features](#new-features)
- [Known Limitations](#known-limitations)
- [Fixed Issues](#fixed-issues)
-- [Open-source Contributions Integrated](#open-source-contributions-integrated)
-## :white_check_mark: 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.
+## :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
-- 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().
+- 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: Fixed Issues
-- 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).
+- 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.
diff --git a/contrib/libs/tbb/SECURITY.md b/contrib/libs/tbb/SECURITY.md
new file mode 100644
index 0000000000..c4a49dd553
--- /dev/null
+++ b/contrib/libs/tbb/SECURITY.md
@@ -0,0 +1,7 @@
+# Security Policy
+Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution,
+impact, severity and mitigation.
+
+## Reporting a Vulnerability
+Please report any security vulnerabilities in this project
+[utilizing the guidelines here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html).
diff --git a/contrib/libs/tbb/SYSTEM_REQUIREMENTS.md b/contrib/libs/tbb/SYSTEM_REQUIREMENTS.md
index c6a6c0bea5..803041c641 100644
--- a/contrib/libs/tbb/SYSTEM_REQUIREMENTS.md
+++ b/contrib/libs/tbb/SYSTEM_REQUIREMENTS.md
@@ -21,14 +21,15 @@ This document provides details about hardware, operating system, and software pr
- [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) Xeon Phi* processor family
- Intel(R) Atom* processor family
- Non-Intel(R) processors compatible with the processors listed above
@@ -36,30 +37,50 @@ This document provides details about hardware, operating system, and software pr
## Software
### Supported Operating Systems
-- Systems with Microsoft* Windows* operating systems
+- Systems with Microsoft* Windows* operating systems:
- Microsoft* Windows* 10
- - Microsoft* Windows* Server 2016
+ - Microsoft* Windows* 11
- Microsoft* Windows* Server 2019
-- Systems with Linux* operating systems
- - Clear Linux*
- - Amazon* Linux 2
- - CentOS* 8
- - Debian* 10
- - Fedora* 34
- - Red Hat* Enterprise Linux* 7, 8
+ - Microsoft* Windows* Server 2022
+- Systems with Linux* operating systems:
+ - Oracle Linux* 8
+ - Amazon* Linux* 2
+ - Debian* 9, 10, 11
+ - Fedora* 36, 37
+ - Rocky* Linux* 9
+ - Red Hat* Enterprise Linux* 8, 9
- SuSE* Linux* Enterprise Server 15
- - Ubuntu* 18.04 LTS, 20.04, 21.04
-- Systems with macOS* operating systems
- - macOS* 10.15, 11.x
-- Systems with Android* operating systems
+ - Ubuntu* 20.04, 22.04
+- Systems with macOS* operating systems:
+ - macOS* 12.x, 13.x
+- Systems with Android* operating systems:
- Android* 9
+### Community-Supported Platforms
+- MinGW*
+- FreeBSD*
+- Microsoft* Windows* on ARM*/ARM64*
+- macOS* on ARM64*
+
### Supported Compilers
- Intel* oneAPI DPC++/C++ Compiler
- Intel* C++ Compiler 19.0 and 19.1 version
-- Microsoft* Visual C++ 14.1 (Microsoft* Visual Studio* 2017, Windows* OS only)
- Microsoft* Visual C++ 14.2 (Microsoft* Visual Studio* 2019, Windows* OS only)
-- For each supported Linux* operating system, the standard gcc version provided with that operating system is supported
- - GNU Compilers (gcc) 4.8.5 - 11.1.1
- - GNU C Library (glibc) version 2.17 - 2.33
- - Clang* 6.0.0 - 12.0.0
+- Microsoft* Visual C++ 14.3 (Microsoft* Visual Studio* 2022, Windows* OS only)
+- For each supported Linux* operating system, the standard gcc version provided with that operating system is supported:
+ - GNU Compilers (gcc) 4.8.5 - 11.2.1
+ - GNU C Library (glibc) version 2.17 - 2.34
+ - Clang* 6.0.0 - 13.0.0
+
+## Limitations
+There are some cases where we cannot provide support for your platforms. It includes:
+
+1. The platform is out of official support (met end of life). When you use an unsupported platform, you can face a security risk that can be difficult to resolve.
+2. We do not have the infrastructure to test a platform. Therefore we cannot guarantee that oneTBB works correctly on that platform.
+3. Changes affect more code than just platform-specific macros.
+4. The platform is incompatible with oneTBB. Some platforms may have limitations that prevent oneTBB from working correctly. We cannot provide support in these cases as the issue is beyond our control.
+5. The platform is modified or customized. If you made significant updates to your platform, it might be hard for us to find the root cause of the issue. Therefore, we may not be able to provide support as the modification could affect the oneTBB functionality.
+
+
+We understand that these limitations can be frustrating. Thus, we suggest creating a branch specifically for the unsupported platform, allowing other users to contribute to or use your implementation.
+
diff --git a/contrib/libs/tbb/WASM_Support.md b/contrib/libs/tbb/WASM_Support.md
new file mode 100644
index 0000000000..67925ee496
--- /dev/null
+++ b/contrib/libs/tbb/WASM_Support.md
@@ -0,0 +1,31 @@
+<!--
+******************************************************************************
+* 
+* 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
+
+``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 to be efficient to parse and execute.
+
+WebAssembly aims to provide a fast, efficient, and safe way to run code in web browsers without needing plugins or other software. Code written in a variety of programming languages, including C, C++, Rust and others, can be compiled into WebAssembly format for use in web pages. This allows you to write high-performance applications that run directly in the browser.
+
+We currently have an [under development branch that provides you with WASM support](https://github.com/oneapi-src/oneTBB/tree/tbb_wasm).
+
+By using WASM, you can:
+* Create highly performant and scalable applications that can meet the demands of modern web-based systems.
+* Take advantage of oneTBB features to optimize the performance of your web-based applications.
+
+
+
diff --git a/contrib/libs/tbb/include/oneapi/tbb/concurrent_hash_map.h b/contrib/libs/tbb/include/oneapi/tbb/concurrent_hash_map.h
index 87881f5310..b30033742c 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/concurrent_hash_map.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/concurrent_hash_map.h
@@ -147,9 +147,9 @@ public:
}
template <typename... Args>
- void init_buckets_impl( segment_ptr_type ptr, size_type sz, Args&&... args ) {
+ void init_buckets_impl( segment_ptr_type ptr, size_type sz, const Args&... args ) {
for (size_type i = 0; i < sz; ++i) {
- bucket_allocator_traits::construct(my_allocator, ptr + i, std::forward<Args>(args)...);
+ bucket_allocator_traits::construct(my_allocator, ptr + i, args...);
}
}
@@ -292,7 +292,7 @@ public:
if( sz >= mask ) { // TODO: add custom load_factor
segment_index_type new_seg = tbb::detail::log2( mask+1 ); //optimized segment_index_of
__TBB_ASSERT( is_valid(my_table[new_seg-1].load(std::memory_order_relaxed)), "new allocations must not publish new mask until segment has allocated");
- static const segment_ptr_type is_allocating = segment_ptr_type(2);;
+ static const segment_ptr_type is_allocating = segment_ptr_type(2);
segment_ptr_type disabled = nullptr;
if (!(my_table[new_seg].load(std::memory_order_acquire))
&& my_table[new_seg].compare_exchange_strong(disabled, is_allocating))
@@ -443,9 +443,11 @@ private:
if( k&(k-2) ) // not the beginning of a segment
++my_bucket;
else my_bucket = my_map->get_bucket( k );
- my_node = static_cast<node*>( my_bucket->node_list.load(std::memory_order_relaxed) );
- if( map_base::is_valid(my_node) ) {
- my_index = k; return;
+ node_base *n = my_bucket->node_list.load(std::memory_order_relaxed);
+ if( map_base::is_valid(n) ) {
+ my_node = static_cast<node*>(n);
+ my_index = k;
+ return;
}
++k;
}
diff --git a/contrib/libs/tbb/include/oneapi/tbb/concurrent_lru_cache.h b/contrib/libs/tbb/include/oneapi/tbb/concurrent_lru_cache.h
index 29ee3bd9d2..83d0576eae 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/concurrent_lru_cache.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/concurrent_lru_cache.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2021 Intel Corporation
+ Copyright (c) 2005-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.
@@ -140,6 +140,11 @@ private:
if (! --(map_it->second.my_ref_counter)) {
// if the LRU history is full, evict the oldest items to get space
if (my_history_list.size() >= my_history_list_capacity) {
+ if (my_history_list_capacity == 0) {
+ // Since LRU history capacity is zero, there is no need to keep the element in history
+ my_storage_map.erase(map_it);
+ return;
+ }
std::size_t number_of_elements_to_evict = 1 + my_history_list.size() - my_history_list_capacity;
for (std::size_t i = 0; i < number_of_elements_to_evict; ++i) {
@@ -320,13 +325,16 @@ public:
public:
retrieve_aggregator_operation(key_type key)
: aggregator_operation(aggregator_operation::op_type::retrieve),
- my_key(key), my_is_new_value_needed(false) {}
+ my_key(key), my_map_record_ptr(nullptr), my_is_new_value_needed(false) {}
void handle(lru_cache_type& lru_cache_ref) {
my_map_record_ptr = &lru_cache_ref.retrieve_serial(my_key, my_is_new_value_needed);
}
- storage_map_reference_type result() { return *my_map_record_ptr; }
+ storage_map_reference_type result() {
+ __TBB_ASSERT(my_map_record_ptr, "Attempt to call result() before calling handle()");
+ return *my_map_record_ptr;
+ }
bool is_new_value_needed() { return my_is_new_value_needed; }
};
diff --git a/contrib/libs/tbb/include/oneapi/tbb/concurrent_queue.h b/contrib/libs/tbb/include/oneapi/tbb/concurrent_queue.h
index 94bff472cf..1e7ff50ba3 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/concurrent_queue.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/concurrent_queue.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -28,6 +28,24 @@ namespace tbb {
namespace detail {
namespace d2 {
+template <typename QueueRep, typename Allocator>
+std::pair<bool, ticket_type> internal_try_pop_impl(void* dst, QueueRep& queue, Allocator& alloc ) {
+ ticket_type ticket{};
+ do {
+ // Basically, we need to read `head_counter` before `tail_counter`. To achieve it we build happens-before on `head_counter`
+ ticket = queue.head_counter.load(std::memory_order_acquire);
+ do {
+ if (static_cast<std::ptrdiff_t>(queue.tail_counter.load(std::memory_order_relaxed) - ticket) <= 0) { // queue is empty
+ // Queue is empty
+ return { false, ticket };
+ }
+ // Queue had item with ticket k when we looked. Attempt to get that item.
+ // Another thread snatched the item, retry.
+ } while (!queue.head_counter.compare_exchange_strong(ticket, ticket + 1));
+ } while (!queue.choose(ticket).pop(dst, ticket, queue, alloc));
+ return { true, ticket };
+}
+
// A high-performance thread-safe non-blocking concurrent queue.
// Multiple threads may each push and pop concurrently.
// Assignment construction is not allowed.
@@ -73,6 +91,10 @@ public:
push(*begin);
}
+ concurrent_queue( std::initializer_list<value_type> init, const allocator_type& alloc = allocator_type() ) :
+ concurrent_queue(init.begin(), init.end(), alloc)
+ {}
+
concurrent_queue(const concurrent_queue& src, const allocator_type& a) :
concurrent_queue(a)
{
@@ -114,6 +136,53 @@ public:
r1::cache_aligned_deallocate(my_queue_representation);
}
+ concurrent_queue& operator=( const concurrent_queue& other ) {
+ //TODO: implement support for std::allocator_traits::propagate_on_container_copy_assignment
+ if (my_queue_representation != other.my_queue_representation) {
+ clear();
+ my_allocator = other.my_allocator;
+ my_queue_representation->assign(*other.my_queue_representation, my_allocator, copy_construct_item);
+ }
+ return *this;
+ }
+
+ concurrent_queue& operator=( concurrent_queue&& other ) {
+ //TODO: implement support for std::allocator_traits::propagate_on_container_move_assignment
+ if (my_queue_representation != other.my_queue_representation) {
+ clear();
+ if (my_allocator == other.my_allocator) {
+ internal_swap(other);
+ } else {
+ my_queue_representation->assign(*other.my_queue_representation, other.my_allocator, move_construct_item);
+ other.clear();
+ my_allocator = std::move(other.my_allocator);
+ }
+ }
+ return *this;
+ }
+
+ concurrent_queue& operator=( std::initializer_list<value_type> init ) {
+ assign(init);
+ return *this;
+ }
+
+ template <typename InputIterator>
+ void assign( InputIterator first, InputIterator last ) {
+ concurrent_queue src(first, last);
+ clear();
+ my_queue_representation->assign(*src.my_queue_representation, my_allocator, move_construct_item);
+ }
+
+ void assign( std::initializer_list<value_type> init ) {
+ assign(init.begin(), init.end());
+ }
+
+ void swap ( concurrent_queue& other ) {
+ //TODO: implement support for std::allocator_traits::propagate_on_container_swap
+ __TBB_ASSERT(my_allocator == other.my_allocator, "unequal allocators");
+ internal_swap(other);
+ }
+
// Enqueue an item at tail of queue.
void push(const T& value) {
internal_push(value);
@@ -178,20 +247,7 @@ private:
}
bool internal_try_pop( void* dst ) {
- ticket_type k;
- do {
- k = my_queue_representation->head_counter.load(std::memory_order_relaxed);
- do {
- if (static_cast<std::ptrdiff_t>(my_queue_representation->tail_counter.load(std::memory_order_relaxed) - k) <= 0) {
- // Queue is empty
- return false;
- }
-
- // Queue had item with ticket k when we looked. Attempt to get that item.
- // Another thread snatched the item, retry.
- } while (!my_queue_representation->head_counter.compare_exchange_strong(k, k + 1));
- } while (!my_queue_representation->choose(k).pop(dst, k, *my_queue_representation, my_allocator));
- return true;
+ return internal_try_pop_impl(dst, *my_queue_representation, my_allocator).first;
}
template <typename Container, typename Value, typename A>
@@ -210,6 +266,20 @@ private:
queue_allocator_type my_allocator;
queue_representation_type* my_queue_representation;
+
+ friend void swap( concurrent_queue& lhs, concurrent_queue& rhs ) {
+ lhs.swap(rhs);
+ }
+
+ friend bool operator==( const concurrent_queue& lhs, const concurrent_queue& rhs ) {
+ return lhs.unsafe_size() == rhs.unsafe_size() && std::equal(lhs.unsafe_begin(), lhs.unsafe_end(), rhs.unsafe_begin());
+ }
+
+#if !__TBB_CPP20_COMPARISONS_PRESENT
+ friend bool operator!=( const concurrent_queue& lhs, const concurrent_queue& rhs ) {
+ return !(lhs == rhs);
+ }
+#endif // __TBB_CPP20_COMPARISONS_PRESENT
}; // class concurrent_queue
#if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT
@@ -299,6 +369,10 @@ public:
push(*begin);
}
+ concurrent_bounded_queue( std::initializer_list<value_type> init, const allocator_type& alloc = allocator_type() ):
+ concurrent_bounded_queue(init.begin(), init.end(), alloc)
+ {}
+
concurrent_bounded_queue( const concurrent_bounded_queue& src, const allocator_type& a ) :
concurrent_bounded_queue(a)
{
@@ -341,6 +415,53 @@ public:
sizeof(queue_representation_type));
}
+ concurrent_bounded_queue& operator=( const concurrent_bounded_queue& other ) {
+ //TODO: implement support for std::allocator_traits::propagate_on_container_copy_assignment
+ if (my_queue_representation != other.my_queue_representation) {
+ clear();
+ my_allocator = other.my_allocator;
+ my_queue_representation->assign(*other.my_queue_representation, my_allocator, copy_construct_item);
+ }
+ return *this;
+ }
+
+ concurrent_bounded_queue& operator=( concurrent_bounded_queue&& other ) {
+ //TODO: implement support for std::allocator_traits::propagate_on_container_move_assignment
+ if (my_queue_representation != other.my_queue_representation) {
+ clear();
+ if (my_allocator == other.my_allocator) {
+ internal_swap(other);
+ } else {
+ my_queue_representation->assign(*other.my_queue_representation, other.my_allocator, move_construct_item);
+ other.clear();
+ my_allocator = std::move(other.my_allocator);
+ }
+ }
+ return *this;
+ }
+
+ concurrent_bounded_queue& operator=( std::initializer_list<value_type> init ) {
+ assign(init);
+ return *this;
+ }
+
+ template <typename InputIterator>
+ void assign( InputIterator first, InputIterator last ) {
+ concurrent_bounded_queue src(first, last);
+ clear();
+ my_queue_representation->assign(*src.my_queue_representation, my_allocator, move_construct_item);
+ }
+
+ void assign( std::initializer_list<value_type> init ) {
+ assign(init.begin(), init.end());
+ }
+
+ void swap ( concurrent_bounded_queue& other ) {
+ //TODO: implement support for std::allocator_traits::propagate_on_container_swap
+ __TBB_ASSERT(my_allocator == other.my_allocator, "unequal allocators");
+ internal_swap(other);
+ }
+
// Enqueue an item at tail of queue.
void push( const T& value ) {
internal_push(value);
@@ -505,21 +626,14 @@ private:
}
bool internal_pop_if_present( void* dst ) {
- ticket_type ticket;
- do {
- ticket = my_queue_representation->head_counter.load(std::memory_order_relaxed);
- do {
- if (static_cast<std::ptrdiff_t>(my_queue_representation->tail_counter.load(std::memory_order_relaxed) - ticket) <= 0) { // queue is empty
- // Queue is empty
- return false;
- }
- // Queue had item with ticket k when we looked. Attempt to get that item.
- // Another thread snatched the item, retry.
- } while (!my_queue_representation->head_counter.compare_exchange_strong(ticket, ticket + 1));
- } while (!my_queue_representation->choose(ticket).pop(dst, ticket, *my_queue_representation, my_allocator));
+ bool present{};
+ ticket_type ticket{};
+ std::tie(present, ticket) = internal_try_pop_impl(dst, *my_queue_representation, my_allocator);
- r1::notify_bounded_queue_monitor(my_monitors, cbq_slots_avail_tag, ticket);
- return true;
+ if (present) {
+ r1::notify_bounded_queue_monitor(my_monitors, cbq_slots_avail_tag, ticket);
+ }
+ return present;
}
void internal_abort() {
@@ -546,6 +660,20 @@ private:
queue_representation_type* my_queue_representation;
r1::concurrent_monitor* my_monitors;
+
+ friend void swap( concurrent_bounded_queue& lhs, concurrent_bounded_queue& rhs ) {
+ lhs.swap(rhs);
+ }
+
+ friend bool operator==( const concurrent_bounded_queue& lhs, const concurrent_bounded_queue& rhs ) {
+ return lhs.size() == rhs.size() && std::equal(lhs.unsafe_begin(), lhs.unsafe_end(), rhs.unsafe_begin());
+ }
+
+#if !__TBB_CPP20_COMPARISONS_PRESENT
+ friend bool operator!=( const concurrent_bounded_queue& lhs, const concurrent_bounded_queue& rhs ) {
+ return !(lhs == rhs);
+ }
+#endif // __TBB_CPP20_COMPARISONS_PRESENT
}; // class concurrent_bounded_queue
#if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT
diff --git a/contrib/libs/tbb/include/oneapi/tbb/concurrent_vector.h b/contrib/libs/tbb/include/oneapi/tbb/concurrent_vector.h
index 51c187f8b8..2a2cb1e4bf 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/concurrent_vector.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/concurrent_vector.h
@@ -1031,7 +1031,7 @@ private:
this->delete_segment(seg_idx - 1);
}
}
- if (!k) this->my_first_block.store(0, std::memory_order_relaxed);;
+ if (!k) this->my_first_block.store(0, std::memory_order_relaxed);
}
}
diff --git a/contrib/libs/tbb/include/oneapi/tbb/detail/_aggregator.h b/contrib/libs/tbb/include/oneapi/tbb/detail/_aggregator.h
index a20b637524..2e3e5cc3d6 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/detail/_aggregator.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/detail/_aggregator.h
@@ -155,14 +155,17 @@ public:
// template<class U, class V> friend class aggregating_functor;
template <typename AggregatingClass, typename OperationList>
class aggregating_functor {
- AggregatingClass* my_object;
+ AggregatingClass* my_object{nullptr};
public:
aggregating_functor() = default;
aggregating_functor( AggregatingClass* object ) : my_object(object) {
__TBB_ASSERT(my_object, nullptr);
}
- void operator()( OperationList* op_list ) { my_object->handle_operations(op_list); }
+ void operator()( OperationList* op_list ) {
+ __TBB_ASSERT(my_object, nullptr);
+ my_object->handle_operations(op_list);
+ }
}; // class aggregating_functor
diff --git a/contrib/libs/tbb/include/oneapi/tbb/detail/_concurrent_queue_base.h b/contrib/libs/tbb/include/oneapi/tbb/detail/_concurrent_queue_base.h
index a418e61178..ee628e1e89 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/detail/_concurrent_queue_base.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/detail/_concurrent_queue_base.h
@@ -123,7 +123,7 @@ public:
page_allocator_traits::construct(page_allocator, p);
}
- if (tail_counter.load(std::memory_order_relaxed) != k) spin_wait_until_my_turn(tail_counter, k, base);
+ spin_wait_until_my_turn(tail_counter, k, base);
d1::call_itt_notify(d1::acquired, &tail_counter);
if (p) {
@@ -134,9 +134,9 @@ public:
} else {
head_page.store(p, std::memory_order_relaxed);
}
- tail_page.store(p, std::memory_order_release);
+ tail_page.store(p, std::memory_order_relaxed);
} else {
- p = tail_page.load(std::memory_order_acquire); // TODO may be relaxed ?
+ p = tail_page.load(std::memory_order_relaxed);
}
return index;
}
@@ -179,7 +179,7 @@ public:
d1::call_itt_notify(d1::acquired, &head_counter);
spin_wait_while_eq(tail_counter, k);
d1::call_itt_notify(d1::acquired, &tail_counter);
- padded_page *p = head_page.load(std::memory_order_acquire);
+ padded_page *p = head_page.load(std::memory_order_relaxed);
__TBB_ASSERT( p, nullptr );
size_type index = modulo_power_of_two( k/queue_rep_type::n_queue, items_per_page );
bool success = false;
@@ -338,8 +338,8 @@ private:
}
void spin_wait_until_my_turn( std::atomic<ticket_type>& counter, ticket_type k, queue_rep_type& rb ) const {
- for (atomic_backoff b(true);; b.pause()) {
- ticket_type c = counter;
+ for (atomic_backoff b{};; b.pause()) {
+ ticket_type c = counter.load(std::memory_order_acquire);
if (c == k) return;
else if (c & 1) {
++rb.n_invalid_entries;
@@ -380,9 +380,9 @@ public:
if( is_valid_page(p) ) {
spin_mutex::scoped_lock lock( my_queue.page_mutex );
padded_page* q = p->next;
- my_queue.head_page.store(q, std::memory_order_release);
+ my_queue.head_page.store(q, std::memory_order_relaxed);
if( !is_valid_page(q) ) {
- my_queue.tail_page.store(nullptr, std::memory_order_release);
+ my_queue.tail_page.store(nullptr, std::memory_order_relaxed);
}
}
my_queue.head_counter.store(my_ticket_type, std::memory_order_release);
diff --git a/contrib/libs/tbb/include/oneapi/tbb/detail/_concurrent_skip_list.h b/contrib/libs/tbb/include/oneapi/tbb/detail/_concurrent_skip_list.h
index 89d2ee3c91..eaaaac81ca 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/detail/_concurrent_skip_list.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/detail/_concurrent_skip_list.h
@@ -1068,6 +1068,7 @@ protected:
__TBB_ASSERT(!handle.empty(), "Extracted handle in merge is empty");
if (!insert(std::move(handle)).second) {
+ __TBB_ASSERT(!handle.empty(), "Handle should not be empty if insert fails");
//If the insertion fails - return the node into source
source.insert(std::move(handle));
}
diff --git a/contrib/libs/tbb/include/oneapi/tbb/detail/_concurrent_unordered_base.h b/contrib/libs/tbb/include/oneapi/tbb/detail/_concurrent_unordered_base.h
index c684f4f736..ade91c330f 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/detail/_concurrent_unordered_base.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/detail/_concurrent_unordered_base.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -677,13 +677,17 @@ public:
size_type current_bucket_count = my_bucket_count.load(std::memory_order_acquire);
size_type necessary_bucket_count = current_bucket_count;
- do {
- // TODO: Log2 seems useful here
- while (necessary_bucket_count * max_load_factor() < elements_count) {
+ // max_load_factor() is currently unsafe, so we can assume that my_max_load_factor
+ // would not be changed during the calculation
+ // TODO: Log2 seems useful here
+ while (necessary_bucket_count * max_load_factor() < elements_count) {
necessary_bucket_count <<= 1;
- }
- } while (current_bucket_count >= necessary_bucket_count ||
- !my_bucket_count.compare_exchange_strong(current_bucket_count, necessary_bucket_count));
+ }
+
+ while (!my_bucket_count.compare_exchange_strong(current_bucket_count, necessary_bucket_count)) {
+ if (current_bucket_count >= necessary_bucket_count)
+ break;
+ }
}
// Observers
@@ -917,7 +921,7 @@ private:
node_allocator_traits::deallocate(dummy_node_allocator, node, 1);
} else {
// GCC 11.1 issues a warning here that incorrect destructor might be called for dummy_nodes
- #if (__TBB_GCC_VERSION >= 110100 && __TBB_GCC_VERSION < 120000 ) && !__clang__ && !__INTEL_COMPILER
+ #if (__TBB_GCC_VERSION >= 110100 && __TBB_GCC_VERSION < 130000 ) && !__clang__ && !__INTEL_COMPILER
volatile
#endif
value_node_ptr val_node = static_cast<value_node_ptr>(node);
diff --git a/contrib/libs/tbb/include/oneapi/tbb/detail/_config.h b/contrib/libs/tbb/include/oneapi/tbb/detail/_config.h
index 05b08562c4..04deb630f0 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/detail/_config.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/detail/_config.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -28,6 +28,12 @@
/* Check which standard library we use. */
#include <cstddef>
+#ifdef __has_include
+#if __has_include(<version>)
+#include <version>
+#endif
+#endif
+
#include "_export.h"
#if _MSC_VER
@@ -220,7 +226,7 @@
/** Library features presence macros **/
#define __TBB_CPP14_INTEGER_SEQUENCE_PRESENT (__TBB_LANG >= 201402L)
-#define __TBB_CPP17_INVOKE_RESULT_PRESENT (__TBB_LANG >= 201703L)
+#define __TBB_CPP17_INVOKE_PRESENT (__TBB_LANG >= 201703L)
// TODO: Remove the condition(__INTEL_COMPILER > 2021) from the __TBB_CPP17_DEDUCTION_GUIDES_PRESENT
// macro when this feature start working correctly on this compiler.
@@ -269,7 +275,7 @@
#if defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_three_way_comparison)
#define __TBB_CPP20_COMPARISONS_PRESENT ((__cpp_impl_three_way_comparison >= 201907L) && (__cpp_lib_three_way_comparison >= 201907L))
#else
- #define __TBB_CPP20_COMPARISONS_PRESENT __TBB_CPP20_PRESENT
+ #define __TBB_CPP20_COMPARISONS_PRESENT 0
#endif
#define __TBB_RESUMABLE_TASKS (!__TBB_WIN8UI_SUPPORT && !__ANDROID__ && !__QNXNTO__ && (!__linux__ || __GLIBC__))
@@ -378,16 +384,12 @@
#define __TBB_ARENA_BINDING 1
#endif
-#if (TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION || __TBB_BUILD) && __TBB_ARENA_BINDING
- #define __TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT 1
-#endif
-
#ifndef __TBB_ENQUEUE_ENFORCED_CONCURRENCY
#define __TBB_ENQUEUE_ENFORCED_CONCURRENCY 1
#endif
#if !defined(__TBB_SURVIVE_THREAD_SWITCH) && \
- (_WIN32 || _WIN64 || __APPLE__ || (__linux__ && !__ANDROID__))
+ (_WIN32 || _WIN64 || __APPLE__ || (defined(__unix__) && !__ANDROID__))
#define __TBB_SURVIVE_THREAD_SWITCH 1
#endif /* __TBB_SURVIVE_THREAD_SWITCH */
diff --git a/contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_body_impl.h b/contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_body_impl.h
index 0b061c2fc2..8ac11211f6 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_body_impl.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_body_impl.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -109,7 +109,7 @@ template <typename Input, typename Output, typename B>
class function_body_leaf : public function_body< Input, Output > {
public:
function_body_leaf( const B &_body ) : body(_body) { }
- Output operator()(const Input &i) override { return body(i); }
+ Output operator()(const Input &i) override { return tbb::detail::invoke(body,i); }
B get_body() { return body; }
function_body_leaf* clone() override {
return new function_body_leaf< Input, Output, B >(body);
@@ -184,7 +184,7 @@ class multifunction_body_leaf : public multifunction_body<Input, OutputSet> {
public:
multifunction_body_leaf(const B &_body) : body(_body) { }
void operator()(const Input &input, OutputSet &oset) override {
- body(input, oset); // body may explicitly put() to one or more of oset.
+ tbb::detail::invoke(body, input, oset); // body may explicitly put() to one or more of oset.
}
void* get_body_ptr() override { return &body; }
multifunction_body_leaf* clone() override {
@@ -218,7 +218,7 @@ template <typename Input, typename Output, typename B>
class type_to_key_function_body_leaf : public type_to_key_function_body<Input, Output> {
public:
type_to_key_function_body_leaf( const B &_body ) : body(_body) { }
- Output operator()(const Input &i) override { return body(i); }
+ Output operator()(const Input &i) override { return tbb::detail::invoke(body, i); }
type_to_key_function_body_leaf* clone() override {
return new type_to_key_function_body_leaf< Input, Output, B>(body);
}
@@ -231,7 +231,7 @@ class type_to_key_function_body_leaf<Input,Output&,B> : public type_to_key_funct
public:
type_to_key_function_body_leaf( const B &_body ) : body(_body) { }
const Output& operator()(const Input &i) override {
- return body(i);
+ return tbb::detail::invoke(body, i);
}
type_to_key_function_body_leaf* clone() override {
return new type_to_key_function_body_leaf< Input, Output&, B>(body);
diff --git a/contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_join_impl.h b/contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_join_impl.h
index 1273e1f9d5..5515421ede 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_join_impl.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_join_impl.h
@@ -384,7 +384,7 @@
graph_task* bypass_t;
// constructor for value parameter
queueing_port_operation(const T& e, op_type t) :
- type(char(t)), my_val(e)
+ type(char(t)), my_val(e), my_arg(nullptr)
, bypass_t(nullptr)
{}
// constructor for pointer parameter
@@ -393,7 +393,7 @@
, bypass_t(nullptr)
{}
// constructor with no parameter
- queueing_port_operation(op_type t) : type(char(t))
+ queueing_port_operation(op_type t) : type(char(t)), my_arg(nullptr)
, bypass_t(nullptr)
{}
};
@@ -422,6 +422,7 @@
break;
case get__item:
if(!this->buffer_empty()) {
+ __TBB_ASSERT(current->my_arg, nullptr);
*(current->my_arg) = this->front();
current->status.store( SUCCEEDED, std::memory_order_release);
}
@@ -547,12 +548,12 @@
input_type *my_arg;
// constructor for value parameter
key_matching_port_operation(const input_type& e, op_type t) :
- type(char(t)), my_val(e) {}
+ type(char(t)), my_val(e), my_arg(nullptr) {}
// constructor for pointer parameter
key_matching_port_operation(const input_type* p, op_type t) :
type(char(t)), my_arg(const_cast<input_type*>(p)) {}
// constructor with no parameter
- key_matching_port_operation(op_type t) : type(char(t)) {}
+ key_matching_port_operation(op_type t) : type(char(t)), my_arg(nullptr) {}
};
typedef aggregating_functor<class_type, key_matching_port_operation> handler_type;
@@ -573,6 +574,7 @@
break;
case get__item:
// use current_key from FE for item
+ __TBB_ASSERT(current->my_arg, nullptr);
if(!this->find_with_key(my_join->current_key, *(current->my_arg))) {
__TBB_ASSERT(false, "Failed to find item corresponding to current_key.");
}
@@ -667,12 +669,12 @@
template<typename InputTuple, typename OutputTuple>
class join_node_FE<reserving, InputTuple, OutputTuple> : public reserving_forwarding_base {
- public:
+ private:
static const int N = std::tuple_size<OutputTuple>::value;
typedef OutputTuple output_type;
typedef InputTuple input_type;
typedef join_node_base<reserving, InputTuple, OutputTuple> base_node_type; // for forwarding
-
+ public:
join_node_FE(graph &g) : reserving_forwarding_base(g), my_node(nullptr) {
ports_with_no_inputs = N;
join_helper<N>::set_join_node_pointer(my_inputs, this);
@@ -1212,10 +1214,10 @@
// using tuple_element. The class PT is the port type (reserving_port, queueing_port, key_matching_port)
// and should match the typename.
- template<int N, template<class> class PT, typename OutputTuple, typename JP>
- class unfolded_join_node : public join_base<N,PT,OutputTuple,JP>::type {
+ template<int M, template<class> class PT, typename OutputTuple, typename JP>
+ class unfolded_join_node : public join_base<M,PT,OutputTuple,JP>::type {
public:
- typedef typename wrap_tuple_elements<N, PT, OutputTuple>::type input_ports_type;
+ typedef typename wrap_tuple_elements<M, PT, OutputTuple>::type input_ports_type;
typedef OutputTuple output_type;
private:
typedef join_node_base<JP, input_ports_type, output_type > base_type;
diff --git a/contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_node_impl.h b/contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_node_impl.h
index 5bc361a4d2..b79c53ddbf 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_node_impl.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_node_impl.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -159,8 +159,8 @@ private:
};
graph_task* bypass_t;
operation_type(const input_type& e, op_type t) :
- type(char(t)), elem(const_cast<input_type*>(&e)) {}
- operation_type(op_type t) : type(char(t)), r(nullptr) {}
+ type(char(t)), elem(const_cast<input_type*>(&e)), bypass_t(nullptr) {}
+ operation_type(op_type t) : type(char(t)), r(nullptr), bypass_t(nullptr) {}
};
bool forwarder_busy;
@@ -361,7 +361,7 @@ public:
template<typename Body>
function_input(
graph &g, size_t max_concurrency, Body& body, node_priority_t a_priority )
- : base_type(g, max_concurrency, a_priority, noexcept(body(input_type())))
+ : base_type(g, max_concurrency, a_priority, noexcept(tbb::detail::invoke(body, input_type())))
, my_body( new function_body_leaf< input_type, output_type, Body>(body) )
, my_init_body( new function_body_leaf< input_type, output_type, Body>(body) ) {
}
@@ -392,7 +392,7 @@ public:
// There is an extra copied needed to capture the
// body execution without the try_put
fgt_begin_body( my_body );
- output_type v = (*my_body)(i);
+ output_type v = tbb::detail::invoke(*my_body, i);
fgt_end_body( my_body );
return v;
}
@@ -496,7 +496,7 @@ public:
// constructor
template<typename Body>
multifunction_input(graph &g, size_t max_concurrency,Body& body, node_priority_t a_priority )
- : base_type(g, max_concurrency, a_priority, noexcept(body(input_type(), my_output_ports)))
+ : base_type(g, max_concurrency, a_priority, noexcept(tbb::detail::invoke(body, input_type(), my_output_ports)))
, my_body( new multifunction_body_leaf<input_type, output_ports_type, Body>(body) )
, my_init_body( new multifunction_body_leaf<input_type, output_ports_type, Body>(body) )
, my_output_ports(init_output_ports<output_ports_type>::call(g, my_output_ports)){
diff --git a/contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_tagged_buffer_impl.h b/contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_tagged_buffer_impl.h
index 6426da5599..0d9de17654 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_tagged_buffer_impl.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/detail/_flow_graph_tagged_buffer_impl.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -130,7 +130,7 @@ private:
const value_type &v) {
size_t l_mask = p_sz-1;
__TBB_ASSERT(my_key, "Error: value-to-key functor not provided");
- size_t h = this->hash((*my_key)(v)) & l_mask;
+ size_t h = this->hash(tbb::detail::invoke(*my_key, v)) & l_mask;
__TBB_ASSERT(p_free_list, "Error: free list not set up.");
element_type* my_elem = p_free_list; p_free_list = (element_type *)(p_free_list->second);
(void) new(&(my_elem->first)) value_type(v);
@@ -200,7 +200,7 @@ public:
bool insert_with_key(const value_type &v) {
pointer_type p = nullptr;
__TBB_ASSERT(my_key, "Error: value-to-key functor not provided");
- if(find_ref_with_key((*my_key)(v), p)) {
+ if(find_ref_with_key(tbb::detail::invoke(*my_key, v), p)) {
p->~value_type();
(void) new(p) value_type(v); // copy-construct into the space
return false;
@@ -217,7 +217,7 @@ public:
for(element_type* p = pointer_array[i]; p; p = (element_type *)(p->second)) {
pointer_type pv = reinterpret_cast<pointer_type>(&(p->first));
__TBB_ASSERT(my_key, "Error: value-to-key functor not provided");
- if(this->equal((*my_key)(*pv), k)) {
+ if(this->equal(tbb::detail::invoke(*my_key, *pv), k)) {
v = pv;
return true;
}
@@ -241,7 +241,7 @@ public:
for(element_type* p = pointer_array[h]; p; prev = p, p = (element_type *)(p->second)) {
value_type *vp = reinterpret_cast<value_type *>(&(p->first));
__TBB_ASSERT(my_key, "Error: value-to-key functor not provided");
- if(this->equal((*my_key)(*vp), k)) {
+ if(this->equal(tbb::detail::invoke(*my_key, *vp), k)) {
vp->~value_type();
if(prev) prev->second = p->second;
else pointer_array[h] = (element_type *)(p->second);
diff --git a/contrib/libs/tbb/include/oneapi/tbb/detail/_machine.h b/contrib/libs/tbb/include/oneapi/tbb/detail/_machine.h
index 763bc65b11..7a4a1e31cb 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/detail/_machine.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/detail/_machine.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -110,9 +110,9 @@ static inline void machine_pause(int32_t delay) {
#if defined(__GNUC__) || defined(__clang__)
namespace gnu_builtins {
- inline uintptr_t clz(unsigned int x) { return __builtin_clz(x); }
- inline uintptr_t clz(unsigned long int x) { return __builtin_clzl(x); }
- inline uintptr_t clz(unsigned long long int x) { return __builtin_clzll(x); }
+ inline uintptr_t clz(unsigned int x) { return static_cast<uintptr_t>(__builtin_clz(x)); }
+ inline uintptr_t clz(unsigned long int x) { return static_cast<uintptr_t>(__builtin_clzl(x)); }
+ inline uintptr_t clz(unsigned long long int x) { return static_cast<uintptr_t>(__builtin_clzll(x)); }
}
#elif defined(_MSC_VER)
#pragma intrinsic(__TBB_W(_BitScanReverse))
@@ -221,8 +221,8 @@ T machine_reverse_bits(T src) {
return builtin_bitreverse(fixed_width_cast(src));
#else /* Generic */
T dst;
- unsigned char *original = (unsigned char *) &src;
- unsigned char *reversed = (unsigned char *) &dst;
+ unsigned char *original = reinterpret_cast<unsigned char *>(&src);
+ unsigned char *reversed = reinterpret_cast<unsigned char *>(&dst);
for ( int i = sizeof(T) - 1; i >= 0; i-- ) {
reversed[i] = reverse_byte( original[sizeof(T) - i - 1] );
diff --git a/contrib/libs/tbb/include/oneapi/tbb/detail/_pipeline_filters.h b/contrib/libs/tbb/include/oneapi/tbb/detail/_pipeline_filters.h
index 149b7f46c2..46e7b95d6c 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/detail/_pipeline_filters.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/detail/_pipeline_filters.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -233,7 +233,7 @@ class concrete_filter: public base_filter {
void* operator()(void* input) override {
input_pointer temp_input = input_helper::cast_from_void_ptr(input);
- output_pointer temp_output = output_helper::create_token(my_body(std::move(input_helper::token(temp_input))));
+ output_pointer temp_output = output_helper::create_token(tbb::detail::invoke(my_body, std::move(input_helper::token(temp_input))));
input_helper::destroy_token(temp_input);
return output_helper::cast_to_void_ptr(temp_output);
}
@@ -281,7 +281,7 @@ class concrete_filter<InputType, void, Body>: public base_filter {
void* operator()(void* input) override {
input_pointer temp_input = input_helper::cast_from_void_ptr(input);
- my_body(std::move(input_helper::token(temp_input)));
+ tbb::detail::invoke(my_body, std::move(input_helper::token(temp_input)));
input_helper::destroy_token(temp_input);
return nullptr;
}
@@ -441,11 +441,11 @@ public:
};
-template <typename Body, typename Input = typename body_types<decltype(&Body::operator())>::input_type>
+template <typename Body, typename Input = typename filter_body_types<decltype(&Body::operator())>::input_type>
using filter_input = typename std::conditional<std::is_same<Input, flow_control>::value, void, Input>::type;
template <typename Body>
-using filter_output = typename body_types<decltype(&Body::operator())>::output_type;
+using filter_output = typename filter_body_types<decltype(&Body::operator())>::output_type;
} // namespace d1
} // namespace detail
diff --git a/contrib/libs/tbb/include/oneapi/tbb/detail/_pipeline_filters_deduction.h b/contrib/libs/tbb/include/oneapi/tbb/detail/_pipeline_filters_deduction.h
index 55f94dce00..c1a6e8aed7 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/detail/_pipeline_filters_deduction.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/detail/_pipeline_filters_deduction.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2021 Intel Corporation
+ Copyright (c) 2005-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.
@@ -26,18 +26,18 @@ namespace detail {
namespace d1 {
template <typename Input, typename Output>
-struct declare_fitler_types {
+struct declare_filter_types {
using input_type = typename std::remove_const<typename std::remove_reference<Input>::type>::type;
using output_type = typename std::remove_const<typename std::remove_reference<Output>::type>::type;
};
-template <typename T> struct body_types;
+template <typename T> struct filter_body_types;
template <typename T, typename Input, typename Output>
-struct body_types<Output(T::*)(Input) const> : declare_fitler_types<Input, Output> {};
+struct filter_body_types<Output(T::*)(Input) const> : declare_filter_types<Input, Output> {};
template <typename T, typename Input, typename Output>
-struct body_types<Output(T::*)(Input)> : declare_fitler_types<Input, Output> {};
+struct filter_body_types<Output(T::*)(Input)> : declare_filter_types<Input, Output> {};
} // namespace d1
} // namespace detail
diff --git a/contrib/libs/tbb/include/oneapi/tbb/detail/_segment_table.h b/contrib/libs/tbb/include/oneapi/tbb/detail/_segment_table.h
index 2f7f83670a..1a31d8a17d 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/detail/_segment_table.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/detail/_segment_table.h
@@ -60,17 +60,19 @@ protected:
static constexpr size_type pointers_per_long_table = sizeof(size_type) * 8;
public:
segment_table( const allocator_type& alloc = allocator_type() )
- : my_segment_table_allocator(alloc), my_segment_table(my_embedded_table)
+ : my_segment_table_allocator(alloc), my_segment_table(nullptr)
, my_first_block{}, my_size{}, my_segment_table_allocation_failed{}
{
+ my_segment_table.store(my_embedded_table, std::memory_order_relaxed);
zero_table(my_embedded_table, pointers_per_embedded_table);
}
segment_table( const segment_table& other )
: my_segment_table_allocator(segment_table_allocator_traits::
select_on_container_copy_construction(other.my_segment_table_allocator))
- , my_segment_table(my_embedded_table), my_first_block{}, my_size{}, my_segment_table_allocation_failed{}
+ , my_segment_table(nullptr), my_first_block{}, my_size{}, my_segment_table_allocation_failed{}
{
+ my_segment_table.store(my_embedded_table, std::memory_order_relaxed);
zero_table(my_embedded_table, pointers_per_embedded_table);
try_call( [&] {
internal_transfer(other, copy_segment_body_type{*this});
@@ -80,9 +82,10 @@ public:
}
segment_table( const segment_table& other, const allocator_type& alloc )
- : my_segment_table_allocator(alloc), my_segment_table(my_embedded_table)
+ : my_segment_table_allocator(alloc), my_segment_table(nullptr)
, my_first_block{}, my_size{}, my_segment_table_allocation_failed{}
{
+ my_segment_table.store(my_embedded_table, std::memory_order_relaxed);
zero_table(my_embedded_table, pointers_per_embedded_table);
try_call( [&] {
internal_transfer(other, copy_segment_body_type{*this});
@@ -92,17 +95,19 @@ public:
}
segment_table( segment_table&& other )
- : my_segment_table_allocator(std::move(other.my_segment_table_allocator)), my_segment_table(my_embedded_table)
+ : my_segment_table_allocator(std::move(other.my_segment_table_allocator)), my_segment_table(nullptr)
, my_first_block{}, my_size{}, my_segment_table_allocation_failed{}
{
+ my_segment_table.store(my_embedded_table, std::memory_order_relaxed);
zero_table(my_embedded_table, pointers_per_embedded_table);
internal_move(std::move(other));
}
segment_table( segment_table&& other, const allocator_type& alloc )
- : my_segment_table_allocator(alloc), my_segment_table(my_embedded_table), my_first_block{}
+ : my_segment_table_allocator(alloc), my_segment_table(nullptr), my_first_block{}
, my_size{}, my_segment_table_allocation_failed{}
{
+ my_segment_table.store(my_embedded_table, std::memory_order_relaxed);
zero_table(my_embedded_table, pointers_per_embedded_table);
using is_equal_type = typename segment_table_allocator_traits::is_always_equal;
internal_move_construct_with_allocator(std::move(other), alloc, is_equal_type());
diff --git a/contrib/libs/tbb/include/oneapi/tbb/detail/_task.h b/contrib/libs/tbb/include/oneapi/tbb/detail/_task.h
index 9c1a355084..636aea97b4 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/detail/_task.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/detail/_task.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2020-2022 Intel Corporation
+ Copyright (c) 2020-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.
@@ -103,7 +103,7 @@ class wait_context {
void add_reference(std::int64_t delta) {
call_itt_task_notify(releasing, this);
- std::uint64_t r = m_ref_count.fetch_add(delta) + delta;
+ std::uint64_t r = m_ref_count.fetch_add(static_cast<std::uint64_t>(delta)) + static_cast<std::uint64_t>(delta);
__TBB_ASSERT_EX((r & overflow_mask) == 0, "Overflow is detected");
diff --git a/contrib/libs/tbb/include/oneapi/tbb/detail/_template_helpers.h b/contrib/libs/tbb/include/oneapi/tbb/detail/_template_helpers.h
index 7221117182..3491371047 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/detail/_template_helpers.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/detail/_template_helpers.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2021 Intel Corporation
+ Copyright (c) 2005-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.
@@ -59,7 +59,7 @@ template <unsigned u, unsigned long long ull >
struct select_size_t_constant {
// Explicit cast is needed to avoid compiler warnings about possible truncation.
// The value of the right size, which is selected by ?:, is anyway not truncated or promoted.
- static const std::size_t value = (std::size_t)((sizeof(std::size_t)==sizeof(u)) ? u : ull);
+ static const std::size_t value = static_cast<std::size_t>((sizeof(std::size_t)==sizeof(u)) ? u : ull);
};
// TODO: do we really need it?
diff --git a/contrib/libs/tbb/include/oneapi/tbb/detail/_utils.h b/contrib/libs/tbb/include/oneapi/tbb/detail/_utils.h
index 28fe1a1730..1ac2e3baa6 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/detail/_utils.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/detail/_utils.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2021 Intel Corporation
+ Copyright (c) 2005-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.
@@ -20,6 +20,7 @@
#include <type_traits>
#include <cstdint>
#include <atomic>
+#include <functional>
#include "_config.h"
#include "_assert.h"
@@ -177,7 +178,7 @@ inline ArgIntegerType modulo_power_of_two(ArgIntegerType arg, DivisorIntegerType
//! A function to check if passed in pointer is aligned on a specific border
template<typename T>
constexpr bool is_aligned(T* pointer, std::uintptr_t alignment) {
- return 0 == ((std::uintptr_t)pointer & (alignment - 1));
+ return 0 == (reinterpret_cast<std::uintptr_t>(pointer) & (alignment - 1));
}
#if TBB_USE_ASSERT
@@ -340,6 +341,22 @@ concept adaptive_same_as =
#endif
#endif // __TBB_CPP20_CONCEPTS_PRESENT
+template <typename F, typename... Args>
+auto invoke(F&& f, Args&&... args)
+#if __TBB_CPP17_INVOKE_PRESENT
+ noexcept(std::is_nothrow_invocable_v<F, Args...>)
+ -> std::invoke_result_t<F, Args...>
+{
+ return std::invoke(std::forward<F>(f), std::forward<Args>(args)...);
+}
+#else // __TBB_CPP17_INVOKE_PRESENT
+ noexcept(noexcept(std::forward<F>(f)(std::forward<Args>(args)...)))
+ -> decltype(std::forward<F>(f)(std::forward<Args>(args)...))
+{
+ return std::forward<F>(f)(std::forward<Args>(args)...);
+}
+#endif // __TBB_CPP17_INVOKE_PRESENT
+
} // namespace d0
namespace d1 {
diff --git a/contrib/libs/tbb/include/oneapi/tbb/flow_graph.h b/contrib/libs/tbb/include/oneapi/tbb/flow_graph.h
index 225c1a57db..2df4b14050 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/flow_graph.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/flow_graph.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -88,8 +88,9 @@ namespace d0 {
template <typename ReturnType, typename OutputType>
concept node_body_return_type = std::same_as<OutputType, tbb::detail::d1::continue_msg> ||
- std::same_as<OutputType, ReturnType>;
+ std::convertible_to<OutputType, ReturnType>;
+// TODO: consider using std::invocable here
template <typename Body, typename Output>
concept continue_node_body = std::copy_constructible<Body> &&
requires( Body& body, const tbb::detail::d1::continue_msg& v ) {
@@ -98,15 +99,13 @@ concept continue_node_body = std::copy_constructible<Body> &&
template <typename Body, typename Input, typename Output>
concept function_node_body = std::copy_constructible<Body> &&
- requires( Body& body, const Input& v ) {
- { body(v) } -> node_body_return_type<Output>;
- };
+ std::invocable<Body&, const Input&> &&
+ node_body_return_type<std::invoke_result_t<Body&, const Input&>, Output>;
template <typename FunctionObject, typename Input, typename Key>
concept join_node_function_object = std::copy_constructible<FunctionObject> &&
- requires( FunctionObject& func, const Input& v ) {
- { func(v) } -> adaptive_same_as<Key>;
- };
+ std::invocable<FunctionObject&, const Input&> &&
+ std::convertible_to<std::invoke_result_t<FunctionObject&, const Input&>, Key>;
template <typename Body, typename Output>
concept input_node_body = std::copy_constructible<Body> &&
@@ -116,21 +115,16 @@ concept input_node_body = std::copy_constructible<Body> &&
template <typename Body, typename Input, typename OutputPortsType>
concept multifunction_node_body = std::copy_constructible<Body> &&
- requires( Body& body, const Input& v, OutputPortsType& p ) {
- body(v, p);
- };
+ std::invocable<Body&, const Input&, OutputPortsType&>;
template <typename Sequencer, typename Value>
concept sequencer = std::copy_constructible<Sequencer> &&
- requires( Sequencer& seq, const Value& value ) {
- { seq(value) } -> adaptive_same_as<std::size_t>;
- };
+ std::invocable<Sequencer&, const Value&> &&
+ std::convertible_to<std::invoke_result_t<Sequencer&, const Value&>, std::size_t>;
template <typename Body, typename Input, typename GatewayType>
concept async_node_body = std::copy_constructible<Body> &&
- requires( Body& body, const Input& v, GatewayType& gateway ) {
- body(v, gateway);
- };
+ std::invocable<Body&, const Input&, GatewayType&>;
} // namespace d0
#endif // __TBB_CPP20_CONCEPTS_PRESENT
@@ -1183,8 +1177,9 @@ protected:
buffer_operation(const T& e, op_type t) : type(char(t))
, elem(const_cast<T*>(&e)) , ltask(nullptr)
+ , r(nullptr)
{}
- buffer_operation(op_type t) : type(char(t)), ltask(nullptr) {}
+ buffer_operation(op_type t) : type(char(t)), elem(nullptr), ltask(nullptr), r(nullptr) {}
};
bool forwarder_busy;
@@ -1271,12 +1266,14 @@ protected:
//! Register successor
virtual void internal_reg_succ(buffer_operation *op) {
+ __TBB_ASSERT(op->r, nullptr);
my_successors.register_successor(*(op->r));
op->status.store(SUCCEEDED, std::memory_order_release);
}
//! Remove successor
virtual void internal_rem_succ(buffer_operation *op) {
+ __TBB_ASSERT(op->r, nullptr);
my_successors.remove_successor(*(op->r));
op->status.store(SUCCEEDED, std::memory_order_release);
}
@@ -1330,12 +1327,14 @@ protected:
}
virtual bool internal_push(buffer_operation *op) {
+ __TBB_ASSERT(op->elem, nullptr);
this->push_back(*(op->elem));
op->status.store(SUCCEEDED, std::memory_order_release);
return true;
}
virtual void internal_pop(buffer_operation *op) {
+ __TBB_ASSERT(op->elem, nullptr);
if(this->pop_back(*(op->elem))) {
op->status.store(SUCCEEDED, std::memory_order_release);
}
@@ -1345,6 +1344,7 @@ protected:
}
virtual void internal_reserve(buffer_operation *op) {
+ __TBB_ASSERT(op->elem, nullptr);
if(this->reserve_front(*(op->elem))) {
op->status.store(SUCCEEDED, std::memory_order_release);
}
@@ -1886,7 +1886,7 @@ private:
size_t my_threshold;
size_t my_count; // number of successful puts
size_t my_tries; // number of active put attempts
- size_t my_future_decrement; // number of active decrement
+ size_t my_future_decrement; // number of active decrement
reservable_predecessor_cache< T, spin_mutex > my_predecessors;
spin_mutex my_mutex;
broadcast_cache< T > my_successors;
@@ -2857,8 +2857,8 @@ public:
async_body(const Body &body, gateway_type *gateway)
: base_type(gateway), my_body(body) { }
- void operator()( const Input &v, Ports & ) noexcept(noexcept(my_body(v, std::declval<gateway_type&>()))) {
- my_body(v, *this->my_gateway);
+ void operator()( const Input &v, Ports & ) noexcept(noexcept(tbb::detail::invoke(my_body, v, std::declval<gateway_type&>()))) {
+ tbb::detail::invoke(my_body, v, *this->my_gateway);
}
Body get_body() { return my_body; }
diff --git a/contrib/libs/tbb/include/oneapi/tbb/info.h b/contrib/libs/tbb/include/oneapi/tbb/info.h
index 5a68960a84..dfcfcc031d 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/info.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/info.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2019-2021 Intel Corporation
+ Copyright (c) 2019-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.
@@ -49,7 +49,6 @@ struct constraints {
max_concurrency = maximal_concurrency;
return *this;
}
-#if __TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT
constraints& set_core_type(core_type_id id) {
core_type = id;
return *this;
@@ -58,14 +57,11 @@ struct constraints {
max_threads_per_core = threads_number;
return *this;
}
-#endif
numa_node_id numa_id = -1;
int max_concurrency = -1;
-#if __TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT
core_type_id core_type = -1;
int max_threads_per_core = -1;
-#endif
};
} // namespace d1
@@ -96,7 +92,6 @@ inline int default_concurrency(numa_node_id id = -1) {
return r1::numa_default_concurrency(id);
}
-#if __TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT
inline std::vector<core_type_id> core_types() {
std::vector<int> core_type_indexes(r1::core_type_count());
r1::fill_core_type_indices(core_type_indexes.data());
@@ -107,22 +102,17 @@ inline int default_concurrency(constraints c) {
if (c.max_concurrency > 0) { return c.max_concurrency; }
return r1::constraints_default_concurrency(c);
}
-#endif /*__TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT*/
} // namespace d1
} // namespace detail
inline namespace v1 {
using detail::d1::numa_node_id;
-#if __TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT
using detail::d1::core_type_id;
-#endif
namespace info {
using detail::d1::numa_nodes;
-#if __TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT
using detail::d1::core_types;
-#endif
using detail::d1::default_concurrency;
} // namespace info
diff --git a/contrib/libs/tbb/include/oneapi/tbb/parallel_for.h b/contrib/libs/tbb/include/oneapi/tbb/parallel_for.h
index d3c8fdd849..91c7c44c87 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/parallel_for.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/parallel_for.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2021 Intel Corporation
+ Copyright (c) 2005-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.
@@ -37,10 +37,7 @@ namespace detail {
inline namespace d0 {
template <typename Body, typename Range>
-concept parallel_for_body = std::copy_constructible<Body> &&
- requires( const std::remove_reference_t<Body>& body, Range& range ) {
- body(range);
- };
+concept parallel_for_body = std::copy_constructible<Body> && std::invocable<const std::remove_reference_t<Body>&, Range&>;
template <typename Index>
concept parallel_for_index = std::constructible_from<Index, int> &&
@@ -52,9 +49,7 @@ concept parallel_for_index = std::constructible_from<Index, int> &&
};
template <typename Function, typename Index>
-concept parallel_for_function = requires( const std::remove_reference_t<Function>& func, Index index ) {
- func(index);
-};
+concept parallel_for_function = std::invocable<const std::remove_reference_t<Function>&, Index>;
} // namespace d0
#endif // __TBB_CPP20_CONCEPTS_PRESENT
@@ -79,6 +74,7 @@ struct start_for : public task {
start_for( const Range& range, const Body& body, Partitioner& partitioner, small_object_allocator& alloc ) :
my_range(range),
my_body(body),
+ my_parent(nullptr),
my_partition(partitioner),
my_allocator(alloc) {}
//! Splitting constructor used to generate children.
@@ -86,6 +82,7 @@ struct start_for : public task {
start_for( start_for& parent_, typename Partitioner::split_type& split_obj, small_object_allocator& alloc ) :
my_range(parent_.my_range, get_range_split_object<Range>(split_obj)),
my_body(parent_.my_body),
+ my_parent(nullptr),
my_partition(parent_.my_partition, split_obj),
my_allocator(alloc) {}
//! Construct right child from the given range as response to the demand.
@@ -93,6 +90,7 @@ struct start_for : public task {
start_for( start_for& parent_, const Range& r, depth_t d, small_object_allocator& alloc ) :
my_range(r),
my_body(parent_.my_body),
+ my_parent(nullptr),
my_partition(parent_.my_partition, split()),
my_allocator(alloc)
{
@@ -116,7 +114,7 @@ struct start_for : public task {
}
//! Run body for range, serves as callback for partitioner
void run_body( Range &r ) {
- my_body( r );
+ tbb::detail::invoke(my_body, r);
}
//! spawn right task, serves as callback for partitioner
@@ -205,7 +203,7 @@ public:
#endif
#endif
for ( Index i = b; i < e; ++i, k += ms ) {
- my_func( k );
+ tbb::detail::invoke(my_func, k);
}
}
};
@@ -310,7 +308,7 @@ void parallel_for_impl(Index first, Index last, Index step, const Function& f, P
throw_exception(exception_id::nonpositive_step); // throws std::invalid_argument
else if (first < last) {
// Above "else" avoids "potential divide by zero" warning on some platforms
- Index end = (last - first - Index(1)) / step + Index(1);
+ Index end = Index(last - first - 1ul) / step + Index(1);
blocked_range<Index> range(static_cast<Index>(0), end);
parallel_for_body_wrapper<Function, Index> body(f, first, step);
parallel_for(range, body, partitioner);
diff --git a/contrib/libs/tbb/include/oneapi/tbb/parallel_for_each.h b/contrib/libs/tbb/include/oneapi/tbb/parallel_for_each.h
index 8eb9e2069e..56dbeb4101 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/parallel_for_each.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/parallel_for_each.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2021 Intel Corporation
+ Copyright (c) 2005-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.
@@ -23,6 +23,7 @@
#include "detail/_task.h"
#include "detail/_aligned_space.h"
#include "detail/_small_object_pool.h"
+#include "detail/_utils.h"
#include "parallel_for.h"
#include "task_group.h" // task_group_context
@@ -41,13 +42,8 @@ class feeder;
inline namespace d0 {
template <typename Body, typename ItemType, typename FeederItemType>
-concept parallel_for_each_body = requires( const std::remove_reference_t<Body>& body, ItemType&& item ) {
- body(std::forward<ItemType>(item));
- } ||
- requires( const std::remove_reference_t<Body>& body, ItemType&& item,
- tbb::detail::d1::feeder<FeederItemType>& feeder ) {
- body(std::forward<ItemType>(item), feeder);
-};
+concept parallel_for_each_body = std::invocable<const std::remove_reference_t<Body>&, ItemType&&> ||
+ std::invocable<const std::remove_reference_t<Body>&, ItemType&&, tbb::detail::d1::feeder<FeederItemType>&>;
} // namespace d0
#endif // __TBB_CPP20_CONCEPTS_PRESENT
@@ -85,23 +81,23 @@ struct parallel_for_each_operator_selector {
public:
template<typename ItemArg, typename FeederArg>
static auto call(const Body& body, ItemArg&& item, FeederArg*)
- -> decltype(body(std::forward<ItemArg>(item)), void()) {
+ -> decltype(tbb::detail::invoke(body, std::forward<ItemArg>(item)), void()) {
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
// Suppression of Microsoft non-standard extension warnings
#pragma warning (push)
#pragma warning (disable: 4239)
#endif
- body(std::forward<ItemArg>(item));
+ tbb::detail::invoke(body, std::forward<ItemArg>(item));
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
- #pragma warning (push)
+ #pragma warning (pop)
#endif
}
template<typename ItemArg, typename FeederArg>
static auto call(const Body& body, ItemArg&& item, FeederArg* feeder)
- -> decltype(body(std::forward<ItemArg>(item), *feeder), void()) {
+ -> decltype(tbb::detail::invoke(body, std::forward<ItemArg>(item), *feeder), void()) {
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
// Suppression of Microsoft non-standard extension warnings
#pragma warning (push)
@@ -109,10 +105,10 @@ public:
#endif
__TBB_ASSERT(feeder, "Feeder was not created but should be");
- body(std::forward<ItemArg>(item), *feeder);
+ tbb::detail::invoke(body, std::forward<ItemArg>(item), *feeder);
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
- #pragma warning (push)
+ #pragma warning (pop)
#endif
}
};
@@ -306,7 +302,9 @@ struct input_block_handling_task : public task {
~input_block_handling_task() {
for(std::size_t counter = 0; counter < max_block_size; ++counter) {
(task_pool.begin() + counter)->~iteration_task();
- (block_iteration_space.begin() + counter)->~Item();
+ if (counter < my_size) {
+ (block_iteration_space.begin() + counter)->~Item();
+ }
}
}
@@ -422,8 +420,9 @@ using iterator_tag_dispatch = typename
>::type;
template <typename Body, typename Iterator, typename Item>
-using feeder_is_required = tbb::detail::void_t<decltype(std::declval<const Body>()(std::declval<typename std::iterator_traits<Iterator>::reference>(),
- std::declval<feeder<Item>&>()))>;
+using feeder_is_required = tbb::detail::void_t<decltype(tbb::detail::invoke(std::declval<const Body>(),
+ std::declval<typename std::iterator_traits<Iterator>::reference>(),
+ std::declval<feeder<Item>&>()))>;
// Creates feeder object only if the body can accept it
template <typename Iterator, typename Body, typename Item, typename = void>
diff --git a/contrib/libs/tbb/include/oneapi/tbb/parallel_reduce.h b/contrib/libs/tbb/include/oneapi/tbb/parallel_reduce.h
index 0dfd486abd..401ad00467 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/parallel_reduce.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/parallel_reduce.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -41,17 +41,18 @@ concept parallel_reduce_body = splittable<Body> &&
};
template <typename Function, typename Range, typename Value>
-concept parallel_reduce_function = requires( const std::remove_reference_t<Function>& func,
- const Range& range,
- const Value& value ) {
- { func(range, value) } -> std::convertible_to<Value>;
-};
+concept parallel_reduce_function = std::invocable<const std::remove_reference_t<Function>&,
+ const Range&, const Value&> &&
+ std::convertible_to<std::invoke_result_t<const std::remove_reference_t<Function>&,
+ const Range&, const Value&>,
+ Value>;
template <typename Combine, typename Value>
-concept parallel_reduce_combine = requires( const std::remove_reference_t<Combine>& combine,
- const Value& lhs, const Value& rhs ) {
- { combine(lhs, rhs) } -> std::convertible_to<Value>;
-};
+concept parallel_reduce_combine = std::invocable<const std::remove_reference_t<Combine>&,
+ const Value&, const Value&> &&
+ std::convertible_to<std::invoke_result_t<const std::remove_reference_t<Combine>&,
+ const Value&, const Value&>,
+ Value>;
} // namespace d0
#endif // __TBB_CPP20_CONCEPTS_PRESENT
@@ -104,6 +105,7 @@ struct start_reduce : public task {
start_reduce( const Range& range, Body& body, Partitioner& partitioner, small_object_allocator& alloc ) :
my_range(range),
my_body(&body),
+ my_parent(nullptr),
my_partition(partitioner),
my_allocator(alloc),
is_right_child(false) {}
@@ -112,6 +114,7 @@ struct start_reduce : public task {
start_reduce( start_reduce& parent_, typename Partitioner::split_type& split_obj, small_object_allocator& alloc ) :
my_range(parent_.my_range, get_range_split_object<Range>(split_obj)),
my_body(parent_.my_body),
+ my_parent(nullptr),
my_partition(parent_.my_partition, split_obj),
my_allocator(alloc),
is_right_child(true)
@@ -123,6 +126,7 @@ struct start_reduce : public task {
start_reduce( start_reduce& parent_, const Range& r, depth_t d, small_object_allocator& alloc ) :
my_range(r),
my_body(parent_.my_body),
+ my_parent(nullptr),
my_partition(parent_.my_partition, split()),
my_allocator(alloc),
is_right_child(true)
@@ -147,7 +151,7 @@ struct start_reduce : public task {
}
//! Run body for range, serves as callback for partitioner
void run_body( Range &r ) {
- (*my_body)(r);
+ tbb::detail::invoke(*my_body, r);
}
//! spawn right task, serves as callback for partitioner
@@ -201,9 +205,10 @@ task* start_reduce<Range,Body,Partitioner>::execute(execution_data& ed) {
// The acquire barrier synchronizes the data pointed with my_body if the left
// task has already finished.
+ __TBB_ASSERT(my_parent, nullptr);
if( is_right_child && my_parent->m_ref_count.load(std::memory_order_acquire) == 2 ) {
tree_node_type* parent_ptr = static_cast<tree_node_type*>(my_parent);
- my_body = (Body*) new( parent_ptr->zombie_space.begin() ) Body(*my_body, split());
+ my_body = static_cast<Body*>(new( parent_ptr->zombie_space.begin() ) Body(*my_body, split()));
parent_ptr->has_right_zombie = true;
}
__TBB_ASSERT(my_body != nullptr, "Incorrect body value");
@@ -261,6 +266,7 @@ struct start_deterministic_reduce : public task {
start_deterministic_reduce( const Range& range, Partitioner& partitioner, Body& body, small_object_allocator& alloc ) :
my_range(range),
my_body(body),
+ my_parent(nullptr),
my_partition(partitioner),
my_allocator(alloc) {}
//! Splitting constructor used to generate children.
@@ -269,6 +275,7 @@ struct start_deterministic_reduce : public task {
small_object_allocator& alloc ) :
my_range(parent_.my_range, get_range_split_object<Range>(split_obj)),
my_body(body),
+ my_parent(nullptr),
my_partition(parent_.my_partition, split_obj),
my_allocator(alloc) {}
static void run(const Range& range, Body& body, Partitioner& partitioner, task_group_context& context) {
@@ -290,7 +297,7 @@ struct start_deterministic_reduce : public task {
}
//! Run body for range, serves as callback for partitioner
void run_body( Range &r ) {
- my_body( r );
+ tbb::detail::invoke(my_body, r);
}
//! Spawn right task, serves as callback for partitioner
void offer_work(typename Partitioner::split_type& split_obj, execution_data& ed) {
@@ -383,10 +390,11 @@ public:
, my_value(other.my_identity_element)
{ }
void operator()(Range& range) {
- my_value = my_real_body(range, const_cast<const Value&>(my_value));
+ my_value = tbb::detail::invoke(my_real_body, range, const_cast<const Value&>(my_value));
}
void join( lambda_reduce_body& rhs ) {
- my_value = my_reduction(const_cast<const Value&>(my_value), const_cast<const Value&>(rhs.my_value));
+ my_value = tbb::detail::invoke(my_reduction, const_cast<const Value&>(my_value),
+ const_cast<const Value&>(rhs.my_value));
}
Value result() const {
return my_value;
diff --git a/contrib/libs/tbb/include/oneapi/tbb/parallel_scan.h b/contrib/libs/tbb/include/oneapi/tbb/parallel_scan.h
index 51adcbd794..6d2a4d6401 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/parallel_scan.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/parallel_scan.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2021 Intel Corporation
+ Copyright (c) 2005-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.
@@ -64,16 +64,18 @@ concept parallel_scan_body = splittable<Body> &&
};
template <typename Function, typename Range, typename Value>
-concept parallel_scan_function = requires( const std::remove_reference_t<Function>& func,
- const Range& range, const Value& value ) {
- { func(range, value, true) } -> std::convertible_to<Value>;
-};
+concept parallel_scan_function = std::invocable<const std::remove_reference_t<Function>&,
+ const Range&, const Value&, bool> &&
+ std::convertible_to<std::invoke_result_t<const std::remove_reference_t<Function>&,
+ const Range&, const Value&, bool>,
+ Value>;
template <typename Combine, typename Value>
-concept parallel_scan_combine = requires( const std::remove_reference_t<Combine>& combine,
- const Value& lhs, const Value& rhs ) {
- { combine(lhs, rhs) } -> std::convertible_to<Value>;
-};
+concept parallel_scan_combine = std::invocable<const std::remove_reference_t<Combine>&,
+ const Value&, const Value&> &&
+ std::convertible_to<std::invoke_result_t<const std::remove_reference_t<Combine>&,
+ const Value&, const Value&>,
+ Value>;
} // namespace d0
namespace d1 {
@@ -519,11 +521,11 @@ public:
template<typename Tag>
void operator()( const Range& r, Tag tag ) {
- m_sum_slot = m_scan(r, m_sum_slot, tag);
+ m_sum_slot = tbb::detail::invoke(m_scan, r, m_sum_slot, tag);
}
void reverse_join( lambda_scan_body& a ) {
- m_sum_slot = m_reverse_join(a.m_sum_slot, m_sum_slot);
+ m_sum_slot = tbb::detail::invoke(m_reverse_join, a.m_sum_slot, m_sum_slot);
}
void assign( lambda_scan_body& b ) {
@@ -626,4 +628,3 @@ inline namespace v1 {
} // namespace tbb
#endif /* __TBB_parallel_scan_H */
-
diff --git a/contrib/libs/tbb/include/oneapi/tbb/partitioner.h b/contrib/libs/tbb/include/oneapi/tbb/partitioner.h
index 5f3c0cc512..98de0d42b7 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/partitioner.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/partitioner.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -70,7 +70,7 @@ class affinity_partitioner_base;
inline std::size_t get_initial_auto_partitioner_divisor() {
const std::size_t factor = 4;
- return factor * max_concurrency();
+ return factor * static_cast<std::size_t>(max_concurrency());
}
//! Defines entry point for affinity partitioner into oneTBB run-time library.
@@ -90,7 +90,7 @@ class affinity_partitioner_base: no_copy {
/** Retains values if resulting size is the same. */
void resize(unsigned factor) {
// Check factor to avoid asking for number of workers while there might be no arena.
- unsigned max_threads_in_arena = max_concurrency();
+ unsigned max_threads_in_arena = static_cast<unsigned>(max_concurrency());
std::size_t new_size = factor ? factor * max_threads_in_arena : 0;
if (new_size != my_size) {
if (my_array) {
@@ -160,6 +160,7 @@ struct tree_node : public node {
template<typename TreeNodeType>
void fold_tree(node* n, const execution_data& ed) {
for (;;) {
+ __TBB_ASSERT(n, nullptr);
__TBB_ASSERT(n->m_ref_count.load(std::memory_order_relaxed) > 0, "The refcount must be positive.");
call_itt_task_notify(releasing, n);
if (--n->m_ref_count > 0) {
diff --git a/contrib/libs/tbb/include/oneapi/tbb/profiling.h b/contrib/libs/tbb/include/oneapi/tbb/profiling.h
index 3bd2a42654..412b5a35eb 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/profiling.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/profiling.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -122,14 +122,14 @@ namespace d1 {
// Distinguish notifications on task for reducing overheads
#if TBB_USE_PROFILING_TOOLS == 2
inline void call_itt_task_notify(d1::notify_type t, void *ptr) {
- r1::call_itt_notify((int)t, ptr);
+ r1::call_itt_notify(static_cast<int>(t), ptr);
}
#else
inline void call_itt_task_notify(d1::notify_type, void *) {}
#endif // TBB_USE_PROFILING_TOOLS
inline void call_itt_notify(d1::notify_type t, void *ptr) {
- r1::call_itt_notify((int)t, ptr);
+ r1::call_itt_notify(static_cast<int>(t), ptr);
}
#if (_WIN32||_WIN64) && !__MINGW32__
diff --git a/contrib/libs/tbb/include/oneapi/tbb/task_arena.h b/contrib/libs/tbb/include/oneapi/tbb/task_arena.h
index 69c8b94765..0de49aef07 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/task_arena.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/task_arena.h
@@ -187,13 +187,8 @@ protected:
, my_num_reserved_slots(reserved_for_masters)
, my_priority(a_priority)
, my_numa_id(constraints_.numa_id)
-#if __TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT
, my_core_type(constraints_.core_type)
, my_max_threads_per_core(constraints_.max_threads_per_core)
-#else
- , my_core_type(automatic)
- , my_max_threads_per_core(automatic)
-#endif
{}
#endif /*__TBB_ARENA_BINDING*/
public:
@@ -280,10 +275,8 @@ public:
constraints{}
.set_numa_id(s.my_numa_id)
.set_max_concurrency(s.my_max_concurrency)
-#if __TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT
.set_core_type(s.my_core_type)
.set_max_threads_per_core(s.my_max_threads_per_core)
-#endif
, s.my_num_reserved_slots, s.my_priority)
{}
#else
@@ -337,10 +330,8 @@ public:
if( !is_active() ) {
my_numa_id = constraints_.numa_id;
my_max_concurrency = constraints_.max_concurrency;
-#if __TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT
my_core_type = constraints_.core_type;
my_max_threads_per_core = constraints_.max_threads_per_core;
-#endif
my_num_reserved_slots = reserved_for_masters;
my_priority = a_priority;
r1::initialize(*this);
diff --git a/contrib/libs/tbb/include/oneapi/tbb/version.h b/contrib/libs/tbb/include/oneapi/tbb/version.h
index 22e67dad50..965af129a8 100644
--- a/contrib/libs/tbb/include/oneapi/tbb/version.h
+++ b/contrib/libs/tbb/include/oneapi/tbb/version.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -29,7 +29,7 @@
// Product version
#define TBB_VERSION_MAJOR 2021
// Update version
-#define TBB_VERSION_MINOR 8
+#define TBB_VERSION_MINOR 10
// "Patch" version for custom releases
#define TBB_VERSION_PATCH 0
// Suffix string
@@ -40,7 +40,7 @@
// OneAPI oneTBB specification version
#define ONETBB_SPEC_VERSION "1.0"
// Full interface version
-#define TBB_INTERFACE_VERSION 12080
+#define TBB_INTERFACE_VERSION 12100
// Major interface version
#define TBB_INTERFACE_VERSION_MAJOR (TBB_INTERFACE_VERSION/1000)
// Minor interface version
diff --git a/contrib/libs/tbb/patches/config.patch b/contrib/libs/tbb/patches/config.patch
new file mode 100644
index 0000000000..c0cdb26f28
--- /dev/null
+++ b/contrib/libs/tbb/patches/config.patch
@@ -0,0 +1,14 @@
+--- a/include/oneapi/tbb/detail/_config.h (index)
++++ b/include/oneapi/tbb/detail/_config.h (working tree)
+@@ -246,1 +246,6 @@
+- #define __TBB_CPP20_CONCEPTS_PRESENT (_MSC_VER >= 1923 && __TBB_LANG >= 202002L) // TODO: INTEL_COMPILER?
++ #if !defined(__cpp_lib_concepts)
++ // TBB's concepts use STL's concepts
++ #define __TBB_CPP20_CONCEPTS_PRESENT 0
++ #else
++ #define __TBB_CPP20_CONCEPTS_PRESENT (_MSC_VER >= 1923 && __TBB_LANG >= 202002L) // TODO: INTEL_COMPILER?
++ #endif
+@@ -258,2 +258,1 @@
+-#define __TBB_CPP17_MEMORY_RESOURCE_PRESENT (_MSC_VER >= 1913 && (__TBB_LANG > 201402L) || \
+- __TBB_GLIBCXX_VERSION >= 90000 && __TBB_LANG >= 201703L)
++#define __TBB_CPP17_MEMORY_RESOURCE_PRESENT 0
diff --git a/contrib/libs/tbb/patches/ucontext-darwin.patch b/contrib/libs/tbb/patches/ucontext-darwin.patch
new file mode 100644
index 0000000000..d10cb7a912
--- /dev/null
+++ b/contrib/libs/tbb/patches/ucontext-darwin.patch
@@ -0,0 +1,10 @@
+--- contrib/libs/tbb/src/tbb/co_context.h (index)
++++ contrib/libs/tbb/src/tbb/co_context.h (working tree)
+@@ -47,6 +47,7 @@
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ #endif
++ #define _XOPEN_SOURCE 700
+ #endif // __APPLE__
+
+ #include <ucontext.h>
diff --git a/contrib/libs/tbb/src/tbb/arena.cpp b/contrib/libs/tbb/src/tbb/arena.cpp
index 2161ed5dc2..e79f689b82 100644
--- a/contrib/libs/tbb/src/tbb/arena.cpp
+++ b/contrib/libs/tbb/src/tbb/arena.cpp
@@ -436,17 +436,11 @@ void task_arena_impl::initialize(d1::task_arena_base& ta) {
(void)governor::get_thread_data();
if (ta.my_max_concurrency < 1) {
#if __TBB_ARENA_BINDING
-
-#if __TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT
d1::constraints arena_constraints = d1::constraints{}
.set_core_type(ta.core_type())
.set_max_threads_per_core(ta.max_threads_per_core())
.set_numa_id(ta.my_numa_id);
ta.my_max_concurrency = (int)default_concurrency(arena_constraints);
-#else /*!__TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT*/
- ta.my_max_concurrency = (int)default_concurrency(ta.my_numa_id);
-#endif /*!__TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT*/
-
#else /*!__TBB_ARENA_BINDING*/
ta.my_max_concurrency = (int)governor::default_num_threads();
#endif /*!__TBB_ARENA_BINDING*/
@@ -736,15 +730,11 @@ int task_arena_impl::max_concurrency(const d1::task_arena_base *ta) {
#if __TBB_ARENA_BINDING
if (ta) {
-#if __TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT
d1::constraints arena_constraints = d1::constraints{}
.set_numa_id(ta->my_numa_id)
.set_core_type(ta->core_type())
.set_max_threads_per_core(ta->max_threads_per_core());
return (int)default_concurrency(arena_constraints);
-#else /*!__TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT*/
- return (int)default_concurrency(ta->my_numa_id);
-#endif /*!__TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT*/
}
#endif /*!__TBB_ARENA_BINDING*/
diff --git a/contrib/libs/tbb/src/tbb/arena_slot.h b/contrib/libs/tbb/src/tbb/arena_slot.h
index d9a70cfaf8..cdd91902d1 100644
--- a/contrib/libs/tbb/src/tbb/arena_slot.h
+++ b/contrib/libs/tbb/src/tbb/arena_slot.h
@@ -221,7 +221,7 @@ private:
}
acquire_task_pool();
std::size_t H = head.load(std::memory_order_relaxed); // mirror
- d1::task** new_task_pool = task_pool_ptr;;
+ d1::task** new_task_pool = task_pool_ptr;
__TBB_ASSERT( my_task_pool_size >= min_task_pool_size, nullptr);
// Count not skipped tasks. Consider using std::count_if.
for ( std::size_t i = H; i < T; ++i )
diff --git a/contrib/libs/tbb/src/tbb/dynamic_link.cpp b/contrib/libs/tbb/src/tbb/dynamic_link.cpp
index 330415a829..2d88f8bc5d 100644
--- a/contrib/libs/tbb/src/tbb/dynamic_link.cpp
+++ b/contrib/libs/tbb/src/tbb/dynamic_link.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -15,6 +15,7 @@
*/
#include "dynamic_link.h"
+#include "environment.h"
#include "oneapi/tbb/detail/_template_helpers.h"
#include "oneapi/tbb/detail/_utils.h"
@@ -414,7 +415,9 @@ namespace r1 {
if (local_binding) {
flags = flags | RTLD_LOCAL;
#if (__linux__ && __GLIBC__) && !__TBB_USE_SANITIZERS
- flags = flags | RTLD_DEEPBIND;
+ if( !GetBoolEnvironmentVariable("TBB_ENABLE_SANITIZERS") ) {
+ flags = flags | RTLD_DEEPBIND;
+ }
#endif
} else {
flags = flags | RTLD_GLOBAL;
diff --git a/contrib/libs/tbb/src/tbb/itt_notify.h b/contrib/libs/tbb/src/tbb/itt_notify.h
index 5fc9d5424f..48ddc5caec 100644
--- a/contrib/libs/tbb/src/tbb/itt_notify.h
+++ b/contrib/libs/tbb/src/tbb/itt_notify.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2021 Intel Corporation
+ Copyright (c) 2005-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.
@@ -34,6 +34,7 @@
#include "tools_api/ittnotify.h"
#include "tools_api/legacy/ittnotify.h"
extern "C" void __itt_fini_ittlib(void);
+extern "C" void __itt_release_resources(void);
#if _WIN32||_WIN64
#undef _T
@@ -75,6 +76,7 @@ extern const tchar
#define ITT_NOTIFY(name,obj) __itt_##name(const_cast<void*>(static_cast<volatile void*>(obj)))
#define ITT_THREAD_SET_NAME(name) __itt_thread_set_name(name)
#define ITT_FINI_ITTLIB() __itt_fini_ittlib()
+#define ITT_RELEASE_RESOURCES() __itt_release_resources()
#define ITT_SYNC_CREATE(obj, type, name) __itt_sync_create((void*)(obj), type, name, 2)
#define ITT_STACK_CREATE(obj) obj = __itt_stack_caller_create()
#define ITT_STACK_DESTROY(obj) (obj!=nullptr) ? __itt_stack_caller_destroy(static_cast<__itt_caller>(obj)) : ((void)0)
@@ -94,6 +96,7 @@ extern const tchar
#define ITT_NOTIFY(name,obj) ((void)0)
#define ITT_THREAD_SET_NAME(name) ((void)0)
#define ITT_FINI_ITTLIB() ((void)0)
+#define ITT_RELEASE_RESOURCES() ((void)0)
#define ITT_SYNC_CREATE(obj, type, name) ((void)0)
#define ITT_STACK_CREATE(obj) ((void)0)
#define ITT_STACK_DESTROY(obj) ((void)0)
diff --git a/contrib/libs/tbb/src/tbb/main.cpp b/contrib/libs/tbb/src/tbb/main.cpp
index d86c3b696b..8a1dc89320 100644
--- a/contrib/libs/tbb/src/tbb/main.cpp
+++ b/contrib/libs/tbb/src/tbb/main.cpp
@@ -100,6 +100,7 @@ void __TBB_InitOnce::remove_ref() {
if( k==0 ) {
governor::release_resources();
ITT_FINI_ITTLIB();
+ ITT_RELEASE_RESOURCES();
}
}
diff --git a/contrib/libs/tbb/src/tbb/rml_thread_monitor.h b/contrib/libs/tbb/src/tbb/rml_thread_monitor.h
index 13b556380f..57e9c30b07 100644
--- a/contrib/libs/tbb/src/tbb/rml_thread_monitor.h
+++ b/contrib/libs/tbb/src/tbb/rml_thread_monitor.h
@@ -31,6 +31,7 @@
#include <pthread.h>
#include <cstring>
#include <cstdlib>
+#include <time.h>
#else
#error Unsupported platform
#endif
@@ -191,8 +192,25 @@ inline thread_monitor::handle_type thread_monitor::launch( void* (*thread_routin
check(pthread_attr_init( &s ), "pthread_attr_init has failed");
if( stack_size>0 )
check(pthread_attr_setstacksize( &s, stack_size ), "pthread_attr_setstack_size has failed" );
+
+ // pthread_create(2) can spuriously fail with EAGAIN. We retry
+ // max_num_tries times with progressively longer wait times.
pthread_t handle;
- check( pthread_create( &handle, &s, thread_routine, arg ), "pthread_create has failed" );
+ const int max_num_tries = 20;
+ int error = EAGAIN;
+
+ for (int i = 0; i < max_num_tries && error == EAGAIN; i++) {
+ if (i != 0) {
+ // Wait i milliseconds
+ struct timespec ts = {0, i * 1000 * 1000};
+ nanosleep(&ts, NULL);
+ }
+ error = pthread_create(&handle, &s, thread_routine, arg);
+ }
+
+ if (error)
+ handle_perror(error, "pthread_create has failed");
+
check( pthread_attr_destroy( &s ), "pthread_attr_destroy has failed" );
return handle;
}
diff --git a/contrib/libs/tbb/src/tbb/semaphore.h b/contrib/libs/tbb/src/tbb/semaphore.h
index 8bc1924f03..353f790565 100644
--- a/contrib/libs/tbb/src/tbb/semaphore.h
+++ b/contrib/libs/tbb/src/tbb/semaphore.h
@@ -22,10 +22,7 @@
#if _WIN32||_WIN64
#include <windows.h>
#elif __APPLE__
-#include <mach/semaphore.h>
-#include <mach/task.h>
-#include <mach/mach_init.h>
-#include <mach/error.h>
+#include <dispatch/dispatch.h>
#else
#include <semaphore.h>
#ifdef TBB_USE_DEBUG
@@ -150,28 +147,18 @@ private:
class semaphore : no_copy {
public:
//! ctor
- semaphore(int start_cnt_ = 0) : sem(start_cnt_) { init_semaphore(start_cnt_); }
+ semaphore(int start_cnt_ = 0) { my_sem = dispatch_semaphore_create(start_cnt_); }
//! dtor
- ~semaphore() {
- kern_return_t ret = semaphore_destroy( mach_task_self(), sem );
- __TBB_ASSERT_EX( ret==err_none, nullptr);
- }
+ ~semaphore() { dispatch_release(my_sem); }
//! wait/acquire
void P() {
- int ret;
- do {
- ret = semaphore_wait( sem );
- } while( ret==KERN_ABORTED );
- __TBB_ASSERT( ret==KERN_SUCCESS, "semaphore_wait() failed" );
+ std::intptr_t ret = dispatch_semaphore_wait(my_sem, DISPATCH_TIME_FOREVER);
+ __TBB_ASSERT_EX(ret == 0, "dispatch_semaphore_wait() failed");
}
//! post/release
- void V() { semaphore_signal( sem ); }
+ void V() { dispatch_semaphore_signal(my_sem); }
private:
- semaphore_t sem;
- void init_semaphore(int start_cnt_) {
- kern_return_t ret = semaphore_create( mach_task_self(), &sem, SYNC_POLICY_FIFO, start_cnt_ );
- __TBB_ASSERT_EX( ret==err_none, "failed to create a semaphore" );
- }
+ dispatch_semaphore_t my_sem;
};
#else /* Linux/Unix */
typedef uint32_t sem_count_t;
@@ -244,31 +231,7 @@ private:
#endif /* !__TBB_USE_SRWLOCK */
#elif __APPLE__
//! binary_semaphore for concurrent monitor
-class binary_semaphore : no_copy {
-public:
- //! ctor
- binary_semaphore() : my_sem(0) {
- kern_return_t ret = semaphore_create( mach_task_self(), &my_sem, SYNC_POLICY_FIFO, 0 );
- __TBB_ASSERT_EX( ret==err_none, "failed to create a semaphore" );
- }
- //! dtor
- ~binary_semaphore() {
- kern_return_t ret = semaphore_destroy( mach_task_self(), my_sem );
- __TBB_ASSERT_EX( ret==err_none, nullptr);
- }
- //! wait/acquire
- void P() {
- int ret;
- do {
- ret = semaphore_wait( my_sem );
- } while( ret==KERN_ABORTED );
- __TBB_ASSERT( ret==KERN_SUCCESS, "semaphore_wait() failed" );
- }
- //! post/release
- void V() { semaphore_signal( my_sem ); }
-private:
- semaphore_t my_sem;
-};
+using binary_semaphore = semaphore;
#else /* Linux/Unix */
#if __TBB_USE_FUTEX
diff --git a/contrib/libs/tbb/src/tbb/task_stream.h b/contrib/libs/tbb/src/tbb/task_stream.h
index dc0b6818bc..0aaace52b4 100644
--- a/contrib/libs/tbb/src/tbb/task_stream.h
+++ b/contrib/libs/tbb/src/tbb/task_stream.h
@@ -193,10 +193,11 @@ public:
d1::task* pop( const lane_selector_t& next_lane ) {
d1::task* popped = nullptr;
unsigned lane = 0;
- do {
- lane = next_lane( /*out_of=*/N );
- __TBB_ASSERT( lane < N, "Incorrect lane index." );
- } while( !empty() && !(popped = try_pop( lane )) );
+ for (atomic_backoff b; !empty() && !popped; b.pause()) {
+ lane = next_lane( /*out_of=*/N);
+ __TBB_ASSERT(lane < N, "Incorrect lane index.");
+ popped = try_pop(lane);
+ }
return popped;
}
diff --git a/contrib/libs/tbb/src/tbb/tools_api/disable_warnings.h b/contrib/libs/tbb/src/tbb/tools_api/disable_warnings.h
index 27aa3ee0ce..977569d087 100644
--- a/contrib/libs/tbb/src/tbb/tools_api/disable_warnings.h
+++ b/contrib/libs/tbb/src/tbb/tools_api/disable_warnings.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2021 Intel Corporation
+ Copyright (c) 2005-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.
@@ -16,7 +16,9 @@
#include "ittnotify_config.h"
-#if ITT_PLATFORM==ITT_PLATFORM_WIN && _MSC_VER
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+
+#if defined _MSC_VER
#pragma warning (disable: 593) /* parameter "XXXX" was set but never used */
#pragma warning (disable: 344) /* typedef name has already been declared (with same type) */
@@ -24,6 +26,8 @@
#pragma warning (disable: 4127) /* conditional expression is constant */
#pragma warning (disable: 4306) /* conversion from '?' to '?' of greater size */
+#endif
+
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#if defined __INTEL_COMPILER
diff --git a/contrib/libs/tbb/src/tbb/tools_api/ittnotify.h b/contrib/libs/tbb/src/tbb/tools_api/ittnotify.h
index 1eecd2faa7..e701980f6a 100644
--- a/contrib/libs/tbb/src/tbb/tools_api/ittnotify.h
+++ b/contrib/libs/tbb/src/tbb/tools_api/ittnotify.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2021 Intel Corporation
+ Copyright (c) 2005-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.
@@ -22,7 +22,7 @@
@brief Public User API functions and types
@mainpage
-The Instrumentation and Tracing Technology API (ITT API) is used to
+The Instrumentation and Tracing Technology API (ITT API) is used to
annotate a user's program with additional information
that can be used by correctness and performance tools. The user inserts
calls in their program. Those calls generate information that is collected
@@ -188,7 +188,12 @@ The same ID may not be reused for different instances, unless a previous
#if ITT_PLATFORM==ITT_PLATFORM_WIN
/* use __forceinline (VC++ specific) */
+#if defined(__MINGW32__) && !defined(__cplusplus)
+#define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__))
+#else
#define ITT_INLINE static __forceinline
+#endif /* __MINGW32__ */
+
#define ITT_INLINE_ATTRIBUTE /* nothing */
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
/*
@@ -249,20 +254,20 @@ The same ID may not be reused for different instances, unless a previous
#define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)
#define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)
-#define ITTNOTIFY_VOID_D0(n,d) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
-#define ITTNOTIFY_VOID_D1(n,d,x) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
-#define ITTNOTIFY_VOID_D2(n,d,x,y) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
-#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
-#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
-#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
-#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
-#define ITTNOTIFY_DATA_D0(n,d) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
-#define ITTNOTIFY_DATA_D1(n,d,x) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
-#define ITTNOTIFY_DATA_D2(n,d,x,y) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
-#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
-#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
-#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
-#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
+#define ITTNOTIFY_VOID_D0(n,d) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
+#define ITTNOTIFY_VOID_D1(n,d,x) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
+#define ITTNOTIFY_VOID_D2(n,d,x,y) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
+#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
+#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
+#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
+#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
+#define ITTNOTIFY_DATA_D0(n,d) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
+#define ITTNOTIFY_DATA_D1(n,d,x) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
+#define ITTNOTIFY_DATA_D2(n,d,x,y) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
+#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
+#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
+#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
+#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
#ifdef ITT_STUB
#undef ITT_STUB
@@ -591,6 +596,18 @@ typedef enum __itt_suppress_mode {
} __itt_suppress_mode_t;
/**
+ * @enum __itt_collection_state
+ * @brief Enumerator for collection state. All non-work states have negative values.
+ */
+typedef enum {
+ __itt_collection_uninitialized = 0, /* uninitialized */
+ __itt_collection_init_fail = 1, /* failed to init */
+ __itt_collection_collector_absent = 2, /* non work state collector exists */
+ __itt_collection_collector_exists = 3, /* work state collector exists */
+ __itt_collection_init_successful = 4 /* success to init */
+} __itt_collection_state;
+
+/**
* @brief Mark a range of memory for error suppression or unsuppression for error types included in mask
*/
void ITTAPI __itt_suppress_mark_range(__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size);
@@ -3869,6 +3886,125 @@ ITT_STUBV(ITTAPI, void, module_unload_with_sections, (__itt_module_object* modu
#endif /* INTEL_NO_MACRO_BODY */
/** @endcond */
+/** @cond exclude_from_documentation */
+#pragma pack(push, 8)
+
+typedef struct ___itt_histogram
+{
+ const __itt_domain* domain; /*!< Domain of the histogram*/
+ const char* nameA; /*!< Name of the histogram */
+#if defined(UNICODE) || defined(_UNICODE)
+ const wchar_t* nameW;
+#else /* UNICODE || _UNICODE */
+ void* nameW;
+#endif /* UNICODE || _UNICODE */
+ __itt_metadata_type x_type; /*!< Type of the histogram X axis */
+ __itt_metadata_type y_type; /*!< Type of the histogram Y axis */
+ int extra1; /*!< Reserved to the runtime */
+ void* extra2; /*!< Reserved to the runtime */
+ struct ___itt_histogram* next;
+} __itt_histogram;
+
+#pragma pack(pop)
+/** @endcond */
+
+/**
+ * @brief Create a typed histogram instance with given name/domain.
+ * @param[in] domain The domain controlling the call.
+ * @param[in] name The name of the histogram.
+ * @param[in] x_type The type of the X axis in histogram (may be 0 to calculate batch statistics).
+ * @param[in] y_type The type of the Y axis in histogram.
+*/
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+__itt_histogram* ITTAPI __itt_histogram_createA(const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
+__itt_histogram* ITTAPI __itt_histogram_createW(const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
+#if defined(UNICODE) || defined(_UNICODE)
+# define __itt_histogram_create __itt_histogram_createW
+# define __itt_histogram_create_ptr __itt_histogram_createW_ptr
+#else /* UNICODE */
+# define __itt_histogram_create __itt_histogram_createA
+# define __itt_histogram_create_ptr __itt_histogram_createA_ptr
+#endif /* UNICODE */
+#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
+__itt_histogram* ITTAPI __itt_histogram_create(const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
+#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
+
+/** @cond exclude_from_documentation */
+#ifndef INTEL_NO_MACRO_BODY
+#ifndef INTEL_NO_ITTNOTIFY_API
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+ITT_STUB(ITTAPI, __itt_histogram*, histogram_createA, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
+ITT_STUB(ITTAPI, __itt_histogram*, histogram_createW, (const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
+#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
+ITT_STUB(ITTAPI, __itt_histogram*, histogram_create, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
+#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#define __itt_histogram_createA ITTNOTIFY_DATA(histogram_createA)
+#define __itt_histogram_createA_ptr ITTNOTIFY_NAME(histogram_createA)
+#define __itt_histogram_createW ITTNOTIFY_DATA(histogram_createW)
+#define __itt_histogram_createW_ptr ITTNOTIFY_NAME(histogram_createW)
+#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
+#define __itt_histogram_create ITTNOTIFY_DATA(histogram_create)
+#define __itt_histogram_create_ptr ITTNOTIFY_NAME(histogram_create)
+#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
+#else /* INTEL_NO_ITTNOTIFY_API */
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#define __itt_histogram_createA(domain, name, x_type, y_type) (__itt_histogram*)0
+#define __itt_histogram_createA_ptr 0
+#define __itt_histogram_createW(domain, name, x_type, y_type) (__itt_histogram*)0
+#define __itt_histogram_createW_ptr 0
+#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
+#define __itt_histogram_create(domain, name, x_type, y_type) (__itt_histogram*)0
+#define __itt_histogram_create_ptr 0
+#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
+#endif /* INTEL_NO_ITTNOTIFY_API */
+#else /* INTEL_NO_MACRO_BODY */
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#define __itt_histogram_createA_ptr 0
+#define __itt_histogram_createW_ptr 0
+#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
+#define __itt_histogram_create_ptr 0
+#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
+#endif /* INTEL_NO_MACRO_BODY */
+/** @endcond */
+
+/**
+ * @brief Submit statistics for a histogram instance.
+ * @param[in] histogram Pointer to the histogram instance to which the histogram statistic is to be dumped.
+ * @param[in] length The number of elements in dumped axis data array.
+ * @param[in] x_data The X axis dumped data itself (may be NULL to calculate batch statistics).
+ * @param[in] y_data The Y axis dumped data itself.
+*/
+void ITTAPI __itt_histogram_submit(__itt_histogram* histogram, size_t length, void* x_data, void* y_data);
+
+/** @cond exclude_from_documentation */
+#ifndef INTEL_NO_MACRO_BODY
+#ifndef INTEL_NO_ITTNOTIFY_API
+ITT_STUBV(ITTAPI, void, histogram_submit, (__itt_histogram* histogram, size_t length, void* x_data, void* y_data))
+#define __itt_histogram_submit ITTNOTIFY_VOID(histogram_submit)
+#define __itt_histogram_submit_ptr ITTNOTIFY_NAME(histogram_submit)
+#else /* INTEL_NO_ITTNOTIFY_API */
+#define __itt_histogram_submit(histogram, length, x_data, y_data)
+#define __itt_histogram_submit_ptr 0
+#endif /* INTEL_NO_ITTNOTIFY_API */
+#else /* INTEL_NO_MACRO_BODY */
+#define __itt_histogram_submit_ptr 0
+#endif /* INTEL_NO_MACRO_BODY */
+
+/**
+* @brief function allows to obtain the current collection state at the moment
+* @return collection state as a enum __itt_collection_state
+*/
+__itt_collection_state __itt_get_collection_state(void);
+
+/**
+* @brief function releases resources allocated by ITT API static part
+* this API should be called from the library destructor
+* @return void
+*/
+void __itt_release_resources(void);
+/** @endcond */
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/contrib/libs/tbb/src/tbb/tools_api/ittnotify_config.h b/contrib/libs/tbb/src/tbb/tools_api/ittnotify_config.h
index 5e7c0cdf5e..0f5d80f659 100644
--- a/contrib/libs/tbb/src/tbb/tools_api/ittnotify_config.h
+++ b/contrib/libs/tbb/src/tbb/tools_api/ittnotify_config.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2022 Intel Corporation
+ Copyright (c) 2005-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.
@@ -121,7 +121,12 @@
#if ITT_PLATFORM==ITT_PLATFORM_WIN
/* use __forceinline (VC++ specific) */
+#if defined(__MINGW32__) && !defined(__cplusplus)
+#define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__))
+#else
#define ITT_INLINE static __forceinline
+#endif /* __MINGW32__ */
+
#define ITT_INLINE_ATTRIBUTE /* nothing */
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
/*
@@ -167,6 +172,18 @@
# define ITT_ARCH_LOONGARCH64 7
#endif /* ITT_ARCH_LOONGARCH64 */
+#ifndef ITT_ARCH_S390X
+# define ITT_ARCH_S390X 8
+#endif /* ITT_ARCH_S390X */
+
+#ifndef ITT_ARCH_HPPA
+# define ITT_ARCH_HPPA 9
+#endif /* ITT_ARCH_HPPA */
+
+#ifndef ITT_ARCH_RISCV64
+# define ITT_ARCH_RISCV64 10
+#endif /* ITT_ARCH_RISCV64 */
+
#ifndef ITT_ARCH
# if defined _M_IX86 || defined __i386__
# define ITT_ARCH ITT_ARCH_IA32
@@ -182,7 +199,14 @@
# define ITT_ARCH ITT_ARCH_PPC64
# elif defined __loongarch__
# define ITT_ARCH ITT_ARCH_LOONGARCH64
+# elif defined __s390__ || defined __s390x__
+# define ITT_ARCH ITT_ARCH_S390X
+# elif defined __hppa__
+# define ITT_ARCH ITT_ARCH_HPPA
+# elif defined __riscv && __riscv_xlen == 64
+# define ITT_ARCH ITT_ARCH_RISCV64
# endif
+
#endif
#ifdef __cplusplus
@@ -211,7 +235,7 @@
#define API_VERSION_BUILD 20180723
#ifndef API_VERSION_NUM
-#define API_VERSION_NUM 3.18.6
+#define API_VERSION_NUM 3.23.0
#endif /* API_VERSION_NUM */
#define API_VERSION "ITT-API-Version " ITT_TO_STR(API_VERSION_NUM) \
@@ -255,13 +279,13 @@ typedef pthread_mutex_t mutex_t;
#define __itt_mutex_init(mutex) InitializeCriticalSection(mutex)
#define __itt_mutex_lock(mutex) EnterCriticalSection(mutex)
#define __itt_mutex_unlock(mutex) LeaveCriticalSection(mutex)
+#define __itt_mutex_destroy(mutex) DeleteCriticalSection(mutex)
#define __itt_load_lib(name) LoadLibraryA(name)
#define __itt_unload_lib(handle) FreeLibrary(handle)
#define __itt_system_error() (int)GetLastError()
#define __itt_fstrcmp(s1, s2) lstrcmpA(s1, s2)
#define __itt_fstrnlen(s, l) strnlen_s(s, l)
#define __itt_fstrcpyn(s1, b, s2, l) strncpy_s(s1, b, s2, l)
-#define __itt_fstrdup(s) _strdup(s)
#define __itt_thread_id() GetCurrentThreadId()
#define __itt_thread_yield() SwitchToThread()
#ifndef ITT_SIMPLE_INIT
@@ -271,6 +295,13 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
{
return InterlockedIncrement(ptr);
}
+ITT_INLINE long
+__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand) ITT_INLINE_ATTRIBUTE;
+ITT_INLINE long
+__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand)
+{
+ return InterlockedCompareExchange(ptr, exchange, comperand);
+}
#endif /* ITT_SIMPLE_INIT */
#define DL_SYMBOLS (1)
@@ -300,6 +331,7 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
}
#define __itt_mutex_lock(mutex) pthread_mutex_lock(mutex)
#define __itt_mutex_unlock(mutex) pthread_mutex_unlock(mutex)
+#define __itt_mutex_destroy(mutex) pthread_mutex_destroy(mutex)
#define __itt_load_lib(name) dlopen(name, RTLD_LAZY)
#define __itt_unload_lib(handle) dlclose(handle)
#define __itt_system_error() errno
@@ -326,14 +358,13 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
}
#endif /* SDL_STRNCPY_S */
-#define __itt_fstrdup(s) strdup(s)
#define __itt_thread_id() pthread_self()
#define __itt_thread_yield() sched_yield()
#if ITT_ARCH==ITT_ARCH_IA64
#ifdef __INTEL_COMPILER
#define __TBB_machine_fetchadd4(addr, val) __fetchadd4_acq((void *)addr, val)
#else /* __INTEL_COMPILER */
-/* TODO: Add Support for not Intel compilers for IA-64 architecture */
+#define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val)
#endif /* __INTEL_COMPILER */
#elif ITT_ARCH==ITT_ARCH_IA32 || ITT_ARCH==ITT_ARCH_IA32E /* ITT_ARCH!=ITT_ARCH_IA64 */
ITT_INLINE long
@@ -357,6 +388,13 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
{
return __TBB_machine_fetchadd4(ptr, 1) + 1L;
}
+ITT_INLINE long
+__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand) ITT_INLINE_ATTRIBUTE;
+ITT_INLINE long
+__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand)
+{
+ return __sync_val_compare_and_swap(ptr, exchange, comperand);
+}
#endif /* ITT_SIMPLE_INIT */
void* dlopen(const char*, int) __attribute__((weak));
@@ -376,10 +414,20 @@ pthread_t pthread_self(void) __attribute__((weak));
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
-typedef enum {
- __itt_collection_normal = 0,
- __itt_collection_paused = 1
-} __itt_collection_state;
+/* strdup() is not included into C99 which results in a compiler warning about
+ * implicitly declared symbol. To avoid the issue strdup is implemented
+ * manually.
+ */
+#define ITT_STRDUP_MAX_STRING_SIZE 4096
+#define __itt_fstrdup(s, new_s) do { \
+ if (s != NULL) { \
+ size_t s_len = __itt_fstrnlen(s, ITT_STRDUP_MAX_STRING_SIZE); \
+ new_s = (char *)malloc(s_len + 1); \
+ if (new_s != NULL) { \
+ __itt_fstrcpyn(new_s, s_len + 1, s, s_len); \
+ } \
+ } \
+} while(0)
typedef enum {
__itt_thread_normal = 0,
@@ -445,6 +493,9 @@ typedef struct __itt_counter_info
struct ___itt_domain;
struct ___itt_string_handle;
+struct ___itt_histogram;
+
+#include "ittnotify.h"
typedef struct ___itt_global
{
@@ -466,8 +517,9 @@ typedef struct ___itt_global
struct ___itt_domain* domain_list;
struct ___itt_string_handle* string_list;
__itt_collection_state state;
- __itt_counter_info_t* counter_list;
+ __itt_counter_info_t* counter_list;
unsigned int ipt_collect_events;
+ struct ___itt_histogram* histogram_list;
} __itt_global;
#pragma pack(pop)
@@ -493,7 +545,9 @@ typedef struct ___itt_global
h = (__itt_thread_info*)malloc(sizeof(__itt_thread_info)); \
if (h != NULL) { \
h->tid = t; \
- h->nameA = n ? __itt_fstrdup(n) : NULL; \
+ char *n_copy = NULL; \
+ __itt_fstrdup(n, n_copy); \
+ h->nameA = n_copy; \
h->nameW = NULL; \
h->state = s; \
h->extra1 = 0; /* reserved */ \
@@ -526,7 +580,9 @@ typedef struct ___itt_global
h = (__itt_domain*)malloc(sizeof(__itt_domain)); \
if (h != NULL) { \
h->flags = 1; /* domain is enabled by default */ \
- h->nameA = name ? __itt_fstrdup(name) : NULL; \
+ char *name_copy = NULL; \
+ __itt_fstrdup(name, name_copy); \
+ h->nameA = name_copy; \
h->nameW = NULL; \
h->extra1 = 0; /* reserved */ \
h->extra2 = NULL; /* reserved */ \
@@ -556,7 +612,9 @@ typedef struct ___itt_global
#define NEW_STRING_HANDLE_A(gptr,h,h_tail,name) { \
h = (__itt_string_handle*)malloc(sizeof(__itt_string_handle)); \
if (h != NULL) { \
- h->strA = name ? __itt_fstrdup(name) : NULL; \
+ char *name_copy = NULL; \
+ __itt_fstrdup(name, name_copy); \
+ h->strA = name_copy; \
h->strW = NULL; \
h->extra1 = 0; /* reserved */ \
h->extra2 = NULL; /* reserved */ \
@@ -588,9 +646,13 @@ typedef struct ___itt_global
#define NEW_COUNTER_A(gptr,h,h_tail,name,domain,type) { \
h = (__itt_counter_info_t*)malloc(sizeof(__itt_counter_info_t)); \
if (h != NULL) { \
- h->nameA = name ? __itt_fstrdup(name) : NULL; \
+ char *name_copy = NULL; \
+ __itt_fstrdup(name, name_copy); \
+ h->nameA = name_copy; \
h->nameW = NULL; \
- h->domainA = domain ? __itt_fstrdup(domain) : NULL; \
+ char *domain_copy = NULL; \
+ __itt_fstrdup(domain, domain_copy); \
+ h->domainA = domain_copy; \
h->domainW = NULL; \
h->type = type; \
h->index = 0; \
@@ -602,4 +664,40 @@ typedef struct ___itt_global
} \
}
+#define NEW_HISTOGRAM_W(gptr,h,h_tail,domain,name,x_type,y_type) { \
+ h = (__itt_histogram*)malloc(sizeof(__itt_histogram)); \
+ if (h != NULL) { \
+ h->domain = domain; \
+ h->nameA = NULL; \
+ h->nameW = name ? _wcsdup(name) : NULL; \
+ h->x_type = x_type; \
+ h->y_type = y_type; \
+ h->extra1 = 0; \
+ h->extra2 = NULL; \
+ if (h_tail == NULL) \
+ (gptr)->histogram_list = h; \
+ else \
+ h_tail->next = h; \
+ } \
+}
+
+#define NEW_HISTOGRAM_A(gptr,h,h_tail,domain,name,x_type,y_type) { \
+ h = (__itt_histogram*)malloc(sizeof(__itt_histogram)); \
+ if (h != NULL) { \
+ h->domain = domain; \
+ char *name_copy = NULL; \
+ __itt_fstrdup(name, name_copy); \
+ h->nameA = name_copy; \
+ h->nameW = NULL; \
+ h->x_type = x_type; \
+ h->y_type = y_type; \
+ h->extra1 = 0; \
+ h->extra2 = NULL; \
+ if (h_tail == NULL) \
+ (gptr)->histogram_list = h; \
+ else \
+ h_tail->next = h; \
+ } \
+}
+
#endif /* _ITTNOTIFY_CONFIG_H_ */
diff --git a/contrib/libs/tbb/src/tbb/tools_api/ittnotify_static.c b/contrib/libs/tbb/src/tbb/tools_api/ittnotify_static.c
index 44dc8a027d..0b9aa492ac 100644
--- a/contrib/libs/tbb/src/tbb/tools_api/ittnotify_static.c
+++ b/contrib/libs/tbb/src/tbb/tools_api/ittnotify_static.c
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2021 Intel Corporation
+ Copyright (c) 2005-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.
@@ -14,13 +14,14 @@
limitations under the License.
*/
+#define INTEL_NO_MACRO_BODY
+#define INTEL_ITTNOTIFY_API_PRIVATE
#include "ittnotify_config.h"
#if ITT_PLATFORM==ITT_PLATFORM_WIN
-#ifdef PATH_MAX
-#undef PATH_MAX
-#endif
+#if !defined(PATH_MAX)
#define PATH_MAX 512
+#endif
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
#include <limits.h>
#include <dlfcn.h>
@@ -31,8 +32,6 @@
#include <stdarg.h>
#include <string.h>
-#define INTEL_NO_MACRO_BODY
-#define INTEL_ITTNOTIFY_API_PRIVATE
#include "ittnotify.h"
#include "legacy/ittnotify.h"
@@ -138,7 +137,7 @@ static const char* ittnotify_lib_name = "libittnotify.dylib";
{ \
if (!p.mutex_initialized) \
{ \
- if (__itt_interlocked_increment(&p.atomic_counter) == 1) \
+ if (__itt_interlocked_compare_exchange(&p.atomic_counter, 1, 0) == 0) \
{ \
__itt_mutex_init(&p.mutex); \
p.mutex_initialized = 1; \
@@ -151,6 +150,20 @@ static const char* ittnotify_lib_name = "libittnotify.dylib";
} \
}
+#define ITT_MUTEX_DESTROY(p) { \
+ if (PTHREAD_SYMBOLS) \
+ { \
+ if (p.mutex_initialized) \
+ { \
+ if (__itt_interlocked_compare_exchange(&p.atomic_counter, 0, 1) == 1) \
+ { \
+ __itt_mutex_destroy(&p.mutex); \
+ p.mutex_initialized = 0; \
+ } \
+ } \
+ } \
+}
+
#define ITT_MODULE_OBJECT_VERSION 1
typedef int (__itt_init_ittlib_t)(const char*, __itt_group_id);
@@ -242,9 +255,11 @@ static __itt_group_alias group_alias[] = {
#pragma pack(pop)
-#if ITT_PLATFORM==ITT_PLATFORM_WIN && _MSC_VER
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#if _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4054) /* warning C4054: 'type cast' : from function pointer 'XXX' to data pointer 'void *' */
+#endif
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
static __itt_api_info api_list[] = {
@@ -265,8 +280,10 @@ static __itt_api_info api_list[] = {
{NULL, NULL, NULL, NULL, __itt_group_none}
};
-#if ITT_PLATFORM==ITT_PLATFORM_WIN && _MSC_VER
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#if _MSC_VER
#pragma warning(pop)
+#endif
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
/* static part descriptor which handles. all notification api attributes. */
@@ -285,9 +302,10 @@ __itt_global _N_(_ittapi_global) = {
NULL, /* thread_list */
NULL, /* domain_list */
NULL, /* string_list */
- __itt_collection_normal, /* collection state */
+ __itt_collection_uninitialized, /* collection state */
NULL, /* counter_list */
- 0 /* ipt_collect_events */
+ 0, /* ipt_collect_events */
+ NULL /* histogram_list */
};
typedef void (__itt_api_init_t)(__itt_global*, __itt_group_id);
@@ -300,9 +318,11 @@ static __itt_domain dummy_domain;
ITT_EXTERN_C void _N_(error_handler)(__itt_error_code, va_list args);
#endif /* ITT_NOTIFY_EXT_REPORT */
-#if ITT_PLATFORM==ITT_PLATFORM_WIN && _MSC_VER
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#if _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4055) /* warning C4055: 'type cast' : from data pointer 'void *' to function pointer 'XXX' */
+#endif
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
static void __itt_report_error(int code, ...)
@@ -320,8 +340,12 @@ static void __itt_report_error(int code, ...)
va_end(args);
}
-#if ITT_PLATFORM==ITT_PLATFORM_WIN && _MSC_VER
+static int __itt_is_collector_available(void);
+
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#if _MSC_VER
#pragma warning(pop)
+#endif
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
@@ -348,13 +372,16 @@ static __itt_domain* ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(domain_createW),_init))(
return &dummy_domain;
}
}
- for (h_tail = NULL, h = _N_(_ittapi_global).domain_list; h != NULL; h_tail = h, h = h->next)
- {
- if (h->nameW != NULL && !wcscmp(h->nameW, name)) break;
- }
- if (h == NULL)
+ if (__itt_is_collector_available())
{
- NEW_DOMAIN_W(&_N_(_ittapi_global),h,h_tail,name);
+ for (h_tail = NULL, h = _N_(_ittapi_global).domain_list; h != NULL; h_tail = h, h = h->next)
+ {
+ if (h->nameW != NULL && !wcscmp(h->nameW, name)) break;
+ }
+ if (h == NULL)
+ {
+ NEW_DOMAIN_W(&_N_(_ittapi_global), h, h_tail, name);
+ }
}
if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
return h;
@@ -398,13 +425,16 @@ static __itt_domain* ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(domain_create),_init))(c
return &dummy_domain;
}
}
- for (h_tail = NULL, h = _N_(_ittapi_global).domain_list; h != NULL; h_tail = h, h = h->next)
- {
- if (h->nameA != NULL && !__itt_fstrcmp(h->nameA, name)) break;
- }
- if (h == NULL)
+ if (__itt_is_collector_available())
{
- NEW_DOMAIN_A(&_N_(_ittapi_global),h,h_tail,name);
+ for (h_tail = NULL, h = _N_(_ittapi_global).domain_list; h != NULL; h_tail = h, h = h->next)
+ {
+ if (h->nameA != NULL && !__itt_fstrcmp(h->nameA, name)) break;
+ }
+ if (h == NULL)
+ {
+ NEW_DOMAIN_A(&_N_(_ittapi_global), h, h_tail, name);
+ }
}
if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
return h;
@@ -466,13 +496,16 @@ static __itt_string_handle* ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(string_handle_cre
return NULL;
}
}
- for (h_tail = NULL, h = _N_(_ittapi_global).string_list; h != NULL; h_tail = h, h = h->next)
- {
- if (h->strW != NULL && !wcscmp(h->strW, name)) break;
- }
- if (h == NULL)
+ if (__itt_is_collector_available())
{
- NEW_STRING_HANDLE_W(&_N_(_ittapi_global),h,h_tail,name);
+ for (h_tail = NULL, h = _N_(_ittapi_global).string_list; h != NULL; h_tail = h, h = h->next)
+ {
+ if (h->strW != NULL && !wcscmp(h->strW, name)) break;
+ }
+ if (h == NULL)
+ {
+ NEW_STRING_HANDLE_W(&_N_(_ittapi_global), h, h_tail, name);
+ }
}
__itt_mutex_unlock(&_N_(_ittapi_global).mutex);
return h;
@@ -516,13 +549,16 @@ static __itt_string_handle* ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(string_handle_cre
return NULL;
}
}
- for (h_tail = NULL, h = _N_(_ittapi_global).string_list; h != NULL; h_tail = h, h = h->next)
- {
- if (h->strA != NULL && !__itt_fstrcmp(h->strA, name)) break;
- }
- if (h == NULL)
+ if (__itt_is_collector_available())
{
- NEW_STRING_HANDLE_A(&_N_(_ittapi_global),h,h_tail,name);
+ for (h_tail = NULL, h = _N_(_ittapi_global).string_list; h != NULL; h_tail = h, h = h->next)
+ {
+ if (h->strA != NULL && !__itt_fstrcmp(h->strA, name)) break;
+ }
+ if (h == NULL)
+ {
+ NEW_STRING_HANDLE_A(&_N_(_ittapi_global), h, h_tail, name);
+ }
}
if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
return h;
@@ -553,15 +589,18 @@ static __itt_counter ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(counter_createW),_init))
return NULL;
}
}
- for (h_tail = NULL, h = _N_(_ittapi_global).counter_list; h != NULL; h_tail = h, h = h->next)
+ if (__itt_is_collector_available())
{
- if (h->nameW != NULL && h->type == (int)type && !wcscmp(h->nameW, name) && ((h->domainW == NULL && domain == NULL) ||
- (h->domainW != NULL && domain != NULL && !wcscmp(h->domainW, domain)))) break;
+ for (h_tail = NULL, h = _N_(_ittapi_global).counter_list; h != NULL; h_tail = h, h = h->next)
+ {
+ if (h->nameW != NULL && h->type == (int)type && !wcscmp(h->nameW, name) && ((h->domainW == NULL && domain == NULL) ||
+ (h->domainW != NULL && domain != NULL && !wcscmp(h->domainW, domain)))) break;
- }
- if (h == NULL)
- {
- NEW_COUNTER_W(&_N_(_ittapi_global),h,h_tail,name,domain,type);
+ }
+ if (h == NULL)
+ {
+ NEW_COUNTER_W(&_N_(_ittapi_global), h, h_tail, name, domain, type);
+ }
}
__itt_mutex_unlock(&_N_(_ittapi_global).mutex);
return (__itt_counter)h;
@@ -606,14 +645,17 @@ static __itt_counter ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(counter_create),_init))(
return NULL;
}
}
- for (h_tail = NULL, h = _N_(_ittapi_global).counter_list; h != NULL; h_tail = h, h = h->next)
- {
- if (h->nameA != NULL && h->type == (int)type && !__itt_fstrcmp(h->nameA, name) && ((h->domainA == NULL && domain == NULL) ||
- (h->domainA != NULL && domain != NULL && !__itt_fstrcmp(h->domainA, domain)))) break;
- }
- if (h == NULL)
+ if (__itt_is_collector_available())
{
- NEW_COUNTER_A(&_N_(_ittapi_global),h,h_tail,name,domain,type);
+ for (h_tail = NULL, h = _N_(_ittapi_global).counter_list; h != NULL; h_tail = h, h = h->next)
+ {
+ if (h->nameA != NULL && h->type == (int)type && !__itt_fstrcmp(h->nameA, name) && ((h->domainA == NULL && domain == NULL) ||
+ (h->domainA != NULL && domain != NULL && !__itt_fstrcmp(h->domainA, domain)))) break;
+ }
+ if (h == NULL)
+ {
+ NEW_COUNTER_A(&_N_(_ittapi_global), h, h_tail, name, domain, type);
+ }
}
if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
return (__itt_counter)h;
@@ -643,15 +685,18 @@ static __itt_counter ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(counter_create_typedW),_
return NULL;
}
}
- for (h_tail = NULL, h = _N_(_ittapi_global).counter_list; h != NULL; h_tail = h, h = h->next)
+ if (__itt_is_collector_available())
{
- if (h->nameW != NULL && h->type == (int)type && !wcscmp(h->nameW, name) && ((h->domainW == NULL && domain == NULL) ||
- (h->domainW != NULL && domain != NULL && !wcscmp(h->domainW, domain)))) break;
+ for (h_tail = NULL, h = _N_(_ittapi_global).counter_list; h != NULL; h_tail = h, h = h->next)
+ {
+ if (h->nameW != NULL && h->type == (int)type && !wcscmp(h->nameW, name) && ((h->domainW == NULL && domain == NULL) ||
+ (h->domainW != NULL && domain != NULL && !wcscmp(h->domainW, domain)))) break;
- }
- if (h == NULL)
- {
- NEW_COUNTER_W(&_N_(_ittapi_global),h,h_tail,name,domain,type);
+ }
+ if (h == NULL)
+ {
+ NEW_COUNTER_W(&_N_(_ittapi_global), h, h_tail, name, domain, type);
+ }
}
__itt_mutex_unlock(&_N_(_ittapi_global).mutex);
return (__itt_counter)h;
@@ -695,17 +740,114 @@ static __itt_counter ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(counter_create_typed),_i
return NULL;
}
}
- for (h_tail = NULL, h = _N_(_ittapi_global).counter_list; h != NULL; h_tail = h, h = h->next)
+ if (__itt_is_collector_available())
+ {
+ for (h_tail = NULL, h = _N_(_ittapi_global).counter_list; h != NULL; h_tail = h, h = h->next)
+ {
+ if (h->nameA != NULL && h->type == (int)type && !__itt_fstrcmp(h->nameA, name) && ((h->domainA == NULL && domain == NULL) ||
+ (h->domainA != NULL && domain != NULL && !__itt_fstrcmp(h->domainA, domain)))) break;
+ }
+ if (h == NULL)
+ {
+ NEW_COUNTER_A(&_N_(_ittapi_global), h, h_tail, name, domain, type);
+ }
+ }
+ if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
+ return (__itt_counter)h;
+}
+
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+static __itt_histogram* ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(histogram_createW),_init))(const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type)
+{
+ __itt_histogram *h_tail = NULL, *h = NULL;
+
+ if (domain == NULL || name == NULL)
+ {
+ return NULL;
+ }
+
+ ITT_MUTEX_INIT_AND_LOCK(_N_(_ittapi_global));
+ if (_N_(_ittapi_global).api_initialized)
+ {
+ if (ITTNOTIFY_NAME(histogram_createW) && ITTNOTIFY_NAME(histogram_createW) != ITT_VERSIONIZE(ITT_JOIN(_N_(histogram_createW),_init)))
+ {
+ __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
+ return ITTNOTIFY_NAME(histogram_createW)(domain, name, x_type, y_type);
+ }
+ else
+ {
+ __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
+ return NULL;
+ }
+ }
+ if (__itt_is_collector_available())
+ {
+ for (h_tail = NULL, h = _N_(_ittapi_global).histogram_list; h != NULL; h_tail = h, h = h->next)
+ {
+ if (h->domain == NULL) continue;
+ else if (h->domain == domain && h->nameW != NULL && !wcscmp(h->nameW, name)) break;
+ }
+ if (h == NULL)
+ {
+ NEW_HISTOGRAM_W(&_N_(_ittapi_global), h, h_tail, domain, name, x_type, y_type);
+ }
+ }
+ __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
+ return (__itt_histogram*)h;
+}
+
+static __itt_histogram* ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(histogram_createA),_init))(const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type)
+#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
+static __itt_histogram* ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(histogram_create),_init))(const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type)
+#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
+{
+ __itt_histogram *h_tail = NULL, *h = NULL;
+
+ if (domain == NULL || name == NULL)
{
- if (h->nameA != NULL && h->type == (int)type && !__itt_fstrcmp(h->nameA, name) && ((h->domainA == NULL && domain == NULL) ||
- (h->domainA != NULL && domain != NULL && !__itt_fstrcmp(h->domainA, domain)))) break;
+ return NULL;
}
- if (h == NULL)
+
+ ITT_MUTEX_INIT_AND_LOCK(_N_(_ittapi_global));
+ if (_N_(_ittapi_global).api_initialized)
{
- NEW_COUNTER_A(&_N_(_ittapi_global),h,h_tail,name,domain,type);
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+ if (ITTNOTIFY_NAME(histogram_createA) && ITTNOTIFY_NAME(histogram_createA) != ITT_VERSIONIZE(ITT_JOIN(_N_(histogram_createA),_init)))
+ {
+ __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
+ return ITTNOTIFY_NAME(histogram_createA)(domain, name, x_type, y_type);
+ }
+#else
+ if (ITTNOTIFY_NAME(histogram_create) && ITTNOTIFY_NAME(histogram_create) != ITT_VERSIONIZE(ITT_JOIN(_N_(histogram_create),_init)))
+ {
+ if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
+ return ITTNOTIFY_NAME(histogram_create)(domain, name, x_type, y_type);
+ }
+#endif
+ else
+ {
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+ __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
+#else
+ if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
+#endif
+ return NULL;
+ }
+ }
+ if (__itt_is_collector_available())
+ {
+ for (h_tail = NULL, h = _N_(_ittapi_global).histogram_list; h != NULL; h_tail = h, h = h->next)
+ {
+ if (h->domain == NULL) continue;
+ else if (h->domain == domain && h->nameA != NULL && !__itt_fstrcmp(h->nameA, name)) break;
+ }
+ if (h == NULL)
+ {
+ NEW_HISTOGRAM_A(&_N_(_ittapi_global), h, h_tail, domain, name, x_type, y_type);
+ }
}
if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
- return (__itt_counter)h;
+ return (__itt_histogram*)h;
}
/* -------------------------------------------------------------------------- */
@@ -720,10 +862,6 @@ static void ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(pause),_init))(void)
{
ITTNOTIFY_NAME(pause)();
}
- else
- {
- _N_(_ittapi_global).state = __itt_collection_paused;
- }
}
static void ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(resume),_init))(void)
@@ -736,10 +874,6 @@ static void ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(resume),_init))(void)
{
ITTNOTIFY_NAME(resume)();
}
- else
- {
- _N_(_ittapi_global).state = __itt_collection_normal;
- }
}
#if ITT_PLATFORM==ITT_PLATFORM_WIN
@@ -1143,10 +1277,27 @@ static void __itt_nullify_all_pointers(void)
*_N_(_ittapi_global).api_list_ptr[i].func_ptr = _N_(_ittapi_global).api_list_ptr[i].null_func;
}
-#if ITT_PLATFORM==ITT_PLATFORM_WIN && _MSC_VER
+static int __itt_is_collector_available(void)
+{
+ int is_available;
+
+ ITT_MUTEX_INIT_AND_LOCK(_N_(_ittapi_global));
+ if (_N_(_ittapi_global).state == __itt_collection_uninitialized)
+ {
+ _N_(_ittapi_global).state = (NULL == __itt_get_lib_name()) ? __itt_collection_collector_absent : __itt_collection_collector_exists;
+ }
+ is_available = (_N_(_ittapi_global).state == __itt_collection_collector_exists ||
+ _N_(_ittapi_global).state == __itt_collection_init_successful);
+ __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
+ return is_available;
+}
+
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#if _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4054) /* warning C4054: 'type cast' : from function pointer 'XXX' to data pointer 'void *' */
#pragma warning(disable: 4055) /* warning C4055: 'type cast' : from data pointer 'void *' to function pointer 'XXX' */
+#endif
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
ITT_EXTERN_C void _N_(fini_ittlib)(void)
@@ -1186,6 +1337,64 @@ ITT_EXTERN_C void _N_(fini_ittlib)(void)
}
}
+/* !!! this function should be called under mutex lock !!! */
+static void __itt_free_allocated_resources(void)
+{
+ __itt_string_handle* current_string = _N_(_ittapi_global).string_list;
+ while (current_string != NULL)
+ {
+ __itt_string_handle* tmp = current_string->next;
+ free((char*)current_string->strA);
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+ free((wchar_t*)current_string->strW);
+#endif
+ free(current_string);
+ current_string = tmp;
+ }
+ _N_(_ittapi_global).string_list = NULL;
+
+ __itt_domain* current_domain = _N_(_ittapi_global).domain_list;
+ while (current_domain != NULL)
+ {
+ __itt_domain* tmp = current_domain->next;
+ free((char*)current_domain->nameA);
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+ free((wchar_t*)current_domain->nameW);
+#endif
+ free(current_domain);
+ current_domain = tmp;
+ }
+ _N_(_ittapi_global).domain_list = NULL;
+
+ __itt_counter_info_t* current_couter = _N_(_ittapi_global).counter_list;
+ while (current_couter != NULL)
+ {
+ __itt_counter_info_t* tmp = current_couter->next;
+ free((char*)current_couter->nameA);
+ free((char*)current_couter->domainA);
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+ free((wchar_t*)current_couter->nameW);
+ free((wchar_t*)current_couter->domainW);
+#endif
+ free(current_couter);
+ current_couter = tmp;
+ }
+ _N_(_ittapi_global).counter_list = NULL;
+
+ __itt_histogram* current_histogram = _N_(_ittapi_global).histogram_list;
+ while (current_histogram != NULL)
+ {
+ __itt_histogram* tmp = current_histogram->next;
+ free((char*)current_histogram->nameA);
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+ free((wchar_t*)current_histogram->nameW);
+#endif
+ free(current_histogram);
+ current_histogram = tmp;
+ }
+ _N_(_ittapi_global).histogram_list = NULL;
+}
+
ITT_EXTERN_C int _N_(init_ittlib)(const char* lib_name, __itt_group_id init_groups)
{
int i;
@@ -1217,6 +1426,7 @@ ITT_EXTERN_C int _N_(init_ittlib)(const char* lib_name, __itt_group_id init_grou
if (_N_(_ittapi_global).lib != NULL)
{
+ _N_(_ittapi_global).state = __itt_collection_init_successful;
__itt_api_init_t* __itt_api_init_ptr;
int lib_version = __itt_lib_version(_N_(_ittapi_global).lib);
@@ -1277,6 +1487,8 @@ ITT_EXTERN_C int _N_(init_ittlib)(const char* lib_name, __itt_group_id init_grou
}
else
{
+ _N_(_ittapi_global).state = __itt_collection_init_fail;
+ __itt_free_allocated_resources();
__itt_nullify_all_pointers();
__itt_report_error(__itt_error_no_module, lib_name,
@@ -1290,6 +1502,7 @@ ITT_EXTERN_C int _N_(init_ittlib)(const char* lib_name, __itt_group_id init_grou
}
else
{
+ _N_(_ittapi_global).state = __itt_collection_collector_absent;
__itt_nullify_all_pointers();
}
_N_(_ittapi_global).api_initialized = 1;
@@ -1323,8 +1536,10 @@ ITT_EXTERN_C __itt_error_handler_t* _N_(set_error_handler)(__itt_error_handler_t
return prev;
}
-#if ITT_PLATFORM==ITT_PLATFORM_WIN && _MSC_VER
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#if _MSC_VER
#pragma warning(pop)
+#endif
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
/** __itt_mark_pt_region functions marks region of interest
@@ -1367,3 +1582,24 @@ ITT_EXTERN_C void _N_(mark_pt_region_end)(__itt_pt_region region)
(void)region;
#endif
}
+
+ITT_EXTERN_C __itt_collection_state (_N_(get_collection_state))(void)
+{
+ if (!_N_(_ittapi_global).api_initialized && _N_(_ittapi_global).thread_list == NULL)
+ {
+ __itt_init_ittlib_name(NULL, __itt_group_all);
+ }
+ return _N_(_ittapi_global).state;
+}
+
+/* !!! should be called from the library destructor !!!
+ * this function destroys the mutex and frees resources
+ * allocated by ITT API static part
+ */
+ITT_EXTERN_C void (_N_(release_resources))(void)
+{
+ ITT_MUTEX_INIT_AND_LOCK(_N_(_ittapi_global));
+ __itt_free_allocated_resources();
+ if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
+ ITT_MUTEX_DESTROY(_N_(_ittapi_global));
+}
diff --git a/contrib/libs/tbb/src/tbb/tools_api/ittnotify_static.h b/contrib/libs/tbb/src/tbb/tools_api/ittnotify_static.h
index 0aab7c87f1..d59bfac1a2 100644
--- a/contrib/libs/tbb/src/tbb/tools_api/ittnotify_static.h
+++ b/contrib/libs/tbb/src/tbb/tools_api/ittnotify_static.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2021 Intel Corporation
+ Copyright (c) 2005-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.
@@ -82,6 +82,14 @@ ITT_STUB(LIBITTAPI, int, thr_name_setW, (const wchar_t *name, int namelen), (IT
ITT_STUB(LIBITTAPI, int, thr_name_set, (const char *name, int namelen), (ITT_FORMAT name, namelen), thr_name_set, __itt_group_thread | __itt_group_legacy, "\"%s\", %d")
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
ITT_STUBV(LIBITTAPI, void, thr_ignore, (void), (ITT_NO_PARAMS), thr_ignore, __itt_group_thread | __itt_group_legacy, "no args")
+
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+ITT_STUB(ITTAPI, __itt_histogram*, histogram_createA, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type), (ITT_FORMAT domain, name, x_type, y_type), histogram_createA, __itt_group_structure, "%p, \"%s\", %d, %d")
+ITT_STUB(ITTAPI, __itt_histogram*, histogram_createW, (const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type), (ITT_FORMAT domain, name, x_type, y_type), histogram_createW, __itt_group_structure, "%p, \"%s\", %d, %d")
+#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
+ITT_STUB(ITTAPI, __itt_histogram*, histogram_create, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type), (ITT_FORMAT domain, name, x_type, y_type), histogram_create, __itt_group_structure, "%p, \"%s\", %d, %d")
+#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
+
#endif /* __ITT_INTERNAL_BODY */
ITT_STUBV(ITTAPI, void, enable_attach, (void), (ITT_NO_PARAMS), enable_attach, __itt_group_all, "no args")
@@ -352,5 +360,6 @@ ITT_STUBV(ITTAPI, void, module_load, (void *start_addr, void *end_addr, const ch
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
ITT_STUBV(ITTAPI, void, module_unload, (void *start_addr), (ITT_FORMAT start_addr), module_unload, __itt_group_module, "%p")
+ITT_STUBV(ITTAPI, void, histogram_submit, (__itt_histogram* histogram, size_t length, void* x_data, void* y_data), (ITT_FORMAT histogram, length, x_data, y_data), histogram_submit, __itt_group_structure, "%p, %lu, %p, %p")
#endif /* __ITT_INTERNAL_INIT */
diff --git a/contrib/libs/tbb/src/tbb/tools_api/ittnotify_types.h b/contrib/libs/tbb/src/tbb/tools_api/ittnotify_types.h
index 7693c46f3d..1c0fded40b 100644
--- a/contrib/libs/tbb/src/tbb/tools_api/ittnotify_types.h
+++ b/contrib/libs/tbb/src/tbb/tools_api/ittnotify_types.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2021 Intel Corporation
+ Copyright (c) 2005-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.
diff --git a/contrib/libs/tbb/src/tbb/tools_api/legacy/ittnotify.h b/contrib/libs/tbb/src/tbb/tools_api/legacy/ittnotify.h
index 3d3561ecc4..1c40c28884 100644
--- a/contrib/libs/tbb/src/tbb/tools_api/legacy/ittnotify.h
+++ b/contrib/libs/tbb/src/tbb/tools_api/legacy/ittnotify.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2021 Intel Corporation
+ Copyright (c) 2005-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.
@@ -126,7 +126,12 @@
#if ITT_PLATFORM==ITT_PLATFORM_WIN
/* use __forceinline (VC++ specific) */
+#if defined(__MINGW32__) && !defined(__cplusplus)
+#define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__))
+#else
#define ITT_INLINE static __forceinline
+#endif /* __MINGW32__ */
+
#define ITT_INLINE_ATTRIBUTE /* nothing */
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
/*
@@ -178,20 +183,20 @@
#define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)
#define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)
-#define ITTNOTIFY_VOID_D0(n,d) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
-#define ITTNOTIFY_VOID_D1(n,d,x) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
-#define ITTNOTIFY_VOID_D2(n,d,x,y) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
-#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
-#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
-#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
-#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
-#define ITTNOTIFY_DATA_D0(n,d) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
-#define ITTNOTIFY_DATA_D1(n,d,x) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
-#define ITTNOTIFY_DATA_D2(n,d,x,y) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
-#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
-#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
-#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
-#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
+#define ITTNOTIFY_VOID_D0(n,d) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
+#define ITTNOTIFY_VOID_D1(n,d,x) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
+#define ITTNOTIFY_VOID_D2(n,d,x,y) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
+#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
+#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
+#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
+#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
+#define ITTNOTIFY_DATA_D0(n,d) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
+#define ITTNOTIFY_DATA_D1(n,d,x) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
+#define ITTNOTIFY_DATA_D2(n,d,x,y) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
+#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
+#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
+#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
+#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
#ifdef ITT_STUB
#undef ITT_STUB
diff --git a/contrib/libs/tbb/ya.make b/contrib/libs/tbb/ya.make
index a810e17bc4..f5093b99b7 100644
--- a/contrib/libs/tbb/ya.make
+++ b/contrib/libs/tbb/ya.make
@@ -1,10 +1,10 @@
-# Generated by devtools/yamaker from nixpkgs 22.11.
+# Generated by devtools/yamaker from nixpkgs 24.05.
LIBRARY()
-VERSION(2021.8.0)
+VERSION(2021.10.0)
-ORIGINAL_SOURCE(https://github.com/uxlfoundation/oneTBB/archive/v2021.8.0.tar.gz)
+ORIGINAL_SOURCE(https://github.com/uxlfoundation/oneTBB/archive/v2021.10.0.tar.gz)
LICENSE(Apache-2.0)
diff --git a/contrib/python/pip/.dist-info/METADATA b/contrib/python/pip/.dist-info/METADATA
index 85bca729e2..3315c06357 100644
--- a/contrib/python/pip/.dist-info/METADATA
+++ b/contrib/python/pip/.dist-info/METADATA
@@ -1,6 +1,6 @@
Metadata-Version: 2.2
Name: pip
-Version: 25.0
+Version: 25.0.1
Summary: The PyPA recommended tool for installing Python packages.
Author-email: The pip developers <distutils-sig@python.org>
License: MIT
diff --git a/contrib/python/pip/pip/__init__.py b/contrib/python/pip/pip/__init__.py
index d047e4789e..d628f93ee2 100644
--- a/contrib/python/pip/pip/__init__.py
+++ b/contrib/python/pip/pip/__init__.py
@@ -1,6 +1,6 @@
from typing import List, Optional
-__version__ = "25.0"
+__version__ = "25.0.1"
def main(args: Optional[List[str]] = None) -> int:
diff --git a/contrib/python/pip/pip/_internal/build_env.py b/contrib/python/pip/pip/_internal/build_env.py
index e820dc3d5f..e8d1aca0d6 100644
--- a/contrib/python/pip/pip/_internal/build_env.py
+++ b/contrib/python/pip/pip/_internal/build_env.py
@@ -11,7 +11,6 @@ from collections import OrderedDict
from types import TracebackType
from typing import TYPE_CHECKING, Iterable, List, Optional, Set, Tuple, Type, Union
-from pip._vendor.certifi import where
from pip._vendor.packaging.version import Version
from pip import __file__ as pip_location
@@ -246,8 +245,6 @@ class BuildEnvironment:
# target from config file or env var should be ignored
"--target",
"",
- "--cert",
- finder.custom_cert or where(),
]
if logger.getEffectiveLevel() <= logging.DEBUG:
args.append("-vv")
@@ -276,6 +273,8 @@ class BuildEnvironment:
args.extend(["--proxy", finder.proxy])
for host in finder.trusted_hosts:
args.extend(["--trusted-host", host])
+ if finder.custom_cert:
+ args.extend(["--cert", finder.custom_cert])
if finder.client_cert:
args.extend(["--client-cert", finder.client_cert])
if finder.allow_all_prereleases:
diff --git a/contrib/python/pip/pip/_internal/metadata/importlib/_dists.py b/contrib/python/pip/pip/_internal/metadata/importlib/_dists.py
index cf8685439a..d220b616e2 100644
--- a/contrib/python/pip/pip/_internal/metadata/importlib/_dists.py
+++ b/contrib/python/pip/pip/_internal/metadata/importlib/_dists.py
@@ -11,6 +11,7 @@ from typing import (
Mapping,
Optional,
Sequence,
+ Union,
cast,
)
@@ -96,7 +97,7 @@ class WheelDistribution(importlib.metadata.Distribution):
raise UnsupportedWheel(error)
return text
- def locate_file(self, path: str | PathLike[str]) -> pathlib.Path:
+ def locate_file(self, path: Union[str, "PathLike[str]"]) -> pathlib.Path:
# This method doesn't make sense for our in-memory wheel, but the API
# requires us to define it.
raise NotImplementedError
diff --git a/contrib/python/pip/ya.make b/contrib/python/pip/ya.make
index e6c62b6ae0..76afcad6d3 100644
--- a/contrib/python/pip/ya.make
+++ b/contrib/python/pip/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(25.0)
+VERSION(25.0.1)
LICENSE(MIT)