From a803f276186fa2c286a357207832112265b448e4 Mon Sep 17 00:00:00 2001
From: tbbdev
Date: Wed, 9 Oct 2019 16:55:53 +0300
Subject: [PATCH] Committing TBB 2019 Update 9 source code
---
.gitignore | 1 +
CHANGES | 34 +
README.md | 8 +-
build/BSD.inc | 2 +-
build/FreeBSD.gcc.inc | 2 +-
build/Makefile.rml | 7 +
build/Makefile.test | 6 +
build/common_rules.inc | 4 +
build/detect.js | 18 +-
build/linux.clang.inc | 10 +-
build/linux.gcc.inc | 20 +-
build/linux.icc.inc | 10 +-
build/macos.clang.inc | 5 +
build/macos.gcc.inc | 6 +-
build/macos.icc.inc | 7 +-
build/macos.inc | 2 +-
build/version_info_macos.sh | 2 +-
build/vs2013/tbb.vcxproj | 16 +-
build/vs2013/tbbmalloc.vcxproj | 16 +-
build/vs2013/tbbmalloc_proxy.vcxproj | 16 +-
build/windows.icl.inc | 14 +-
build/windows.inc | 6 +-
cmake/README.rst | 10 +-
cmake/TBBInstallConfig.cmake | 4 +-
cmake/TBBMakeConfig.cmake | 50 +-
cmake/templates/TBBConfig.cmake.in | 21 +-
cmake/templates/TBBConfigInternal.cmake.in | 54 +-
.../GettingStarted/sub_string_finder/Makefile | 15 +-
.../msvs/sub_string_finder.vcxproj | 8 +-
.../msvs/sub_string_finder_extended.vcxproj | 8 +-
.../msvs/sub_string_finder_pretty.vcxproj | 8 +-
examples/Makefile | 2 +
examples/common/copy_libraries.bat | 2 -
examples/common/examples-common.inc | 12 +-
examples/common/index.html | 30 +-
.../common/utility/get_default_num_threads.h | 32 +
examples/common/utility/utility.h | 9 +-
.../count_strings/Makefile | 7 +-
.../count_strings/count_strings.cpp | 13 +-
.../count_strings/msvs/count_strings.vcxproj | 8 +-
.../count_strings.xcodeproj/project.pbxproj | 4 +-
.../shortpath/Makefile | 5 +-
.../shortpath/msvs/shortpath.vcxproj | 8 +-
.../shortpath/shortpath.cpp | 56 +-
.../xcode/shortpath.xcodeproj/project.pbxproj | 2 +
examples/graph/binpack/Makefile | 7 +-
examples/graph/binpack/binpack.cpp | 23 +-
examples/graph/binpack/msvs/binpack.vcxproj | 8 +-
.../xcode/binpack.xcodeproj/project.pbxproj | 4 +
examples/graph/cholesky/Makefile | 8 +-
examples/graph/cholesky/cholesky.cpp | 16 +-
examples/graph/cholesky/msvs/cholesky.vcxproj | 8 +-
.../xcode/cholesky.xcodeproj/project.pbxproj | 2 +
examples/graph/dining_philosophers/Makefile | 7 +-
.../dining_philosophers.cpp | 21 +-
.../msvs/dining_philosophers.vcxproj | 8 +-
.../project.pbxproj | 2 +
examples/graph/fgbzip2/Makefile | 8 +-
examples/graph/fgbzip2/fgbzip2.cpp | 2 +-
examples/graph/fgbzip2/msvs/fgbzip2.vcxproj | 8 +-
.../xcode/fgbzip2.xcodeproj/project.pbxproj | 4 +-
examples/graph/logic_sim/Makefile | 7 +-
examples/graph/logic_sim/basics.h | 12 +-
.../graph/logic_sim/msvs/logic_sim.vcxproj | 8 +-
examples/graph/logic_sim/test_all.cpp | 93 +-
examples/graph/som/Makefile | 9 +-
examples/graph/som/msvs/som.vcxproj | 8 +-
examples/graph/som/som_graph.cpp | 34 +-
.../som/xcode/som.xcodeproj/project.pbxproj | 2 +
examples/graph/stereo/msvs/stereo.vcxproj | 8 +-
.../parallel_do/parallel_preorder/Graph.cpp | 15 +-
.../parallel_do/parallel_preorder/Graph.h | 9 +-
.../parallel_do/parallel_preorder/Makefile | 7 +-
.../parallel_do/parallel_preorder/main.cpp | 11 +-
.../msvs/parallel_preorder.vcxproj | 8 +-
.../project.pbxproj | 4 +
examples/parallel_for/game_of_life/Makefile | 7 +-
.../game_of_life/msvs/Game_of_life.vcxproj | 16 +-
.../game_of_life/src/Evolution.cpp | 39 +-
.../parallel_for/game_of_life/src/Evolution.h | 40 +-
.../game_of_life/src/Game_of_life.cpp | 3 +-
.../parallel_for/polygon_overlay/Makefile | 13 +-
.../polygon_overlay/msvs/pover.vcxproj | 16 +-
.../parallel_for/polygon_overlay/polymain.cpp | 7 +-
.../parallel_for/polygon_overlay/polyover.cpp | 34 +-
.../parallel_for/polygon_overlay/polyover.h | 1 -
.../polygon_overlay/pover_video.cpp | 10 +-
.../polygon_overlay.xcodeproj/project.pbxproj | 4 +-
examples/parallel_for/seismic/Makefile | 13 +-
examples/parallel_for/seismic/main.cpp | 23 +-
.../seismic/msvs/SeismicSimulation.vcxproj | 16 +-
.../parallel_for/seismic/seismic_video.cpp | 4 +-
.../xcode/seismic.xcodeproj/project.pbxproj | 4 +-
examples/parallel_for/tachyon/Makefile | 7 +-
.../tachyon/msvs/tachyon.tbb.vcxproj | 16 +-
.../tachyon/msvs/tachyon.tbb1d.vcxproj | 16 +-
.../tachyon/msvs/{win8ui => uwp}/App.xaml | 0
.../tachyon/msvs/{win8ui => uwp}/App.xaml.cpp | 0
.../tachyon/msvs/{win8ui => uwp}/App.xaml.h | 0
.../msvs/{win8ui => uwp}/Assets/Logo.png | Bin
.../msvs/{win8ui => uwp}/Assets/SmallLogo.png | Bin
.../{win8ui => uwp}/Assets/SplashScreen.png | Bin
.../msvs/{win8ui => uwp}/Assets/StoreLogo.png | Bin
.../Common/StandardStyles.xaml | 0
.../msvs/{win8ui => uwp}/DirectXBase.cpp | 2 +-
.../msvs/{win8ui => uwp}/DirectXBase.h | 0
.../msvs/{win8ui => uwp}/DirectXPage.xaml | 0
.../msvs/{win8ui => uwp}/DirectXPage.xaml.cpp | 13 +-
.../msvs/{win8ui => uwp}/DirectXPage.xaml.h | 0
.../tachyon/msvs/uwp/Package.appxmanifest | 49 +
.../copy_libraries_and_assets.bat | 11 +-
.../tachyon/msvs/{win8ui => uwp}/pch.h | 0
.../tachyon/msvs/uwp/tbbTachyon.sln | 32 +
.../msvs/{win8ui => uwp}/tbbTachyon.vcxproj | 38 +-
.../tbbTachyon.vcxproj.filters | 112 +--
.../{win8ui => uwp}/tbbTachyonRenderer.cpp | 5 +-
.../msvs/{win8ui => uwp}/tbbTachyonRenderer.h | 0
.../tachyon/msvs/win8ui/Package.appxmanifest | 30 -
.../tachyon/msvs/win8ui/tbbTachyon.sln | 34 -
examples/parallel_for/tachyon/src/main.cpp | 16 +-
.../parallel_for/tachyon/src/trace.tbb.cpp | 25 +-
.../parallel_for/tachyon/src/trace.tbb1d.cpp | 19 +-
.../xcode/tachyon.xcodeproj/project.pbxproj | 8 +-
examples/parallel_reduce/convex_hull/Makefile | 11 +-
.../parallel_reduce/convex_hull/convex_hull.h | 8 +-
.../convex_hull/convex_hull_bench.cpp | 12 +-
.../convex_hull/convex_hull_sample.cpp | 8 +-
.../msvs/convex_hull_benchmark.vcxproj | 8 +-
.../msvs/convex_hull_sample.vcxproj | 8 +-
examples/parallel_reduce/primes/Makefile | 7 +-
examples/parallel_reduce/primes/main.cpp | 16 +-
.../primes/msvs/primes.vcxproj | 8 +-
examples/parallel_reduce/primes/primes.cpp | 3 +-
examples/parallel_reduce/primes/primes.h | 4 +-
examples/pipeline/index.html | 24 +-
examples/pipeline/square/Makefile | 7 +-
examples/pipeline/square/msvs/square.vcxproj | 8 +-
examples/pipeline/square/readme.html | 30 +-
examples/pipeline/square/square.cpp | 183 ++--
examples/task/tree_sum/Makefile | 7 +-
examples/task/tree_sum/main.cpp | 11 +-
examples/task/tree_sum/msvs/tree_sum.vcxproj | 8 +-
examples/task_arena/fractal/Makefile | 11 +-
examples/task_arena/fractal/fractal.cpp | 81 +-
examples/task_arena/fractal/fractal.h | 21 +-
examples/task_arena/fractal/fractal_video.h | 2 -
examples/task_arena/fractal/main.cpp | 3 +-
.../task_arena/fractal/msvs/fractal.vcxproj | 16 +-
examples/task_arena/fractal/readme.html | 10 +-
.../xcode/fractal.xcodeproj/project.pbxproj | 6 +-
examples/task_arena/index.html | 2 +-
examples/task_group/sudoku/Makefile | 6 +-
.../task_group/sudoku/msvs/sudoku.vcxproj | 8 +-
examples/task_group/sudoku/sudoku.cpp | 31 +-
.../xcode/sudoku.xcodeproj/project.pbxproj | 4 +
examples/test_all/fibonacci/CMakeLists.txt | 6 +
examples/test_all/fibonacci/Fibonacci.cpp | 109 ++-
examples/test_all/fibonacci/Makefile | 7 +-
.../test_all/fibonacci/msvs/fibonacci.vcxproj | 8 +-
.../xcode/fibonacci.xcodeproj/project.pbxproj | 4 +
include/serial/tbb/parallel_for.h | 41 +-
include/tbb/aggregator.h | 6 +
include/tbb/aligned_space.h | 19 +-
include/tbb/atomic.h | 46 +-
include/tbb/combinable.h | 7 +
include/tbb/compat/condition_variable | 101 +-
include/tbb/compat/ppl.h | 17 +
include/tbb/compat/thread | 19 +-
include/tbb/compat/tuple | 33 +-
include/tbb/concurrent_hash_map.h | 21 +-
include/tbb/concurrent_lru_cache.h | 7 +
include/tbb/concurrent_map.h | 6 +
include/tbb/concurrent_priority_queue.h | 6 +
include/tbb/concurrent_queue.h | 6 +
include/tbb/concurrent_set.h | 7 +
include/tbb/concurrent_unordered_map.h | 6 +
include/tbb/concurrent_unordered_set.h | 6 +
include/tbb/concurrent_vector.h | 15 +
include/tbb/critical_section.h | 20 +-
include/tbb/enumerable_thread_specific.h | 58 +-
include/tbb/flow_graph.h | 868 +++++++++++++-----
include/tbb/flow_graph_abstractions.h | 6 +-
include/tbb/flow_graph_opencl_node.h | 44 +-
include/tbb/internal/_concurrent_queue_impl.h | 22 +-
.../tbb/internal/_concurrent_skip_list_impl.h | 70 +-
.../tbb/internal/_concurrent_unordered_impl.h | 29 +-
.../_deprecated_header_message_guard.h | 69 ++
include/tbb/internal/_flow_graph_body_impl.h | 8 +-
include/tbb/internal/_flow_graph_cache_impl.h | 20 +-
include/tbb/internal/_flow_graph_impl.h | 96 +-
.../tbb/internal/_flow_graph_indexer_impl.h | 2 +-
include/tbb/internal/_flow_graph_join_impl.h | 14 +-
include/tbb/internal/_flow_graph_node_impl.h | 97 +-
.../tbb/internal/_flow_graph_node_set_impl.h | 269 ++++++
.../internal/_flow_graph_nodes_deduction.h | 260 ++++++
.../tbb/internal/_flow_graph_streaming_node.h | 3 +-
include/tbb/internal/_flow_graph_trace_impl.h | 109 ++-
include/tbb/internal/_tbb_hash_compare_impl.h | 10 +-
include/tbb/internal/_tbb_strings.h | 3 +
include/tbb/internal/_template_helpers.h | 25 +-
.../_warning_suppress_disable_notice.h | 27 +
.../_warning_suppress_enable_notice.h | 32 +
include/tbb/iterators.h | 2 +-
include/tbb/mutex.h | 19 +-
include/tbb/parallel_do.h | 6 +
include/tbb/parallel_for.h | 10 +-
include/tbb/parallel_invoke.h | 6 +
include/tbb/parallel_reduce.h | 6 +
include/tbb/parallel_scan.h | 6 +
include/tbb/parallel_sort.h | 6 +
include/tbb/parallel_while.h | 6 +
include/tbb/partitioner.h | 7 +
include/tbb/pipeline.h | 117 ++-
include/tbb/queuing_mutex.h | 6 +
include/tbb/queuing_rw_mutex.h | 6 +
include/tbb/reader_writer_lock.h | 20 +-
include/tbb/recursive_mutex.h | 20 +-
include/tbb/runtime_loader.h | 19 +-
include/tbb/spin_mutex.h | 6 +
include/tbb/task.h | 91 +-
include/tbb/task_arena.h | 29 +-
include/tbb/task_group.h | 129 ++-
include/tbb/task_scheduler_init.h | 19 +-
include/tbb/task_scheduler_observer.h | 6 +
include/tbb/tbb.h | 10 +
include/tbb/tbb_config.h | 52 +-
include/tbb/tbb_exception.h | 14 +-
include/tbb/tbb_profiling.h | 15 +
include/tbb/tbb_stddef.h | 25 +-
include/tbb/tbb_thread.h | 25 +-
python/setup.py | 2 +-
src/old/concurrent_queue_v2.h | 30 +-
src/perf/harness_perf.h | 39 +
src/perf/time_resumable_tasks.cpp | 323 +++++++
src/rml/server/rml_server.cpp | 40 +-
src/tbb/arena.cpp | 139 ++-
src/tbb/arena.h | 184 ++--
src/tbb/co_context.h | 217 +++++
src/tbb/custom_scheduler.h | 576 +++++++-----
src/tbb/governor.cpp | 2 +
src/tbb/governor.h | 7 +
src/tbb/lin32-tbb-export.lst | 7 +
src/tbb/lin64-tbb-export.lst | 7 +
src/tbb/lin64ipf-tbb-export.lst | 7 +
src/tbb/mac32-tbb-export.lst | 7 +
src/tbb/mac64-tbb-export.lst | 7 +
src/tbb/market.cpp | 302 +++---
src/tbb/market.h | 12 +-
src/tbb/scheduler.cpp | 75 +-
src/tbb/scheduler.h | 334 +++++--
src/tbb/scheduler_common.h | 8 +-
src/tbb/tbb_main.cpp | 23 +-
src/tbb/tbb_misc.cpp | 13 +
src/tbb/tbb_misc.h | 2 +
src/tbb/win32-tbb-export.lst | 7 +
src/tbb/win64-gcc-tbb-export.lst | 8 +-
src/tbb/win64-tbb-export.lst | 7 +
src/test/harness.h | 21 +
src/test/harness_graph.h | 4 +-
src/test/harness_m128.h | 5 +
src/test/test_allocator.h | 7 +
src/test/test_async_msg.cpp | 8 +-
src/test/test_async_node.cpp | 126 +++
src/test/test_broadcast_node.cpp | 53 +-
src/test/test_buffer_node.cpp | 45 +-
src/test/test_combinable.cpp | 13 -
src/test/test_concurrent_associative_common.h | 94 +-
src/test/test_concurrent_map.cpp | 10 +-
src/test/test_concurrent_ordered_common.h | 58 +-
src/test/test_concurrent_priority_queue.cpp | 3 +
src/test/test_concurrent_queue.cpp | 5 -
src/test/test_concurrent_set.cpp | 10 +-
src/test/test_continue_node.cpp | 156 +++-
src/test/test_eh_flow_graph.cpp | 1 -
src/test/test_eh_tasks.cpp | 2 +-
src/test/test_flow_graph_whitebox.cpp | 1 -
src/test/test_follows_and_precedes_api.h | 259 ++++++
src/test/test_function_node.cpp | 80 +-
src/test/test_global_control.cpp | 4 +
src/test/test_indexer_node.cpp | 96 ++
src/test/test_iterators.cpp | 3 +-
src/test/test_join_node.cpp | 65 +-
src/test/test_join_node.h | 10 +-
src/test/test_join_node_key_matching.cpp | 35 +
src/test/test_join_node_msg_key_matching.cpp | 39 +
src/test/test_limiter_node.cpp | 53 +-
src/test/test_multifunction_node.cpp | 51 +
src/test/test_opencl_node.cpp | 10 +-
src/test/test_overwrite_node.cpp | 44 +-
src/test/test_parallel_pipeline.cpp | 43 +-
src/test/test_parallel_reduce.cpp | 3 -
src/test/test_partitioner_whitebox.h | 15 +-
src/test/test_priority_queue_node.cpp | 52 +-
src/test/test_queue_node.cpp | 44 +-
src/test/test_resumable_tasks.cpp | 388 ++++++++
src/test/test_sequencer_node.cpp | 60 +-
src/test/test_source_node.cpp | 86 +-
src/test/test_split_node.cpp | 98 +-
src/test/test_streaming_node.cpp | 10 +-
src/test/test_tagged_msg.cpp | 2 +-
src/test/test_task.cpp | 10 +-
src/test/test_task_group.cpp | 733 ++++++++-------
src/test/test_tbb_header.cpp | 2 +
src/test/test_tbb_version.cpp | 4 +-
src/test/test_write_once_node.cpp | 44 +-
305 files changed, 8103 insertions(+), 2800 deletions(-)
create mode 100644 examples/common/utility/get_default_num_threads.h
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/App.xaml (100%)
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/App.xaml.cpp (100%)
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/App.xaml.h (100%)
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/Assets/Logo.png (100%)
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/Assets/SmallLogo.png (100%)
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/Assets/SplashScreen.png (100%)
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/Assets/StoreLogo.png (100%)
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/Common/StandardStyles.xaml (100%)
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/DirectXBase.cpp (99%)
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/DirectXBase.h (100%)
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/DirectXPage.xaml (100%)
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/DirectXPage.xaml.cpp (89%)
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/DirectXPage.xaml.h (100%)
create mode 100644 examples/parallel_for/tachyon/msvs/uwp/Package.appxmanifest
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/copy_libraries_and_assets.bat (75%)
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/pch.h (100%)
create mode 100644 examples/parallel_for/tachyon/msvs/uwp/tbbTachyon.sln
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/tbbTachyon.vcxproj (91%)
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/tbbTachyon.vcxproj.filters (87%)
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/tbbTachyonRenderer.cpp (97%)
rename examples/parallel_for/tachyon/msvs/{win8ui => uwp}/tbbTachyonRenderer.h (100%)
delete mode 100644 examples/parallel_for/tachyon/msvs/win8ui/Package.appxmanifest
delete mode 100644 examples/parallel_for/tachyon/msvs/win8ui/tbbTachyon.sln
create mode 100644 include/tbb/internal/_deprecated_header_message_guard.h
create mode 100644 include/tbb/internal/_flow_graph_node_set_impl.h
create mode 100644 include/tbb/internal/_flow_graph_nodes_deduction.h
create mode 100644 include/tbb/internal/_warning_suppress_disable_notice.h
create mode 100644 include/tbb/internal/_warning_suppress_enable_notice.h
create mode 100644 src/perf/harness_perf.h
create mode 100644 src/perf/time_resumable_tasks.cpp
create mode 100644 src/tbb/co_context.h
create mode 100644 src/test/test_follows_and_precedes_api.h
create mode 100644 src/test/test_resumable_tasks.cpp
diff --git a/.gitignore b/.gitignore
index 13b5c5a11f..9b2411eca8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -85,3 +85,4 @@ CMakeFiles/
.svn
crash*
*.tmp
+/.vs
diff --git a/CHANGES b/CHANGES
index 6e7cb60fd9..79bb6754b8 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,40 @@
The list of most significant changes made over time in
Intel(R) Threading Building Blocks (Intel(R) TBB).
+Intel TBB 2019 Update 9
+TBB_INTERFACE_VERSION == 11009
+
+Changes (w.r.t. Intel TBB 2019 Update 8):
+
+- Multiple APIs are deprecated. For details, please see
+ Deprecated Features appendix in the TBB reference manual.
+- Added C++17 deduction guides for flow graph nodes.
+
+Preview Features:
+
+- Added isolated_task_group class that allows multiple threads to add
+ and execute tasks sharing the same isolation.
+- Extended the flow graph API to simplify connecting nodes.
+- Added erase() by heterogeneous keys for concurrent ordered containers.
+- Added a possibility to suspend task execution at a specific point
+ and resume it later.
+
+Bugs fixed:
+
+- Fixed the emplace() method of concurrent unordered containers to
+ destroy a temporary element that was not inserted.
+- Fixed a bug in the merge() method of concurrent unordered
+ containers.
+- Fixed behavior of a continue_node that follows buffering nodes.
+
+Open-source contributions integrated:
+
+- Added support for move-only types to tbb::parallel_pipeline
+ (https://github.com/intel/tbb/pull/159) by Raf Schietekat.
+- Fixed detection of clang version when CUDA toolkit is installed
+ (https://github.com/intel/tbb/pull/150) by Guilherme Amadio.
+
+------------------------------------------------------------------------
Intel TBB 2019 Update 8
TBB_INTERFACE_VERSION == 11008
diff --git a/README.md b/README.md
index 4efa64a664..926a964e40 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-# Threading Building Blocks 2019 Update 8
-[![Stable release](https://img.shields.io/badge/version-2019_U8-green.svg)](https://github.com/01org/tbb/releases/tag/2019_U8)
+# Threading Building Blocks 2019 Update 9
+[![Stable release](https://img.shields.io/badge/version-2019_U9-green.svg)](https://github.com/intel/tbb/releases/tag/2019_U9)
[![Apache License Version 2.0](https://img.shields.io/badge/license-Apache_2.0-green.svg)](LICENSE)
Threading Building Blocks (TBB) lets you easily write parallel C++ programs that take
@@ -8,7 +8,7 @@ full advantage of multicore performance, that are portable, composable and have
## Release Information
Here are the latest [Changes](CHANGES) and [Release Notes](doc/Release_Notes.txt) (contains system requirements and known issues).
-Since [2018 U5](https://github.com/01org/tbb/releases/tag/2018_U5) TBB binary packages include [Parallel STL](https://github.com/intel/parallelstl) as a high-level component.
+Since [2018 U5](https://github.com/intel/tbb/releases/tag/2018_U5) TBB binary packages include [Parallel STL](https://github.com/intel/parallelstl) as a high-level component.
## Documentation
* TBB [tutorial](https://software.intel.com/en-us/tbb-tutorial)
@@ -17,7 +17,7 @@ and [latest](https://www.threadingbuildingblocks.org/docs/help/index.htm)
## Support
Please report issues and suggestions via
-[GitHub issues](https://github.com/01org/tbb/issues) or start a topic on the
+[GitHub issues](https://github.com/intel/tbb/issues) or start a topic on the
[TBB forum](http://software.intel.com/en-us/forums/intel-threading-building-blocks/).
## How to Contribute
diff --git a/build/BSD.inc b/build/BSD.inc
index 6ef75dbabb..bb35b58d51 100644
--- a/build/BSD.inc
+++ b/build/BSD.inc
@@ -25,7 +25,7 @@ ifndef arch
endif
ifndef runtime
- clang_version:=$(shell clang -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/")
+ clang_version:=$(shell clang --version | sed -n "1s/.*version \(.*[0-9]\) .*/\1/p")
os_version:=$(shell uname -r)
os_kernel_version:=$(shell uname -r | sed -e 's/-.*$$//')
export runtime:=cc$(clang_version)_kernel$(os_kernel_version)
diff --git a/build/FreeBSD.gcc.inc b/build/FreeBSD.gcc.inc
index 653d4a3ed1..ebc47d76eb 100644
--- a/build/FreeBSD.gcc.inc
+++ b/build/FreeBSD.gcc.inc
@@ -32,7 +32,7 @@ C_FLAGS = $(CPLUS_FLAGS)
# gcc 6.0 and later have -flifetime-dse option that controls
# elimination of stores done outside the object lifetime
-ifneq (,$(shell gcc -dumpfullversion -dumpversion | egrep "^([6-9])"))
+ifneq (,$(shell gcc -dumpfullversion -dumpversion | egrep "^([6-9]|1[0-9])"))
# keep pre-contruction stores for zero initialization
DSE_KEY = -flifetime-dse=1
endif
diff --git a/build/Makefile.rml b/build/Makefile.rml
index 62983a6418..69e2e05993 100644
--- a/build/Makefile.rml
+++ b/build/Makefile.rml
@@ -60,6 +60,13 @@ TBB_DEP_NON_RML_TEST?= cache_aligned_allocator_rml.$(OBJ) dynamic_link_rml.$(OBJ
ifeq ($(cfg),debug)
RML_TBB_DEP+= spin_mutex_rml.$(OBJ)
TBB_DEP_RML_TEST?= $(RML_ASM.OBJ) tbb_misc_rml.$(OBJ)
+
+ifeq (windows icl,$(tbb_os) $(compiler_name))
+# Some versions of ICC link to the wrong version of the vc runtime
+# libcpmtd.lib should be used instead of libcpmt.lib
+LIB_LINK_FLAGS += /nodefaultlib:libcpmt.lib
+endif
+
else
TBB_DEP_RML_TEST?= $(RML_ASM.OBJ)
endif
diff --git a/build/Makefile.test b/build/Makefile.test
index a014e13783..4eb0010a31 100644
--- a/build/Makefile.test
+++ b/build/Makefile.test
@@ -103,6 +103,9 @@ test_dynamic_link.$(TEST_EXT): LIBS += $(LIBDL)
ifneq (,$(BIGOBJ_KEY))
TEST_BIGOBJ = test_opencl_node.$(TEST_EXT) \
test_atomic.$(TEST_EXT) \
+ test_concurrent_hash_map.$(TEST_EXT) \
+ test_concurrent_set.$(TEST_EXT) \
+ test_concurrent_map.$(TEST_EXT) \
test_concurrent_unordered_set.$(TEST_EXT) \
test_concurrent_unordered_map.$(TEST_EXT) \
test_join_node_key_matching.$(TEST_EXT) \
@@ -130,6 +133,8 @@ TEST_TBB_PLAIN.EXE = test_assembly.$(TEST_EXT) \
test_concurrent_unordered_set.$(TEST_EXT) \
test_concurrent_unordered_map.$(TEST_EXT) \
test_concurrent_hash_map.$(TEST_EXT) \
+ test_concurrent_set.$(TEST_EXT) \
+ test_concurrent_map.$(TEST_EXT) \
test_enumerable_thread_specific.$(TEST_EXT) \
test_handle_perror.$(TEST_EXT) \
test_halt.$(TEST_EXT) \
@@ -211,6 +216,7 @@ TEST_TBB_PLAIN.EXE = test_assembly.$(TEST_EXT) \
test_composite_node.$(TEST_EXT) \
test_async_node.$(TEST_EXT) \
test_async_msg.$(TEST_EXT) \
+ test_resumable_tasks.$(TEST_EXT) \
test_tbb_version.$(TEST_EXT) # insert new files right above
# These tests depend on other technologies
diff --git a/build/common_rules.inc b/build/common_rules.inc
index d56b92485a..e974701314 100644
--- a/build/common_rules.inc
+++ b/build/common_rules.inc
@@ -42,6 +42,10 @@ endif
INCLUDES += $(INCLUDE_KEY)$(tbb_root)/src $(INCLUDE_KEY)$(tbb_root)/src/rml/include $(INCLUDE_KEY)$(tbb_root)/include
CPLUS_FLAGS += $(WARNING_KEY) $(CXXFLAGS)
+
+# Suppress warnings about usage of deprecated content
+CPLUS_FLAGS += $(DEFINE_KEY)TBB_SUPPRESS_DEPRECATED_MESSAGES=1
+
ifeq (1,$(tbb_cpf))
CPLUS_FLAGS += $(DEFINE_KEY)__TBB_CPF_BUILD=1
endif
diff --git a/build/detect.js b/build/detect.js
index ccbe98634b..6617e3e1d1 100644
--- a/build/detect.js
+++ b/build/detect.js
@@ -57,12 +57,18 @@ function doWork() {
WScript.Echo("mingw" + gccVersion);
}
else if (WScript.Arguments(0) == "/minversion") {
- // Comparing strings, not numbers; will not work for two-digit versions
- if (gccVersion >= WScript.Arguments(2)) {
- WScript.Echo("ok");
- } else {
- WScript.Echo("fail");
+ for (var i = 0; i < 3; i++) {
+ v1 = parseInt(gccVersion.split('.')[i]);
+ v2 = parseInt(WScript.Arguments(2).split('.')[i]);
+
+ if (v1 > v2) {
+ break;
+ } else if (v1 < v2) {
+ WScript.Echo("fail");
+ return;
+ }
}
+ WScript.Echo("ok");
}
}
return;
@@ -121,6 +127,8 @@ function doWork() {
} else if (mapContext.match(vc140)) {
if (WshShell.ExpandEnvironmentStrings("%VisualStudioVersion%") == "15.0")
WScript.Echo("vc14.1");
+ else if (WshShell.ExpandEnvironmentStrings("%VisualStudioVersion%") == "16.0")
+ WScript.Echo("vc14.2");
else
WScript.Echo("vc14");
} else {
diff --git a/build/linux.clang.inc b/build/linux.clang.inc
index 9965331118..a0caf16e2b 100644
--- a/build/linux.clang.inc
+++ b/build/linux.clang.inc
@@ -30,17 +30,21 @@ EXPORT_KEY = -Wl,--version-script,
LIBDL = -ldl
LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
-LIBS += -lpthread -lrt
+LIBS += -lrt
LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
C_FLAGS = $(CPLUS_FLAGS)
ifeq ($(cfg), release)
- CPLUS_FLAGS = $(ITT_NOTIFY) -g -O2 -DUSE_PTHREAD
+ # -g is set intentionally in the release mode. It should not affect performance.
+ CPLUS_FLAGS = -O2 -g
endif
ifeq ($(cfg), debug)
- CPLUS_FLAGS = -DTBB_USE_DEBUG $(ITT_NOTIFY) -g -O0 -DUSE_PTHREAD
+ CPLUS_FLAGS = -DTBB_USE_DEBUG -O0 -g
endif
+CPLUS_FLAGS += $(ITT_NOTIFY) -DUSE_PTHREAD -pthread
+LIB_LINK_FLAGS += -pthread
+
ifneq (,$(stdlib))
CPLUS_FLAGS += -stdlib=$(stdlib)
LIB_LINK_FLAGS += -stdlib=$(stdlib)
diff --git a/build/linux.gcc.inc b/build/linux.gcc.inc
index b8986768a1..14428ad6b9 100644
--- a/build/linux.gcc.inc
+++ b/build/linux.gcc.inc
@@ -31,27 +31,27 @@ EXPORT_KEY = -Wl,--version-script,
LIBDL = -ldl
LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
-LIBS += -lpthread -lrt
+LIBS += -lrt
LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
C_FLAGS = $(CPLUS_FLAGS)
# gcc 4.2 and higher support OpenMP
-ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^(4\.[2-9]|[5-9])"))
+ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^(4\.[2-9]|[5-9]|1[0-9])"))
OPENMP_FLAG = -fopenmp
endif
# gcc 4.8 and later support RTM intrinsics, but require command line switch to enable them
-ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^(4\.[8-9]|[5-9])"))
+ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^(4\.[8-9]|[5-9]|1[0-9])"))
RTM_KEY = -mrtm
endif
# gcc 4.0 and later have -Wextra that is used by some our customers.
-ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^([4-9])"))
+ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^([4-9]|1[0-9])"))
WARNING_KEY += -Wextra
endif
# gcc 5.0 and later have -Wsuggest-override and -Wno-sized-deallocation options
-ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^([5-9])"))
+ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^([5-9]|1[0-9])"))
# enable -Wsuggest-override via a pre-included header in order to limit to C++11 and above
INCLUDE_TEST_HEADERS = -include $(tbb_root)/src/test/harness_preload.h
WARNING_SUPPRESS += -Wno-sized-deallocation
@@ -59,18 +59,22 @@ endif
# gcc 6.0 and later have -flifetime-dse option that controls
# elimination of stores done outside the object lifetime
-ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^([6-9])"))
+ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^([6-9]|1[0-9])"))
# keep pre-contruction stores for zero initialization
DSE_KEY = -flifetime-dse=1
endif
ifeq ($(cfg), release)
- CPLUS_FLAGS = $(ITT_NOTIFY) -g -O2 -DUSE_PTHREAD
+ # -g is set intentionally in the release mode. It should not affect performance.
+ CPLUS_FLAGS = -O2 -g
endif
ifeq ($(cfg), debug)
- CPLUS_FLAGS = -DTBB_USE_DEBUG $(ITT_NOTIFY) -g -O0 -DUSE_PTHREAD
+ CPLUS_FLAGS = -DTBB_USE_DEBUG -O0 -g
endif
+CPLUS_FLAGS += $(ITT_NOTIFY) -DUSE_PTHREAD -pthread
+LIB_LINK_FLAGS += -pthread
+
TBB_ASM.OBJ=
MALLOC_ASM.OBJ=
diff --git a/build/linux.icc.inc b/build/linux.icc.inc
index 3079812abe..210ad178dc 100644
--- a/build/linux.icc.inc
+++ b/build/linux.icc.inc
@@ -34,16 +34,20 @@ endif
ITT_NOTIFY = -DDO_ITT_NOTIFY
ifeq (release,$(cfg))
SDL_FLAGS += -D_FORTIFY_SOURCE=2
-CPLUS_FLAGS = $(ITT_NOTIFY) -O2 -g -DUSE_PTHREAD
+# -g is set intentionally in the release mode. It should not affect performance.
+CPLUS_FLAGS = -O2 -g -qno-opt-report-embed
else
-CPLUS_FLAGS = $(ITT_NOTIFY) -O0 -g -DUSE_PTHREAD -DTBB_USE_DEBUG
+CPLUS_FLAGS = -O0 -g -DTBB_USE_DEBUG
endif
LIB_LINK_FLAGS = -shared -static-intel -Wl,-soname=$(BUILDING_LIBRARY) -z relro -z now
-LIBS += -lpthread -lrt
+LIBS += -lrt
LINK_FLAGS = -rdynamic
C_FLAGS = $(CPLUS_FLAGS)
+CPLUS_FLAGS += $(ITT_NOTIFY) -DUSE_PTHREAD -pthread
+LIB_LINK_FLAGS += -pthread
+
ifneq (,$(shell icc -dumpversion | egrep "^1[6-9]\."))
OPENMP_FLAG = -qopenmp
else
diff --git a/build/macos.clang.inc b/build/macos.clang.inc
index 4316fa3952..5b67de4400 100644
--- a/build/macos.clang.inc
+++ b/build/macos.clang.inc
@@ -42,6 +42,11 @@ endif
CPLUS_FLAGS += -DUSE_PTHREAD $(ITT_NOTIFY)
+ifeq (1,$(tbb_cpf))
+# For correct ucontext.h structures layout
+CPLUS_FLAGS += -D_XOPEN_SOURCE
+endif
+
# For Clang, we add the option to support RTM intrinsics *iff* xtest is found in
ifneq (,$(shell grep xtest `echo "\#include" | $(CONLY) -E -M - 2>&1 | grep immintrin.h` 2>/dev/null))
RTM_KEY = -mrtm
diff --git a/build/macos.gcc.inc b/build/macos.gcc.inc
index b03dc9cba1..2a6f3856ee 100644
--- a/build/macos.gcc.inc
+++ b/build/macos.gcc.inc
@@ -35,19 +35,19 @@ LIB_LINK_FLAGS = -dynamiclib -install_name @rpath/$(BUILDING_LIBRARY)
C_FLAGS = $(CPLUS_FLAGS)
# gcc 4.8 and later support RTM intrinsics, but require command line switch to enable them
-ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^(4\.[8-9]|[5-9])"))
+ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^(4\.[8-9]|[5-9]|1[0-9])"))
RTM_KEY = -mrtm
endif
# gcc 5.0 and later have -Wsuggest-override option
# enable it via a pre-included header in order to limit to C++11 and above
-ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^([5-9])"))
+ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^([5-9]|1[0-9])"))
INCLUDE_TEST_HEADERS = -include $(tbb_root)/src/test/harness_preload.h
endif
# gcc 6.0 and later have -flifetime-dse option that controls
# elimination of stores done outside the object lifetime
-ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^([6-9])"))
+ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^([6-9]|1[0-9])"))
# keep pre-contruction stores for zero initialization
DSE_KEY = -flifetime-dse=1
endif
diff --git a/build/macos.icc.inc b/build/macos.icc.inc
index 506d98c9c6..20f59b2649 100644
--- a/build/macos.icc.inc
+++ b/build/macos.icc.inc
@@ -49,7 +49,7 @@ endif
ifeq ($(cfg), release)
SDL_FLAGS += -D_FORTIFY_SOURCE=2
- CPLUS_FLAGS = -g -O2 -fno-omit-frame-pointer
+ CPLUS_FLAGS = -g -O2 -fno-omit-frame-pointer -qno-opt-report-embed
else
CPLUS_FLAGS = -g -O0 -DTBB_USE_DEBUG
endif
@@ -57,6 +57,11 @@ endif
ITT_NOTIFY = -DDO_ITT_NOTIFY
CPLUS_FLAGS += -DUSE_PTHREAD $(ITT_NOTIFY)
+ifeq (1,$(tbb_cpf))
+# For correct ucontext.h structures layout
+CPLUS_FLAGS += -D_XOPEN_SOURCE
+endif
+
ifneq (,$(codecov))
CPLUS_FLAGS += -prof-gen=srcpos
endif
diff --git a/build/macos.inc b/build/macos.inc
index aa2923baf7..99c46e91d2 100644
--- a/build/macos.inc
+++ b/build/macos.inc
@@ -45,7 +45,7 @@ ifndef arch
endif
ifndef runtime
- clang_version:=$(shell clang -v 2>&1 >/dev/null | grep version | sed -e "s/.*version \(.*[0-9]\) .*/\1/")
+ clang_version:=$(shell clang --version | sed -n "1s/.*version \(.*[0-9]\) .*/\1/p")
ifndef os_version
os_version:=$(shell /usr/bin/sw_vers -productVersion)
endif
diff --git a/build/version_info_macos.sh b/build/version_info_macos.sh
index d49fcf8ed2..370e4e1a00 100644
--- a/build/version_info_macos.sh
+++ b/build/version_info_macos.sh
@@ -19,7 +19,7 @@ echo "#define __TBB_VERSION_STRINGS(N) \\"
echo '#N": BUILD_HOST'"\t\t"`hostname -s`" ("`arch`")"'" ENDL \'
echo '#N": BUILD_OS'"\t\t"`sw_vers -productName`" version "`sw_vers -productVersion`'" ENDL \'
echo '#N": BUILD_KERNEL'"\t"`uname -v`'" ENDL \'
-echo '#N": BUILD_CLANG'"\t"`clang --version &1 | grep 'version '`'" ENDL \'
+echo '#N": BUILD_CLANG'"\t"`clang --version | sed -n "1p"`'" ENDL \'
echo '#N": BUILD_XCODE'"\t"`xcodebuild -version &1 | grep 'Xcode'`'" ENDL \'
[ -z "$COMPILER_VERSION" ] || echo '#N": BUILD_COMPILER'"\t"$COMPILER_VERSION'" ENDL \'
echo '#N": BUILD_TARGET'"\t$arch on $runtime"'" ENDL \'
diff --git a/build/vs2013/tbb.vcxproj b/build/vs2013/tbb.vcxproj
index cbfcd3919d..e1aa9b549d 100644
--- a/build/vs2013/tbb.vcxproj
+++ b/build/vs2013/tbb.vcxproj
@@ -170,7 +170,7 @@
- /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include
+ /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include
Disabled
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
@@ -198,7 +198,7 @@
X64
- /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include
+ /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include
Disabled
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
@@ -223,7 +223,7 @@
- /c /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include
+ /c /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
MultiThreadedDLL
@@ -250,7 +250,7 @@
X64
- /c /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include
+ /c /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
MultiThreadedDLL
@@ -273,7 +273,7 @@
- /c /MTd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include
+ /c /MTd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include
Disabled
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
@@ -301,7 +301,7 @@
X64
- /c /MTd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include
+ /c /MTd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include
Disabled
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
@@ -326,7 +326,7 @@
- /c /MT /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include
+ /c /MT /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
MultiThreaded
@@ -353,7 +353,7 @@
X64
- /c /MT /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include
+ /c /MT /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
MultiThreaded
diff --git a/build/vs2013/tbbmalloc.vcxproj b/build/vs2013/tbbmalloc.vcxproj
index 0a38cd5f65..b8f21dd5d3 100644
--- a/build/vs2013/tbbmalloc.vcxproj
+++ b/build/vs2013/tbbmalloc.vcxproj
@@ -170,7 +170,7 @@
- /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc /I.
+ /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc /I.
Disabled
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
@@ -197,7 +197,7 @@
X64
- /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc /I.
+ /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc /I.
Disabled
.;%(AdditionalIncludeDirectories)
false
@@ -222,7 +222,7 @@
- /c /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc /I.
+ /c /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc /I.
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
MultiThreadedDLL
@@ -248,7 +248,7 @@
X64
- /c /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc /I.
+ /c /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc /I.
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
MultiThreadedDLL
@@ -271,7 +271,7 @@
- /c /MTd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc /I.
+ /c /MTd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc /I.
Disabled
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
@@ -298,7 +298,7 @@
X64
- /c /MTd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc /I.
+ /c /MTd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc /I.
Disabled
.;%(AdditionalIncludeDirectories)
false
@@ -323,7 +323,7 @@
- /c /MT /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc /I.
+ /c /MT /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc /I.
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
MultiThreaded
@@ -347,7 +347,7 @@
X64
- /c /MT /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc /I.
+ /c /MT /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc /I.
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
MultiThreaded
diff --git a/build/vs2013/tbbmalloc_proxy.vcxproj b/build/vs2013/tbbmalloc_proxy.vcxproj
index 758bb51741..23dac2f64b 100644
--- a/build/vs2013/tbbmalloc_proxy.vcxproj
+++ b/build/vs2013/tbbmalloc_proxy.vcxproj
@@ -170,7 +170,7 @@
- /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /W4 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc
+ /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /W4 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc
Disabled
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
@@ -199,7 +199,7 @@
X64
- /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /W4 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc
+ /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /W4 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc
Disabled
.;%(AdditionalIncludeDirectories)
false
@@ -227,7 +227,7 @@
- /c /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /W4 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc
+ /c /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /W4 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
@@ -256,7 +256,7 @@
X64
- /c /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /W4 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc
+ /c /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /W4 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
@@ -282,7 +282,7 @@
- /c /MTd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /W4 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc
+ /c /MTd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /W4 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc
Disabled
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
@@ -311,7 +311,7 @@
X64
- /c /MTd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /W4 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc
+ /c /MTd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /W4 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc
Disabled
.;%(AdditionalIncludeDirectories)
false
@@ -339,7 +339,7 @@
- /c /MT /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /W4 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc
+ /c /MT /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /W4 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
@@ -368,7 +368,7 @@
X64
- /c /MT /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /W4 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc
+ /c /MT /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /D__TBB_LIB_NAME=tbb.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /W4 /D__TBBMALLOC_BUILD=1 /I../../src /I../../src/rml/include /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc
.;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
diff --git a/build/windows.icl.inc b/build/windows.icl.inc
index 8010d5fc3c..de2e66aaf6 100644
--- a/build/windows.icl.inc
+++ b/build/windows.icl.inc
@@ -51,6 +51,11 @@ ifeq (ok,$(call detect_js,/minversion icl 17 4))
VS2017_SUPPORT = yes
endif
+# ICC 19.0.4 and higher provide support for VS2019
+ifeq (ok,$(call detect_js,/minversion icl 19 4))
+ VS2019_SUPPORT = yes
+endif
+
ifeq ($(runtime), vc_mt)
MS_CRT_KEY = /MT$(if $(findstring debug,$(cfg)),d)
else
@@ -59,7 +64,7 @@ endif
EH_FLAGS = $(if $(no_exceptions),/EHs-,/EHsc /GR)
ifeq ($(cfg), release)
- CPLUS_FLAGS = $(MS_CRT_KEY) /O2 /Zi $(EH_FLAGS) /Zc:forScope /Zc:wchar_t /D__TBB_LIB_NAME=$(TBB.LIB)
+ CPLUS_FLAGS = $(MS_CRT_KEY) /O2 /Zi /Qopt-report-embed- $(EH_FLAGS) /Zc:forScope /Zc:wchar_t /D__TBB_LIB_NAME=$(TBB.LIB)
ASM_FLAGS =
endif
ifeq ($(cfg), debug)
@@ -110,7 +115,7 @@ ifeq ($(VCCOMPAT_FLAG),)
VCCOMPAT_FLAG := $(if $(findstring vc8, $(VCVERSION)),/Qvc8)
endif
ifeq ($(VCCOMPAT_FLAG),)
- VCCOMPAT_FLAG := $(if $(findstring vc_mt, $(VCVERSION)),/Qvc10)
+ VCCOMPAT_FLAG := $(if $(findstring vc_mt, $(VCVERSION)),/Qvc14)
endif
ifeq ($(VCCOMPAT_FLAG),)
VCCOMPAT_FLAG := $(if $(findstring vc9, $(VCVERSION)),/Qvc9)
@@ -131,6 +136,11 @@ ifeq ($(VCCOMPAT_FLAG),)
VCCOMPAT_FLAG := /Qvc14.1
endif
endif
+ ifeq ($(VS2019_SUPPORT),yes)
+ ifneq (,$(findstring vc14.2, $(VCVERSION)))
+ VCCOMPAT_FLAG := /Qvc14.2
+ endif
+ endif
endif
ifeq ($(VCCOMPAT_FLAG),)
$(error VC version not detected correctly: $(VCVERSION) )
diff --git a/build/windows.inc b/build/windows.inc
index fdb9d5b8c3..0d50e079e7 100644
--- a/build/windows.inc
+++ b/build/windows.inc
@@ -59,7 +59,11 @@ def_prefix = $(if $(findstring intel64,$(arch)),win64,win32)
# Target Windows version. Do not increase beyond 0x0502 without prior discussion!
# Used as the value for macro definition option in windows.cl.inc etc.
# For tests, we need at least Windows XP SP2 for sake of enabling stack backtraces.
+ifeq (1,$(tbb_cpf))
+_WIN32_WINNT=0x0600
+else
_WIN32_WINNT=0x0502
+endif
TBB.LST = $(tbb_root)/src/tbb/$(def_prefix)-tbb-export.lst
TBB.DEF = $(TBB.LST:.lst=.def)
@@ -68,7 +72,7 @@ TBB.LIB = tbb$(CPF_SUFFIX)$(DEBUG_SUFFIX).$(LIBEXT)
TBB.RES = tbb_resource.res
# On Windows, we use #pragma comment to set the proper TBB lib to link with.
# But for cross-configuration testing, need to link explicitly.
-# Tests use this variable to detect dependency on TBB binary, so have to be non-empty.
+# Tests use this variable to detect dependency on TBB binary, so have to be non-empty.
LINK_TBB.LIB = $(if $(crosstest),$(TBB.LIB),$(DEFINE_KEY)__TBB_IMPLICITLY_LINKED)
TBB.MANIFEST =
ifneq ($(filter vc8 vc9,$(runtime)),)
diff --git a/cmake/README.rst b/cmake/README.rst
index 3b16c37c14..52cc46def8 100644
--- a/cmake/README.rst
+++ b/cmake/README.rst
@@ -30,7 +30,7 @@ Visit our `forum `_ has the following format: ``find_package(TBB .. ...)``. TBB interface version can also be obtained in the customer project via the ``TBB_INTERFACE_VERSION`` variable.
+* TBB versioning via `find_package `_ has the following format: ``find_package(TBB . ...)``.
Use cases of TBB integration into CMake-aware projects
------------------------------------------------------------
@@ -206,7 +206,7 @@ Variables set during TBB configuration:
``TBB__FOUND`` specific TBB component is found
``TBB_IMPORTED_TARGETS`` all created TBB imported targets
``TBB_VERSION`` TBB version (format: ``.``)
-``TBB_INTERFACE_VERSION`` TBB interface version
+``TBB_INTERFACE_VERSION`` TBB interface version (can be empty, see below for details)
========================= ================================================
TBBInstallConfig
@@ -219,7 +219,7 @@ Provides the following functions:
.. code:: cmake
tbb_install_config(INSTALL_DIR SYSTEM_NAME Linux|Darwin|Windows
- [TBB_VERSION ..|TBB_VERSION_FILE ]
+ [TBB_VERSION .|TBB_VERSION_FILE ]
[LIB_REL_PATH INC_REL_PATH ]
[LIB_PATH INC_PATH ])``
@@ -241,8 +241,8 @@ The use case is applicable for package maintainers who create own TBB packages a
``SYSTEM_NAME Linux|Darwin|Windows`` OS name to generate config files for
``TBB_VERSION_FILE `` Path to ``tbb_stddef.h`` to parse version from and
write it to TBBConfigVersion.cmake
-``TBB_VERSION ..`` Directly specified TBB version;
- alternative to ``TBB_VERSION_FILE`` parameter
+``TBB_VERSION .`` Directly specified TBB version; alternative to ``TBB_VERSION_FILE`` parameter;
+ ``TBB_INTERFACE_VERSION`` is set to empty value in this case
``LIB_REL_PATH `` Relative path to TBB binaries (.lib files on Windows), default: ``../../../lib``
``BIN_REL_PATH `` Relative path to TBB DLLs, default: ``../../../bin`` (applicable for Windows only)
``INC_REL_PATH `` Relative path to TBB headers, default: ``../../../include``
diff --git a/cmake/TBBInstallConfig.cmake b/cmake/TBBInstallConfig.cmake
index b6ed34b0bc..a5fa7e8a58 100644
--- a/cmake/TBBInstallConfig.cmake
+++ b/cmake/TBBInstallConfig.cmake
@@ -83,8 +83,8 @@ function(tbb_install_config)
file(READ ${tbb_version_file} _tbb_stddef)
string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" _tbb_ver_major "${_tbb_stddef}")
string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" _tbb_ver_minor "${_tbb_stddef}")
- string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" _tbb_ver_interface "${_tbb_stddef}")
- set(TBB_VERSION "${_tbb_ver_major}.${_tbb_ver_minor}.${_tbb_ver_interface}")
+ string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_tbb_stddef}")
+ set(TBB_VERSION "${_tbb_ver_major}.${_tbb_ver_minor}")
endif()
# ------
diff --git a/cmake/TBBMakeConfig.cmake b/cmake/TBBMakeConfig.cmake
index bbcb990b32..b5b7a12243 100644
--- a/cmake/TBBMakeConfig.cmake
+++ b/cmake/TBBMakeConfig.cmake
@@ -56,33 +56,16 @@ function(tbb_make_config)
set(TBB_LIB_EXT "so.2")
# Note: multiline variable
- set(TBB_CHOOSE_COMPILER_SUBDIR "if (CMAKE_CXX_COMPILER_LOADED)
- set(_tbb_compiler_id \${CMAKE_CXX_COMPILER_ID})
- set(_tbb_compiler_ver \${CMAKE_CXX_COMPILER_VERSION})
-elseif (CMAKE_C_COMPILER_LOADED)
- set(_tbb_compiler_id \${CMAKE_C_COMPILER_ID})
- set(_tbb_compiler_ver \${CMAKE_C_COMPILER_VERSION})
-endif()
+ set(TBB_CHOOSE_COMPILER_SUBDIR "set(_tbb_compiler_subdir gcc4.8)
# For non-GCC compilers try to find version of system GCC to choose right compiler subdirectory.
-if (NOT _tbb_compiler_id STREQUAL \"GNU\")
- execute_process(COMMAND gcc --version OUTPUT_VARIABLE _tbb_gcc_ver_output ERROR_QUIET)
- string(REGEX REPLACE \".*gcc.*([0-9]+\\\\.[0-9]+)\\\\.[0-9]+.*\" \"\\\\1\" _tbb_compiler_ver \"\${_tbb_gcc_ver_output}\")
- if (NOT _tbb_compiler_ver)
+if (NOT CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\" AND NOT CMAKE_C_COMPILER_ID STREQUAL \"GNU\")
+ find_program(_gcc_executable gcc)
+ if (NOT _gcc_executable)
message(FATAL_ERROR \"This Intel TBB package is intended to be used only in environment with available 'gcc'\")
endif()
- unset(_tbb_gcc_ver_output)
-endif()
-
-set(_tbb_compiler_subdir gcc4.1)
-foreach (_tbb_gcc_version 4.1 4.4 4.7)
- if (NOT _tbb_compiler_ver VERSION_LESS \${_tbb_gcc_version})
- set(_tbb_compiler_subdir gcc\${_tbb_gcc_version})
- endif()
-endforeach()
-
-unset(_tbb_compiler_id)
-unset(_tbb_compiler_ver)")
+ unset(_gcc_executable)
+endif()")
elseif (tbb_system_name STREQUAL "Windows")
set(TBB_SHARED_LIB_DIR "bin")
@@ -96,23 +79,14 @@ unset(_tbb_compiler_ver)")
message(FATAL_ERROR \"This Intel TBB package is intended to be used only in the project with MSVC\")
endif()
-# Detect the most relevant MSVC subdirectory
-set(_tbb_msvc_1700_subdir vc11)
-set(_tbb_msvc_1800_subdir vc12)
-set(_tbb_msvc_1900_subdir vc14)
-set(_tbb_msvc_ver \${MSVC_VERSION})
-if (MSVC_VERSION VERSION_LESS 1700)
- message(FATAL_ERROR \"This Intel TBB package is intended to be used only in the project with MSVC version 1700 (vc11) or higher\")
-elseif (MSVC_VERSION VERSION_GREATER 1900)
- set(_tbb_msvc_ver 1900)
+if (MSVC_VERSION VERSION_LESS 1900)
+ message(FATAL_ERROR \"This Intel TBB package is intended to be used only in the project with MSVC version 1900 (vc14) or higher\")
endif()
-set(_tbb_compiler_subdir \${_tbb_msvc_\${_tbb_msvc_ver}_subdir})
-unset(_tbb_msvc_1700_subdir)
-unset(_tbb_msvc_1800_subdir)
-unset(_tbb_msvc_1900_subdir)
+
+set(_tbb_compiler_subdir vc14)
if (WINDOWS_STORE)
- set(_tbb_compiler_subdir \${_tbb_compiler_subdir}_ui)
+ set(_tbb_compiler_subdir \${_tbb_compiler_subdir}_uwp)
endif()")
if (tbb_MK_CONFIG_FOR_SOURCE)
@@ -153,7 +127,7 @@ endif()")
string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" _tbb_ver_major "${_tbb_stddef}")
string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" _tbb_ver_minor "${_tbb_stddef}")
string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_tbb_stddef}")
- set(TBB_VERSION "${_tbb_ver_major}.${_tbb_ver_minor}.${TBB_INTERFACE_VERSION}")
+ set(TBB_VERSION "${_tbb_ver_major}.${_tbb_ver_minor}")
if (tbb_MK_CONFIG_FOR_SOURCE)
set(TBB_CHOOSE_ARCH_AND_COMPILER "")
diff --git a/cmake/templates/TBBConfig.cmake.in b/cmake/templates/TBBConfig.cmake.in
index 84e25399f8..d5f2eabc8b 100644
--- a/cmake/templates/TBBConfig.cmake.in
+++ b/cmake/templates/TBBConfig.cmake.in
@@ -13,23 +13,12 @@
# limitations under the License.
# It defines the following variables:
-# TBB_tbb_FOUND
-# TBB_tbbmalloc_FOUND
-# TBB_tbbmalloc_proxy_FOUND
+# TBB__FOUND
# TBB_IMPORTED_TARGETS
#
# TBBConfigVersion.cmake defines TBB_VERSION
#
# Initialize to default values
-if (NOT TBB_tbb_FOUND)
- set(TBB_tbb_FOUND 0)
-endif()
-if (NOT TBB_tbbmalloc_FOUND)
- set(TBB_tbbmalloc_FOUND 0)
-endif()
-if (NOT TBB_tbbmalloc_proxy_FOUND)
- set(TBB_tbbmalloc_proxy_FOUND 0)
-endif()
if (NOT TBB_IMPORTED_TARGETS)
set(TBB_IMPORTED_TARGETS "")
endif()
@@ -41,6 +30,8 @@ if (NOT TBB_FIND_COMPONENTS)
endforeach()
endif()
+set(TBB_INTERFACE_VERSION @TBB_INTERFACE_VERSION@)
+
# Add components with internal dependencies: tbbmalloc_proxy -> tbbmalloc
list(FIND TBB_FIND_COMPONENTS tbbmalloc_proxy _tbbmalloc_proxy_ix)
if (NOT _tbbmalloc_proxy_ix EQUAL -1)
@@ -54,6 +45,8 @@ endif()
unset(_tbbmalloc_proxy_ix)
foreach (_tbb_component ${TBB_FIND_COMPONENTS})
+ set(TBB_${_tbb_component}_FOUND 0)
+
set(_tbb_release_lib "${CMAKE_CURRENT_LIST_DIR}/@TBB_LIB_REL_PATH@/@TBB_LIB_PREFIX@${_tbb_component}.@TBB_LIB_EXT@")
set(_tbb_debug_lib "${CMAKE_CURRENT_LIST_DIR}/@TBB_LIB_REL_PATH@/@TBB_LIB_PREFIX@${_tbb_component}_debug.@TBB_LIB_EXT@")
@@ -79,17 +72,17 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})
if (_tbb_component STREQUAL tbbmalloc_proxy)
set_target_properties(TBB::tbbmalloc_proxy PROPERTIES INTERFACE_LINK_LIBRARIES TBB::tbbmalloc)
endif()
- list(APPEND TBB_IMPORTED_TARGETS TBB::${_tbb_component})
else()
message(STATUS "Using previously found TBB::${_tbb_component}")
endif()
+ list(APPEND TBB_IMPORTED_TARGETS TBB::${_tbb_component})
set(TBB_${_tbb_component}_FOUND 1)
elseif (TBB_FIND_REQUIRED AND TBB_FIND_REQUIRED_${_tbb_component})
message(STATUS "Missed required Intel TBB component: ${_tbb_component}")
message(STATUS " one or both of:\n ${_tbb_release_lib}\n ${_tbb_debug_lib}\n files must exist.")
set(TBB_FOUND FALSE)
- set(TBB_${_tbb_component}_FOUND 0)
endif()
endforeach()
+list(REMOVE_DUPLICATES TBB_IMPORTED_TARGETS)
unset(_tbb_release_lib)
unset(_tbb_debug_lib)
diff --git a/cmake/templates/TBBConfigInternal.cmake.in b/cmake/templates/TBBConfigInternal.cmake.in
index 40528c6df1..c3d7ee4caa 100644
--- a/cmake/templates/TBBConfigInternal.cmake.in
+++ b/cmake/templates/TBBConfigInternal.cmake.in
@@ -12,8 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# TBB_FOUND should not be set explicitly. It is defined automatically by CMake.
-# Handling of TBB_VERSION is in TBBConfigVersion.cmake.
+# It defines the following variables:
+# TBB__FOUND
+# TBB_IMPORTED_TARGETS
+#
+# TBBConfigVersion.cmake defines TBB_VERSION
+#
+# Initialize to default values
+if (NOT TBB_IMPORTED_TARGETS)
+ set(TBB_IMPORTED_TARGETS "")
+endif()
if (NOT TBB_FIND_COMPONENTS)
set(TBB_FIND_COMPONENTS "@TBB_DEFAULT_COMPONENTS@")
@@ -38,39 +46,45 @@ get_filename_component(_tbb_root "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_tbb_root "${_tbb_root}" PATH)
@TBB_CHOOSE_ARCH_AND_COMPILER@
foreach (_tbb_component ${TBB_FIND_COMPONENTS})
+ set(TBB_${_tbb_component}_FOUND 0)
+
set(_tbb_release_lib "@TBB_RELEASE_LIB_PATH@/@TBB_LIB_PREFIX@${_tbb_component}.@TBB_LIB_EXT@")
set(_tbb_debug_lib "@TBB_DEBUG_LIB_PATH@/@TBB_LIB_PREFIX@${_tbb_component}_debug.@TBB_LIB_EXT@")
if (EXISTS "${_tbb_release_lib}" OR EXISTS "${_tbb_debug_lib}")
- add_library(TBB::${_tbb_component} SHARED IMPORTED)
- set_target_properties(TBB::${_tbb_component} PROPERTIES
- INTERFACE_INCLUDE_DIRECTORIES "${_tbb_root}/include"@TBB_COMPILE_DEFINITIONS@)
-
- if (EXISTS "${_tbb_release_lib}")
+ if (NOT TARGET TBB::${_tbb_component})
+ add_library(TBB::${_tbb_component} SHARED IMPORTED)
set_target_properties(TBB::${_tbb_component} PROPERTIES
- IMPORTED_LOCATION_RELEASE "${_tbb_release_lib}"@TBB_IMPLIB_RELEASE@)
- set_property(TARGET TBB::${_tbb_component} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
- endif()
+ INTERFACE_INCLUDE_DIRECTORIES "${_tbb_root}/include"@TBB_COMPILE_DEFINITIONS@)
- if (EXISTS "${_tbb_debug_lib}")
- set_target_properties(TBB::${_tbb_component} PROPERTIES
- IMPORTED_LOCATION_DEBUG "${_tbb_debug_lib}"@TBB_IMPLIB_DEBUG@)
- set_property(TARGET TBB::${_tbb_component} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
- endif()
+ if (EXISTS "${_tbb_release_lib}")
+ set_target_properties(TBB::${_tbb_component} PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${_tbb_release_lib}"@TBB_IMPLIB_RELEASE@)
+ set_property(TARGET TBB::${_tbb_component} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+ endif()
- # Add internal dependencies for imported targets: TBB::tbbmalloc_proxy -> TBB::tbbmalloc
- if (_tbb_component STREQUAL tbbmalloc_proxy)
- set_target_properties(TBB::tbbmalloc_proxy PROPERTIES INTERFACE_LINK_LIBRARIES TBB::tbbmalloc)
- endif()
+ if (EXISTS "${_tbb_debug_lib}")
+ set_target_properties(TBB::${_tbb_component} PROPERTIES
+ IMPORTED_LOCATION_DEBUG "${_tbb_debug_lib}"@TBB_IMPLIB_DEBUG@)
+ set_property(TARGET TBB::${_tbb_component} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+ endif()
+ # Add internal dependencies for imported targets: TBB::tbbmalloc_proxy -> TBB::tbbmalloc
+ if (_tbb_component STREQUAL tbbmalloc_proxy)
+ set_target_properties(TBB::tbbmalloc_proxy PROPERTIES INTERFACE_LINK_LIBRARIES TBB::tbbmalloc)
+ endif()
+ else()
+ message(STATUS "Using previously found TBB::${_tbb_component}")
+ endif()
list(APPEND TBB_IMPORTED_TARGETS TBB::${_tbb_component})
set(TBB_${_tbb_component}_FOUND 1)
elseif (TBB_FIND_REQUIRED AND TBB_FIND_REQUIRED_${_tbb_component})
message(STATUS "Missed required Intel TBB component: ${_tbb_component}")
+ message(STATUS " one or both of:\n ${_tbb_release_lib}\n ${_tbb_debug_lib}\n files must exist.")
set(TBB_FOUND FALSE)
- set(TBB_${_tbb_component}_FOUND 0)
endif()
endforeach()
+list(REMOVE_DUPLICATES TBB_IMPORTED_TARGETS)
@TBB_UNSET_ADDITIONAL_VARIABLES@
unset(_tbbmalloc_proxy_ix)
unset(_tbbmalloc_ix)
diff --git a/examples/GettingStarted/sub_string_finder/Makefile b/examples/GettingStarted/sub_string_finder/Makefile
index 8aa56e712d..77148464b4 100644
--- a/examples/GettingStarted/sub_string_finder/Makefile
+++ b/examples/GettingStarted/sub_string_finder/Makefile
@@ -44,21 +44,24 @@ else ifeq ($(shell uname), Darwin)
override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib
endif
+# autodetect C++11 support
+include ../../common/examples-common.inc
+
all: release test
release: *.cpp
ifeq ($(offload),)
- $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o sub_string_finder sub_string_finder.cpp $(TBBLIB) $(LIBS)
- $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o sub_string_finder_pretty sub_string_finder_pretty.cpp $(TBBLIB) $(LIBS)
+ $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o sub_string_finder sub_string_finder.cpp $(TBBLIB) $(LIBS) $(CXX0XFLAGS)
+ $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o sub_string_finder_pretty sub_string_finder_pretty.cpp $(TBBLIB) $(LIBS) $(CXX0XFLAGS)
endif
- $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o sub_string_finder_extended sub_string_finder_extended.cpp $(TBBLIB) $(LIBS)
+ $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o sub_string_finder_extended sub_string_finder_extended.cpp $(TBBLIB) $(LIBS) $(CXX0XFLAGS)
debug: *.cpp
ifeq ($(offload),)
- $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o sub_string_finder sub_string_finder.cpp $(TBBLIB_DEBUG) $(LIBS)
- $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o sub_string_finder_pretty sub_string_finder_pretty.cpp $(TBBLIB_DEBUG) $(LIBS)
+ $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o sub_string_finder sub_string_finder.cpp $(TBBLIB_DEBUG) $(LIBS) $(CXX0XFLAGS)
+ $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o sub_string_finder_pretty sub_string_finder_pretty.cpp $(TBBLIB_DEBUG) $(LIBS) $(CXX0XFLAGS)
endif
- $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o sub_string_finder_extended sub_string_finder_extended.cpp $(TBBLIB_DEBUG) $(LIBS)
+ $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o sub_string_finder_extended sub_string_finder_extended.cpp $(TBBLIB_DEBUG) $(LIBS) $(CXX0XFLAGS)
clean:
$(RM) sub_string_finder sub_string_finder_extended sub_string_finder_pretty *.o *.d
diff --git a/examples/GettingStarted/sub_string_finder/msvs/sub_string_finder.vcxproj b/examples/GettingStarted/sub_string_finder/msvs/sub_string_finder.vcxproj
index 8926181723..b3397cbb3d 100644
--- a/examples/GettingStarted/sub_string_finder/msvs/sub_string_finder.vcxproj
+++ b/examples/GettingStarted/sub_string_finder/msvs/sub_string_finder.vcxproj
@@ -101,7 +101,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX86
@@ -127,7 +127,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX64
@@ -149,7 +149,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -176,7 +176,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/GettingStarted/sub_string_finder/msvs/sub_string_finder_extended.vcxproj b/examples/GettingStarted/sub_string_finder/msvs/sub_string_finder_extended.vcxproj
index fad404334d..0ff7e15d9c 100644
--- a/examples/GettingStarted/sub_string_finder/msvs/sub_string_finder_extended.vcxproj
+++ b/examples/GettingStarted/sub_string_finder/msvs/sub_string_finder_extended.vcxproj
@@ -101,7 +101,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX86
@@ -127,7 +127,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX64
@@ -149,7 +149,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -176,7 +176,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/GettingStarted/sub_string_finder/msvs/sub_string_finder_pretty.vcxproj b/examples/GettingStarted/sub_string_finder/msvs/sub_string_finder_pretty.vcxproj
index bb3e84b762..fced1c2301 100644
--- a/examples/GettingStarted/sub_string_finder/msvs/sub_string_finder_pretty.vcxproj
+++ b/examples/GettingStarted/sub_string_finder/msvs/sub_string_finder_pretty.vcxproj
@@ -101,7 +101,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX86
@@ -127,7 +127,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX64
@@ -149,7 +149,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -176,7 +176,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/Makefile b/examples/Makefile
index dd1339b223..8c07b3e610 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -37,6 +37,8 @@ override CXXFLAGS += $(CXX_STD_FLAGS)
# give stdver priotity over autodetection
ifneq (,$(stdver))
CXX0XFLAGS=-std=$(stdver)
+else
+ include common/examples-common.inc
endif
# empty CXX0XFLAGS exported as well, to have control over C++ autodetection
export CXX0XFLAGS
diff --git a/examples/common/copy_libraries.bat b/examples/common/copy_libraries.bat
index c1ed9d72f5..1c35145214 100644
--- a/examples/common/copy_libraries.bat
+++ b/examples/common/copy_libraries.bat
@@ -41,8 +41,6 @@ if ("%TBBROOT%") == ("") set TBBROOT=%~d0%~p0..\..\
:: Getting vs folders in case vc_mt binaries are not provided
:: ordered from oldest to newest, so we end with newest available version
-if ("%VS110COMNTOOLS%") NEQ ("") set vc_dir=vc11
-if ("%VS120COMNTOOLS%") NEQ ("") set vc_dir=vc12
if ("%VS140COMNTOOLS%") NEQ ("") set vc_dir=vc14
:: To use Microsoft* Visual Studio* 2017 IDE, make sure the variable VS150COMNTOOLS is set in your IDE instance.
:: If it is not, try running Microsoft Visual Studio 2017 from Microsoft* Developer Command Prompt* for VS 2017.
diff --git a/examples/common/examples-common.inc b/examples/common/examples-common.inc
index c0257a7316..f81c18c5db 100644
--- a/examples/common/examples-common.inc
+++ b/examples/common/examples-common.inc
@@ -14,19 +14,19 @@
# detect if a compiler can support C++11
# If CXX0XFLAGS already set, do not change it
-ifneq (,$(findstring $(CXX), icc icpc clang++))
+ifneq (,$(findstring icc, $(CXX))$(findstring icpc, $(CXX))$(findstring clang++, $(CXX)))
# every supported icc or clang is OK
- CXX0XFLAGS ?= -std=c++0x
+ CXX0XFLAGS ?= -std=c++11
else
- ifneq (,$(findstring $(CXX), g++ gcc))
+ ifneq (,$(findstring g++, $(CXX))$(findstring gcc, $(CXX)))
ifneq (, $(strip $(shell $(CXX) -v 2>&1 | grep "clang-")))
# This is clang actually,
# every supported clang is OK
- CXX0XFLAGS ?= -std=c++0x
+ CXX0XFLAGS ?= -std=c++11
else
# support of lambda started GCC 4.5
- ifneq (, $(strip $(shell g++ -dumpfullversion -dumpversion | egrep "^(4\.[5-9]|[5-9])")))
- CXX0XFLAGS ?= -std=c++0x
+ ifneq (, $(strip $(shell g++ -dumpfullversion -dumpversion | egrep "^(4\.[5-9]|[5-9]|1[0-9])")))
+ CXX0XFLAGS ?= -std=c++11
endif
endif
endif
diff --git a/examples/common/index.html b/examples/common/index.html
index 2535857f77..7de00c9f48 100644
--- a/examples/common/index.html
+++ b/examples/common/index.html
@@ -119,11 +119,11 @@
.circ {
list-style-type:circle
}
-
+
.single {
padding: 0 0.5em;
}
-
+
/* ------------------------------------------------- */
/* Table styles */
table{
@@ -150,9 +150,9 @@
}
th{
border:1px #dddddd solid;
- padding-top:2px;
+ padding-top:2px;
padding-bottom:0px;
- padding-right:3px;
+ padding-right:3px;
padding-left:3px;
}
td{
@@ -225,7 +225,7 @@
padding-right:5px;
vertical-align:top;
}
-
+
.specs {
border-collapse:collapse;
}
@@ -242,7 +242,7 @@
padding: 0 0.2em 0.2em;
text-align: center;
}
- .specs td tr:last-child td,
+ .specs td tr:last-child td,
.specs td tr:last-child th {
padding: 0 0.2em;
}
@@ -266,7 +266,7 @@
Intel® Threading Building Blocks. Common source code for samples
-
+
Intel® Threading Building Blocks. Common source code for samples
-
+
This directory contains common code that is used in the Intel® Threading Building Blocks (Intel® TBB) samples.
@@ -332,7 +332,7 @@
Intel® Threading Building Blocks. Common source code fo
See the examples that use the GUI
(stereo ,
- tachyon ,
+ tachyon ,
seismic ,
fractal )
for more details.
@@ -360,21 +360,23 @@ Intel® Threading Building Blocks. Common source code fo
Most Intel TBB examples allow to specify n-of-threads , the set of thread numbers that should be used to run an example.
Usually, it is a range of the form low[:high[:(+|*|#)S]] , where low and optional high
- are non-negative integers or 'auto' for the default choice, and optional step expression (+|*|#)S
+ are non-negative integers or 'auto' for the default choice, and optional step expression (+|*|#)S
specifies how thread numbers are chosen within the range:
With +/* , the previous number is incremented/multiplied by S .
E.g., expression '12:16:+1' means 12,13,14,15,16 threads, and '1:16:*2' means 1,2,4,8,16 threads.
With # , S is the desired number of steps between any subsequent powers of 2;
- it must be a power of 2 on its own, with most meaningful values being 2, 4, and 8.
+ it must be a power of 2 on its own, with most meaningful values being 2, 4, and 8.
For a given number of threads, the actual step value is computed as the quotient
of the nearest smaller power of 2 divided by the number of steps, but is at least 1.
E.g., '1:32:#4' means 1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32 threads;
note the step doubling at 8 and 16 to keep 4 steps between powers of 2.
A default value for the number of threads can be customized in an example. If not customized, it is '1:auto:#4'.
- The 'auto' parameter is substituted with a value returned by a specified function, which typically is
- tbb::task_scheduler_init::default_num_threads()
.
+ The 'auto' parameter is substituted with a value returned by a specified function
+ (this function is typically utility::get_default_num_threads()
, which returns a copy of
+ constant that was initialized with tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism)
+ at the start of the program).
@@ -388,7 +390,7 @@ Intel® Threading Building Blocks. Common source code fo
Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
- * Other names and brands may be claimed as the property of others.
+ * Other names and brands may be claimed as the property of others.
© 2019, Intel Corporation
diff --git a/examples/common/utility/get_default_num_threads.h b/examples/common/utility/get_default_num_threads.h
new file mode 100644
index 0000000000..6af6d970e8
--- /dev/null
+++ b/examples/common/utility/get_default_num_threads.h
@@ -0,0 +1,32 @@
+/*
+ Copyright (c) 2005-2019 Intel Corporation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+#ifndef GET_DEFAULT_NUM_THREADS_H_
+#define GET_DEFAULT_NUM_THREADS_H_
+
+#include "tbb/global_control.h"
+
+namespace utility {
+ inline int get_default_num_threads() {
+ #if __TBB_MIC_OFFLOAD
+ #pragma offload target(mic) out(default_num_threads)
+ #endif // __TBB_MIC_OFFLOAD
+ static size_t default_num_threads = tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism);
+ return static_cast(default_num_threads);
+ }
+}
+
+#endif /* GET_DEFAULT_NUM_THREADS_H_ */
diff --git a/examples/common/utility/utility.h b/examples/common/utility/utility.h
index ab55007ce0..f146f9debd 100644
--- a/examples/common/utility/utility.h
+++ b/examples/common/utility/utility.h
@@ -99,9 +99,10 @@ namespace utility{
template
class type_impl : public type_base {
private:
+ type_impl(const type_impl& src) : type_base(src.name, src.description), target(src.target),
+ validating_function(src.validating_function) {}
type_impl& operator=(const type_impl&);
typedef bool(*validating_function_type)(const type&);
- private:
type & target;
validating_function_type validating_function;
public:
@@ -419,10 +420,10 @@ namespace utility{
int first; // 0<=first (0 can be used as a special value)
int last; // first<=last
- internal::thread_range_step step;
+ ::utility::internal::thread_range_step step;
thread_number_range( int (*auto_number_of_threads_)(),int low_=1, int high_=-1
- , internal::thread_range_step step_ = internal::thread_range_step(internal::step_function_power2_ladder,4)
+ , ::utility::internal::thread_range_step step_ = ::utility::internal::thread_range_step(::utility::internal::step_function_power2_ladder,4)
)
: auto_number_of_threads(auto_number_of_threads_), first(low_), last((high_>-1) ? high_ : auto_number_of_threads_())
,step(step_)
@@ -484,7 +485,7 @@ namespace utility{
"\n\twhere low and optional high are non-negative integers or 'auto' for the default choice,"
"\n\tand optional step expression specifies how thread numbers are chosen within the range."
"\n\tSee examples/common/index.html for detailed description."
- ;
+ ;
inline void report_elapsed_time(double seconds){
std::cout<<"elapsed time : "<. */
typedef std::basic_string,tbb::tbb_allocator > MyString;
@@ -185,7 +186,7 @@ int main( int argc, char* argv[] ) {
//! Working threads count
// The 1st argument is the function to obtain 'auto' value; the 2nd is the default value
// The example interprets 0 threads as "run serially, then fully subscribed"
- utility::thread_number_range threads(tbb::task_scheduler_init::default_num_threads,0);
+ utility::thread_number_range threads(utility::get_default_num_threads,0);
utility::parse_cli_arguments(argc,argv,
utility::cli_argument_pack()
@@ -204,18 +205,18 @@ int main( int argc, char* argv[] ) {
if ( threads.first ) {
for(int p = threads.first; p <= threads.last; p = threads.step(p)) {
if ( !silent ) printf("threads = %d ", p );
- task_scheduler_init init( p );
+ global_control c(tbb::global_control::max_allowed_parallelism, p);
CountOccurrences( p );
}
} else { // Number of threads wasn't set explicitly. Run serial and parallel version
{ // serial run
if ( !silent ) printf("serial run ");
- task_scheduler_init init_serial(1);
+ global_control c(tbb::global_control::max_allowed_parallelism, 1);
CountOccurrences(1);
}
{ // parallel run (number of threads is selected automatically)
if ( !silent ) printf("parallel run ");
- task_scheduler_init init_parallel;
+ global_control c(tbb::global_control::max_allowed_parallelism, utility::get_default_num_threads());
CountOccurrences(0);
}
}
diff --git a/examples/concurrent_hash_map/count_strings/msvs/count_strings.vcxproj b/examples/concurrent_hash_map/count_strings/msvs/count_strings.vcxproj
index 7e29463139..0f050eb72a 100644
--- a/examples/concurrent_hash_map/count_strings/msvs/count_strings.vcxproj
+++ b/examples/concurrent_hash_map/count_strings/msvs/count_strings.vcxproj
@@ -101,7 +101,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX86
@@ -127,7 +127,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX64
@@ -149,7 +149,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -176,7 +176,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/concurrent_hash_map/count_strings/xcode/count_strings.xcodeproj/project.pbxproj b/examples/concurrent_hash_map/count_strings/xcode/count_strings.xcodeproj/project.pbxproj
index 120146d552..966ca5f21f 100644
--- a/examples/concurrent_hash_map/count_strings/xcode/count_strings.xcodeproj/project.pbxproj
+++ b/examples/concurrent_hash_map/count_strings/xcode/count_strings.xcodeproj/project.pbxproj
@@ -167,7 +167,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ CLANG_CXX_LANGUAGE_STANDARD = "c++11";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
@@ -228,7 +228,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ CLANG_CXX_LANGUAGE_STANDARD = "c++11";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
diff --git a/examples/concurrent_priority_queue/shortpath/Makefile b/examples/concurrent_priority_queue/shortpath/Makefile
index 5028ce64e4..b5b5cb5585 100644
--- a/examples/concurrent_priority_queue/shortpath/Makefile
+++ b/examples/concurrent_priority_queue/shortpath/Makefile
@@ -23,9 +23,6 @@ ifneq (,$(shell which icc 2>/dev/null))
CXX=icpc
endif
-# autodetect C++11 support
-include ../../common/examples-common.inc
-
ifeq ($(shell uname), Linux)
ifeq ($(target), android)
LIBS+= --sysroot=$(SYSROOT)
@@ -37,6 +34,8 @@ else ifeq ($(shell uname), Darwin)
override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib
endif
+include ../../common/examples-common.inc
+
all: release test
release: *.cpp
diff --git a/examples/concurrent_priority_queue/shortpath/msvs/shortpath.vcxproj b/examples/concurrent_priority_queue/shortpath/msvs/shortpath.vcxproj
index 22aed9c8af..0d2ac6cfd7 100644
--- a/examples/concurrent_priority_queue/shortpath/msvs/shortpath.vcxproj
+++ b/examples/concurrent_priority_queue/shortpath/msvs/shortpath.vcxproj
@@ -101,7 +101,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX86
@@ -127,7 +127,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX64
@@ -149,7 +149,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -176,7 +176,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/concurrent_priority_queue/shortpath/shortpath.cpp b/examples/concurrent_priority_queue/shortpath/shortpath.cpp
index bbdfcf7c19..ec45ebf09d 100644
--- a/examples/concurrent_priority_queue/shortpath/shortpath.cpp
+++ b/examples/concurrent_priority_queue/shortpath/shortpath.cpp
@@ -16,18 +16,19 @@
#include
#include
+#include
#include
-#include "tbb/atomic.h"
#include "tbb/tick_count.h"
-#include "tbb/task_scheduler_init.h"
#include "tbb/task_group.h"
#include "tbb/concurrent_priority_queue.h"
#include "tbb/spin_mutex.h"
#include "tbb/parallel_for.h"
#include "tbb/blocked_range.h"
+#include "tbb/global_control.h"
#include "../../common/utility/utility.h"
#include "../../common/utility/fast_random.h"
+#include "../../common/utility/get_default_num_threads.h"
#if defined(_MSC_VER) && defined(_Wp64)
// Workaround for overzealous compiler warnings in /Wp64 mode
@@ -74,24 +75,24 @@ typedef size_t vertex_id;
typedef std::pair vertex_rec;
typedef vector > edge_set;
-bool verbose = false; // prints bin details and other diagnostics to screen
-bool silent = false; // suppress all output except for time
-size_t N = 1000; // number of vertices
-size_t src = 0; // start of path
-size_t dst = N-1; // end of path
-double INF=100000.0; // infinity
-size_t grainsize = 16; // number of vertices per task on average
-size_t max_spawn; // max tasks to spawn
-tbb::atomic num_spawn; // number of active tasks
-
-point_set vertices; // vertices
-edge_set edges; // edges
-vector predecessor; // for recreating path from src to dst
-
-vector f_distance; // estimated distances at particular vertex
-vector g_distance; // current shortest distances from src vertex
-spin_mutex *locks; // a lock for each vertex
-task_group *sp_group; // task group for tasks executing sub-problems
+bool verbose = false; // prints bin details and other diagnostics to screen
+bool silent = false; // suppress all output except for time
+size_t N = 1000; // number of vertices
+size_t src = 0; // start of path
+size_t dst = N-1; // end of path
+double INF=100000.0; // infinity
+size_t grainsize = 16; // number of vertices per task on average
+size_t max_spawn; // max tasks to spawn
+std::atomic num_spawn; // number of active tasks
+
+point_set vertices; // vertices
+edge_set edges; // edges
+vector predecessor; // for recreating path from src to dst
+
+vector f_distance; // estimated distances at particular vertex
+vector g_distance; // current shortest distances from src vertex
+spin_mutex *locks; // a lock for each vertex
+task_group *sp_group; // task group for tasks executing sub-problems
class compare_f {
public:
@@ -200,13 +201,6 @@ void print_path() {
else if (!silent) printf(" %5.1f\n", path_length);
}
-int get_default_num_threads() {
- static int threads = 0;
- if (threads == 0)
- threads = tbb::task_scheduler_init::default_num_threads();
- return threads;
-}
-
#if !__TBB_CPP11_LAMBDAS_PRESENT
class gen_vertices {
public:
@@ -246,7 +240,7 @@ class reset_vertices {
#endif
void InitializeGraph() {
- task_scheduler_init init(get_default_num_threads());
+ global_control c(tbb::global_control::max_allowed_parallelism, utility::get_default_num_threads());
vertices.resize(N);
edges.resize(N);
predecessor.resize(N);
@@ -294,7 +288,7 @@ void ReleaseGraph() {
}
void ResetGraph() {
- task_scheduler_init init(get_default_num_threads());
+ global_control c(tbb::global_control::max_allowed_parallelism, utility::get_default_num_threads());
#if __TBB_CPP11_LAMBDAS_PRESENT
parallel_for(blocked_range(0,N),
[&](blocked_range& r) {
@@ -310,7 +304,7 @@ void ResetGraph() {
int main(int argc, char *argv[]) {
try {
- utility::thread_number_range threads(get_default_num_threads);
+ utility::thread_number_range threads(utility::get_default_num_threads);
utility::parse_cli_arguments(argc, argv,
utility::cli_argument_pack()
//"-h" option for displaying help is present implicitly
@@ -339,7 +333,7 @@ int main(int argc, char *argv[]) {
InitializeGraph();
for (int n_thr=threads.first; n_thr<=threads.last; n_thr=threads.step(n_thr)) {
ResetGraph();
- task_scheduler_init init(n_thr);
+ global_control c(tbb::global_control::max_allowed_parallelism, n_thr);
t0 = tick_count::now();
shortpath();
t1 = tick_count::now();
diff --git a/examples/concurrent_priority_queue/shortpath/xcode/shortpath.xcodeproj/project.pbxproj b/examples/concurrent_priority_queue/shortpath/xcode/shortpath.xcodeproj/project.pbxproj
index 1af55b14fc..6b2f38d542 100644
--- a/examples/concurrent_priority_queue/shortpath/xcode/shortpath.xcodeproj/project.pbxproj
+++ b/examples/concurrent_priority_queue/shortpath/xcode/shortpath.xcodeproj/project.pbxproj
@@ -169,6 +169,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
@@ -228,6 +229,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
diff --git a/examples/graph/binpack/Makefile b/examples/graph/binpack/Makefile
index d9d11f773b..cc98a0789f 100644
--- a/examples/graph/binpack/Makefile
+++ b/examples/graph/binpack/Makefile
@@ -34,13 +34,16 @@ else ifeq ($(shell uname), Darwin)
override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib
endif
+# autodetect C++11 support
+include ../../common/examples-common.inc
+
all: release test
release: *.cpp
- $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS)
+ $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS) $(CXX0XFLAGS)
debug: *.cpp
- $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS)
+ $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS) $(CXX0XFLAGS)
profile: override CXXFLAGS += -DTBB_USE_THREADING_TOOLS -g
profile: release
diff --git a/examples/graph/binpack/binpack.cpp b/examples/graph/binpack/binpack.cpp
index d089ab0ae9..79c4bd4c58 100644
--- a/examples/graph/binpack/binpack.cpp
+++ b/examples/graph/binpack/binpack.cpp
@@ -22,14 +22,14 @@
#include
#include
#include
-#include "tbb/atomic.h"
-#include "tbb/task_scheduler_init.h"
+#include
#include "tbb/tick_count.h"
#include "tbb/flow_graph.h"
+#include "tbb/global_control.h"
#include "../../common/utility/utility.h"
+#include "../../common/utility/get_default_num_threads.h"
using tbb::tick_count;
-using tbb::task_scheduler_init;
using namespace tbb::flow;
typedef size_t size_type; // to represent non-zero indices, capacities, etc.
@@ -62,9 +62,9 @@ size_type min_B; // lower bound on the optimal number of bins
size_type B; // the answer, i.e. number of bins used by the algorithm
size_type *input_array; // stores randomly generated input values
value_type item_sum; // sum of all randomly generated input values
-tbb::atomic packed_sum; // sum of all values currently packed into all bins
-tbb::atomic packed_items; // number of values currently packed into all bins
-tbb::atomic active_bins; // number of active bin_packers
+std::atomic packed_sum; // sum of all values currently packed into all bins
+std::atomic packed_items; // number of values currently packed into all bins
+std::atomic active_bins; // number of active bin_packers
bin_packer **bins; // the array of bin packers
// This class is the Body type for bin_packer
@@ -218,16 +218,9 @@ class bin_printer {
}
};
-int get_default_num_threads() {
- static int threads = 0;
- if (threads == 0)
- threads = task_scheduler_init::default_num_threads();
- return threads;
-}
-
int main(int argc, char *argv[]) {
try {
- utility::thread_number_range threads(get_default_num_threads);
+ utility::thread_number_range threads(utility::get_default_num_threads);
utility::parse_cli_arguments(argc, argv,
utility::cli_argument_pack()
//"-h" option for displaying help is present implicitly
@@ -255,7 +248,7 @@ int main(int argc, char *argv[]) {
tick_count start = tick_count::now();
for(int p = threads.first; p <= threads.last; p = threads.step(p)) {
- task_scheduler_init init(p);
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, p);
packed_sum = 0;
packed_items = 0;
B = 0;
diff --git a/examples/graph/binpack/msvs/binpack.vcxproj b/examples/graph/binpack/msvs/binpack.vcxproj
index 5946c6681e..620a672fd8 100644
--- a/examples/graph/binpack/msvs/binpack.vcxproj
+++ b/examples/graph/binpack/msvs/binpack.vcxproj
@@ -101,7 +101,7 @@
tbb_debug.lib;tbbmalloc_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX86
@@ -127,7 +127,7 @@
tbb_debug.lib;tbbmalloc_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX64
@@ -149,7 +149,7 @@
tbb.lib;tbbmalloc.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -176,7 +176,7 @@
tbb.lib;tbbmalloc.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/graph/binpack/xcode/binpack.xcodeproj/project.pbxproj b/examples/graph/binpack/xcode/binpack.xcodeproj/project.pbxproj
index ad27f7251b..1c199b809e 100644
--- a/examples/graph/binpack/xcode/binpack.xcodeproj/project.pbxproj
+++ b/examples/graph/binpack/xcode/binpack.xcodeproj/project.pbxproj
@@ -169,6 +169,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
@@ -202,6 +203,7 @@
"$(TBBROOT)/include",
/opt/intel/tbb/include,
);
+ ICC_CXX_LANG_DIALECT = "c++11";
LD_RUNPATH_SEARCH_PATHS = "$(TBBROOT)/lib /opt/intel/tbb/lib";
LIBRARY_SEARCH_PATHS = (
"$(TBBROOT)/lib",
@@ -227,6 +229,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
@@ -259,6 +262,7 @@
"$(TBBROOT)/include",
/opt/intel/tbb/include,
);
+ ICC_CXX_LANG_DIALECT = "c++11";
LD_RUNPATH_SEARCH_PATHS = "$(TBBROOT)/lib /opt/intel/tbb/lib";
LIBRARY_SEARCH_PATHS = (
"$(TBBROOT)/lib",
diff --git a/examples/graph/cholesky/Makefile b/examples/graph/cholesky/Makefile
index 7b0c7ded00..fe11dab7de 100644
--- a/examples/graph/cholesky/Makefile
+++ b/examples/graph/cholesky/Makefile
@@ -34,16 +34,16 @@ endif
override MKL_LIBS += -lmkl_rt
endif
-# C++0x support
-override CXXFLAGS += -std=c++0x
+# autodetect C++11 support
+include ../../common/examples-common.inc
all: release test
release: *.cpp
- $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(MKL_LIBS) $(LIBS)
+ $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(MKL_LIBS) $(LIBS) $(CXX0XFLAGS)
debug: *.cpp
- $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(MKL_LIBS) $(LIBS)
+ $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(MKL_LIBS) $(LIBS) $(CXX0XFLAGS)
profile: override CXXFLAGS += -DTBB_USE_THREADING_TOOLS -g
profile: release
diff --git a/examples/graph/cholesky/cholesky.cpp b/examples/graph/cholesky/cholesky.cpp
index aa4376b105..44aeb6307b 100644
--- a/examples/graph/cholesky/cholesky.cpp
+++ b/examples/graph/cholesky/cholesky.cpp
@@ -27,10 +27,11 @@
#include "tbb/tbb_config.h"
#include "tbb/flow_graph.h"
#include "tbb/tick_count.h"
-#include "tbb/task_scheduler_init.h"
+#include "tbb/global_control.h"
// Application command line arguments parsing
#include "../../common/utility/utility.h"
+#include "../../common/utility/get_default_num_threads.h"
/************************************************************
FORWARD DECLARATIONS
@@ -49,7 +50,7 @@ void matrix_init( double * &A, int &n, const char *fname );
/**********************************************
Writes a lower triangular matrix to a file
- -- first line of file is n
+ -- first line of file is n
-- subsequently 1 row per line
**********************************************/
void matrix_write ( double *A, int n, const char *fname, bool is_triangular = false );
@@ -58,11 +59,11 @@ void matrix_write ( double *A, int n, const char *fname, bool is_triangular = fa
GLOBAL VARIABLES
************************************************************/
bool g_benchmark_run = false;
-int g_num_tbb_threads = tbb::task_scheduler_init::default_num_threads();
int g_n = -1, g_b = -1, g_num_trials = 1;
char *g_input_file_name = NULL;
char *g_output_prefix = NULL;
std::string g_alg_name;
+int g_num_tbb_threads;
// Creates tiled array
static double ***create_tile_array( double *A, int n, int b ) {
@@ -210,7 +211,7 @@ static void call_dpotf2( double ***tile, int b, int k ) {
double *A_block = tile[k][k];
char uplo = 'l';
int info = 0;
- dpotf2( &uplo, &b, A_block, &b, &info );
+ dpotf2( &uplo, &b, A_block, &b, &info );
return;
}
@@ -320,7 +321,7 @@ class dpotf2_body {
dpotf2( &uplo, &b, A_block, &b, &info );
// Send to dtrsms in same column
- // k == k j == k
+ // k == k j == k
t.a[2] = k;
for ( int j = k+1; j < p; ++j ) {
t.a[1] = j;
@@ -390,7 +391,7 @@ class dsyr2k_body {
int j = in2.first.a[1];
int i = in2.first.a[2];
- tile_t A_block = in2.second;
+ tile_t A_block = in2.second;
if ( i == j ) { // Diagonal block
tile_t L_block = in0.second;
dsyrk( &uplo, &transa, &b, &b, &alpha, L_block, &b, &beta, A_block, &b );
@@ -660,6 +661,7 @@ bool process_args( int argc, char *argv[] ) {
}
int main(int argc, char *argv[]) {
+ g_num_tbb_threads = utility::get_default_num_threads();
typedef std::map< std::string, algorithm * > algmap_t;
algmap_t algmap;
@@ -674,7 +676,7 @@ int main(int argc, char *argv[]) {
exit( 1 );
}
- tbb::task_scheduler_init init( g_num_tbb_threads );
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, g_num_tbb_threads);
double *A = NULL;
// Read input matrix
diff --git a/examples/graph/cholesky/msvs/cholesky.vcxproj b/examples/graph/cholesky/msvs/cholesky.vcxproj
index d906a466c2..67c7c8f2b7 100644
--- a/examples/graph/cholesky/msvs/cholesky.vcxproj
+++ b/examples/graph/cholesky/msvs/cholesky.vcxproj
@@ -102,7 +102,7 @@
tbb_debug.lib;mkl_rt.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(MKLROOT)\lib\ia32;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(MKLROOT)\lib\ia32;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX86
@@ -129,7 +129,7 @@
tbb_debug.lib;mkl_rt.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(MKLROOT)\lib\intel64;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(MKLROOT)\lib\intel64;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX64
@@ -152,7 +152,7 @@
tbb.lib;mkl_rt.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(MKLROOT)\lib\ia32;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(MKLROOT)\lib\ia32;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -180,7 +180,7 @@
tbb.lib;mkl_rt.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(MKLROOT)\lib\intel64;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(MKLROOT)\lib\intel64;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/graph/cholesky/xcode/cholesky.xcodeproj/project.pbxproj b/examples/graph/cholesky/xcode/cholesky.xcodeproj/project.pbxproj
index 041d3bc198..87f4d6907b 100644
--- a/examples/graph/cholesky/xcode/cholesky.xcodeproj/project.pbxproj
+++ b/examples/graph/cholesky/xcode/cholesky.xcodeproj/project.pbxproj
@@ -171,6 +171,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
@@ -233,6 +234,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
diff --git a/examples/graph/dining_philosophers/Makefile b/examples/graph/dining_philosophers/Makefile
index fd86266600..6fd81a655b 100644
--- a/examples/graph/dining_philosophers/Makefile
+++ b/examples/graph/dining_philosophers/Makefile
@@ -33,13 +33,16 @@ else ifeq ($(shell uname), Darwin)
override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib
endif
+# autodetect C++11 support
+include ../../common/examples-common.inc
+
all: release test
release: dining_philosophers.cpp
- $(CXX) -O2 -DNDEBUG -D_CONSOLE $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS)
+ $(CXX) -O2 -DNDEBUG -D_CONSOLE $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS) $(CXX0XFLAGS)
debug: dining_philosophers.cpp
- $(CXX) -O0 -D_CONSOLE -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS)
+ $(CXX) -O0 -D_CONSOLE -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS) $(CXX0XFLAGS)
profile: override CXXFLAGS += -DTBB_USE_THREADING_TOOLS -g
profile: release
diff --git a/examples/graph/dining_philosophers/dining_philosophers.cpp b/examples/graph/dining_philosophers/dining_philosophers.cpp
index e052e07a08..672040864e 100644
--- a/examples/graph/dining_philosophers/dining_philosophers.cpp
+++ b/examples/graph/dining_philosophers/dining_philosophers.cpp
@@ -20,13 +20,14 @@
#endif
#include "tbb/flow_graph.h"
-#include "tbb/task_scheduler_init.h"
#include "tbb/tick_count.h"
-#include "tbb/tbb_thread.h"
-#include "tbb/atomic.h"
#include "tbb/spin_mutex.h"
+#include "tbb/global_control.h"
#include
+#include
+#include
#include "../../common/utility/utility.h"
+#include "../../common/utility/get_default_num_threads.h"
#include
#include
@@ -45,8 +46,8 @@
// eat() function_node. The output of the eat() function_node is sent to the forward()
// multifunction_node.
-const tbb::tick_count::interval_t think_time(1.0);
-const tbb::tick_count::interval_t eat_time(1.0);
+const std::chrono::seconds think_time (1);
+const std::chrono::seconds eat_time (1);
const int num_times = 10;
tbb::tick_count t0;
@@ -69,8 +70,8 @@ struct RunOptions {
};
RunOptions ParseCommandLine(int argc, char *argv[]) {
- int auto_threads = tbb::task_scheduler_init::default_num_threads();
- utility::thread_number_range threads(tbb::task_scheduler_init::default_num_threads, auto_threads, auto_threads);
+ int auto_threads = utility::get_default_num_threads();
+ utility::thread_number_range threads(utility::get_default_num_threads, auto_threads, auto_threads);
int nPhilosophers = 5;
bool verbose = false;
char charbuf[100];
@@ -198,7 +199,7 @@ void philosopher::eat() {
tbb::spin_mutex::scoped_lock lock(my_mutex);
std::printf("%s eating\n", name());
}
- tbb::this_tbb_thread::sleep(eat_time);
+ std::this_thread::sleep_for(eat_time);
if(verbose) {
tbb::spin_mutex::scoped_lock lock(my_mutex);
std::printf("%s done eating\n", name());
@@ -210,7 +211,7 @@ void philosopher::think() {
tbb::spin_mutex::scoped_lock lock(my_mutex);
std::printf("%s thinking\n", name());
}
- tbb::this_tbb_thread::sleep(think_time);
+ std::this_thread::sleep_for(think_time);
if(verbose) {
tbb::spin_mutex::scoped_lock lock(my_mutex);
std::printf("%s done thinking\n", name());
@@ -231,7 +232,7 @@ int main(int argc, char *argv[]) {
for(num_threads = options.threads.first; num_threads <= options.threads.last; num_threads = options.threads.step(num_threads)) {
- tbb::task_scheduler_init init(num_threads);
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, num_threads);
graph g;
diff --git a/examples/graph/dining_philosophers/msvs/dining_philosophers.vcxproj b/examples/graph/dining_philosophers/msvs/dining_philosophers.vcxproj
index 78b0ae2807..53e5ce2503 100644
--- a/examples/graph/dining_philosophers/msvs/dining_philosophers.vcxproj
+++ b/examples/graph/dining_philosophers/msvs/dining_philosophers.vcxproj
@@ -101,7 +101,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX86
@@ -127,7 +127,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX64
@@ -149,7 +149,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -176,7 +176,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/graph/dining_philosophers/xcode/dining_philosophers.xcodeproj/project.pbxproj b/examples/graph/dining_philosophers/xcode/dining_philosophers.xcodeproj/project.pbxproj
index 7a3535da4a..9b3462c09d 100644
--- a/examples/graph/dining_philosophers/xcode/dining_philosophers.xcodeproj/project.pbxproj
+++ b/examples/graph/dining_philosophers/xcode/dining_philosophers.xcodeproj/project.pbxproj
@@ -177,6 +177,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
@@ -235,6 +236,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
diff --git a/examples/graph/fgbzip2/Makefile b/examples/graph/fgbzip2/Makefile
index cf1ab954f2..b93daa8c0a 100644
--- a/examples/graph/fgbzip2/Makefile
+++ b/examples/graph/fgbzip2/Makefile
@@ -24,22 +24,22 @@ ifneq (,$(shell which icc 2>/dev/null))
CXX=icpc
endif
-# autodetect C++11 support
-include ../../common/examples-common.inc
-
ifeq ($(shell uname), Linux)
LIBS+= -lrt -lpthread
else ifeq ($(shell uname), Darwin)
override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib
endif
+# autodetect C++11 support
+include ../../common/examples-common.inc
+
all: release test
release:
$(CXX) -O2 -DNDEBUG *.cpp $(CXXFLAGS) -o $(PROG) -ltbb $(LIBS) $(CXX0XFLAGS)
debug:
- $(CXX) -O0 -g -DTBB_USE_DEBUG *.cpp $(CXXFLAGS) -o $(PROG) -ltbb_debug $(LIBS) $(CXX0XFLAGS)
+ $(CXX) -O0 -g -DTBB_USE_DEBUG *.cpp $(CXXFLAGS) -o $(PROG) -ltbb_debug $(LIBS) $(CXX0XFLAGS)
profile: override CXXFLAGS += -DTBB_USE_THREADING_TOOLS -g
profile: release
diff --git a/examples/graph/fgbzip2/fgbzip2.cpp b/examples/graph/fgbzip2/fgbzip2.cpp
index c9cd43f875..c2261928a0 100644
--- a/examples/graph/fgbzip2/fgbzip2.cpp
+++ b/examples/graph/fgbzip2/fgbzip2.cpp
@@ -25,12 +25,12 @@
#include
#include
#include
+#include
#include "bzlib.h"
#include "tbb/flow_graph.h"
#include "tbb/tick_count.h"
-#include "tbb/compat/thread"
#include "tbb/concurrent_queue.h"
// TODO: change memory allocation/deallocation to be managed in constructor/destructor
diff --git a/examples/graph/fgbzip2/msvs/fgbzip2.vcxproj b/examples/graph/fgbzip2/msvs/fgbzip2.vcxproj
index bf28d99e1a..4d6ae7f4b5 100644
--- a/examples/graph/fgbzip2/msvs/fgbzip2.vcxproj
+++ b/examples/graph/fgbzip2/msvs/fgbzip2.vcxproj
@@ -102,7 +102,7 @@
tbb_debug.lib;tbbmalloc_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX86
@@ -129,7 +129,7 @@
tbb_debug.lib;tbbmalloc_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX64
@@ -152,7 +152,7 @@
tbb.lib;tbbmalloc.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -180,7 +180,7 @@
tbb.lib;tbbmalloc.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/graph/fgbzip2/xcode/fgbzip2.xcodeproj/project.pbxproj b/examples/graph/fgbzip2/xcode/fgbzip2.xcodeproj/project.pbxproj
index 69f17bd87c..a2de5c60b1 100644
--- a/examples/graph/fgbzip2/xcode/fgbzip2.xcodeproj/project.pbxproj
+++ b/examples/graph/fgbzip2/xcode/fgbzip2.xcodeproj/project.pbxproj
@@ -201,7 +201,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ CLANG_CXX_LANGUAGE_STANDARD = "c++11";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
@@ -258,7 +258,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ CLANG_CXX_LANGUAGE_STANDARD = "c++11";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
diff --git a/examples/graph/logic_sim/Makefile b/examples/graph/logic_sim/Makefile
index 1aaee5ca94..5a626eb904 100644
--- a/examples/graph/logic_sim/Makefile
+++ b/examples/graph/logic_sim/Makefile
@@ -34,13 +34,16 @@ else ifeq ($(shell uname), Darwin)
override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib
endif
+# autodetect C++11 support
+include ../../common/examples-common.inc
+
all: release test
release: *.cpp
- $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $(PROG).cpp -std=c++0x -ltbb $(LIBS)
+ $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $(PROG).cpp -std=c++11 -ltbb $(LIBS) $(CXX0XFLAGS)
debug: *.cpp
- $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $(PROG).cpp -std=c++0x -ltbb_debug $(LIBS)
+ $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $(PROG).cpp -std=c++11 -ltbb_debug $(LIBS) $(CXX0XFLAGS)
profile: override CXXFLAGS += -DTBB_USE_THREADING_TOOLS -g
profile: release
diff --git a/examples/graph/logic_sim/basics.h b/examples/graph/logic_sim/basics.h
index 76aa3a1145..b696d62c9a 100644
--- a/examples/graph/logic_sim/basics.h
+++ b/examples/graph/logic_sim/basics.h
@@ -19,8 +19,6 @@
#include
#include
-#include "tbb/atomic.h"
-#include "tbb/task_scheduler_init.h"
#include "tbb/tick_count.h"
#include "tbb/flow_graph.h"
#include "../../common/utility/utility.h"
@@ -167,7 +165,7 @@ class steady_signal {
~steady_signal() {}
// Assignment is ignored
steady_signal& operator=(const steady_signal& src) { return *this; }
- sender& get_out() { return signal_node; }
+ write_once_node& get_out() { return signal_node; }
void activate() { signal_node.try_put(init_signal); }
};
@@ -208,7 +206,7 @@ class pulse {
ms = src.ms; init_ms = src.init_ms; reps = src.reps; init_reps = src.init_reps;
return *this;
}
- sender& get_out() { return clock_node; }
+ source_node& get_out() { return clock_node; }
void activate() { clock_node.activate(); }
void reset() { reps = init_reps; }
};
@@ -227,7 +225,7 @@ class push_button {
~push_button() {}
// Assignment is ignored
push_button& operator=(const push_button& src) { return *this; }
- sender& get_out() { return push_button_node; }
+ overwrite_node& get_out() { return push_button_node; }
void press() { push_button_node.try_put(high); }
void release() { push_button_node.try_put(low); }
};
@@ -243,7 +241,7 @@ class toggle {
~toggle() {}
// Assignment ignored
toggle& operator=(const toggle& src) { return *this; }
- sender& get_out() { return toggle_node; }
+ overwrite_node& get_out() { return toggle_node; }
void flip() {
if (state==high) state = low;
else state = high;
@@ -494,7 +492,7 @@ class led {
label = src.label; state = undefined; report_changes = src.report_changes;
return *this;
}
- receiver& get_in() { return led_node; }
+ function_node& get_in() { return led_node; }
void display() {
if (state == high) printf("%s: (*)\n", label.c_str());
else if (state == low) printf("%s: ( )\n", label.c_str());
diff --git a/examples/graph/logic_sim/msvs/logic_sim.vcxproj b/examples/graph/logic_sim/msvs/logic_sim.vcxproj
index 922e86b2ce..7c7725fce2 100644
--- a/examples/graph/logic_sim/msvs/logic_sim.vcxproj
+++ b/examples/graph/logic_sim/msvs/logic_sim.vcxproj
@@ -101,7 +101,7 @@
tbb_debug.lib;tbbmalloc_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX86
@@ -127,7 +127,7 @@
tbb_debug.lib;tbbmalloc_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX64
@@ -149,7 +149,7 @@
tbb.lib;tbbmalloc.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -176,7 +176,7 @@
tbb.lib;tbbmalloc.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/graph/logic_sim/test_all.cpp b/examples/graph/logic_sim/test_all.cpp
index 6613561ab8..95c1857df6 100644
--- a/examples/graph/logic_sim/test_all.cpp
+++ b/examples/graph/logic_sim/test_all.cpp
@@ -15,9 +15,11 @@
*/
#include "tbb/tbb_config.h"
+#include "tbb/global_control.h"
#include
#include "../../common/utility/utility.h"
+#include "../../common/utility/get_default_num_threads.h"
#if __TBB_FLOW_GRAPH_CPP11_FEATURES
@@ -41,19 +43,12 @@
bool verbose = false; // prints bin details and other diagnostics to screen
bool silent = false; // suppress all output except for time
-int get_default_num_threads() {
- static int threads = 0;
- if (threads == 0)
- threads = tbb::task_scheduler_init::default_num_threads();
- return threads;
-}
-
#endif // __TBB_FLOW_GRAPH_CPP11_FEATURES
int main(int argc, char *argv[]) {
#if __TBB_FLOW_GRAPH_CPP11_FEATURES
try {
- utility::thread_number_range threads(get_default_num_threads);
+ utility::thread_number_range threads(utility::get_default_num_threads);
utility::parse_cli_arguments(argc, argv,
utility::cli_argument_pack()
//"-h" option for displaying help is present implicitly
@@ -66,19 +61,19 @@ int main(int argc, char *argv[]) {
tick_count start = tick_count::now();
for(int p = threads.first; p <= threads.last; p = threads.step(p)) {
- task_scheduler_init init(p);
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, p);
if (!silent) cout << "graph test running on " << p << " threads.\n";
-
+
graph g;
{ // test buffer: 0, 1
buffer b(g);
toggle input(g);
led output(g, "OUTPUT", false); // false means we will explicitly call display to see LED
-
+
make_edge(input.get_out(), input_port<0>(b));
make_edge(output_port<0>(b), output.get_in());
-
+
if (!silent) printf("Testing buffer...\n");
input.activate(); // 0
g.wait_for_all();
@@ -94,10 +89,10 @@ int main(int argc, char *argv[]) {
not_gate n(g);
toggle input(g);
led output(g, "OUTPUT", false);
-
+
make_edge(input.get_out(), input_port<0>(n));
make_edge(output_port<0>(n), output.get_in());
-
+
if (!silent) printf("Testing not_gate...\n");
input.activate(); // 0
g.wait_for_all();
@@ -114,11 +109,11 @@ int main(int argc, char *argv[]) {
toggle input0(g);
toggle input1(g);
led output(g, "OUTPUT", false);
-
+
make_edge(input0.get_out(), input_port<0>(a));
make_edge(input1.get_out(), input_port<1>(a));
make_edge(output_port<0>(a), output.get_in());
-
+
if (!silent) printf("Testing and_gate...\n");
input1.activate(); input0.activate(); // 0 0
g.wait_for_all();
@@ -144,12 +139,12 @@ int main(int argc, char *argv[]) {
toggle input1(g);
toggle input2(g);
led output(g, "OUTPUT", false);
-
+
make_edge(input0.get_out(), input_port<0>(o));
make_edge(input1.get_out(), input_port<1>(o));
make_edge(input2.get_out(), input_port<2>(o));
make_edge(output_port<0>(o), output.get_in());
-
+
if (!silent) printf("Testing or_gate...\n");
input2.activate(); input1.activate(); input0.activate(); // 0 0 0
g.wait_for_all();
@@ -190,11 +185,11 @@ int main(int argc, char *argv[]) {
toggle input0(g);
toggle input1(g);
led output(g, "OUTPUT", false);
-
+
make_edge(input0.get_out(), input_port<0>(x));
make_edge(input1.get_out(), input_port<1>(x));
make_edge(output_port<0>(x), output.get_in());
-
+
if (!silent) printf("Testing xor_gate...\n");
input1.activate(); input0.activate(); // 0 0
g.wait_for_all();
@@ -220,11 +215,11 @@ int main(int argc, char *argv[]) {
toggle input0(g);
toggle input1(g);
led output(g, "OUTPUT", false);
-
+
make_edge(input0.get_out(), input_port<0>(n));
make_edge(input1.get_out(), input_port<1>(n));
make_edge(output_port<0>(n), output.get_in());
-
+
if (!silent) printf("Testing nor_gate...\n");
input1.activate(); input0.activate(); // 0 0
g.wait_for_all();
@@ -252,7 +247,7 @@ int main(int argc, char *argv[]) {
xor_gate<2> x(g);
nor_gate<2> n(g);
digit output(g, "OUTPUT", false);
-
+
make_edge(input0.get_out(), input_port<0>(a));
make_edge(input1.get_out(), input_port<1>(a));
make_edge(output_port<0>(a), input_port<0>(output));
@@ -268,7 +263,7 @@ int main(int argc, char *argv[]) {
make_edge(input0.get_out(), input_port<0>(n));
make_edge(input1.get_out(), input_port<1>(n));
make_edge(output_port<0>(n), input_port<3>(output));
-
+
if (!silent) printf("Testing steady_signal...\n");
input0.activate(); // 1
input1.activate(); // 0
@@ -300,31 +295,31 @@ int main(int argc, char *argv[]) {
toggle CarryIN(g);
led Sum(g, "SUM");
led CarryOUT(g, "CarryOUT");
-
+
make_edge(A.get_out(), input_port(my_adder));
make_edge(B.get_out(), input_port(my_adder));
make_edge(CarryIN.get_out(), input_port(my_adder));
make_edge(output_port(my_adder), Sum.get_in());
make_edge(output_port<1>(my_adder), CarryOUT.get_in());
-
+
A.activate();
B.activate();
CarryIN.activate();
-
+
if (!silent) printf("A on\n");
A.flip();
g.wait_for_all();
if (!silent) Sum.display();
if (!silent) CarryOUT.display();
assert((Sum.get_value() == high) && (CarryOUT.get_value() == low));
-
+
if (!silent) printf("A off\n");
A.flip();
g.wait_for_all();
if (!silent) Sum.display();
if (!silent) CarryOUT.display();
assert((Sum.get_value() == low) && (CarryOUT.get_value() == low));
-
+
if (!silent) printf("B on\n");
B.flip();
g.wait_for_all();
@@ -337,7 +332,7 @@ int main(int argc, char *argv[]) {
if (!silent) Sum.display();
if (!silent) CarryOUT.display();
assert((Sum.get_value() == low) && (CarryOUT.get_value() == low));
-
+
if (!silent) printf("CarryIN on\n");
CarryIN.flip();
g.wait_for_all();
@@ -350,7 +345,7 @@ int main(int argc, char *argv[]) {
if (!silent) Sum.display();
if (!silent) CarryOUT.display();
assert((Sum.get_value() == low) && (CarryOUT.get_value() == low));
-
+
if (!silent) printf("A&B on\n");
A.flip();
B.flip();
@@ -365,7 +360,7 @@ int main(int argc, char *argv[]) {
if (!silent) Sum.display();
if (!silent) CarryOUT.display();
assert((Sum.get_value() == low) && (CarryOUT.get_value() == low));
-
+
if (!silent) printf("A&CarryIN on\n");
A.flip();
CarryIN.flip();
@@ -380,7 +375,7 @@ int main(int argc, char *argv[]) {
if (!silent) Sum.display();
if (!silent) CarryOUT.display();
assert((Sum.get_value() == low) && (CarryOUT.get_value() == low));
-
+
if (!silent) printf("B&CarryIN on\n");
B.flip();
CarryIN.flip();
@@ -395,7 +390,7 @@ int main(int argc, char *argv[]) {
if (!silent) Sum.display();
if (!silent) CarryOUT.display();
assert((Sum.get_value() == low) && (CarryOUT.get_value() == low));
-
+
if (!silent) printf("A&B&CarryIN on\n");
A.flip();
B.flip();
@@ -429,7 +424,7 @@ int main(int argc, char *argv[]) {
make_edge(output_port(two_adder), input_port<0>(Sum));
make_edge(A[1].get_out(), input_port(two_adder));
- make_edge(B[1].get_out(), input_port(two_adder));
+ make_edge(B[1].get_out(), input_port(two_adder));
make_edge(output_port(two_adder), input_port<1>(Sum));
make_edge(CarryIN.get_out(), input_port(two_adder));
@@ -484,21 +479,21 @@ int main(int argc, char *argv[]) {
make_edge(CarryIN.get_out(), input_port(four_adder));
make_edge(output_port(four_adder), CarryOUT.get_in());
-
+
// Activate all switches at low state
for (int i=0; i<4; ++i) {
A[i].activate();
B[i].activate();
}
CarryIN.activate();
-
+
if (!silent) printf("1+0\n");
A[0].flip();
g.wait_for_all();
if (!silent) Sum.display();
if (!silent) CarryOUT.display();
assert((Sum.get_value() == 1) && (CarryOUT.get_value() == low));
-
+
if (!silent) printf("0+1\n");
A[0].flip();
B[0].flip();
@@ -506,7 +501,7 @@ int main(int argc, char *argv[]) {
if (!silent) Sum.display();
if (!silent) CarryOUT.display();
assert((Sum.get_value() == 1) && (CarryOUT.get_value() == low));
-
+
if (!silent) printf("3+4\n");
A[0].flip();
A[1].flip();
@@ -516,7 +511,7 @@ int main(int argc, char *argv[]) {
if (!silent) Sum.display();
if (!silent) CarryOUT.display();
assert((Sum.get_value() == 7) && (CarryOUT.get_value() == low));
-
+
if (!silent) printf("6+1\n");
A[0].flip();
A[2].flip();
@@ -526,7 +521,7 @@ int main(int argc, char *argv[]) {
if (!silent) Sum.display();
if (!silent) CarryOUT.display();
assert((Sum.get_value() == 7) && (CarryOUT.get_value() == low));
-
+
if (!silent) printf("0+0+carry\n");
A[1].flip();
A[2].flip();
@@ -536,7 +531,7 @@ int main(int argc, char *argv[]) {
if (!silent) Sum.display();
if (!silent) CarryOUT.display();
assert((Sum.get_value() == 1) && (CarryOUT.get_value() == low));
-
+
if (!silent) printf("15+15+carry\n");
A[0].flip();
A[1].flip();
@@ -550,7 +545,7 @@ int main(int argc, char *argv[]) {
if (!silent) Sum.display();
if (!silent) CarryOUT.display();
assert((Sum.get_value() == 0xf) && (CarryOUT.get_value() == high));
-
+
if (!silent) printf("8+8\n");
A[0].flip();
A[1].flip();
@@ -563,7 +558,7 @@ int main(int argc, char *argv[]) {
if (!silent) Sum.display();
if (!silent) CarryOUT.display();
assert((Sum.get_value() == 0) && (CarryOUT.get_value() == high));
-
+
if (!silent) printf("0+0\n");
A[3].flip();
B[3].flip();
@@ -581,7 +576,7 @@ int main(int argc, char *argv[]) {
led Q(g, " Q", verbose); // if true, LEDs print at every state change
led notQ(g, "~Q", verbose);
- make_edge(D.get_out(), input_port<0>(my_d_latch));
+ make_edge(D.get_out(), input_port<0>(my_d_latch));
make_edge(E.get_out(), input_port<1>(my_d_latch));
make_edge(output_port<0>(my_d_latch), Q.get_in());
make_edge(output_port<1>(my_d_latch), notQ.get_in());
@@ -595,7 +590,7 @@ int main(int argc, char *argv[]) {
if (!silent && !verbose) { Q.display(); notQ.display(); }
assert((Q.get_value() == high) && (notQ.get_value() == low));
E.reset();
-
+
if (!silent) printf("Toggling D\n");
E.activate();
D.flip();
@@ -603,7 +598,7 @@ int main(int argc, char *argv[]) {
if (!silent && !verbose) { Q.display(); notQ.display(); }
assert((Q.get_value() == low) && (notQ.get_value() == high));
E.reset();
-
+
if (!silent) printf("Toggling D\n");
E.activate();
D.flip();
@@ -611,7 +606,7 @@ int main(int argc, char *argv[]) {
if (!silent && !verbose) { Q.display(); notQ.display(); }
assert((Q.get_value() == high) && (notQ.get_value() == low));
E.reset();
-
+
if (!silent) printf("Toggling D\n");
E.activate();
D.flip();
@@ -619,7 +614,7 @@ int main(int argc, char *argv[]) {
if (!silent && !verbose) { Q.display(); notQ.display(); }
assert((Q.get_value() == low) && (notQ.get_value() == high));
E.reset();
-
+
if (!silent) printf("Toggling D\n");
E.activate();
D.flip();
diff --git a/examples/graph/som/Makefile b/examples/graph/som/Makefile
index 9bb927190c..bc927db5a9 100644
--- a/examples/graph/som/Makefile
+++ b/examples/graph/som/Makefile
@@ -33,18 +33,21 @@ else ifeq ($(shell uname), Darwin)
override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib
endif
+# autodetect C++11 support
+include ../../common/examples-common.inc
+
all: release test
release: $(SRCFILES)
ifeq ($(compiler),xl)
# Avoiding "1586-346 (U) An error occurred during code generation. The code generation return code was 40." with -O3.
- $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(EXE) $(SRCFILES) -ltbb -ltbbmalloc $(LIBS)
+ $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(EXE) $(SRCFILES) -ltbb -ltbbmalloc $(LIBS) $(CXX0XFLAGS)
else
- $(CXX) -O3 -DNDEBUG $(CXXFLAGS) -o $(EXE) $(SRCFILES) -ltbb -ltbbmalloc $(LIBS)
+ $(CXX) -O3 -DNDEBUG $(CXXFLAGS) -o $(EXE) $(SRCFILES) -ltbb -ltbbmalloc $(LIBS) $(CXX0XFLAGS)
endif
debug: $(SRCFILES)
- $(CXX) -g -O0 -DTBB_USE_DEBUG -D_DEBUG $(CXXFLAGS) -o $(EXE) $(SRCFILES) -ltbb_debug -ltbbmalloc_debug $(LIBS)
+ $(CXX) -g -O0 -DTBB_USE_DEBUG -D_DEBUG $(CXXFLAGS) -o $(EXE) $(SRCFILES) -ltbb_debug -ltbbmalloc_debug $(LIBS) $(CXX0XFLAGS)
profile: override CXXFLAGS += -DTBB_USE_THREADING_TOOLS -g
profile: release
diff --git a/examples/graph/som/msvs/som.vcxproj b/examples/graph/som/msvs/som.vcxproj
index a29633e941..2e39b69c6c 100644
--- a/examples/graph/som/msvs/som.vcxproj
+++ b/examples/graph/som/msvs/som.vcxproj
@@ -101,7 +101,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
false
@@ -130,7 +130,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
false
@@ -155,7 +155,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -185,7 +185,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/graph/som/som_graph.cpp b/examples/graph/som/som_graph.cpp
index 2397a73e07..12461ff809 100644
--- a/examples/graph/som/som_graph.cpp
+++ b/examples/graph/som/som_graph.cpp
@@ -41,11 +41,12 @@
#define _MAIN_C_ 1
#include "som.h"
-#include "tbb/task_scheduler_init.h"
#include "tbb/flow_graph.h"
#include "tbb/blocked_range2d.h"
#include "tbb/tick_count.h"
+#include "tbb/task_arena.h"
#include "../../common/utility/utility.h"
+#include "../../common/utility/get_default_num_threads.h"
#define RED 0
#define GREEN 1
@@ -96,12 +97,19 @@ queue_node *q[SPECULATION_CNT]; // queue for function nodes
search_node_array_type* s_array[SPECULATION_CNT]; // 2d array of function nodes
graph_array_type* g_array[SPECULATION_CNT]; // 2d array of graphs
+// All graphs must locate in the same arena.
+graph* construct_graph(task_arena& ta) {
+ graph* result;
+ ta.execute([&result]{result = new graph;});
+ return result;
+}
+
// build a set of SPECULATION_CNT graphs, each of which consists of a broadcast_node,
// xranges x yranges function_nodes, and one queue_node for output.
// once speculation starts, if i % SPECULATION_CNT is the current graph, (i+1) % SPECULATION_CNT
// is the first speculation, and so on.
void
-build_BMU_graph(SOMap &map1) {
+build_BMU_graph(SOMap &map1, task_arena& ta) {
// build current graph
xsize = ((int)map1.size() + xranges - 1) / xranges;
ysize = ((int)map1[0].size() + yranges - 1) / yranges;
@@ -110,7 +118,7 @@ build_BMU_graph(SOMap &map1) {
for(int ii = 0; ii < xranges*yranges+1;++ii) function_node_execs.push_back(0);
for(int scnt = 0; scnt < SPECULATION_CNT; ++scnt) {
- g[scnt] = new graph;
+ g[scnt] = construct_graph(ta);
send_to[scnt] = new b_node(*(g[scnt])); // broadcast node to the function_nodes
q[scnt] = new queue_node(*(g[scnt])); // output queue
@@ -131,7 +139,7 @@ build_BMU_graph(SOMap &map1) {
int ymax = (j + ysize) > (int)map1[0].size() ? (int)map1[0].size() : j + ysize;
subsquare_type sst(i,xmax,1,j,ymax,1);
BMU_search_body bb(map1,sst,function_node_execs[offset]);
- graph *g_local = new graph;
+ graph *g_local = construct_graph(ta);
search_node *s = new search_node(*g_local, serial, bb); // copies Body
(*g_array[scnt])[xindex].push_back(g_local);
(*s_array[scnt])[xindex].push_back(s);
@@ -252,8 +260,8 @@ graph_BMU( int indx ) { // indx ranges over [0 .. SPECULATION_CNT -1]
// end of one epoch
}
-void graph_teach(SOMap &map1, teaching_vector_type &in) {
- build_BMU_graph(map1);
+void graph_teach(SOMap &map1, teaching_vector_type &in, task_arena& ta) {
+ build_BMU_graph(map1, ta);
// normally the training would pick random exemplars to teach the SOM. We need
// the process to be reproducible, so we will pick the exemplars in order, [0, in.size())
int next_j = 0;
@@ -306,8 +314,8 @@ int
main(int argc, char** argv) {
int l_speculation_start;
utility::thread_number_range threads(
- task_scheduler_init::default_num_threads,
- task_scheduler_init::default_num_threads() // run only the default number of threads if none specified
+ utility::get_default_num_threads,
+ utility::get_default_num_threads() // run only the default number of threads if none specified
);
utility::parse_cli_arguments(argc,argv,
@@ -340,7 +348,8 @@ main(int argc, char** argv) {
// adjust nPasses so the 1x1 time is somewhere around serial_time_adjust seconds.
// make sure the example test runs for at least 0.5 second.
for(;;) {
- task_scheduler_init init(1);
+ // Restrict max concurrency level via task_arena interface
+ task_arena ta(1);
SOMap map1(xMax,yMax);
speculation_start = nPasses + 1; // Don't speculate
@@ -348,7 +357,7 @@ main(int argc, char** argv) {
yranges = 1;
map1.initialize(InitializeGradient, max_range, min_range);
tick_count t0 = tick_count::now();
- graph_teach(map1, my_teaching);
+ graph_teach(map1, my_teaching, ta);
tick_count t1 = tick_count::now();
double nSeconds = (t1-t0).seconds();
if(nSeconds < 0.5) {
@@ -387,7 +396,8 @@ main(int argc, char** argv) {
}
double single_time; // for speedup calculations
for(int p = threads.first; p <= threads.last; ++p) {
- task_scheduler_init init(p);
+ // Restrict max concurrency level via task_arena interface
+ task_arena ta(p);
if ( extra_debug )printf( " -------------- Running with %d threads. ------------\n", p);
// run the SOM build for a series of subranges
for(xranges = 1; xranges <= xRangeMax; ++xranges) {
@@ -404,7 +414,7 @@ main(int argc, char** argv) {
if(extra_debug) printf( "Start learning for [%d,%d] ----------- \n", xranges,yranges);
tick_count t0 = tick_count::now();
- graph_teach(map1, my_teaching);
+ graph_teach(map1, my_teaching, ta);
tick_count t1 = tick_count::now();
if ( extra_debug )printf( "Done learning for [%d,%d], which took %g seconds ", xranges,yranges, (t1-t0).seconds());
diff --git a/examples/graph/som/xcode/som.xcodeproj/project.pbxproj b/examples/graph/som/xcode/som.xcodeproj/project.pbxproj
index 96c8393560..8402dd0d58 100644
--- a/examples/graph/som/xcode/som.xcodeproj/project.pbxproj
+++ b/examples/graph/som/xcode/som.xcodeproj/project.pbxproj
@@ -173,6 +173,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
@@ -232,6 +233,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
diff --git a/examples/graph/stereo/msvs/stereo.vcxproj b/examples/graph/stereo/msvs/stereo.vcxproj
index e460eced41..87308f2616 100644
--- a/examples/graph/stereo/msvs/stereo.vcxproj
+++ b/examples/graph/stereo/msvs/stereo.vcxproj
@@ -91,7 +91,7 @@
true
- $(INTELOCLSDKROOT)lib\x86;$(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(INTELOCLSDKROOT)lib\x86;$(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
OpenCL.lib;%(AdditionalDependencies)
@@ -105,7 +105,7 @@
true
- $(INTELOCLSDKROOT)lib\x64;$(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(INTELOCLSDKROOT)lib\x64;$(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
OpenCL.lib;%(AdditionalDependencies)
@@ -123,7 +123,7 @@
true
true
true
- $(INTELOCLSDKROOT)lib\x86;$(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(INTELOCLSDKROOT)lib\x86;$(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
OpenCL.lib;%(AdditionalDependencies)
@@ -141,7 +141,7 @@
true
true
true
- $(INTELOCLSDKROOT)lib\x64;$(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(INTELOCLSDKROOT)lib\x64;$(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
OpenCL.lib;%(AdditionalDependencies)
diff --git a/examples/parallel_do/parallel_preorder/Graph.cpp b/examples/parallel_do/parallel_preorder/Graph.cpp
index 57428a4ea5..709a2c7a3d 100644
--- a/examples/parallel_do/parallel_preorder/Graph.cpp
+++ b/examples/parallel_do/parallel_preorder/Graph.cpp
@@ -20,6 +20,17 @@
using namespace std;
+Cell::Cell(const Cell& other)
+ : op( other.op )
+ , value( other.value )
+ , successor( other.successor )
+{
+ ref_count = other.ref_count.load();
+
+ input[0] = other.input[0];
+ input[1] = other.input[1];
+}
+
void Graph::create_random_dag( size_t number_of_nodes ) {
my_vertex_set.resize(number_of_nodes);
for( size_t k=0; k
+#include
enum OpKind {
// Use Cell's value
@@ -40,7 +40,7 @@ class Cell {
//! Inputs to this cell
Cell* input[2];
-
+
//! Type of value stored in a Cell
typedef Matrix value_type;
@@ -51,13 +51,16 @@ class Cell {
std::vector successor;
//! Reference count of number of inputs that are not yet updated.
- tbb::atomic ref_count;
+ std::atomic ref_count;
//! Update the Cell's value.
void update();
//! Default constructor
Cell() {}
+
+ //! Copy constructor
+ Cell(const Cell& other);
};
//! A directed graph where the vertices are Cells.
diff --git a/examples/parallel_do/parallel_preorder/Makefile b/examples/parallel_do/parallel_preorder/Makefile
index ba91676643..0409e97691 100644
--- a/examples/parallel_do/parallel_preorder/Makefile
+++ b/examples/parallel_do/parallel_preorder/Makefile
@@ -35,13 +35,16 @@ else ifeq ($(shell uname), Darwin)
override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib
endif
+# autodetect C++11 support
+include ../../common/examples-common.inc
+
all: release test
release: *.cpp
- $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS)
+ $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS) $(CXX0XFLAGS)
debug: *.cpp
- $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS)
+ $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS) $(CXX0XFLAGS)
clean:
$(RM) $(PROG) *.o *.d
diff --git a/examples/parallel_do/parallel_preorder/main.cpp b/examples/parallel_do/parallel_preorder/main.cpp
index d96f8f582c..ec33f8fc3e 100644
--- a/examples/parallel_do/parallel_preorder/main.cpp
+++ b/examples/parallel_do/parallel_preorder/main.cpp
@@ -18,9 +18,10 @@
traversal of a directed acyclic graph. */
#include
-#include "tbb/task_scheduler_init.h"
#include "tbb/tick_count.h"
+#include "tbb/global_control.h"
#include "../../common/utility/utility.h"
+#include "../../common/utility/get_default_num_threads.h"
#include
#include
#include "Graph.h"
@@ -32,13 +33,12 @@ void ParallelPreorderTraversal( const std::vector& root_set );
//------------------------------------------------------------------------
// Test driver
//------------------------------------------------------------------------
-utility::thread_number_range threads(tbb::task_scheduler_init::default_num_threads);
static unsigned nodes = 1000;
static unsigned traversals = 500;
static bool SilentFlag = false;
//! Parse the command line.
-static void ParseCommandLine( int argc, const char* argv[] ) {
+static void ParseCommandLine( int argc, const char* argv[], utility::thread_number_range& threads ) {
utility::parse_cli_arguments(
argc,argv,
utility::cli_argument_pack()
@@ -52,13 +52,14 @@ static void ParseCommandLine( int argc, const char* argv[] ) {
int main( int argc, const char* argv[] ) {
try {
+ utility::thread_number_range threads(utility::get_default_num_threads);
tbb::tick_count main_start = tbb::tick_count::now();
- ParseCommandLine(argc,argv);
+ ParseCommandLine(argc,argv,threads);
// Start scheduler with given number of threads.
for( int p=threads.first; p<=threads.last; p = threads.step(p) ) {
tbb::tick_count t0 = tbb::tick_count::now();
- tbb::task_scheduler_init init(p);
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, p);
srand(2);
size_t root_set_size = 0;
{
diff --git a/examples/parallel_do/parallel_preorder/msvs/parallel_preorder.vcxproj b/examples/parallel_do/parallel_preorder/msvs/parallel_preorder.vcxproj
index 4f66cc8cc9..455d3cfb64 100644
--- a/examples/parallel_do/parallel_preorder/msvs/parallel_preorder.vcxproj
+++ b/examples/parallel_do/parallel_preorder/msvs/parallel_preorder.vcxproj
@@ -101,7 +101,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX86
@@ -127,7 +127,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX64
@@ -149,7 +149,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -176,7 +176,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/parallel_do/parallel_preorder/xcode/parallel_preorder.xcodeproj/project.pbxproj b/examples/parallel_do/parallel_preorder/xcode/parallel_preorder.xcodeproj/project.pbxproj
index 10431bbbbc..6cedebc98b 100644
--- a/examples/parallel_do/parallel_preorder/xcode/parallel_preorder.xcodeproj/project.pbxproj
+++ b/examples/parallel_do/parallel_preorder/xcode/parallel_preorder.xcodeproj/project.pbxproj
@@ -181,6 +181,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
ENABLE_TESTABILITY = YES;
GCC_ENABLE_CPP_RTTI = YES;
GCC_MODEL_TUNING = "";
@@ -191,6 +192,7 @@
"$(TBBROOT)/include",
/opt/intel/tbb/include,
);
+ ICC_CXX_LANG_DIALECT = "c++11";
LD_RUNPATH_SEARCH_PATHS = "$(TBBROOT)/lib /opt/intel/tbb/lib";
LIBRARY_SEARCH_PATHS = (
"$(TBBROOT)/lib",
@@ -216,6 +218,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
GCC_ENABLE_CPP_RTTI = YES;
GCC_MODEL_TUNING = "";
GCC_VERSION = "";
@@ -225,6 +228,7 @@
"$(TBBROOT)/include",
/opt/intel/tbb/include,
);
+ ICC_CXX_LANG_DIALECT = "c++11";
LD_RUNPATH_SEARCH_PATHS = "$(TBBROOT)/lib /opt/intel/tbb/lib";
LIBRARY_SEARCH_PATHS = (
"$(TBBROOT)/lib",
diff --git a/examples/parallel_for/game_of_life/Makefile b/examples/parallel_for/game_of_life/Makefile
index 9ecddf284a..bd31fa4cb3 100644
--- a/examples/parallel_for/game_of_life/Makefile
+++ b/examples/parallel_for/game_of_life/Makefile
@@ -32,13 +32,16 @@ else ifeq ($(shell uname), Darwin)
override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib
endif
+# autodetect C++11 support
+include ../../common/examples-common.inc
+
all: release test
release: src/Evolution.cpp src/Update_state.cpp src/Game_of_life.cpp
- $(CXX) -O2 -DNDEBUG -D_CONSOLE $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS)
+ $(CXX) -O2 -DNDEBUG -D_CONSOLE $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS) $(CXX0XFLAGS)
debug: src/Evolution.cpp src/Update_state.cpp src/Game_of_life.cpp
- $(CXX) -O0 -D_CONSOLE -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS)
+ $(CXX) -O0 -D_CONSOLE -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS) $(CXX0XFLAGS)
clean:
rm -f $(PROG) *.o *.d
diff --git a/examples/parallel_for/game_of_life/msvs/Game_of_life.vcxproj b/examples/parallel_for/game_of_life/msvs/Game_of_life.vcxproj
index 1a6c3ada13..ffc3334c2a 100644
--- a/examples/parallel_for/game_of_life/msvs/Game_of_life.vcxproj
+++ b/examples/parallel_for/game_of_life/msvs/Game_of_life.vcxproj
@@ -190,7 +190,7 @@
tbb_debug.lib;user32.lib
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
true
Windows
@@ -219,7 +219,7 @@
tbb_debug.lib;user32.lib
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
true
Windows
@@ -246,7 +246,7 @@
tbb.lib;user32.lib
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -277,7 +277,7 @@
tbb.lib;user32.lib
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -305,7 +305,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
$(TargetDir)$(TargetName).pdb
Console
@@ -334,7 +334,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
$(TargetDir)$(TargetName).pdb
Console
@@ -359,7 +359,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -388,7 +388,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/parallel_for/game_of_life/src/Evolution.cpp b/examples/parallel_for/game_of_life/src/Evolution.cpp
index 75fb1e5409..b11c15501c 100644
--- a/examples/parallel_for/game_of_life/src/Evolution.cpp
+++ b/examples/parallel_for/game_of_life/src/Evolution.cpp
@@ -15,13 +15,14 @@
*/
/*
- Evolution.cpp: implementation file for evolution classes; evolution
- classes do looped evolution of patterns in a defined
+ Evolution.cpp: implementation file for evolution classes; evolution
+ classes do looped evolution of patterns in a defined
2 dimensional space
*/
#include "Evolution.h"
#include "Board.h"
+#include "../../../common/utility/get_default_num_threads.h"
#ifdef USE_SSE
#define GRAIN_SIZE 14
@@ -35,8 +36,8 @@
*/
/**
- Evolution::UpdateMatrix() - moves the calculated destination data
- to the source data block. No destination zeroing is required since it will
+ Evolution::UpdateMatrix() - moves the calculated destination data
+ to the source data block. No destination zeroing is required since it will
be completely overwritten during the next calculation cycle.
**/
void Evolution::UpdateMatrix()
@@ -63,7 +64,7 @@ void SequentialEvolution::Run(double execution_time, int nthread)
tbb::tick_count t0 = tbb::tick_count::now();
while (!m_done)
{
- if( !is_paused )
+ if( !is_paused )
{
tbb::tick_count t = tbb::tick_count::now();
Step();
@@ -99,7 +100,7 @@ void SequentialEvolution::Run(double execution_time, int nthread)
//! SequentialEvolution::Step() - override of step method
void SequentialEvolution::Step()
{
- if( !is_paused )
+ if( !is_paused )
{
#ifdef USE_SSE
UpdateState(m_matrix, m_matrix->data, 0, m_matrix->height);
@@ -121,7 +122,7 @@ void ParallelEvolution::Run()
#else
void ParallelEvolution::Run(double execution_time, int nthread)
{
- if(nthread == tbb::task_scheduler_init::automatic)
+ if(nthread == utility::get_default_num_threads())
printf("Starting game (Parallel evolution for automatic number of thread(s))\n");
else
printf("Starting game (Parallel evolution for %d thread(s))\n", nthread);
@@ -132,13 +133,13 @@ void ParallelEvolution::Run(double execution_time, int nthread)
#ifndef _CONSOLE
//! start task scheduler as necessary
- if (m_pInit == NULL)
+ if (m_pGlobControl == NULL)
{
- m_pInit = new tbb::task_scheduler_init();
+ m_pGlobControl = new tbb::global_control(tbb::global_control::max_allowed_parallelism, utility::get_default_num_threads());
}
m_evt_start_parallel->WaitOne();
#else
- tbb::task_scheduler_init init(nthread);
+ tbb::global_control* pGlobControl = new tbb::global_control(tbb::global_control::max_allowed_parallelism, nthread);
#endif
double work_time = m_serial_time;
@@ -146,7 +147,7 @@ void ParallelEvolution::Run(double execution_time, int nthread)
while (!m_done)
{
- if( !is_paused )
+ if( !is_paused )
{
tbb::tick_count t = tbb::tick_count::now();
Step();
@@ -157,7 +158,7 @@ void ParallelEvolution::Run(double execution_time, int nthread)
if ( real_work_time < work_time )
continue;
m_parallel_time += real_work_time;
- m_board->draw(m_nIteration);
+ m_board->draw(m_nIteration);
#else
m_parallel_time += real_work_time;
#endif
@@ -174,19 +175,21 @@ void ParallelEvolution::Run(double execution_time, int nthread)
if(m_parallel_time > execution_time)
{
printf("iterations count = %d time = %g\n", m_nIteration, m_parallel_time);
- init.terminate();
+ delete pGlobControl; pGlobControl = NULL;
break;
}
#endif
}
+ if (pGlobControl)
+ delete pGlobControl;
}
/**
class tbb_parallel_task
-
- TBB requires a class for parallel loop implementations. The actual
- loop "chunks" are performed using the () operator of the class.
- The blocked_range contains the range to calculate. Please see the
+
+ TBB requires a class for parallel loop implementations. The actual
+ loop "chunks" are performed using the () operator of the class.
+ The blocked_range contains the range to calculate. Please see the
TBB documentation for more information.
**/
#ifndef _CONSOLE
@@ -203,7 +206,7 @@ class tbb_parallel_task
return;
}
- void operator()( const tbb::blocked_range& r ) const
+ void operator()( const tbb::blocked_range& r ) const
{
int begin = (int)r.begin(); //! capture lower range number for this chunk
int end = (int)r.end(); //! capture upper range number for this chunk
diff --git a/examples/parallel_for/game_of_life/src/Evolution.h b/examples/parallel_for/game_of_life/src/Evolution.h
index ab6f07617a..57c3df429c 100644
--- a/examples/parallel_for/game_of_life/src/Evolution.h
+++ b/examples/parallel_for/game_of_life/src/Evolution.h
@@ -14,9 +14,9 @@
limitations under the License.
*/
-/**
- Evolution.h: Header file for evolution classes; evolution classes do
- looped evolution of patterns in a defined 2 dimensional space
+/**
+ Evolution.h: Header file for evolution classes; evolution classes do
+ looped evolution of patterns in a defined 2 dimensional space
**/
#ifndef __EVOLUTION_H__
@@ -29,10 +29,10 @@
#define WIN32_LEAN_AND_MEAN
-#include "tbb/task_scheduler_init.h"
#include "tbb/blocked_range.h"
#include "tbb/parallel_for.h"
#include "tbb/tick_count.h"
+#include "tbb/global_control.h"
#ifndef _CONSOLE
#include
@@ -55,7 +55,7 @@ class Evolution
public:
Evolution( Matrix *m, //! beginning matrix including initial pattern
BoardPtr board //! the board to update
- ) : m_matrix(m), m_board(board),
+ ) : m_matrix(m), m_board(board),
m_size(m_matrix->height * m_matrix->width), m_done(false)
{
//! allocate memory for second matrix data block
@@ -80,7 +80,7 @@ class Evolution
//! Quit() - tell the thread to terminate
virtual void Quit() { m_done = true; }
-
+
//! Step() - performs a single evolutionary generation computation on the game matrix
virtual void Step() = 0;
@@ -92,23 +92,23 @@ class Evolution
else
is_paused = false;
}
-
+
protected:
- /**
- UpdateMatrix() - moves the previous destination data to the source
+ /**
+ UpdateMatrix() - moves the previous destination data to the source
data block and zeros out destination.
**/
void UpdateMatrix();
protected:
Matrix* m_matrix; //! Pointer to initial matrix
- char* m_dest; //! Pointer to calculation destination data
+ char* m_dest; //! Pointer to calculation destination data
BoardPtr m_board; //! The game board to update
int m_size; //! size of the matrix data block
volatile bool m_done; //! a flag used to terminate the thread
Int32 m_nIteration; //! current calculation cycle index
volatile bool is_paused; //! is needed to perform next iteration
-
+
//! Calculation time of the sequential version (since the start), seconds.
/**
This member is updated by the sequential version and read by parallel,
@@ -137,7 +137,7 @@ class SequentialEvolution: public Evolution
SequentialEvolution(Matrix *m, BoardPtr board)
: Evolution(m, board)
{}
-#ifndef _CONSOLE
+#ifndef _CONSOLE
virtual void Run() override;
virtual void Step() override;
#else
@@ -163,15 +163,15 @@ class ParallelEvolution: public Evolution
: Evolution(m, board),
m_parallel_time(0)
{
- // instantiate a task_scheduler_init object and save a pointer to it
- m_pInit = NULL;
+ // instantiate a global_control object and save a pointer to it
+ m_pGlobControl = NULL;
}
-
+
~ParallelEvolution()
{
- //! delete task_scheduler_init object
- if (m_pInit != NULL)
- delete m_pInit;
+ //! delete global_control object
+ if (m_pGlobControl != NULL)
+ delete m_pGlobControl;
}
#ifndef _CONSOLE
virtual void Run() override;
@@ -180,10 +180,10 @@ class ParallelEvolution: public Evolution
virtual void Run(double execution_time, int nthread);
virtual void Step();
#endif
-
+
private:
- tbb::task_scheduler_init* m_pInit;
+ tbb::global_control* m_pGlobControl;
double m_parallel_time;
};
diff --git a/examples/parallel_for/game_of_life/src/Game_of_life.cpp b/examples/parallel_for/game_of_life/src/Game_of_life.cpp
index 43dfc100b8..16e86915cb 100644
--- a/examples/parallel_for/game_of_life/src/Game_of_life.cpp
+++ b/examples/parallel_for/game_of_life/src/Game_of_life.cpp
@@ -20,6 +20,7 @@
*/
#include "Board.h"
#include "Form1.h"
+#include "../../../common/utility/get_default_num_threads.h"
#define WIN32_LEAN_AND_MEAN
@@ -149,7 +150,7 @@ bool ParseCommandLine(int argc, char * argv [])
//! command line without parameters
if(argc == 1)
{
- low = tbb::task_scheduler_init::automatic;
+ low = utility::get_default_num_threads();
high = low;
execution_time = 5;
return true;
diff --git a/examples/parallel_for/polygon_overlay/Makefile b/examples/parallel_for/polygon_overlay/Makefile
index de4c66f62d..011fbff43b 100644
--- a/examples/parallel_for/polygon_overlay/Makefile
+++ b/examples/parallel_for/polygon_overlay/Makefile
@@ -38,6 +38,9 @@ else ifeq ($(shell uname), Darwin)
override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib
endif
+# autodetect C++11 support
+include ../../common/examples-common.inc
+
all: release test
resources:
@@ -51,19 +54,19 @@ endif # macOS*
release: $(SRCFILES) resources
ifeq ($(compiler),xl)
# Avoiding "1586-346 (U) An error occurred during code generation. The code generation return code was 40." with -O3.
- $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(EXE) $(SRCFILES) -ltbb -ltbbmalloc $(LIBS)
+ $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(EXE) $(SRCFILES) -ltbb -ltbbmalloc $(LIBS) $(CXX0XFLAGS)
else
ifeq ($(UI),mac)
- $(CXX_UI) -O3 -DNDEBUG $(CXXFLAGS) -c $(MACUISOURCES)
+ $(CXX_UI) -O3 -DNDEBUG $(CXXFLAGS) -c $(MACUISOURCES) $(CXX0XFLAGS)
endif # macOS
- $(CXX) -O3 -DNDEBUG $(CXXFLAGS) -o $(EXE) $(SRCFILES) $(MACUIOBJS) -ltbb -ltbbmalloc $(LIBS)
+ $(CXX) -O3 -DNDEBUG $(CXXFLAGS) -o $(EXE) $(SRCFILES) $(MACUIOBJS) -ltbb -ltbbmalloc $(LIBS) $(CXX0XFLAGS)
endif
debug: $(SRCFILES) resources
ifeq ($(UI),mac)
- $(CXX_UI) -g -O0 -DTBB_USE_DEBUG -D_DEBUG $(CXXFLAGS) -c $(MACUISOURCES)
+ $(CXX_UI) -g -O0 -DTBB_USE_DEBUG -D_DEBUG $(CXXFLAGS) -c $(MACUISOURCES) $(CXX0XFLAGS)
endif # macOS
- $(CXX) -g -O0 -DTBB_USE_DEBUG -D_DEBUG $(CXXFLAGS) -o $(EXE) $(SRCFILES) $(MACUIOBJS) -ltbb_debug -ltbbmalloc_debug $(LIBS)
+ $(CXX) -g -O0 -DTBB_USE_DEBUG -D_DEBUG $(CXXFLAGS) -o $(EXE) $(SRCFILES) $(MACUIOBJS) -ltbb_debug -ltbbmalloc_debug $(LIBS) $(CXX0XFLAGS)
clean:
$(RM) $(EXE) *.o *.d
diff --git a/examples/parallel_for/polygon_overlay/msvs/pover.vcxproj b/examples/parallel_for/polygon_overlay/msvs/pover.vcxproj
index dc5e8f9a80..f55108da3f 100644
--- a/examples/parallel_for/polygon_overlay/msvs/pover.vcxproj
+++ b/examples/parallel_for/polygon_overlay/msvs/pover.vcxproj
@@ -184,7 +184,7 @@
tbb_debug.lib;tbbmalloc_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Windows
MachineX86
@@ -213,7 +213,7 @@
tbb_debug.lib;tbbmalloc_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Windows
MachineX64
@@ -240,7 +240,7 @@
tbb.lib;tbbmalloc.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -272,7 +272,7 @@
tbb.lib;tbbmalloc.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -304,7 +304,7 @@
tbb.lib;tbbmalloc.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;$(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;$(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -339,7 +339,7 @@
tbb.lib;tbbmalloc.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;$(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;$(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -370,7 +370,7 @@
tbb_debug.lib;tbbmalloc_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;$(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;$(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories)
true
Windows
MachineX86
@@ -402,7 +402,7 @@
tbb_debug.lib;tbbmalloc_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;$(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;$(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories)
true
Windows
MachineX64
diff --git a/examples/parallel_for/polygon_overlay/polymain.cpp b/examples/parallel_for/polygon_overlay/polymain.cpp
index c996e1e6f6..ed0fb4efe7 100644
--- a/examples/parallel_for/polygon_overlay/polymain.cpp
+++ b/examples/parallel_for/polygon_overlay/polymain.cpp
@@ -27,7 +27,6 @@
#include
#include "tbb/tick_count.h"
-#include "tbb/task_scheduler_init.h"
#include "pover_global.h"
#include "polyover.h"
#include "pover_video.h"
@@ -39,7 +38,7 @@ using namespace std;
const char *faceNames[] = { "North", "East", "South", "West" };
#endif
-/**
+/**
**/
int main( int argc, char **argv) {
pover_video poly;
@@ -107,7 +106,7 @@ void Usage(int argc, char **argv) {
if(cmdTail == NULL) {
cmdTail = *argv;
}
- else {
+ else {
cmdTail++;
}
cout << cmdTail << " [threads[:threads2]] [--polys npolys] [--size nnnxnnn] [--seed nnn]" << std::endl;
@@ -363,7 +362,7 @@ bool GenerateMap(Polygon_map_t **newMap, int xSize, int ySize, int gNPolygons, c
(**newMap)[polyIndx].get(&xlow,&ylow,&xhigh,&yhigh);
xlnew = xlow;
xhnew = xhigh;
- ylnew = ylow;
+ ylnew = ylow;
yhnew = yhigh;
// can this polygon be expanded along the chosen side?
switch(checkSide) {
diff --git a/examples/parallel_for/polygon_overlay/polyover.cpp b/examples/parallel_for/polygon_overlay/polyover.cpp
index 62a7b8a627..2f517e0b5c 100644
--- a/examples/parallel_for/polygon_overlay/polyover.cpp
+++ b/examples/parallel_for/polygon_overlay/polyover.cpp
@@ -23,10 +23,10 @@
#include
#include "tbb/tick_count.h"
#include "tbb/blocked_range.h"
-#include "tbb/task_scheduler_init.h"
#include "tbb/parallel_for.h"
-#include "tbb/mutex.h"
#include "tbb/spin_mutex.h"
+#include "tbb/global_control.h"
+#include "../../common/utility/get_default_num_threads.h"
#include "polyover.h"
#include "polymain.h"
#include "pover_video.h"
@@ -125,8 +125,8 @@ void NaiveParallelOverlay(Polygon_map_t *&result_map, Polygon_map_t &polymap1, P
// -----------------------------------
bool automatic_threadcount = false;
- if(gThreadsLow == THREADS_UNSET || gThreadsLow == tbb::task_scheduler_init::automatic) {
- gThreadsLow = gThreadsHigh = tbb::task_scheduler_init::automatic;
+ if(gThreadsLow == THREADS_UNSET || gThreadsLow == utility::get_default_num_threads()) {
+ gThreadsLow = gThreadsHigh = utility::get_default_num_threads();
automatic_threadcount = true;
}
result_map = new Polygon_map_t;
@@ -140,7 +140,7 @@ void NaiveParallelOverlay(Polygon_map_t *&result_map, Polygon_map_t &polymap1, P
int grain_size = gGrainSize;
for(int nthreads = gThreadsLow; nthreads <= gThreadsHigh; nthreads++) {
- tbb::task_scheduler_init init(nthreads);
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, nthreads);
if(gIsGraphicalVersion) {
RPolygon *xp = new RPolygon(0, 0, gMapXSize-1, gMapYSize-1, 0, 0, 0); // Clear the output space
delete xp;
@@ -200,7 +200,7 @@ void split_at( Flagged_map_t& in_map, Flagged_map_t &left_out, Flagged_map_t &ri
// vectors of pointers, and each range owns its maps (has to free them on destruction.)
template
class blocked_range_with_maps {
-
+
typedef blocked_range my_range_type;
private:
@@ -361,8 +361,8 @@ void SplitParallelOverlay(Polygon_map_t **result_map, Polygon_map_t *polymap1, P
double domainSplitParallelTime;
tbb::tick_count t0, t1;
tbb::spin_mutex *resultMutex;
- if(gThreadsLow == THREADS_UNSET || gThreadsLow == tbb::task_scheduler_init::automatic ) {
- gThreadsLow = gThreadsHigh = tbb::task_scheduler_init::automatic;
+ if(gThreadsLow == THREADS_UNSET || gThreadsLow == utility::get_default_num_threads() ) {
+ gThreadsLow = gThreadsHigh = utility::get_default_num_threads();
automatic_threadcount = true;
}
*result_map = new Polygon_map_t;
@@ -380,7 +380,7 @@ void SplitParallelOverlay(Polygon_map_t **result_map, Polygon_map_t *polymap1, P
grain_size = gGrainSize;
#endif
for(nthreads = gThreadsLow; nthreads <= gThreadsHigh; nthreads++) {
- tbb::task_scheduler_init init(nthreads);
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, nthreads);
if(gIsGraphicalVersion) {
RPolygon *xp = new RPolygon(0, 0, gMapXSize-1, gMapYSize-1, 0, 0, 0); // Clear the output space
delete xp;
@@ -477,8 +477,8 @@ void SplitParallelOverlayCV(concurrent_Polygon_map_t **result_map, Polygon_map_t
bool automatic_threadcount = false;
double domainSplitParallelTime;
tbb::tick_count t0, t1;
- if(gThreadsLow == THREADS_UNSET || gThreadsLow == tbb::task_scheduler_init::automatic ) {
- gThreadsLow = gThreadsHigh = tbb::task_scheduler_init::automatic;
+ if(gThreadsLow == THREADS_UNSET || gThreadsLow == utility::get_default_num_threads() ) {
+ gThreadsLow = gThreadsHigh = utility::get_default_num_threads();
automatic_threadcount = true;
}
*result_map = new concurrent_Polygon_map_t;
@@ -495,7 +495,7 @@ void SplitParallelOverlayCV(concurrent_Polygon_map_t **result_map, Polygon_map_t
grain_size = gGrainSize;
#endif
for(nthreads = gThreadsLow; nthreads <= gThreadsHigh; nthreads++) {
- tbb::task_scheduler_init init(nthreads);
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, nthreads);
if(gIsGraphicalVersion) {
RPolygon *xp = new RPolygon(0, 0, gMapXSize-1, gMapYSize-1, 0, 0, 0); // Clear the output space
delete xp;
@@ -516,7 +516,7 @@ void SplitParallelOverlayCV(concurrent_Polygon_map_t **result_map, Polygon_map_t
}
#if _DEBUG
{
-
+
Polygon_map_t s_result_map;
for(concurrent_Polygon_map_t::const_iterator ci = (*result_map)->begin(); ci != (*result_map)->end(); ++ci) {
s_result_map.push_back(*ci);
@@ -602,8 +602,8 @@ void SplitParallelOverlayETS(ETS_Polygon_map_t **result_map, Polygon_map_t *poly
bool automatic_threadcount = false;
double domainSplitParallelTime;
tbb::tick_count t0, t1;
- if(gThreadsLow == THREADS_UNSET || gThreadsLow == tbb::task_scheduler_init::automatic ) {
- gThreadsLow = gThreadsHigh = tbb::task_scheduler_init::automatic;
+ if(gThreadsLow == THREADS_UNSET || gThreadsLow == utility::get_default_num_threads() ) {
+ gThreadsLow = gThreadsHigh = utility::get_default_num_threads();
automatic_threadcount = true;
}
*result_map = new ETS_Polygon_map_t;
@@ -620,7 +620,7 @@ void SplitParallelOverlayETS(ETS_Polygon_map_t **result_map, Polygon_map_t *poly
grain_size = gGrainSize;
#endif
for(nthreads = gThreadsLow; nthreads <= gThreadsHigh; nthreads++) {
- tbb::task_scheduler_init init(nthreads);
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, nthreads);
if(gIsGraphicalVersion) {
RPolygon *xp = new RPolygon(0, 0, gMapXSize-1, gMapYSize-1, 0, 0, 0); // Clear the output space
delete xp;
@@ -642,7 +642,7 @@ void SplitParallelOverlayETS(ETS_Polygon_map_t **result_map, Polygon_map_t *poly
}
#if _DEBUG
{
-
+
Polygon_map_t s_result_map;
flattened2d psv = flatten2d(**result_map);
s_result_map.push_back(RPolygon(0,0,mapxSize, mapySize));
diff --git a/examples/parallel_for/polygon_overlay/polyover.h b/examples/parallel_for/polygon_overlay/polyover.h
index ddc09ff25a..3a0e5aff54 100644
--- a/examples/parallel_for/polygon_overlay/polyover.h
+++ b/examples/parallel_for/polygon_overlay/polyover.h
@@ -18,7 +18,6 @@
* polyover.h : extern declarations for polyover.cpp
*/
#include "rpolygon.h"
-#include "tbb/mutex.h"
#include "tbb/spin_mutex.h"
extern void OverlayOnePolygonWithMap(Polygon_map_t *resultMap, RPolygon *myPoly, Polygon_map_t *map2, tbb::spin_mutex *rMutex);
diff --git a/examples/parallel_for/polygon_overlay/pover_video.cpp b/examples/parallel_for/polygon_overlay/pover_video.cpp
index 15cd4505c9..bccf825f50 100644
--- a/examples/parallel_for/polygon_overlay/pover_video.cpp
+++ b/examples/parallel_for/polygon_overlay/pover_video.cpp
@@ -22,7 +22,7 @@
#include "polymain.h"
#include "pover_video.h"
#include "tbb/tick_count.h"
-#include "tbb/task_scheduler_init.h"
+#include "../../common/utility/get_default_num_threads.h"
#ifndef _WIN32
#include
#include
@@ -48,14 +48,14 @@ using namespace std;
bool g_next_frame() {
if(++n_next_frame_calls >= frame_skips) { // the data race here is benign
- n_next_frame_calls = 0;
+ n_next_frame_calls = 0;
return gVideo->next_frame();
- }
+ }
return gVideo->running;
}
bool g_last_frame() {
- if(n_next_frame_calls) return gVideo->next_frame();
+ if(n_next_frame_calls) return gVideo->next_frame();
return gVideo->running;
}
@@ -109,7 +109,7 @@ void pover_video::on_process() {
if(gCsvFile.is_open()) {
gCsvFile << "Serial Time," << gSerialTime << std::endl;
gCsvFile << "Threads,";
- if(gThreadsLow == THREADS_UNSET || gThreadsLow == tbb::task_scheduler_init::automatic) {
+ if(gThreadsLow == THREADS_UNSET || gThreadsLow == utility::get_default_num_threads()) {
gCsvFile << "Threads,Automatic";
}
else {
diff --git a/examples/parallel_for/polygon_overlay/xcode/polygon_overlay.xcodeproj/project.pbxproj b/examples/parallel_for/polygon_overlay/xcode/polygon_overlay.xcodeproj/project.pbxproj
index b2b4b93e0b..c3c1e34517 100644
--- a/examples/parallel_for/polygon_overlay/xcode/polygon_overlay.xcodeproj/project.pbxproj
+++ b/examples/parallel_for/polygon_overlay/xcode/polygon_overlay.xcodeproj/project.pbxproj
@@ -317,7 +317,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ CLANG_CXX_LANGUAGE_STANDARD = "c++11";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
@@ -383,7 +383,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ CLANG_CXX_LANGUAGE_STANDARD = "c++11";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
diff --git a/examples/parallel_for/seismic/Makefile b/examples/parallel_for/seismic/Makefile
index b66999da77..2202524b0f 100644
--- a/examples/parallel_for/seismic/Makefile
+++ b/examples/parallel_for/seismic/Makefile
@@ -29,7 +29,7 @@ TBBLIB_DEBUG = -ltbb_debug
ifeq ($(offload), mic)
override CXXFLAGS += -D__TBB_MIC_OFFLOAD=1 -offload-attribute-target=mic
# Replace -ltbb with -tbb in the offload mode
-TBBLIB = -tbb
+TBBLIB = -ltbb
TBBLIB_DEBUG += -offload-option,mic,ld,"-ltbb_debug"
# Currently only console mode is supported in offload version
override UI=con
@@ -48,6 +48,9 @@ else ifeq ($(shell uname), Darwin)
override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib
endif
+# autodetect C++11 support
+include ../../common/examples-common.inc
+
all: release test
resources:
@@ -60,15 +63,15 @@ endif # macOS*
release: resources
ifeq ($(UI),mac)
- $(CXX_UI) -O2 -DNDEBUG $(CXXFLAGS) -c $(MACUISOURCES)
+ $(CXX_UI) -O2 -DNDEBUG $(CXXFLAGS) -c $(MACUISOURCES) $(CXX0XFLAGS)
endif # macOS
- $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(EXE) $(SOURCES) $(MACUIOBJS) $(TBBLIB) $(LIBS)
+ $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(EXE) $(SOURCES) $(MACUIOBJS) $(TBBLIB) $(LIBS) $(CXX0XFLAGS)
debug: resources
ifeq ($(UI),mac)
- $(CXX_UI) -g -O0 -DTBB_USE_DEBUG $(CXXFLAGS) -c $(MACUISOURCES)
+ $(CXX_UI) -g -O0 -DTBB_USE_DEBUG $(CXXFLAGS) -c $(MACUISOURCES) $(CXX0XFLAGS)
endif # macOS
- $(CXX) -g -O0 -DTBB_USE_DEBUG $(CXXFLAGS) -o $(EXE) $(SOURCES) $(MACUIOBJS) $(TBBLIB_DEBUG) $(LIBS)
+ $(CXX) -g -O0 -DTBB_USE_DEBUG $(CXXFLAGS) -o $(EXE) $(SOURCES) $(MACUIOBJS) $(TBBLIB_DEBUG) $(LIBS) $(CXX0XFLAGS)
clean:
$(RM) $(EXE) *.o *.d
diff --git a/examples/parallel_for/seismic/main.cpp b/examples/parallel_for/seismic/main.cpp
index 56059f31f7..cb43ded439 100644
--- a/examples/parallel_for/seismic/main.cpp
+++ b/examples/parallel_for/seismic/main.cpp
@@ -18,11 +18,12 @@
#include
#include "tbb/tick_count.h"
+#include "tbb/global_control.h"
#include "../../common/utility/utility.h"
+#include "../../common/utility/get_default_num_threads.h"
#include "seismic_video.h"
#include "universe.h"
-#include "tbb/task_scheduler_init.h"
Universe u;
@@ -40,23 +41,9 @@ struct RunOptions {
}
};
-int do_get_default_num_threads() {
- int threads;
-#if __TBB_MIC_OFFLOAD
- #pragma offload target(mic) out(threads)
-#endif // __TBB_MIC_OFFLOAD
- threads = tbb::task_scheduler_init::default_num_threads();
- return threads;
-}
-
-int get_default_num_threads() {
- static int threads = do_get_default_num_threads();
- return threads;
-}
-
RunOptions ParseCommandLine(int argc, char *argv[]){
// zero number of threads means to run serial version
- utility::thread_number_range threads(get_default_num_threads,0,get_default_num_threads());
+ utility::thread_number_range threads(utility::get_default_num_threads,0,utility::get_default_num_threads());
int numberOfFrames = 0;
bool silent = false;
@@ -106,7 +93,7 @@ int main(int argc, char *argv[])
#pragma offload target(mic) in(u, numberOfFrames, p, dmem), out(pMem:length(memSize))
{
- // It is necessary to update the pointer on mic
+ // It is necessary to update the pointer on mic
// since the address spaces on host and on target are different
dmem.set_address(pMem);
u.SetDrawingMemory(dmem);
@@ -117,7 +104,7 @@ int main(int argc, char *argv[])
u.SerialUpdateUniverse();
}
} else {
- tbb::task_scheduler_init init(p);
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, p);
for( int i=0; i
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Windows
MachineX86
@@ -213,7 +213,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Windows
MachineX64
@@ -240,7 +240,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -272,7 +272,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -304,7 +304,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;$(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;$(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -339,7 +339,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;$(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;$(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -370,7 +370,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;$(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;$(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories)
true
Windows
MachineX86
@@ -402,7 +402,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;$(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;$(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories)
true
Windows
MachineX64
diff --git a/examples/parallel_for/seismic/seismic_video.cpp b/examples/parallel_for/seismic/seismic_video.cpp
index e19d705cdf..c66848f18d 100644
--- a/examples/parallel_for/seismic/seismic_video.cpp
+++ b/examples/parallel_for/seismic/seismic_video.cpp
@@ -16,7 +16,7 @@
#include "seismic_video.h"
#include "universe.h"
-#include "tbb/task_scheduler_init.h"
+#include "tbb/global_control.h"
const char * const SeismicVideo::titles[2] = {"Seismic Simulation: Serial", "Seismic Simulation: Parallel"};
void SeismicVideo::on_mouse(int x, int y, int key) {
@@ -37,7 +37,7 @@ void SeismicVideo::on_key(int key) {
}
void SeismicVideo::on_process() {
- tbb::task_scheduler_init Init(threadsHigh);
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, threadsHigh);
for( int frames = 0; numberOfFrames_==0 || frames
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Windows
UseLinkTimeCodeGeneration
@@ -222,7 +222,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Windows
UseLinkTimeCodeGeneration
@@ -252,7 +252,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -285,7 +285,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -316,7 +316,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;$(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;$(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -349,7 +349,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;$(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;$(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -382,7 +382,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;$(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;$(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories)
true
Windows
UseLinkTimeCodeGeneration
@@ -416,7 +416,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;$(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;$(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories)
true
Windows
UseLinkTimeCodeGeneration
diff --git a/examples/parallel_for/tachyon/msvs/tachyon.tbb1d.vcxproj b/examples/parallel_for/tachyon/msvs/tachyon.tbb1d.vcxproj
index 36106dee9a..325605e0e9 100644
--- a/examples/parallel_for/tachyon/msvs/tachyon.tbb1d.vcxproj
+++ b/examples/parallel_for/tachyon/msvs/tachyon.tbb1d.vcxproj
@@ -188,7 +188,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Windows
UseLinkTimeCodeGeneration
@@ -222,7 +222,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Windows
UseLinkTimeCodeGeneration
@@ -252,7 +252,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -285,7 +285,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -316,7 +316,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;$(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;$(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -349,7 +349,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;$(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;$(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories)
true
Windows
true
@@ -382,7 +382,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;$(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;$(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories)
true
Windows
UseLinkTimeCodeGeneration
@@ -416,7 +416,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;$(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;$(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories)
true
Windows
UseLinkTimeCodeGeneration
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/App.xaml b/examples/parallel_for/tachyon/msvs/uwp/App.xaml
similarity index 100%
rename from examples/parallel_for/tachyon/msvs/win8ui/App.xaml
rename to examples/parallel_for/tachyon/msvs/uwp/App.xaml
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/App.xaml.cpp b/examples/parallel_for/tachyon/msvs/uwp/App.xaml.cpp
similarity index 100%
rename from examples/parallel_for/tachyon/msvs/win8ui/App.xaml.cpp
rename to examples/parallel_for/tachyon/msvs/uwp/App.xaml.cpp
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/App.xaml.h b/examples/parallel_for/tachyon/msvs/uwp/App.xaml.h
similarity index 100%
rename from examples/parallel_for/tachyon/msvs/win8ui/App.xaml.h
rename to examples/parallel_for/tachyon/msvs/uwp/App.xaml.h
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/Assets/Logo.png b/examples/parallel_for/tachyon/msvs/uwp/Assets/Logo.png
similarity index 100%
rename from examples/parallel_for/tachyon/msvs/win8ui/Assets/Logo.png
rename to examples/parallel_for/tachyon/msvs/uwp/Assets/Logo.png
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/Assets/SmallLogo.png b/examples/parallel_for/tachyon/msvs/uwp/Assets/SmallLogo.png
similarity index 100%
rename from examples/parallel_for/tachyon/msvs/win8ui/Assets/SmallLogo.png
rename to examples/parallel_for/tachyon/msvs/uwp/Assets/SmallLogo.png
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/Assets/SplashScreen.png b/examples/parallel_for/tachyon/msvs/uwp/Assets/SplashScreen.png
similarity index 100%
rename from examples/parallel_for/tachyon/msvs/win8ui/Assets/SplashScreen.png
rename to examples/parallel_for/tachyon/msvs/uwp/Assets/SplashScreen.png
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/Assets/StoreLogo.png b/examples/parallel_for/tachyon/msvs/uwp/Assets/StoreLogo.png
similarity index 100%
rename from examples/parallel_for/tachyon/msvs/win8ui/Assets/StoreLogo.png
rename to examples/parallel_for/tachyon/msvs/uwp/Assets/StoreLogo.png
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/Common/StandardStyles.xaml b/examples/parallel_for/tachyon/msvs/uwp/Common/StandardStyles.xaml
similarity index 100%
rename from examples/parallel_for/tachyon/msvs/win8ui/Common/StandardStyles.xaml
rename to examples/parallel_for/tachyon/msvs/uwp/Common/StandardStyles.xaml
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/DirectXBase.cpp b/examples/parallel_for/tachyon/msvs/uwp/DirectXBase.cpp
similarity index 99%
rename from examples/parallel_for/tachyon/msvs/win8ui/DirectXBase.cpp
rename to examples/parallel_for/tachyon/msvs/uwp/DirectXBase.cpp
index 921a3599cd..58c8cff543 100644
--- a/examples/parallel_for/tachyon/msvs/win8ui/DirectXBase.cpp
+++ b/examples/parallel_for/tachyon/msvs/uwp/DirectXBase.cpp
@@ -182,7 +182,7 @@ void DirectXBase::SetDpi(float dpi)
void DirectXBase::UpdateForWindowSizeChange()
{
// Only handle window size changed if there is no pending DPI change.
- if (m_dpi != DisplayProperties::LogicalDpi)
+ if (m_dpi != DisplayInformation::GetForCurrentView()->LogicalDpi)
return;
if (m_window->Bounds.Width != m_windowBounds.Width ||
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/DirectXBase.h b/examples/parallel_for/tachyon/msvs/uwp/DirectXBase.h
similarity index 100%
rename from examples/parallel_for/tachyon/msvs/win8ui/DirectXBase.h
rename to examples/parallel_for/tachyon/msvs/uwp/DirectXBase.h
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/DirectXPage.xaml b/examples/parallel_for/tachyon/msvs/uwp/DirectXPage.xaml
similarity index 100%
rename from examples/parallel_for/tachyon/msvs/win8ui/DirectXPage.xaml
rename to examples/parallel_for/tachyon/msvs/uwp/DirectXPage.xaml
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/DirectXPage.xaml.cpp b/examples/parallel_for/tachyon/msvs/uwp/DirectXPage.xaml.cpp
similarity index 89%
rename from examples/parallel_for/tachyon/msvs/win8ui/DirectXPage.xaml.cpp
rename to examples/parallel_for/tachyon/msvs/uwp/DirectXPage.xaml.cpp
index e56f6c9bf1..9b11ff6d33 100644
--- a/examples/parallel_for/tachyon/msvs/win8ui/DirectXPage.xaml.cpp
+++ b/examples/parallel_for/tachyon/msvs/uwp/DirectXPage.xaml.cpp
@@ -17,7 +17,6 @@
#include "pch.h"
#include "DirectXPage.xaml.h"
-#include "tbb/tbb.h"
using namespace tbbTachyon;
@@ -59,15 +58,15 @@ DirectXPage::DirectXPage() :
m_renderer->Initialize(
Window::Current->CoreWindow,
this,
- DisplayProperties::LogicalDpi
+ DisplayInformation::GetForCurrentView()->LogicalDpi
);
m_eventToken = CompositionTarget::Rendering::add(ref new EventHandler(this, &DirectXPage::OnRendering));
- int num_threads = 2*tbb::task_scheduler_init::default_num_threads();
+ int num_threads = 2*utility::get_default_num_threads();
// The thread slider has geometric sequence with several intermediate steps for each interval between 2^N and 2^(N+1).
// The nearest (from below) the power of 2.
- int i_base = log2(num_threads);
+ int i_base = int(log2(num_threads));
int base = 1 << i_base;
// The step size for the current interval.
int step = base / num_interval_steps;
@@ -75,7 +74,7 @@ DirectXPage::DirectXPage() :
int i_step = (num_threads-base)/step;
ThreadsSlider->Maximum = (i_base-interval_step_power)*num_interval_steps + i_step;
- global_number_of_threads = m_number_of_threads = tbb::task_scheduler_init::automatic;
+ global_number_of_threads = m_number_of_threads = utility::get_default_num_threads();
}
DirectXPage::~DirectXPage()
@@ -118,9 +117,9 @@ void tbbTachyon::DirectXPage::ThreadsSliderValueChanged(Platform::Object^ sender
int step = max(1,base/num_interval_steps);
m_number_of_threads = base + (pos%num_interval_steps)*step;
- if (m_number_of_threads == 0) m_number_of_threads = tbb::task_scheduler_init::automatic;
+ if (m_number_of_threads == 0) m_number_of_threads = utility::get_default_num_threads();
- NumberOfThreadsTextBlock->Text="Number Of Threads: " + (m_number_of_threads == tbb::task_scheduler_init::automatic? "Auto": m_number_of_threads.ToString());
+ NumberOfThreadsTextBlock->Text="Number Of Threads: " + (m_number_of_threads == utility::get_default_num_threads()? "Auto": m_number_of_threads.ToString());
if (global_number_of_threads != m_number_of_threads){
ThreadsApply->Visibility=Windows::UI::Xaml::Visibility::Visible;
}else{
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/DirectXPage.xaml.h b/examples/parallel_for/tachyon/msvs/uwp/DirectXPage.xaml.h
similarity index 100%
rename from examples/parallel_for/tachyon/msvs/win8ui/DirectXPage.xaml.h
rename to examples/parallel_for/tachyon/msvs/uwp/DirectXPage.xaml.h
diff --git a/examples/parallel_for/tachyon/msvs/uwp/Package.appxmanifest b/examples/parallel_for/tachyon/msvs/uwp/Package.appxmanifest
new file mode 100644
index 0000000000..71d2555f1d
--- /dev/null
+++ b/examples/parallel_for/tachyon/msvs/uwp/Package.appxmanifest
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+ tbbTachyon
+ Administrator
+ Assets\StoreLogo.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/copy_libraries_and_assets.bat b/examples/parallel_for/tachyon/msvs/uwp/copy_libraries_and_assets.bat
similarity index 75%
rename from examples/parallel_for/tachyon/msvs/win8ui/copy_libraries_and_assets.bat
rename to examples/parallel_for/tachyon/msvs/uwp/copy_libraries_and_assets.bat
index f922a867dd..8da5bda0af 100644
--- a/examples/parallel_for/tachyon/msvs/win8ui/copy_libraries_and_assets.bat
+++ b/examples/parallel_for/tachyon/msvs/uwp/copy_libraries_and_assets.bat
@@ -29,9 +29,14 @@ if ("%4") == ("") set dat_file="%output_dir%\..\..\dat\balls.dat"
:: Actually we can set install root by ourselves
if ("%TBBROOT%") == ("") set TBBROOT=%~dp0..\..\..\..\..\
-:: ordered from oldest to newest, so we end with newest available version
-if ("%VS110COMNTOOLS%") NEQ ("") set vc_dir=vc11_ui
-if ("%VS120COMNTOOLS%") NEQ ("") set vc_dir=vc12_ui
+:: Getting vs folders ordered from oldest to newest, so we end with newest available version
+if ("%VS140COMNTOOLS%") NEQ ("") set vc_dir=vc14_uwp
+:: To use Microsoft* Visual Studio* 2017 IDE, make sure the variable VS150COMNTOOLS is set in your IDE instance.
+:: If it is not, try running Microsoft Visual Studio 2017 from Microsoft* Developer Command Prompt* for VS 2017.
+:: For details, see https://developercommunity.visualstudio.com/content/problem/730/vs154-env-var-vs150comntools-missing-from-build-sy.html
+if ("%VS150COMNTOOLS%") NEQ ("") set vc_dir=vc14_uwp
+:: The same comment also applies to Microsoft Visual Studio 2019 and variable VS160COMNTOOLS
+if ("%VS160COMNTOOLS%") NEQ ("") set vc_dir=vc14_uwp
echo Using %vc_dir% libraries
if exist "%TBBROOT%\bin\%arch%\%vc_dir%\tbb%postfix%.dll" set interim_path=bin\%arch%
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/pch.h b/examples/parallel_for/tachyon/msvs/uwp/pch.h
similarity index 100%
rename from examples/parallel_for/tachyon/msvs/win8ui/pch.h
rename to examples/parallel_for/tachyon/msvs/uwp/pch.h
diff --git a/examples/parallel_for/tachyon/msvs/uwp/tbbTachyon.sln b/examples/parallel_for/tachyon/msvs/uwp/tbbTachyon.sln
new file mode 100644
index 0000000000..594bd78cc2
--- /dev/null
+++ b/examples/parallel_for/tachyon/msvs/uwp/tbbTachyon.sln
@@ -0,0 +1,32 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tbbTachyon", "tbbTachyon.vcxproj", "{77FEB0A5-648A-4561-8A9D-61C7818B4490}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Debug|x64.ActiveCfg = Debug|x64
+ {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Debug|x64.Build.0 = Debug|x64
+ {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Debug|x64.Deploy.0 = Debug|x64
+ {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Debug|x86.ActiveCfg = Debug|Win32
+ {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Debug|x86.Build.0 = Debug|Win32
+ {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Debug|x86.Deploy.0 = Debug|Win32
+ {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Release|x64.ActiveCfg = Release|x64
+ {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Release|x64.Build.0 = Release|x64
+ {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Release|x64.Deploy.0 = Release|x64
+ {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Release|x86.ActiveCfg = Release|Win32
+ {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Release|x86.Build.0 = Release|Win32
+ {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Release|x86.Deploy.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/tbbTachyon.vcxproj b/examples/parallel_for/tachyon/msvs/uwp/tbbTachyon.vcxproj
similarity index 91%
rename from examples/parallel_for/tachyon/msvs/win8ui/tbbTachyon.vcxproj
rename to examples/parallel_for/tachyon/msvs/uwp/tbbTachyon.vcxproj
index 43f1c96775..4d196d21ea 100644
--- a/examples/parallel_for/tachyon/msvs/win8ui/tbbTachyon.vcxproj
+++ b/examples/parallel_for/tachyon/msvs/uwp/tbbTachyon.vcxproj
@@ -1,5 +1,5 @@
-
-
+
+
Debug
@@ -19,42 +19,46 @@
- {e20cb432-6730-4021-a372-1c81a333518a}
+ {77feb0a5-648a-4561-8a9d-61c7818b4490}
tbbTachyon
en-US
- $(VCTargetsPath11)
- 11.0
+ 14.0
true
+ Windows Store
+ 10.0.14393.0
+ 10.0.10586.0
+ 10.0
Application
true
- v120
- true
+ v140
Application
true
- v120
- true
+ v140
Application
false
- false
- v120
- true
+ true
+ v140
+ true
Application
false
- false
- v120
- true
+ true
+ v140
+ true
+
+
+
@@ -70,10 +74,12 @@
+
tbbTachyon_TemporaryKey.pfx
True
- 5E3EA4A6008AD66D2487EFC68BB366981685295D
+
+
d2d1.lib; d3d11.lib; dxgi.lib; ole32.lib; windowscodecs.lib; dwrite.lib; dxguid.lib; %(AdditionalDependencies)
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/tbbTachyon.vcxproj.filters b/examples/parallel_for/tachyon/msvs/uwp/tbbTachyon.vcxproj.filters
similarity index 87%
rename from examples/parallel_for/tachyon/msvs/win8ui/tbbTachyon.vcxproj.filters
rename to examples/parallel_for/tachyon/msvs/uwp/tbbTachyon.vcxproj.filters
index 54c9254155..aadb2dd3e2 100644
--- a/examples/parallel_for/tachyon/msvs/win8ui/tbbTachyon.vcxproj.filters
+++ b/examples/parallel_for/tachyon/msvs/uwp/tbbTachyon.vcxproj.filters
@@ -1,34 +1,5 @@

-
-
-
- Resources\Common
-
-
- Resources\Assets
-
-
- Resources\Assets
-
-
- Resources\Assets
-
-
- Resources\Assets
-
-
- {a5d732ac-1380-4b99-910c-c5685c48ec08}
-
-
- e20cb432-6730-4021-a372-1c81a333518a
-
-
- ac5c7e6e-0221-4a78-85c7-20768e92cf5a
-
-
- Frontend
-
-
+
@@ -50,6 +21,9 @@
Backend
+
+ Backend
+
Backend
@@ -80,16 +54,19 @@
Backend
+
+ Backend
+
Backend
Backend
-
+
Backend
-
+
Backend
@@ -140,12 +117,6 @@
Backend
-
- Backend
-
-
- Backend
-
Frontend
@@ -164,16 +135,27 @@
-
- Resources\Assets
-
+
+ Resources\Assests
+
+
+ Resources\Assests
+
+
+ Resources\Assests
+
+
+ Resources\Assests
+
+
+
Libraries
-
+
Libraries
-
+
Libraries
@@ -182,25 +164,40 @@
Frontend
+
+ Resources\Assests
+
+
+
+
+ Frontend
+
+
+ Resources\Common
+
- {a70d1cf5-5cc8-4f50-a6d2-92d2b973df86}
-
-
- {eb414f7a-2d2d-4ff5-93fe-458cc3021423}
+ {5aa279ad-b96c-4b37-b7b8-ac9e2fc6a71a}
- {77eb2f1c-7dec-4360-8989-e9ad18034e10}
+ {e4177cac-d0b5-40da-a461-f198ad2a979a}
- {d825a994-3d08-4764-9945-ec9aafc1f496}
+ {7d1b3680-1522-4d95-8632-7824b4d5cdbe}
+
+
+ {5446688c-27e2-4099-bda8-776ce360b3e4}
+
+
+ {b39c6427-41fc-44e7-b9f6-55284a523b3f}
+
+
+ {1f1ca390-e43c-42ba-b04d-6c004ef14b52}
+
+
+ {16f9ea87-9c30-407c-8e9e-818f60e1c163}
-
-
-
- Scripts
-
@@ -212,4 +209,9 @@
Frontend
-
+
+
+ Scripts
+
+
+
\ No newline at end of file
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/tbbTachyonRenderer.cpp b/examples/parallel_for/tachyon/msvs/uwp/tbbTachyonRenderer.cpp
similarity index 97%
rename from examples/parallel_for/tachyon/msvs/win8ui/tbbTachyonRenderer.cpp
rename to examples/parallel_for/tachyon/msvs/uwp/tbbTachyonRenderer.cpp
index 2ad770323c..29c12f7d3d 100644
--- a/examples/parallel_for/tachyon/msvs/win8ui/tbbTachyonRenderer.cpp
+++ b/examples/parallel_for/tachyon/msvs/uwp/tbbTachyonRenderer.cpp
@@ -20,7 +20,6 @@
#include
#include
#include "../../src/tachyon_video.h"
-#include "tbb/tbb.h"
using namespace Microsoft::WRL;
using namespace Windows::Foundation;
@@ -133,9 +132,9 @@ void tbbTachyonRenderer::Render()
#if SHOW_TEXT
if (video && video->running)
global_elapsedTime=(long)(time(NULL)-global_startTime);
-
+
Platform::String^ text= "Running in " +
- (global_number_of_threads == tbb::task_scheduler_init::automatic? "all hardware threads: ":
+ (global_number_of_threads == utility::get_default_num_threads()? "all hardware threads: ":
global_number_of_threads.ToString() + (global_number_of_threads==1?" thread: ":" threads: ")) +
global_elapsedTime.ToString() + (global_elapsedTime>1?" seconds":" second");
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/tbbTachyonRenderer.h b/examples/parallel_for/tachyon/msvs/uwp/tbbTachyonRenderer.h
similarity index 100%
rename from examples/parallel_for/tachyon/msvs/win8ui/tbbTachyonRenderer.h
rename to examples/parallel_for/tachyon/msvs/uwp/tbbTachyonRenderer.h
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/Package.appxmanifest b/examples/parallel_for/tachyon/msvs/win8ui/Package.appxmanifest
deleted file mode 100644
index df3c07adc3..0000000000
--- a/examples/parallel_for/tachyon/msvs/win8ui/Package.appxmanifest
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
- Tachyon Demo
- test
- Assets\StoreLogo.png
-
-
- 6.2.0
- 6.2.0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/parallel_for/tachyon/msvs/win8ui/tbbTachyon.sln b/examples/parallel_for/tachyon/msvs/win8ui/tbbTachyon.sln
deleted file mode 100644
index ed64646af5..0000000000
--- a/examples/parallel_for/tachyon/msvs/win8ui/tbbTachyon.sln
+++ /dev/null
@@ -1,34 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.40629.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tbbTachyon", "tbbTachyon.vcxproj", "{E20CB432-6730-4021-A372-1C81A333518A}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E6DDEA39-7910-47F9-A0E3-56AD7E62ACBD}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {E20CB432-6730-4021-A372-1C81A333518A}.Debug|Win32.ActiveCfg = Debug|Win32
- {E20CB432-6730-4021-A372-1C81A333518A}.Debug|Win32.Build.0 = Debug|Win32
- {E20CB432-6730-4021-A372-1C81A333518A}.Debug|Win32.Deploy.0 = Debug|Win32
- {E20CB432-6730-4021-A372-1C81A333518A}.Debug|x64.ActiveCfg = Debug|x64
- {E20CB432-6730-4021-A372-1C81A333518A}.Debug|x64.Build.0 = Debug|x64
- {E20CB432-6730-4021-A372-1C81A333518A}.Debug|x64.Deploy.0 = Debug|x64
- {E20CB432-6730-4021-A372-1C81A333518A}.Release|Win32.ActiveCfg = Release|Win32
- {E20CB432-6730-4021-A372-1C81A333518A}.Release|Win32.Build.0 = Release|Win32
- {E20CB432-6730-4021-A372-1C81A333518A}.Release|Win32.Deploy.0 = Release|Win32
- {E20CB432-6730-4021-A372-1C81A333518A}.Release|x64.ActiveCfg = Release|x64
- {E20CB432-6730-4021-A372-1C81A333518A}.Release|x64.Build.0 = Release|x64
- {E20CB432-6730-4021-A372-1C81A333518A}.Release|x64.Deploy.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/examples/parallel_for/tachyon/src/main.cpp b/examples/parallel_for/tachyon/src/main.cpp
index 442083eade..3e4965a29e 100644
--- a/examples/parallel_for/tachyon/src/main.cpp
+++ b/examples/parallel_for/tachyon/src/main.cpp
@@ -97,8 +97,8 @@ void initoptions(argoptions * opt) {
opt->verbosemode = -1;
opt->antialiasing = -1;
opt->displaymode = -1;
- opt->boundmode = -1;
- opt->boundthresh = -1;
+ opt->boundmode = -1;
+ opt->boundthresh = -1;
opt->usecamfile = -1;
}
@@ -120,7 +120,7 @@ int CreateScene() {
// scene->hres and scene->vres should be equal to screen resolution
scene->hres = global_xwinsize = global_xsize;
- scene->vres = global_ywinsize = global_ysize;
+ scene->vres = global_ywinsize = global_ysize;
return 0;
}
@@ -137,7 +137,7 @@ unsigned int __stdcall example_main(void *)
tachyon.init_console();
// always using window even if(!global_usegraphics)
- global_usegraphics =
+ global_usegraphics =
tachyon.init_window(global_xwinsize, global_ywinsize);
if(!tachyon.running)
exit(-1);
@@ -149,7 +149,7 @@ unsigned int __stdcall example_main(void *)
global_startTime=(long) time(NULL);
global_isCancelled=false;
if (video)video->running = true;
- tbb::task_scheduler_init init (global_number_of_threads);
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, global_number_of_threads);
memset(g_pImg, 0, sizeof(unsigned int) * global_xsize * global_ysize);
tachyon.main_loop();
global_elapsedTime = (long)(time(NULL)-global_startTime);
@@ -262,7 +262,7 @@ int useoptions(argoptions * opt, SceneHandle scene) {
if (opt->antialiasing != -1) {
/* need new api code for this */
- }
+ }
if (opt->displaymode != -1) {
rt_displaymode(scene, opt->displaymode);
@@ -277,7 +277,7 @@ int useoptions(argoptions * opt, SceneHandle scene) {
}
return 0;
-}
+}
argoptions ParseCommandLine(int argc, const char *argv[]) {
argoptions opt;
@@ -362,7 +362,7 @@ int main (int argc, char *argv[]) {
tachyon.title = global_window_title;
// always using window even if(!global_usegraphics)
- global_usegraphics =
+ global_usegraphics =
tachyon.init_window(global_xwinsize, global_ywinsize);
if(!tachyon.running)
return -1;
diff --git a/examples/parallel_for/tachyon/src/trace.tbb.cpp b/examples/parallel_for/tachyon/src/trace.tbb.cpp
index 8d2da92fee..bef7853252 100644
--- a/examples/parallel_for/tachyon/src/trace.tbb.cpp
+++ b/examples/parallel_for/tachyon/src/trace.tbb.cpp
@@ -81,19 +81,20 @@ static int colors[NUM_COLORS][3] = {
{1,152,231}, {79,235,237}, {52,193,72}, {67,136,151}, {78,87,179}, {143,255,9},
};
-#include "tbb/atomic.h"
+#include
#include "tbb/enumerable_thread_specific.h"
// storage and counter for thread numbers in order of first task run
typedef tbb::enumerable_thread_specific< int > thread_id_t;
thread_id_t thread_ids (-1);
-tbb::atomic thread_number;
+std::atomic thread_number;
#endif
-#include "tbb/task_scheduler_init.h"
#include "tbb/parallel_for.h"
#include "tbb/spin_mutex.h"
#include "tbb/blocked_range2d.h"
+#include "tbb/global_control.h"
+#include "../../../common/utility/get_default_num_threads.h"
static tbb::spin_mutex MyMutex, MyMutex2;
@@ -108,7 +109,7 @@ static color_t render_one_pixel (int x, int y, unsigned int *local_mbox, unsigne
ray primary, sample;
color col, avcol;
int R,G,B;
- intersectstruct local_intersections;
+ intersectstruct local_intersections;
int alias;
/* end private */
@@ -117,11 +118,11 @@ static color_t render_one_pixel (int x, int y, unsigned int *local_mbox, unsigne
primary.flags = RT_RAY_REGULAR;
serial++;
- primary.serial = serial;
+ primary.serial = serial;
primary.mbox = local_mbox;
primary.maxdist = FHUGE;
primary.scene = &scene;
- col=trace(&primary);
+ col=trace(&primary);
serial = primary.serial;
@@ -131,7 +132,7 @@ static color_t render_one_pixel (int x, int y, unsigned int *local_mbox, unsigne
serial++; /* increment serial number */
sample=primary; /* copy the regular primary ray to start with */
- sample.serial = serial;
+ sample.serial = serial;
{
tbb::spin_mutex::scoped_lock lock (MyMutex);
@@ -140,7 +141,7 @@ static color_t render_one_pixel (int x, int y, unsigned int *local_mbox, unsigne
sample.d.z+=((rand() % 100) - 50) / jitterscale;
}
- avcol=trace(&sample);
+ avcol=trace(&sample);
serial = sample.serial; /* update our overall serial # */
@@ -172,7 +173,7 @@ static color_t render_one_pixel (int x, int y, unsigned int *local_mbox, unsigne
G = int((1.0 - alpha) * G + alpha * blend[1]);
B = int((1.0 - alpha) * B + alpha * blend[2]);
#endif
-
+
return video->get_color(R, G, B);
}
@@ -226,10 +227,10 @@ class parallel_task {
void * thread_trace(thr_parms * parms)
{
#if !WIN8UI_EXAMPLE
- int n, nthreads = tbb::task_scheduler_init::automatic;
+ int n, nthreads = utility::get_default_num_threads();
char *nthreads_str = getenv ("TBB_NUM_THREADS");
if (nthreads_str && (sscanf (nthreads_str, "%d", &n) > 0) && (n > 0)) nthreads = n;
- tbb::task_scheduler_init init (nthreads);
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, nthreads);
#endif
// shared but read-only so could be private too
@@ -261,5 +262,5 @@ void * thread_trace(thr_parms * parms)
#endif
tbb::parallel_for (tbb::blocked_range2d (starty, stopy, grain_size, startx, stopx, grain_size), parallel_task (), tbb::auto_partitioner());
- return(NULL);
+ return(NULL);
}
diff --git a/examples/parallel_for/tachyon/src/trace.tbb1d.cpp b/examples/parallel_for/tachyon/src/trace.tbb1d.cpp
index d5a409bc66..92940f2f52 100644
--- a/examples/parallel_for/tachyon/src/trace.tbb1d.cpp
+++ b/examples/parallel_for/tachyon/src/trace.tbb1d.cpp
@@ -68,10 +68,11 @@ static int stopy;
static flt jitterscale;
static int totaly;
-#include "tbb/task_scheduler_init.h"
#include "tbb/parallel_for.h"
#include "tbb/spin_mutex.h"
#include "tbb/blocked_range.h"
+#include "tbb/global_control.h"
+#include "../../../common/utility/get_default_num_threads.h"
static tbb::spin_mutex MyMutex, MyMutex2;
@@ -82,7 +83,7 @@ static color_t render_one_pixel (int x, int y, unsigned int *local_mbox, unsigne
ray primary, sample;
color col, avcol;
int R,G,B;
- intersectstruct local_intersections;
+ intersectstruct local_intersections;
int alias;
/* end private */
@@ -91,11 +92,11 @@ static color_t render_one_pixel (int x, int y, unsigned int *local_mbox, unsigne
primary.flags = RT_RAY_REGULAR;
serial++;
- primary.serial = serial;
+ primary.serial = serial;
primary.mbox = local_mbox;
primary.maxdist = FHUGE;
primary.scene = &scene;
- col=trace(&primary);
+ col=trace(&primary);
serial = primary.serial;
@@ -105,7 +106,7 @@ static color_t render_one_pixel (int x, int y, unsigned int *local_mbox, unsigne
serial++; /* increment serial number */
sample=primary; /* copy the regular primary ray to start with */
- sample.serial = serial;
+ sample.serial = serial;
{
tbb::spin_mutex::scoped_lock lock (MyMutex);
@@ -114,7 +115,7 @@ static color_t render_one_pixel (int x, int y, unsigned int *local_mbox, unsigne
sample.d.z+=((rand() % 100) - 50) / jitterscale;
}
- avcol=trace(&sample);
+ avcol=trace(&sample);
serial = sample.serial; /* update our overall serial # */
@@ -170,10 +171,10 @@ class parallel_task {
void * thread_trace(thr_parms * parms)
{
- int n, nthreads = tbb::task_scheduler_init::automatic;
+ int n, nthreads = utility::get_default_num_threads();
char *nthreads_str = getenv ("TBB_NUM_THREADS");
if (nthreads_str && (sscanf (nthreads_str, "%d", &n) > 0) && (n > 0)) nthreads = n;
- tbb::task_scheduler_init init (nthreads);
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, nthreads);
// shared but read-only so could be private too
all_parms = parms;
@@ -197,5 +198,5 @@ void * thread_trace(thr_parms * parms)
else
tbb::parallel_for (tbb::blocked_range (starty, stopy, grain_size), parallel_task (), tbb::auto_partitioner() );
- return(NULL);
+ return(NULL);
}
diff --git a/examples/parallel_for/tachyon/xcode/tachyon.xcodeproj/project.pbxproj b/examples/parallel_for/tachyon/xcode/tachyon.xcodeproj/project.pbxproj
index a29342edb2..c472abb206 100644
--- a/examples/parallel_for/tachyon/xcode/tachyon.xcodeproj/project.pbxproj
+++ b/examples/parallel_for/tachyon/xcode/tachyon.xcodeproj/project.pbxproj
@@ -992,7 +992,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ CLANG_CXX_LANGUAGE_STANDARD = "c++11";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
@@ -1059,7 +1059,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ CLANG_CXX_LANGUAGE_STANDARD = "c++11";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
@@ -1160,7 +1160,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ CLANG_CXX_LANGUAGE_STANDARD = "c++11";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
@@ -1204,7 +1204,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ CLANG_CXX_LANGUAGE_STANDARD = "c++11";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
diff --git a/examples/parallel_reduce/convex_hull/Makefile b/examples/parallel_reduce/convex_hull/Makefile
index 4fcccbbfdc..b70624c25f 100644
--- a/examples/parallel_reduce/convex_hull/Makefile
+++ b/examples/parallel_reduce/convex_hull/Makefile
@@ -35,15 +35,18 @@ else ifeq ($(shell uname), Darwin)
override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib
endif
+# autodetect C++11 support
+include ../../common/examples-common.inc
+
all: release test
release: *.cpp
- $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o convex_hull_sample convex_hull_sample.cpp -ltbb $(LIBS)
- $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o convex_hull_bench convex_hull_bench.cpp -ltbb $(LIBS)
+ $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o convex_hull_sample convex_hull_sample.cpp -ltbb $(LIBS) $(CXX0XFLAGS)
+ $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o convex_hull_bench convex_hull_bench.cpp -ltbb $(LIBS) $(CXX0XFLAGS)
debug: *.cpp
- $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o convex_hull_sample convex_hull_sample.cpp -ltbb_debug $(LIBS)
- $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o convex_hull_bench convex_hull_bench.cpp -ltbb_debug $(LIBS)
+ $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o convex_hull_sample convex_hull_sample.cpp -ltbb_debug $(LIBS) $(CXX0XFLAGS)
+ $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o convex_hull_bench convex_hull_bench.cpp -ltbb_debug $(LIBS) $(CXX0XFLAGS)
clean:
$(RM) convex_hull_bench convex_hull_sample *.o *.d
diff --git a/examples/parallel_reduce/convex_hull/convex_hull.h b/examples/parallel_reduce/convex_hull/convex_hull.h
index a624635604..7ed556d820 100644
--- a/examples/parallel_reduce/convex_hull/convex_hull.h
+++ b/examples/parallel_reduce/convex_hull/convex_hull.h
@@ -29,8 +29,9 @@
#include
#include
#include "tbb/tick_count.h"
-#include "tbb/task_scheduler_init.h"
+#include "tbb/global_control.h"
#include "../../common/utility/utility.h"
+#include "../../common/utility/get_default_num_threads.h"
#include "../../common/utility/fast_random.h"
using namespace std;
@@ -38,7 +39,6 @@ using namespace std;
namespace cfg {
// convex hull problem user set parameters
long numberOfPoints = 5000000; // problem size
- utility::thread_number_range threads(tbb::task_scheduler_init::default_num_threads);
// convex hull grain sizes for 3 subproblems. Be sure 16*GS < 512Kb
const size_t generateGrainSize = 25000;
@@ -52,12 +52,12 @@ namespace util {
vector OUTPUT;
// utility functionality
- void ParseInputArgs(int argc, char* argv[]) {
+ void ParseInputArgs(int argc, char* argv[], utility::thread_number_range& threads) {
utility::parse_cli_arguments(
argc,argv,
utility::cli_argument_pack()
//"-h" option for displaying help is present implicitly
- .positional_arg(cfg::threads,"n-of-threads",utility::thread_number_range_desc)
+ .positional_arg(threads,"n-of-threads",utility::thread_number_range_desc)
.positional_arg(cfg::numberOfPoints,"n-of-points","number of points")
.arg(silent,"silent","no output except elapsed time")
.arg(verbose,"verbose","turns verbose ON")
diff --git a/examples/parallel_reduce/convex_hull/convex_hull_bench.cpp b/examples/parallel_reduce/convex_hull/convex_hull_bench.cpp
index 986497a5b9..0336d89d5c 100644
--- a/examples/parallel_reduce/convex_hull/convex_hull_bench.cpp
+++ b/examples/parallel_reduce/convex_hull/convex_hull_bench.cpp
@@ -175,7 +175,6 @@ int main(int argc, char* argv[]) {
#else // USETBB - parallel version of Quick Hull algorithm
-#include "tbb/task_scheduler_init.h"
#include "tbb/parallel_for.h"
#include "tbb/parallel_reduce.h"
#include "tbb/blocked_range.h"
@@ -566,7 +565,8 @@ void quickhull(const pointVec_t &points, pointVec_t &hull, bool buffered) {
}
int main(int argc, char* argv[]) {
- util::ParseInputArgs(argc, argv);
+ utility::thread_number_range threads(utility::get_default_num_threads);
+ util::ParseInputArgs(argc, argv, threads);
int nthreads;
util::my_time_t tm_init, tm_start, tm_end;
@@ -577,11 +577,11 @@ int main(int argc, char* argv[]) {
std::cout << "Starting STL locked unbuffered push_back version of QUICK HULL algorithm" << std::endl;
#endif // USECONCVEC
- for(nthreads=cfg::threads.first; nthreads<=cfg::threads.last; nthreads=cfg::threads.step(nthreads)) {
+ for(nthreads=threads.first; nthreads<=threads.last; nthreads=threads.step(nthreads)) {
pointVec_t points;
pointVec_t hull;
- tbb::task_scheduler_init init(nthreads);
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, nthreads);
tm_init = util::gettime();
initialize(points);
tm_start = util::gettime();
@@ -599,11 +599,11 @@ int main(int argc, char* argv[]) {
std::cout << "Starting STL locked buffered version of QUICK HULL algorithm" << std::endl;
#endif
- for(nthreads=cfg::threads.first; nthreads<=cfg::threads.last; nthreads=cfg::threads.step(nthreads)) {
+ for(nthreads=threads.first; nthreads<=threads.last; nthreads=threads.step(nthreads)) {
pointVec_t points;
pointVec_t hull;
- tbb::task_scheduler_init init(nthreads);
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, nthreads);
tm_init = util::gettime();
initialize(points);
diff --git a/examples/parallel_reduce/convex_hull/convex_hull_sample.cpp b/examples/parallel_reduce/convex_hull/convex_hull_sample.cpp
index fbe3ecc4a6..9d5bae2157 100644
--- a/examples/parallel_reduce/convex_hull/convex_hull_sample.cpp
+++ b/examples/parallel_reduce/convex_hull/convex_hull_sample.cpp
@@ -24,7 +24,6 @@
*/
#include "convex_hull.h"
-#include "tbb/task_scheduler_init.h"
#include "tbb/parallel_for.h"
#include "tbb/parallel_reduce.h"
#include "tbb/blocked_range.h"
@@ -255,9 +254,10 @@ void quickhull(const pointVec_t &points, pointVec_t &hull) {
}
int main(int argc, char* argv[]) {
+ utility::thread_number_range threads(utility::get_default_num_threads);
util::my_time_t tm_main_begin = util::gettime();
- util::ParseInputArgs(argc, argv);
+ util::ParseInputArgs(argc, argv, threads);
pointVec_t points;
pointVec_t hull;
@@ -269,8 +269,8 @@ int main(int argc, char* argv[]) {
std::cout << "Starting TBB-buffered version of QUICK HULL algorithm" << std::endl;
}
- for(nthreads=cfg::threads.first; nthreads<=cfg::threads.last; nthreads=cfg::threads.step(nthreads)) {
- tbb::task_scheduler_init init(nthreads);
+ for(nthreads=threads.first; nthreads<=threads.last; nthreads=threads.step(nthreads)) {
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, nthreads);
points.clear();
util::my_time_t tm_init = util::gettime();
diff --git a/examples/parallel_reduce/convex_hull/msvs/convex_hull_benchmark.vcxproj b/examples/parallel_reduce/convex_hull/msvs/convex_hull_benchmark.vcxproj
index 99067be68b..4f00735e32 100644
--- a/examples/parallel_reduce/convex_hull/msvs/convex_hull_benchmark.vcxproj
+++ b/examples/parallel_reduce/convex_hull/msvs/convex_hull_benchmark.vcxproj
@@ -101,7 +101,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX86
@@ -127,7 +127,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX64
@@ -150,7 +150,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -178,7 +178,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/parallel_reduce/convex_hull/msvs/convex_hull_sample.vcxproj b/examples/parallel_reduce/convex_hull/msvs/convex_hull_sample.vcxproj
index 118b35d91f..d8937199d4 100644
--- a/examples/parallel_reduce/convex_hull/msvs/convex_hull_sample.vcxproj
+++ b/examples/parallel_reduce/convex_hull/msvs/convex_hull_sample.vcxproj
@@ -101,7 +101,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX86
@@ -127,7 +127,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX64
@@ -150,7 +150,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -178,7 +178,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/parallel_reduce/primes/Makefile b/examples/parallel_reduce/primes/Makefile
index 53cdf2efcb..bbbac1fe7e 100644
--- a/examples/parallel_reduce/primes/Makefile
+++ b/examples/parallel_reduce/primes/Makefile
@@ -44,13 +44,16 @@ else ifeq ($(shell uname), Darwin)
override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib
endif
+# autodetect C++11 support
+include ../../common/examples-common.inc
+
all: release test
release: main.cpp primes.cpp
- $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ $(TBBLIB) $(LIBS)
+ $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ $(TBBLIB) $(LIBS) $(CXX0XFLAGS)
debug: main.cpp primes.cpp
- $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ $(TBBLIB_DEBUG) $(LIBS)
+ $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ $(TBBLIB_DEBUG) $(LIBS) $(CXX0XFLAGS)
clean:
$(RM) $(PROG) *.o *.d
diff --git a/examples/parallel_reduce/primes/main.cpp b/examples/parallel_reduce/primes/main.cpp
index a397d00672..2dfd397f0e 100644
--- a/examples/parallel_reduce/primes/main.cpp
+++ b/examples/parallel_reduce/primes/main.cpp
@@ -43,23 +43,9 @@ struct RunOptions{
{}
};
-int do_get_default_num_threads() {
- int threads;
- #if __TBB_MIC_OFFLOAD
- #pragma offload target(mic) out(threads)
- #endif // __TBB_MIC_OFFLOAD
- threads = tbb::task_scheduler_init::default_num_threads();
- return threads;
-}
-
-int get_default_num_threads() {
- static int threads = do_get_default_num_threads();
- return threads;
-}
-
//! Parse the command line.
static RunOptions ParseCommandLine( int argc, const char* argv[] ) {
- utility::thread_number_range threads( get_default_num_threads, 0, get_default_num_threads() );
+ utility::thread_number_range threads( utility::get_default_num_threads, 0, utility::get_default_num_threads() );
NumberType grainSize = 1000;
bool silent = false;
NumberType number = 100000000;
diff --git a/examples/parallel_reduce/primes/msvs/primes.vcxproj b/examples/parallel_reduce/primes/msvs/primes.vcxproj
index 697045eb0b..af2746f755 100644
--- a/examples/parallel_reduce/primes/msvs/primes.vcxproj
+++ b/examples/parallel_reduce/primes/msvs/primes.vcxproj
@@ -101,7 +101,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX86
@@ -127,7 +127,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX64
@@ -149,7 +149,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -176,7 +176,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/parallel_reduce/primes/primes.cpp b/examples/parallel_reduce/primes/primes.cpp
index c45bd041d2..bf663b3adb 100644
--- a/examples/parallel_reduce/primes/primes.cpp
+++ b/examples/parallel_reduce/primes/primes.cpp
@@ -33,7 +33,6 @@
#include
#include
#include "tbb/parallel_reduce.h"
-#include "tbb/task_scheduler_init.h"
using namespace std;
@@ -285,7 +284,7 @@ class Sieve {
//! Count number of primes between 0 and n
/** This is the parallel version. */
NumberType ParallelCountPrimes( NumberType n , int number_of_threads, NumberType grain_size ) {
- tbb::task_scheduler_init init(number_of_threads);
+ tbb::global_control c(tbb::global_control::max_allowed_parallelism, number_of_threads);
// Two is special case
NumberType count = n>=2;
diff --git a/examples/parallel_reduce/primes/primes.h b/examples/parallel_reduce/primes/primes.h
index 023d85b8ac..dd5755705e 100644
--- a/examples/parallel_reduce/primes/primes.h
+++ b/examples/parallel_reduce/primes/primes.h
@@ -21,7 +21,7 @@
#pragma offload_attribute (push,target(mic))
#endif // __TBB_MIC_OFFLOAD
-#include "tbb/task_scheduler_init.h"
+#include "../../common/utility/get_default_num_threads.h"
#include
typedef std::size_t NumberType;
@@ -31,7 +31,7 @@ NumberType SerialCountPrimes( NumberType n);
//! Count number of primes between 0 and n
/** This is the parallel version. */
-NumberType ParallelCountPrimes( NumberType n, int numberOfThreads= tbb::task_scheduler_init::automatic, NumberType grainSize = 1000);
+NumberType ParallelCountPrimes( NumberType n, int numberOfThreads= utility::get_default_num_threads(), NumberType grainSize = 1000);
#if __TBB_MIC_OFFLOAD
#pragma offload_attribute (pop)
diff --git a/examples/pipeline/index.html b/examples/pipeline/index.html
index 92c013ddac..a645b2cb03 100644
--- a/examples/pipeline/index.html
+++ b/examples/pipeline/index.html
@@ -119,11 +119,11 @@
.circ {
list-style-type:circle
}
-
+
.single {
padding: 0 0.5em;
}
-
+
/* ------------------------------------------------- */
/* Table styles */
table{
@@ -150,9 +150,9 @@
}
th{
border:1px #dddddd solid;
- padding-top:2px;
+ padding-top:2px;
padding-bottom:0px;
- padding-right:3px;
+ padding-right:3px;
padding-left:3px;
}
td{
@@ -225,7 +225,7 @@
padding-right:5px;
vertical-align:top;
}
-
+
.specs {
border-collapse:collapse;
}
@@ -242,7 +242,7 @@
padding: 0 0.2em 0.2em;
text-align: center;
}
- .specs td tr:last-child td,
+ .specs td tr:last-child td,
.specs td tr:last-child th {
padding: 0 0.2em;
}
@@ -263,10 +263,10 @@
font-style: italic;
}
- Intel® Threading Building Blocks. Samples on pipeline algorithm
+ Intel® Threading Building Blocks. Samples on parallel_pipeline algorithm
-
+
- Intel® Threading Building Blocks. Samples on pipeline algorithm
+ Intel® Threading Building Blocks. Samples on parallel_pipeline algorithm
-
+
- This directory has examples of the pipeline algorithm.
+ This directory has examples of the parallel_pipeline algorithm.
@@ -334,7 +334,7 @@ Intel® Threading Building Blocks. Samples on pipe
Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
- * Other names and brands may be claimed as the property of others.
+ * Other names and brands may be claimed as the property of others.
© 2019, Intel Corporation
diff --git a/examples/pipeline/square/Makefile b/examples/pipeline/square/Makefile
index fe0427c8b0..50cfba961f 100644
--- a/examples/pipeline/square/Makefile
+++ b/examples/pipeline/square/Makefile
@@ -36,13 +36,16 @@ else ifeq ($(shell uname), Darwin)
override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib
endif
+# autodetect C++11 support
+include ../../common/examples-common.inc
+
all: release test
release: $(SOURCES)
- $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS)
+ $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS) $(CXX0XFLAGS)
debug: $(SOURCES)
- $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS)
+ $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS) $(CXX0XFLAGS)
clean:
$(RM) $(PROG) *.o *.d input.txt output.txt
diff --git a/examples/pipeline/square/msvs/square.vcxproj b/examples/pipeline/square/msvs/square.vcxproj
index 67aea8c720..e70fd320a6 100644
--- a/examples/pipeline/square/msvs/square.vcxproj
+++ b/examples/pipeline/square/msvs/square.vcxproj
@@ -101,7 +101,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX86
@@ -127,7 +127,7 @@
tbb_debug.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
MachineX64
@@ -149,7 +149,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc12;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\ia32\vc_mt;$(TBBROOT)\lib\ia32\vc14;$(SolutionDir)\..\..\..\..\lib\ia32\vc_mt;$(SolutionDir)\..\..\..\..\lib\ia32\vc14;%(AdditionalLibraryDirectories)
true
Console
true
@@ -176,7 +176,7 @@
tbb.lib;%(AdditionalDependencies)
- $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc12;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc12;%(AdditionalLibraryDirectories)
+ $(TBBROOT)\lib\intel64\vc_mt;$(TBBROOT)\lib\intel64\vc14;$(SolutionDir)\..\..\..\..\lib\intel64\vc_mt;$(SolutionDir)\..\..\..\..\lib\intel64\vc14;%(AdditionalLibraryDirectories)
true
Console
true
diff --git a/examples/pipeline/square/readme.html b/examples/pipeline/square/readme.html
index 7f2b2677da..b806066bde 100644
--- a/examples/pipeline/square/readme.html
+++ b/examples/pipeline/square/readme.html
@@ -119,11 +119,11 @@
.circ {
list-style-type:circle
}
-
+
.single {
padding: 0 0.5em;
}
-
+
/* ------------------------------------------------- */
/* Table styles */
table{
@@ -150,9 +150,9 @@
}
th{
border:1px #dddddd solid;
- padding-top:2px;
+ padding-top:2px;
padding-bottom:0px;
- padding-right:3px;
+ padding-right:3px;
padding-left:3px;
}
td{
@@ -225,7 +225,7 @@
padding-right:5px;
vertical-align:top;
}
-
+
.specs {
border-collapse:collapse;
}
@@ -242,7 +242,7 @@
padding: 0 0.2em 0.2em;
text-align: center;
}
- .specs td tr:last-child td,
+ .specs td tr:last-child td,
.specs td tr:last-child th {
padding: 0 0.2em;
}
@@ -266,7 +266,7 @@
Intel® Threading Building Blocks. Square sample
-
+
Intel® Threading Building Blocks. Square sample
-
+
- Text filter that demonstrates class pipeline. Example program reads a file
+ Text filter that demonstrates the use of parallel_pipeline. Example program reads a file
containing decimal integers in text format, and changes each to its square.
@@ -325,7 +325,7 @@ Intel® Threading Building Blocks. Square sample
-
+
-
+
Up to parent directory
@@ -407,11 +407,11 @@ Intel® Threading Building Blocks. Square sample
Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
- * Other names and brands may be claimed as the property of others.
+ * Other names and brands may be claimed as the property of others.
© 2019, Intel Corporation
-
-
+
+
| |