diff --git a/lib/3rdParty/tbb/CHANGES b/lib/3rdParty/tbb/CHANGES
index f2fc2d3..ab1d1a1 100644
--- a/lib/3rdParty/tbb/CHANGES
+++ b/lib/3rdParty/tbb/CHANGES
@@ -2,6 +2,280 @@
The list of most significant changes made over time in
Intel(R) Threading Building Blocks (Intel(R) TBB).
+Intel TBB 2017 Update 7
+TBB_INTERFACE_VERSION == 9107
+
+Changes (w.r.t. Intel TBB 2017 Update 6):
+
+- In the huge pages mode, the memory allocator now is also able to use
+ transparent huge pages.
+
+Preview Features:
+
+- Added support for Intel TBB integration into CMake-aware
+ projects, with valuable guidance and feedback provided by Brad King
+ (Kitware).
+
+Bugs fixed:
+
+- Fixed scalable_allocation_command(TBBMALLOC_CLEAN_ALL_BUFFERS, 0)
+ to process memory left after exited threads.
+
+------------------------------------------------------------------------
+Intel TBB 2017 Update 6
+TBB_INTERFACE_VERSION == 9106
+
+Changes (w.r.t. Intel TBB 2017 Update 5):
+
+- Added support for Android* NDK r14.
+
+Preview Features:
+
+- Added a blocking terminate extension to the task_scheduler_init class
+ that allows an object to wait for termination of worker threads.
+
+Bugs fixed:
+
+- Fixed compilation and testing issues with MinGW (GCC 6).
+- Fixed compilation with /std:c++latest option of VS 2017
+ (https://github.com/01org/tbb/issues/13).
+
+------------------------------------------------------------------------
+Intel TBB 2017 Update 5
+TBB_INTERFACE_VERSION == 9105
+
+Changes (w.r.t. Intel TBB 2017 Update 4):
+
+- Added support for Microsoft* Visual Studio* 2017.
+- Added graph/matmult example to demonstrate support for compute offload
+ to Intel(R) Graphics Technology in the flow graph API.
+- The "compiler" build option now allows to specify a full path to the
+ compiler.
+
+Changes affecting backward compatibility:
+
+- Constructors for many classes, including graph nodes, concurrent
+ containers, thread-local containers, etc., are declared explicit and
+ cannot be used for implicit conversions anymore.
+
+Bugs fixed:
+
+- Added a workaround for bug 16657 in the GNU C Library (glibc)
+ affecting the debug version of tbb::mutex.
+- Fixed a crash in pool_identify() called for an object allocated in
+ another thread.
+
+------------------------------------------------------------------------
+Intel TBB 2017 Update 4
+TBB_INTERFACE_VERSION == 9104
+
+Changes (w.r.t. Intel TBB 2017 Update 3):
+
+- Added support for C++11 move semantics in parallel_do.
+- Added support for FreeBSD* 11.
+
+Changes affecting backward compatibility:
+
+- Minimal compiler versions required for support of C++11 move semantics
+ raised to GCC 4.5, VS 2012, and Intel(R) C++ Compiler 14.0.
+
+Bugs fixed:
+
+- The workaround for crashes in the library compiled with GCC 6
+ (-flifetime-dse=1) was extended to Windows*.
+
+------------------------------------------------------------------------
+Intel TBB 2017 Update 3
+TBB_INTERFACE_VERSION == 9103
+
+Changes (w.r.t. Intel TBB 2017 Update 2):
+
+- Added support for Android* 7.0 and Android* NDK r13, r13b.
+
+Preview Features:
+
+- Added template class gfx_factory to the flow graph API. It implements
+ the Factory concept for streaming_node to offload computations to
+ Intel(R) processor graphics.
+
+Bugs fixed:
+
+- Fixed a possible deadlock caused by missed wakeup signals in
+ task_arena::execute().
+
+Open-source contributions integrated:
+
+- A build fix for Linux* s390x platform by Jerry J.
+
+------------------------------------------------------------------------
+Intel TBB 2017 Update 2
+TBB_INTERFACE_VERSION == 9102
+
+Changes (w.r.t. Intel TBB 2017 Update 1):
+
+- Removed the long-outdated support for Xbox* consoles.
+
+Bugs fixed:
+
+- Fixed the issue with task_arena::execute() not being processed when
+ the calling thread cannot join the arena.
+- Fixed dynamic memory allocation replacement failure on macOS* 10.12.
+
+------------------------------------------------------------------------
+Intel TBB 2017 Update 1
+TBB_INTERFACE_VERSION == 9101
+
+Changes (w.r.t. Intel TBB 2017):
+
+Bugs fixed:
+
+- Fixed dynamic memory allocation replacement failures on Windows* 10
+ Anniversary Update.
+- Fixed emplace() method of concurrent unordered containers to not
+ require a copy constructor.
+
+------------------------------------------------------------------------
+Intel TBB 2017
+TBB_INTERFACE_VERSION == 9100
+
+Changes (w.r.t. Intel TBB 4.4 Update 5):
+
+- static_partitioner class is now a fully supported feature.
+- async_node class is now a fully supported feature.
+- Improved dynamic memory allocation replacement on Windows* OS to skip
+ DLLs for which replacement cannot be done, instead of aborting.
+- Intel TBB no longer performs dynamic memory allocation replacement
+ for Microsoft* Visual Studio* 2008.
+- For 64-bit platforms, quadrupled the worst-case limit on the amount
+ of memory the Intel TBB allocator can handle.
+- Added TBB_USE_GLIBCXX_VERSION macro to specify the version of GNU
+ libstdc++ when it cannot be properly recognized, e.g. when used
+ with Clang on Linux* OS. Inspired by a contribution from David A.
+- Added graph/stereo example to demostrate tbb::flow::async_msg.
+- Removed a few cases of excessive user data copying in the flow graph.
+- Reworked split_node to eliminate unnecessary overheads.
+- Added support for C++11 move semantics to the argument of
+ tbb::parallel_do_feeder::add() method.
+- Added C++11 move constructor and assignment operator to
+ tbb::combinable template class.
+- Added tbb::this_task_arena::max_concurrency() function and
+ max_concurrency() method of class task_arena returning the maximal
+ number of threads that can work inside an arena.
+- Deprecated tbb::task_arena::current_thread_index() static method;
+ use tbb::this_task_arena::current_thread_index() function instead.
+- All examples for commercial version of library moved online:
+ https://software.intel.com/en-us/product-code-samples. Examples are
+ available as a standalone package or as a part of Intel(R) Parallel
+ Studio XE or Intel(R) System Studio Online Samples packages.
+
+Changes affecting backward compatibility:
+
+- Renamed following methods and types in async_node class:
+ Old New
+ async_gateway_type => gateway_type
+ async_gateway() => gateway()
+ async_try_put() => try_put()
+ async_reserve() => reserve_wait()
+ async_commit() => release_wait()
+- Internal layout of some flow graph nodes has changed; recompilation
+ is recommended for all binaries that use the flow graph.
+
+Preview Features:
+
+- Added template class streaming_node to the flow graph API. It allows
+ a flow graph to offload computations to other devices through
+ streaming or offloading APIs.
+- Template class opencl_node reimplemented as a specialization of
+ streaming_node that works with OpenCL*.
+- Added tbb::this_task_arena::isolate() function to isolate execution
+ of a group of tasks or an algorithm from other tasks submitted
+ to the scheduler.
+
+Bugs fixed:
+
+- Added a workaround for GCC bug #62258 in std::rethrow_exception()
+ to prevent possible problems in case of exception propagation.
+- Fixed parallel_scan to provide correct result if the initial value
+ of an accumulator is not the operation identity value.
+- Fixed a memory corruption in the memory allocator when it meets
+ internal limits.
+- Fixed the memory allocator on 64-bit platforms to align memory
+ to 16 bytes by default for all allocations bigger than 8 bytes.
+- As a workaround for crashes in the Intel TBB library compiled with
+ GCC 6, added -flifetime-dse=1 to compilation options on Linux* OS.
+- Fixed a race in the flow graph implementation.
+
+Open-source contributions integrated:
+
+- Enabling use of C++11 'override' keyword by Raf Schietekat.
+
+------------------------------------------------------------------------
+Intel TBB 4.4 Update 6
+TBB_INTERFACE_VERSION == 9006
+
+Changes (w.r.t. Intel TBB 4.4 Update 5):
+
+- For 64-bit platforms, quadrupled the worst-case limit on the amount
+ of memory the Intel TBB allocator can handle.
+
+Bugs fixed:
+
+- Fixed a memory corruption in the memory allocator when it meets
+ internal limits.
+- Fixed the memory allocator on 64-bit platforms to align memory
+ to 16 bytes by default for all allocations bigger than 8 bytes.
+- Fixed parallel_scan to provide correct result if the initial value
+ of an accumulator is not the operation identity value.
+- As a workaround for crashes in the Intel TBB library compiled with
+ GCC 6, added -flifetime-dse=1 to compilation options on Linux* OS.
+
+------------------------------------------------------------------------
+Intel TBB 4.4 Update 5
+TBB_INTERFACE_VERSION == 9005
+
+Changes (w.r.t. Intel TBB 4.4 Update 4):
+
+- Modified graph/fgbzip2 example to remove unnecessary data queuing.
+
+Preview Features:
+
+- Added a Python* module which is able to replace Python's thread pool
+ class with the implementation based on Intel TBB task scheduler.
+
+Bugs fixed:
+
+- Fixed the implementation of 64-bit tbb::atomic for IA-32 architecture
+ to work correctly with GCC 5.2 in C++11/14 mode.
+- Fixed a possible crash when tasks with affinity (e.g. specified via
+ affinity_partitioner) are used simultaneously with task priority
+ changes.
+
+------------------------------------------------------------------------
+Intel TBB 4.4 Update 4
+TBB_INTERFACE_VERSION == 9004
+
+Changes (w.r.t. Intel TBB 4.4 Update 3):
+
+- Removed a few cases of excessive user data copying in the flow graph.
+- Improved robustness of concurrent_bounded_queue::abort() in case of
+ simultaneous push and pop operations.
+
+Preview Features:
+
+- Added tbb::flow::async_msg, a special message type to support
+ communications between the flow graph and external asynchronous
+ activities.
+- async_node modified to support use with C++03 compilers.
+
+Bugs fixed:
+
+- Fixed a bug in dynamic memory allocation replacement for Windows* OS.
+- Fixed excessive memory consumption on Linux* OS caused by enabling
+ zero-copy realloc.
+- Fixed performance regression on Intel(R) Xeon Phi(tm) coprocessor with
+ auto_partitioner.
+
+------------------------------------------------------------------------
Intel TBB 4.4 Update 3
TBB_INTERFACE_VERSION == 9003
@@ -474,7 +748,7 @@ Bugs fixed:
- Fixed data races in preview extensions of task_scheduler_observer.
- Added noexcept(false) for destructor of task_group_base to avoid
- crash on cancelation of structured task group in C++11.
+ crash on cancellation of structured task group in C++11.
Open-source contributions integrated:
@@ -490,7 +764,7 @@ TBB_INTERFACE_VERSION == 7003
Changes (w.r.t. Intel TBB 4.2 Update 2):
- Added support for Microsoft* Visual Studio* 2013.
-- Improved Microsoft* PPL-compatible form of parallel_for for better
+- Improved Microsoft* PPL-compatible form of parallel_for for better
support of auto-vectorization.
- Added a new example for cancellation and reset in the flow graph:
Kohonen self-organizing map (examples/graph/som).
@@ -556,7 +830,7 @@ Preview Features:
- Class task_arena no longer requires linking with a preview library,
though still remains a community preview feature.
- The method task_arena::wait_until_empty() is removed.
-- The method task_arena::current_slot() now returns -1 if
+- The method task_arena::current_slot() now returns -1 if
the task scheduler is not initialized in the thread.
Changes affecting backward compatibility:
@@ -737,7 +1011,7 @@ Changes (w.r.t. Intel TBB 4.1):
any platform supported by compiler version 12.1 and newer.
- Using GetNativeSystemInfo() instead of GetSystemInfo() to support
more than 32 processors for 32-bit applications under WOW64.
-- The following form of parallel_for:
+- The following form of parallel_for:
parallel_for(first, last, [step,] f[, context]) now accepts an
optional partitioner parameter after the function f.
@@ -808,7 +1082,7 @@ Changes (w.r.t. Intel TBB 4.0 Update 4):
Bugs fixed:
-- Fixed a tv_nsec overflow bug in condition_variable::wait_for.
+- Fixed a tv_nsec overflow bug in condition_variable::wait_for.
- Fixed execution order of enqueued tasks with different priorities.
- Fixed a bug with task priority changes causing lack of progress
for fire-and-forget tasks when TBB was initialized to use 1 thread.
@@ -877,7 +1151,7 @@ Changes (w.r.t. Intel TBB 4.0 Update 2):
Backward-incompatible API changes:
- a graph reference parameter is now required to be passed to the
- constructors of the following flow graph nodes: overwrite_node,
+ constructors of the following flow graph nodes: overwrite_node,
write_once_node, broadcast_node, and the CPF or_node.
- the following tbb::flow node methods and typedefs have been renamed:
Old New
@@ -898,10 +1172,10 @@ TBB_INTERFACE_VERSION == 6002
Changes (w.r.t. Intel TBB 4.0 Update 1 commercial-aligned release):
-- concurrent_bounded_queue now has an abort() operation that releases
- threads involved in pending push or pop operations. The released
+- concurrent_bounded_queue now has an abort() operation that releases
+ threads involved in pending push or pop operations. The released
threads will receive a tbb::user_abort exception.
-- Added Community Preview Feature: concurrent_lru_cache container,
+- Added Community Preview Feature: concurrent_lru_cache container,
a concurrent implementation of LRU (least-recently-used) cache.
Bugs fixed:
@@ -992,8 +1266,8 @@ TBB_INTERFACE_VERSION == 5006 (forgotten to increment)
Changes (w.r.t. Intel TBB 3.0 Update 6 commercial-aligned release):
-- Added implementation of the platform isolation layer based on
- GCC atomic built-ins; it is supposed to work on any platform
+- Added implementation of the platform isolation layer based on
+ GCC atomic built-ins; it is supposed to work on any platform
where GCC has these built-ins.
Community Preview Features:
@@ -1070,9 +1344,9 @@ Changes (w.r.t. Intel TBB 3.0 Update 3 commercial-aligned release):
- Fixed library loading to avoid possibility for remote code execution,
see http://www.microsoft.com/technet/security/advisory/2269637.mspx.
- Added support of more than 64 cores for appropriate Microsoft*
- Windows* versions. For more details, see
+ Windows* versions. For more details, see
http://msdn.microsoft.com/en-us/library/dd405503.aspx.
-- Default number of worker threads is adjusted in accordance with
+- Default number of worker threads is adjusted in accordance with
process affinity mask.
Bugs fixed:
@@ -1157,7 +1431,7 @@ Bugs fixed:
was a temporary object.
- Incorrect usage of memory fences on PowerPC and XBOX360 platforms.
- A subtle issue in task group context binding that could result
- in cancelation signal being missed by nested task groups.
+ in cancellation signal being missed by nested task groups.
- Incorrect construction of concurrent_unordered_map if specified
number of buckets is not power of two.
- Broken count() and equal_range() of concurrent_unordered_map.
@@ -2078,7 +2352,8 @@ Packaging:
are provided separately on Intel(R) Premier.
------------------------------------------------------------------------
-Intel and Cilk are registered trademarks or trademarks of Intel Corporation or its
-subsidiaries in the United States and other countries.
+Intel, the Intel logo, Xeon, Intel Xeon Phi, and Cilk are registered
+trademarks or trademarks of Intel Corporation or its subsidiaries in
+the United States and other countries.
* Other names and brands may be claimed as the property of others.
diff --git a/lib/3rdParty/tbb/LICENSE b/lib/3rdParty/tbb/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/lib/3rdParty/tbb/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
diff --git a/lib/3rdParty/tbb/bin/x64/v140/tbb.dll b/lib/3rdParty/tbb/bin/x64/v140/tbb.dll
index b0dcda7..655e651 100644
Binary files a/lib/3rdParty/tbb/bin/x64/v140/tbb.dll and b/lib/3rdParty/tbb/bin/x64/v140/tbb.dll differ
diff --git a/lib/3rdParty/tbb/bin/x64/v140/tbb_debug.dll b/lib/3rdParty/tbb/bin/x64/v140/tbb_debug.dll
index 62e4369..bad9f08 100644
Binary files a/lib/3rdParty/tbb/bin/x64/v140/tbb_debug.dll and b/lib/3rdParty/tbb/bin/x64/v140/tbb_debug.dll differ
diff --git a/lib/3rdParty/tbb/bin/x64/v140/tbb_preview.dll b/lib/3rdParty/tbb/bin/x64/v140/tbb_preview.dll
index 1d9fc5f..7351808 100644
Binary files a/lib/3rdParty/tbb/bin/x64/v140/tbb_preview.dll and b/lib/3rdParty/tbb/bin/x64/v140/tbb_preview.dll differ
diff --git a/lib/3rdParty/tbb/bin/x64/v140/tbbmalloc.dll b/lib/3rdParty/tbb/bin/x64/v140/tbbmalloc.dll
index d6f7ee0..cee4336 100644
Binary files a/lib/3rdParty/tbb/bin/x64/v140/tbbmalloc.dll and b/lib/3rdParty/tbb/bin/x64/v140/tbbmalloc.dll differ
diff --git a/lib/3rdParty/tbb/bin/x64/v140/tbbmalloc_proxy.dll b/lib/3rdParty/tbb/bin/x64/v140/tbbmalloc_proxy.dll
index 01b0bb9..7e53309 100644
Binary files a/lib/3rdParty/tbb/bin/x64/v140/tbbmalloc_proxy.dll and b/lib/3rdParty/tbb/bin/x64/v140/tbbmalloc_proxy.dll differ
diff --git a/lib/3rdParty/tbb/bin/x86/v140/tbb.dll b/lib/3rdParty/tbb/bin/x86/v140/tbb.dll
index 9a99bb5..20ca289 100644
Binary files a/lib/3rdParty/tbb/bin/x86/v140/tbb.dll and b/lib/3rdParty/tbb/bin/x86/v140/tbb.dll differ
diff --git a/lib/3rdParty/tbb/bin/x86/v140/tbb_debug.dll b/lib/3rdParty/tbb/bin/x86/v140/tbb_debug.dll
index 7a29cba..96c5011 100644
Binary files a/lib/3rdParty/tbb/bin/x86/v140/tbb_debug.dll and b/lib/3rdParty/tbb/bin/x86/v140/tbb_debug.dll differ
diff --git a/lib/3rdParty/tbb/bin/x86/v140/tbb_preview.dll b/lib/3rdParty/tbb/bin/x86/v140/tbb_preview.dll
index f76c8d6..2090302 100644
Binary files a/lib/3rdParty/tbb/bin/x86/v140/tbb_preview.dll and b/lib/3rdParty/tbb/bin/x86/v140/tbb_preview.dll differ
diff --git a/lib/3rdParty/tbb/bin/x86/v140/tbbmalloc.dll b/lib/3rdParty/tbb/bin/x86/v140/tbbmalloc.dll
index 7e53e1f..99c6495 100644
Binary files a/lib/3rdParty/tbb/bin/x86/v140/tbbmalloc.dll and b/lib/3rdParty/tbb/bin/x86/v140/tbbmalloc.dll differ
diff --git a/lib/3rdParty/tbb/bin/x86/v140/tbbmalloc_proxy.dll b/lib/3rdParty/tbb/bin/x86/v140/tbbmalloc_proxy.dll
index e4cfbdc..cae643f 100644
Binary files a/lib/3rdParty/tbb/bin/x86/v140/tbbmalloc_proxy.dll and b/lib/3rdParty/tbb/bin/x86/v140/tbbmalloc_proxy.dll differ
diff --git a/lib/3rdParty/tbb/include/index.html b/lib/3rdParty/tbb/include/index.html
index c992bb6..b0962e0 100644
--- a/lib/3rdParty/tbb/include/index.html
+++ b/lib/3rdParty/tbb/include/index.html
@@ -8,12 +8,14 @@ Include files for Intel® Threading Building Blocks (Intel® TBB).
tbb
Include files for Intel TBB classes and functions.
+ serial/tbb
+Include files for a sequential implementation of the parallel_for algorithm.
Up to parent directory
-Copyright © 2005-2016 Intel Corporation. All Rights Reserved.
+Copyright © 2005-2017 Intel Corporation. All Rights Reserved.
Intel is a registered trademark or trademark of Intel Corporation
or its subsidiaries in the United States and other countries.
diff --git a/lib/3rdParty/tbb/include/serial/tbb/parallel_for.h b/lib/3rdParty/tbb/include/serial/tbb/parallel_for.h
index 3ef776d..c8f9a79 100644
--- a/lib/3rdParty/tbb/include/serial/tbb/parallel_for.h
+++ b/lib/3rdParty/tbb/include/serial/tbb/parallel_for.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_SERIAL_parallel_for_H
@@ -121,14 +121,12 @@ void parallel_for( const Range& range, const Body& body, const auto_partitioner&
serial::interface9::start_for::run(range,body,partitioner);
}
-#if TBB_PREVIEW_STATIC_PARTITIONER
//! Parallel iteration over range with static_partitioner.
/** @ingroup algorithms **/
template
void parallel_for( const Range& range, const Body& body, const static_partitioner& partitioner ) {
serial::interface9::start_for::run(range,body,partitioner);
}
-#endif
//! Parallel iteration over range with affinity_partitioner.
/** @ingroup algorithms **/
@@ -169,13 +167,11 @@ template
void parallel_for(Index first, Index last, Index step, const Function& f, const auto_partitioner& p) {
parallel_for_impl(first, last, step, f, p);
}
-#if TBB_PREVIEW_STATIC_PARTITIONER
//! Parallel iteration over a range of integers with explicit step and static partitioner
template
void parallel_for(Index first, Index last, Index step, const Function& f, const static_partitioner& p) {
parallel_for_impl(first, last, step, f, p);
}
-#endif
//! Parallel iteration over a range of integers with explicit step and affinity partitioner
template
void parallel_for(Index first, Index last, Index step, const Function& f, affinity_partitioner& p) {
@@ -197,13 +193,11 @@ template
void parallel_for(Index first, Index last, const Function& f, const auto_partitioner& p) {
parallel_for_impl(first, last, static_cast(1), f, p);
}
-#if TBB_PREVIEW_STATIC_PARTITIONER
//! Parallel iteration over a range of integers with default step and static partitioner
template
void parallel_for(Index first, Index last, const Function& f, const static_partitioner& p) {
parallel_for_impl(first, last, static_cast(1), f, p);
}
-#endif
//! Parallel iteration over a range of integers with default step and affinity_partitioner
template
void parallel_for(Index first, Index last, const Function& f, affinity_partitioner& p) {
diff --git a/lib/3rdParty/tbb/include/serial/tbb/tbb_annotate.h b/lib/3rdParty/tbb/include/serial/tbb/tbb_annotate.h
index f7de75c..81c8d3a 100644
--- a/lib/3rdParty/tbb/include/serial/tbb/tbb_annotate.h
+++ b/lib/3rdParty/tbb/include/serial/tbb/tbb_annotate.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_annotate_H
diff --git a/lib/3rdParty/tbb/include/tbb/aggregator.h b/lib/3rdParty/tbb/include/tbb/aggregator.h
index fc2ad21..6aecbb7 100644
--- a/lib/3rdParty/tbb/include/tbb/aggregator.h
+++ b/lib/3rdParty/tbb/include/tbb/aggregator.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB__aggregator_H
@@ -62,7 +62,7 @@ public:
template
class basic_operation : public basic_operation_base, no_assign {
const Body& my_body;
- /*override*/ void apply_body() { my_body(); }
+ void apply_body() __TBB_override { my_body(); }
public:
basic_operation(const Body& b) : basic_operation_base(), my_body(b) {}
};
@@ -102,7 +102,7 @@ public:
/** Details of user-made operations must be handled by user-provided handler */
void process(aggregator_operation *op) { execute_impl(*op); }
- protected:
+protected:
/** Place operation in mailbox, then either handle mailbox or wait for the operation
to be completed by a different thread. */
void execute_impl(aggregator_operation& op) {
@@ -114,7 +114,7 @@ public:
// thus this tag will be acquired just before the operation is handled in the
// handle_operations functor.
call_itt_notify(releasing, &(op.status));
- // insert the operation in the queue
+ // insert the operation into the list
do {
// ITT may flag the following line as a race; it is a false positive:
// This is an atomic read; we don't provide itt_hide_load_word for atomics
@@ -135,7 +135,7 @@ public:
}
- private:
+private:
//! An atomically updated list (aka mailbox) of aggregator_operations
atomic mailbox;
diff --git a/lib/3rdParty/tbb/include/tbb/aligned_space.h b/lib/3rdParty/tbb/include/tbb/aligned_space.h
index 07d49ab..56fd85f 100644
--- a/lib/3rdParty/tbb/include/tbb/aligned_space.h
+++ b/lib/3rdParty/tbb/include/tbb/aligned_space.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_aligned_space_H
diff --git a/lib/3rdParty/tbb/include/tbb/atomic.h b/lib/3rdParty/tbb/include/tbb/atomic.h
index b269ff2..72ec534 100644
--- a/lib/3rdParty/tbb/include/tbb/atomic.h
+++ b/lib/3rdParty/tbb/include/tbb/atomic.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_atomic_H
@@ -31,8 +31,8 @@
#include "tbb_machine.h"
-#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
- // Workaround for overzealous compiler warnings
+#if _MSC_VER && !__INTEL_COMPILER
+ // Suppress overzealous compiler warnings till the end of the file
#pragma warning (push)
#pragma warning (disable: 4244 4267 4512)
#endif
@@ -54,7 +54,9 @@ enum memory_semantics {
//! @cond INTERNAL
namespace internal {
-#if __TBB_ATTRIBUTE_ALIGNED_PRESENT
+#if __TBB_ALIGNAS_PRESENT
+ #define __TBB_DECL_ATOMIC_FIELD(t,f,a) alignas(a) t f;
+#elif __TBB_ATTRIBUTE_ALIGNED_PRESENT
#define __TBB_DECL_ATOMIC_FIELD(t,f,a) t f __attribute__ ((aligned(a)));
#elif __TBB_DECLSPEC_ALIGN_PRESENT
#define __TBB_DECL_ATOMIC_FIELD(t,f,a) __declspec(align(a)) t f;
@@ -551,6 +553,6 @@ inline atomic& as_atomic( T& t ) {
#if _MSC_VER && !__INTEL_COMPILER
#pragma warning (pop)
-#endif // warnings 4244, 4267 are back
+#endif // warnings are restored
#endif /* __TBB_atomic_H */
diff --git a/lib/3rdParty/tbb/include/tbb/blocked_range.h b/lib/3rdParty/tbb/include/tbb/blocked_range.h
index 5262669..9f24cd2 100644
--- a/lib/3rdParty/tbb/include/tbb/blocked_range.h
+++ b/lib/3rdParty/tbb/include/tbb/blocked_range.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_blocked_range_H
diff --git a/lib/3rdParty/tbb/include/tbb/blocked_range2d.h b/lib/3rdParty/tbb/include/tbb/blocked_range2d.h
index 00b809c..f1b9f35 100644
--- a/lib/3rdParty/tbb/include/tbb/blocked_range2d.h
+++ b/lib/3rdParty/tbb/include/tbb/blocked_range2d.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_blocked_range2d_H
diff --git a/lib/3rdParty/tbb/include/tbb/blocked_range3d.h b/lib/3rdParty/tbb/include/tbb/blocked_range3d.h
index 9db8b49..c62565e 100644
--- a/lib/3rdParty/tbb/include/tbb/blocked_range3d.h
+++ b/lib/3rdParty/tbb/include/tbb/blocked_range3d.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_blocked_range3d_H
diff --git a/lib/3rdParty/tbb/include/tbb/cache_aligned_allocator.h b/lib/3rdParty/tbb/include/tbb/cache_aligned_allocator.h
index 14640ff..d435e78 100644
--- a/lib/3rdParty/tbb/include/tbb/cache_aligned_allocator.h
+++ b/lib/3rdParty/tbb/include/tbb/cache_aligned_allocator.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_cache_aligned_allocator_H
diff --git a/lib/3rdParty/tbb/include/tbb/combinable.h b/lib/3rdParty/tbb/include/tbb/combinable.h
index 3a95397..0063dbb 100644
--- a/lib/3rdParty/tbb/include/tbb/combinable.h
+++ b/lib/3rdParty/tbb/include/tbb/combinable.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_combinable_H
@@ -31,10 +31,10 @@ namespace tbb {
//! Thread-local storage with optional reduction
/** @ingroup containers */
template
- class combinable {
+ class combinable {
+
private:
typedef typename tbb::cache_aligned_allocator my_alloc;
-
typedef typename tbb::enumerable_thread_specific my_ets_type;
my_ets_type my_ets;
@@ -43,15 +43,28 @@ namespace tbb {
combinable() { }
template
- combinable( finit _finit) : my_ets(_finit) { }
+ explicit combinable( finit _finit) : my_ets(_finit) { }
//! destructor
- ~combinable() {
+ ~combinable() { }
+
+ combinable( const combinable& other) : my_ets(other.my_ets) { }
+
+#if __TBB_ETS_USE_CPP11
+ combinable( combinable&& other) : my_ets( std::move(other.my_ets)) { }
+#endif
+
+ combinable & operator=( const combinable & other) {
+ my_ets = other.my_ets;
+ return *this;
}
- combinable(const combinable& other) : my_ets(other.my_ets) { }
-
- combinable & operator=( const combinable & other) { my_ets = other.my_ets; return *this; }
+#if __TBB_ETS_USE_CPP11
+ combinable & operator=( combinable && other) {
+ my_ets=std::move(other.my_ets);
+ return *this;
+ }
+#endif
void clear() { my_ets.clear(); }
diff --git a/lib/3rdParty/tbb/include/tbb/compat/condition_variable b/lib/3rdParty/tbb/include/tbb/compat/condition_variable
index 7a79225..43edfc0 100644
--- a/lib/3rdParty/tbb/include/tbb/compat/condition_variable
+++ b/lib/3rdParty/tbb/include/tbb/compat/condition_variable
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_condition_variable_H
diff --git a/lib/3rdParty/tbb/include/tbb/compat/ppl.h b/lib/3rdParty/tbb/include/tbb/compat/ppl.h
index 2cfc537..840dfb2 100644
--- a/lib/3rdParty/tbb/include/tbb/compat/ppl.h
+++ b/lib/3rdParty/tbb/include/tbb/compat/ppl.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_compat_ppl_H
diff --git a/lib/3rdParty/tbb/include/tbb/compat/thread b/lib/3rdParty/tbb/include/tbb/compat/thread
index bc22ed5..0edd928 100644
--- a/lib/3rdParty/tbb/include/tbb/compat/thread
+++ b/lib/3rdParty/tbb/include/tbb/compat/thread
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_thread_H
diff --git a/lib/3rdParty/tbb/include/tbb/compat/tuple b/lib/3rdParty/tbb/include/tbb/compat/tuple
index 1eafb7b..5767c49 100644
--- a/lib/3rdParty/tbb/include/tbb/compat/tuple
+++ b/lib/3rdParty/tbb/include/tbb/compat/tuple
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_tuple_H
diff --git a/lib/3rdParty/tbb/include/tbb/concurrent_hash_map.h b/lib/3rdParty/tbb/include/tbb/concurrent_hash_map.h
index fb41de7..09b2765 100644
--- a/lib/3rdParty/tbb/include/tbb/concurrent_hash_map.h
+++ b/lib/3rdParty/tbb/include/tbb/concurrent_hash_map.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_concurrent_hash_map_H
@@ -32,7 +32,7 @@
#include
#include // Need std::pair
#include // Need std::memset
-#include // Need std::swap
+#include __TBB_STD_SWAP_HEADER
#if !TBB_USE_EXCEPTIONS && _MSC_VER
#pragma warning (pop)
@@ -333,9 +333,10 @@ namespace interface5 {
void advance_to_next_bucket() { // TODO?: refactor to iterator_base class
size_t k = my_index+1;
- while( my_bucket && k <= my_map->my_mask ) {
+ __TBB_ASSERT( my_bucket, "advancing an invalid iterator?");
+ while( k <= my_map->my_mask ) {
// Following test uses 2's-complement wizardry
- if( k& (k-2) ) // not the beginning of a segment
+ if( k&(k-2) ) // not the beginning of a segment
++my_bucket;
else my_bucket = my_map->get_bucket( k );
my_node = static_cast( my_bucket->node_list );
@@ -368,7 +369,7 @@ namespace interface5 {
public:
//! Construct undefined iterator
- hash_map_iterator() {}
+ hash_map_iterator(): my_map(), my_index(), my_bucket(), my_node() {}
hash_map_iterator( const hash_map_iterator &other ) :
my_map(other.my_map),
my_index(other.my_index),
@@ -765,7 +766,7 @@ public:
};
//! Construct empty table.
- concurrent_hash_map( const allocator_type &a = allocator_type() )
+ explicit concurrent_hash_map( const allocator_type &a = allocator_type() )
: internal::hash_map_base(), my_allocator(a)
{}
diff --git a/lib/3rdParty/tbb/include/tbb/concurrent_lru_cache.h b/lib/3rdParty/tbb/include/tbb/concurrent_lru_cache.h
index 20fbb7b..8aacf24 100644
--- a/lib/3rdParty/tbb/include/tbb/concurrent_lru_cache.h
+++ b/lib/3rdParty/tbb/include/tbb/concurrent_lru_cache.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_concurrent_lru_cache_H
@@ -126,8 +126,8 @@ private:
}
static handle_move_t move(handle_object& h){
__TBB_ASSERT(h.my_cache_pointer,"move from the same object twice ?");
- concurrent_lru_cache * cache_pointer = NULL;
- std::swap(cache_pointer,h.my_cache_pointer);
+ concurrent_lru_cache * cache_pointer = h.my_cache_pointer;
+ h.my_cache_pointer = NULL;
return handle_move_t(*cache_pointer,h.my_map_record_ref);
}
private:
diff --git a/lib/3rdParty/tbb/include/tbb/concurrent_priority_queue.h b/lib/3rdParty/tbb/include/tbb/concurrent_priority_queue.h
index d5871e5..89297d8 100644
--- a/lib/3rdParty/tbb/include/tbb/concurrent_priority_queue.h
+++ b/lib/3rdParty/tbb/include/tbb/concurrent_priority_queue.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_concurrent_priority_queue_H
@@ -30,6 +30,7 @@
#include
#include
#include
+#include __TBB_STD_SWAP_HEADER
#if __TBB_INITIALIZER_LISTS_PRESENT
#include
@@ -373,7 +374,7 @@ class concurrent_priority_queue {
compare(data[0], data[data.size()-1])) {
// there are newly pushed elems and the last one
// is higher than top
- *(tmp->elem) = move(data[data.size()-1]);
+ *(tmp->elem) = tbb::internal::move(data[data.size()-1]);
__TBB_store_with_release(my_size, my_size-1);
itt_store_word_with_release(tmp->status, uintptr_t(SUCCEEDED));
data.pop_back();
@@ -389,7 +390,7 @@ class concurrent_priority_queue {
if (tmp->type == PUSH_OP) {
push_back_helper(*(tmp->elem), typename internal::use_element_copy_constructor::type());
} else {
- data.push_back(move(*(tmp->elem)));
+ data.push_back(tbb::internal::move(*(tmp->elem)));
}
__TBB_store_with_release(my_size, my_size + 1);
itt_store_word_with_release(tmp->status, uintptr_t(SUCCEEDED));
@@ -413,13 +414,13 @@ class concurrent_priority_queue {
compare(data[0], data[data.size()-1])) {
// there are newly pushed elems and the last one is
// higher than top
- *(tmp->elem) = move(data[data.size()-1]);
+ *(tmp->elem) = tbb::internal::move(data[data.size()-1]);
__TBB_store_with_release(my_size, my_size-1);
itt_store_word_with_release(tmp->status, uintptr_t(SUCCEEDED));
data.pop_back();
}
else { // extract top and push last element down heap
- *(tmp->elem) = move(data[0]);
+ *(tmp->elem) = tbb::internal::move(data[0]);
__TBB_store_with_release(my_size, my_size-1);
itt_store_word_with_release(tmp->status, uintptr_t(SUCCEEDED));
reheap();
@@ -439,14 +440,14 @@ class concurrent_priority_queue {
for (; mark>1;
if (!compare(data[parent], to_place)) break;
- data[cur_pos] = move(data[parent]);
+ data[cur_pos] = tbb::internal::move(data[parent]);
cur_pos = parent;
} while( cur_pos );
- data[cur_pos] = move(to_place);
+ data[cur_pos] = tbb::internal::move(to_place);
}
}
@@ -461,12 +462,12 @@ class concurrent_priority_queue {
++target;
// target now has the higher priority child
if (compare(data[target], data[data.size()-1])) break;
- data[cur_pos] = move(data[target]);
+ data[cur_pos] = tbb::internal::move(data[target]);
cur_pos = target;
child = (cur_pos<<1)+1;
}
if (cur_pos != data.size()-1)
- data[cur_pos] = move(data[data.size()-1]);
+ data[cur_pos] = tbb::internal::move(data[data.size()-1]);
data.pop_back();
if (mark > data.size()) mark = data.size();
}
diff --git a/lib/3rdParty/tbb/include/tbb/concurrent_queue.h b/lib/3rdParty/tbb/include/tbb/concurrent_queue.h
index ee1187c..81db58a 100644
--- a/lib/3rdParty/tbb/include/tbb/concurrent_queue.h
+++ b/lib/3rdParty/tbb/include/tbb/concurrent_queue.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_concurrent_queue_H
@@ -40,7 +40,7 @@ class concurrent_queue: public internal::concurrent_queue_base_v3 {
page_allocator_type my_allocator;
//! Allocates a block of size n (bytes)
- /*override*/ virtual void *allocate_block( size_t n ) {
+ virtual void *allocate_block( size_t n ) __TBB_override {
void *b = reinterpret_cast(my_allocator.allocate( n ));
if( !b )
internal::throw_exception(internal::eid_bad_alloc);
@@ -48,7 +48,7 @@ class concurrent_queue: public internal::concurrent_queue_base_v3 {
}
//! Deallocates block created by allocate_block.
- /*override*/ virtual void deallocate_block( void *b, size_t n ) {
+ virtual void deallocate_block( void *b, size_t n ) __TBB_override {
my_allocator.deallocate( reinterpret_cast(b), n );
}
@@ -185,10 +185,8 @@ concurrent_queue::~concurrent_queue() {
template
void concurrent_queue::clear() {
- while( !empty() ) {
- T value;
- this->internal_try_pop(&value);
- }
+ T value;
+ while( !empty() ) try_pop(value);
}
} // namespace strict_ppl
@@ -223,41 +221,41 @@ class concurrent_bounded_queue: public internal::concurrent_queue_base_v8 {
return (&static_cast(static_cast(&p))->last)[index];
}
- /*override*/ virtual void copy_item( page& dst, size_t index, const void* src ) {
+ virtual void copy_item( page& dst, size_t index, const void* src ) __TBB_override {
new( &get_ref(dst,index) ) T(*static_cast(src));
}
#if __TBB_CPP11_RVALUE_REF_PRESENT
- /*override*/ virtual void move_item( page& dst, size_t index, const void* src ) {
+ virtual void move_item( page& dst, size_t index, const void* src ) __TBB_override {
new( &get_ref(dst,index) ) T( std::move(*static_cast(const_cast(src))) );
}
#else
- /*override*/ virtual void move_item( page&, size_t, const void* ) {
+ virtual void move_item( page&, size_t, const void* ) __TBB_override {
__TBB_ASSERT( false, "Unreachable code" );
}
#endif
- /*override*/ virtual void copy_page_item( page& dst, size_t dindex, const page& src, size_t sindex ) {
+ virtual void copy_page_item( page& dst, size_t dindex, const page& src, size_t sindex ) __TBB_override {
new( &get_ref(dst,dindex) ) T( get_ref( const_cast(src), sindex ) );
}
#if __TBB_CPP11_RVALUE_REF_PRESENT
- /*override*/ virtual void move_page_item( page& dst, size_t dindex, const page& src, size_t sindex ) {
+ virtual void move_page_item( page& dst, size_t dindex, const page& src, size_t sindex ) __TBB_override {
new( &get_ref(dst,dindex) ) T( std::move(get_ref( const_cast(src), sindex )) );
}
#else
- /*override*/ virtual void move_page_item( page&, size_t, const page&, size_t ) {
+ virtual void move_page_item( page&, size_t, const page&, size_t ) __TBB_override {
__TBB_ASSERT( false, "Unreachable code" );
}
#endif
- /*override*/ virtual void assign_and_destroy_item( void* dst, page& src, size_t index ) {
+ virtual void assign_and_destroy_item( void* dst, page& src, size_t index ) __TBB_override {
T& from = get_ref(src,index);
destroyer d(from);
*static_cast(dst) = tbb::internal::move( from );
}
- /*override*/ virtual page *allocate_page() {
+ virtual page *allocate_page() __TBB_override {
size_t n = sizeof(padded_page) + (items_per_page-1)*sizeof(T);
page *p = reinterpret_cast(my_allocator.allocate( n ));
if( !p )
@@ -265,7 +263,7 @@ class concurrent_bounded_queue: public internal::concurrent_queue_base_v8 {
return p;
}
- /*override*/ virtual void deallocate_page( page *p ) {
+ virtual void deallocate_page( page *p ) __TBB_override {
size_t n = sizeof(padded_page) + (items_per_page-1)*sizeof(T);
my_allocator.deallocate( reinterpret_cast(p), n );
}
@@ -449,10 +447,8 @@ concurrent_bounded_queue::~concurrent_bounded_queue() {
template
void concurrent_bounded_queue::clear() {
- while( !empty() ) {
- T value;
- internal_pop_if_present(&value);
- }
+ T value;
+ while( try_pop(value) ) /*noop*/;
}
using strict_ppl::concurrent_queue;
diff --git a/lib/3rdParty/tbb/include/tbb/concurrent_unordered_map.h b/lib/3rdParty/tbb/include/tbb/concurrent_unordered_map.h
index 09a2a28..c959a7e 100644
--- a/lib/3rdParty/tbb/include/tbb/concurrent_unordered_map.h
+++ b/lib/3rdParty/tbb/include/tbb/concurrent_unordered_map.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
/* Container implementations in this header are based on PPL implementations
@@ -45,22 +45,6 @@ protected:
concurrent_unordered_map_traits() : my_hash_compare() {}
concurrent_unordered_map_traits(const hash_compare& hc) : my_hash_compare(hc) {}
- class value_compare : public std::binary_function
- {
- friend class concurrent_unordered_map_traits;
-
- public:
- bool operator()(const value_type& left, const value_type& right) const
- {
- return (my_hash_compare(left.first, right.first));
- }
-
- value_compare(const hash_compare& comparator) : my_hash_compare(comparator) {}
-
- protected:
- hash_compare my_hash_compare; // the comparator predicate for keys
- };
-
template
static const Key& get_key(const std::pair& value) {
return (value.first);
@@ -115,12 +99,10 @@ public:
const hasher& _Hasher = hasher(), const key_equal& _Key_equality = key_equal(),
const allocator_type& a = allocator_type())
: base_type(n_of_buckets, key_compare(_Hasher, _Key_equality), a)
- {
- }
+ {}
- concurrent_unordered_map(const Allocator& a) : base_type(base_type::initial_bucket_number, key_compare(), a)
- {
- }
+ explicit concurrent_unordered_map(const Allocator& a) : base_type(base_type::initial_bucket_number, key_compare(), a)
+ {}
template
concurrent_unordered_map(Iterator first, Iterator last, size_type n_of_buckets = base_type::initial_bucket_number,
@@ -142,11 +124,11 @@ public:
}
#endif //# __TBB_INITIALIZER_LISTS_PRESENT
-#if __TBB_CPP11_RVALUE_REF_PRESENT && __TBB_CPP11_IMPLICIT_MOVE_MEMBERS_GENERATION_FOR_DERIVED_BROKEN
+#if __TBB_CPP11_RVALUE_REF_PRESENT
+#if !__TBB_IMPLICIT_MOVE_PRESENT
concurrent_unordered_map(const concurrent_unordered_map& table)
: base_type(table)
- {
- }
+ {}
concurrent_unordered_map& operator=(const concurrent_unordered_map& table)
{
@@ -155,25 +137,22 @@ public:
concurrent_unordered_map(concurrent_unordered_map&& table)
: base_type(std::move(table))
- {
- }
+ {}
concurrent_unordered_map& operator=(concurrent_unordered_map&& table)
{
return static_cast(base_type::operator=(std::move(table)));
}
-#endif //__TBB_CPP11_IMPLICIT_MOVE_MEMBERS_GENERATION_FOR_DERIVED_BROKEN
+#endif //!__TBB_IMPLICIT_MOVE_PRESENT
+
+ concurrent_unordered_map(concurrent_unordered_map&& table, const Allocator& a) : base_type(std::move(table), a)
+ {}
+#endif //__TBB_CPP11_RVALUE_REF_PRESENT
concurrent_unordered_map(const concurrent_unordered_map& table, const Allocator& a)
: base_type(table, a)
- {
- }
+ {}
-#if __TBB_CPP11_RVALUE_REF_PRESENT
- concurrent_unordered_map(concurrent_unordered_map&& table, const Allocator& a) : base_type(std::move(table), a)
- {
- }
-#endif
// Observers
mapped_type& operator[](const key_type& key)
{
@@ -256,12 +235,10 @@ public:
const hasher& _Hasher = hasher(), const key_equal& _Key_equality = key_equal(),
const allocator_type& a = allocator_type())
: base_type(n_of_buckets, key_compare(_Hasher, _Key_equality), a)
- {
- }
+ {}
- concurrent_unordered_multimap(const Allocator& a) : base_type(base_type::initial_bucket_number, key_compare(), a)
- {
- }
+ explicit concurrent_unordered_multimap(const Allocator& a) : base_type(base_type::initial_bucket_number, key_compare(), a)
+ {}
template
concurrent_unordered_multimap(Iterator first, Iterator last, size_type n_of_buckets = base_type::initial_bucket_number,
@@ -283,11 +260,11 @@ public:
}
#endif //# __TBB_INITIALIZER_LISTS_PRESENT
-#if __TBB_CPP11_RVALUE_REF_PRESENT && __TBB_CPP11_IMPLICIT_MOVE_MEMBERS_GENERATION_FOR_DERIVED_BROKEN
+#if __TBB_CPP11_RVALUE_REF_PRESENT
+#if !__TBB_IMPLICIT_MOVE_PRESENT
concurrent_unordered_multimap(const concurrent_unordered_multimap& table)
: base_type(table)
- {
- }
+ {}
concurrent_unordered_multimap& operator=(const concurrent_unordered_multimap& table)
{
@@ -296,25 +273,21 @@ public:
concurrent_unordered_multimap(concurrent_unordered_multimap&& table)
: base_type(std::move(table))
- {
- }
+ {}
concurrent_unordered_multimap& operator=(concurrent_unordered_multimap&& table)
{
return static_cast(base_type::operator=(std::move(table)));
}
-#endif //__TBB_CPP11_IMPLICIT_MOVE_MEMBERS_GENERATION_FOR_DERIVED_BROKEN
+#endif //!__TBB_IMPLICIT_MOVE_PRESENT
+
+ concurrent_unordered_multimap(concurrent_unordered_multimap&& table, const Allocator& a) : base_type(std::move(table), a)
+ {}
+#endif //__TBB_CPP11_RVALUE_REF_PRESENT
concurrent_unordered_multimap(const concurrent_unordered_multimap& table, const Allocator& a)
: base_type(table, a)
- {
- }
-
-#if __TBB_CPP11_RVALUE_REF_PRESENT
- concurrent_unordered_multimap(concurrent_unordered_multimap&& table, const Allocator& a) : base_type(std::move(table), a)
- {
- }
-#endif
+ {}
};
} // namespace interface5
diff --git a/lib/3rdParty/tbb/include/tbb/concurrent_unordered_set.h b/lib/3rdParty/tbb/include/tbb/concurrent_unordered_set.h
index 62d992b..a26fee1 100644
--- a/lib/3rdParty/tbb/include/tbb/concurrent_unordered_set.h
+++ b/lib/3rdParty/tbb/include/tbb/concurrent_unordered_set.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
/* Container implementations in this header are based on PPL implementations
@@ -45,8 +45,6 @@ protected:
concurrent_unordered_set_traits() : my_hash_compare() {}
concurrent_unordered_set_traits(const hash_compare& hc) : my_hash_compare(hc) {}
- typedef hash_compare value_compare;
-
static const Key& get_key(const value_type& value) {
return value;
}
@@ -59,8 +57,8 @@ class concurrent_unordered_set : public internal::concurrent_unordered_base< con
{
// Base type definitions
typedef internal::hash_compare hash_compare;
- typedef internal::concurrent_unordered_base< concurrent_unordered_set_traits > base_type;
- typedef concurrent_unordered_set_traits, Allocator, false> traits_type;
+ typedef concurrent_unordered_set_traits traits_type;
+ typedef internal::concurrent_unordered_base< traits_type > base_type;
#if __TBB_EXTRA_DEBUG
public:
#endif
@@ -94,12 +92,10 @@ public:
explicit concurrent_unordered_set(size_type n_of_buckets = base_type::initial_bucket_number, const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(), const allocator_type& a = allocator_type())
: base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
- {
- }
+ {}
- concurrent_unordered_set(const Allocator& a) : base_type(base_type::initial_bucket_number, key_compare(), a)
- {
- }
+ explicit concurrent_unordered_set(const Allocator& a) : base_type(base_type::initial_bucket_number, key_compare(), a)
+ {}
template
concurrent_unordered_set(Iterator first, Iterator last, size_type n_of_buckets = base_type::initial_bucket_number, const hasher& a_hasher = hasher(),
@@ -111,7 +107,7 @@ public:
#if __TBB_INITIALIZER_LISTS_PRESENT
//! Constructor from initializer_list
- concurrent_unordered_set(std::initializer_list il, size_type n_of_buckets = base_type::initial_bucket_number, const hasher& a_hasher = hasher(),
+ concurrent_unordered_set(std::initializer_list il, size_type n_of_buckets = base_type::initial_bucket_number, const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(), const allocator_type& a = allocator_type())
: base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
{
@@ -119,11 +115,11 @@ public:
}
#endif //# __TBB_INITIALIZER_LISTS_PRESENT
-#if __TBB_CPP11_RVALUE_REF_PRESENT && __TBB_CPP11_IMPLICIT_MOVE_MEMBERS_GENERATION_FOR_DERIVED_BROKEN
+#if __TBB_CPP11_RVALUE_REF_PRESENT
+#if !__TBB_IMPLICIT_MOVE_PRESENT
concurrent_unordered_set(const concurrent_unordered_set& table)
: base_type(table)
- {
- }
+ {}
concurrent_unordered_set& operator=(const concurrent_unordered_set& table)
{
@@ -132,26 +128,22 @@ public:
concurrent_unordered_set(concurrent_unordered_set&& table)
: base_type(std::move(table))
- {
- }
+ {}
concurrent_unordered_set& operator=(concurrent_unordered_set&& table)
{
return static_cast(base_type::operator=(std::move(table)));
}
-#endif //__TBB_CPP11_IMPLICIT_MOVE_MEMBERS_GENERATION_FOR_DERIVED_BROKEN
+#endif //!__TBB_IMPLICIT_MOVE_PRESENT
+
+ concurrent_unordered_set(concurrent_unordered_set&& table, const Allocator& a)
+ : base_type(std::move(table), a)
+ {}
+#endif //__TBB_CPP11_RVALUE_REF_PRESENT
concurrent_unordered_set(const concurrent_unordered_set& table, const Allocator& a)
: base_type(table, a)
- {
- }
-
-#if __TBB_CPP11_RVALUE_REF_PRESENT
- concurrent_unordered_set(concurrent_unordered_set&& table, const Allocator& a)
- : base_type(std::move(table), a)
- {
- }
-#endif //__TBB_CPP11_RVALUE_REF_PRESENT
+ {}
};
@@ -199,12 +191,10 @@ public:
const hasher& _Hasher = hasher(), const key_equal& _Key_equality = key_equal(),
const allocator_type& a = allocator_type())
: base_type(n_of_buckets, key_compare(_Hasher, _Key_equality), a)
- {
- }
+ {}
- concurrent_unordered_multiset(const Allocator& a) : base_type(base_type::initial_bucket_number, key_compare(), a)
- {
- }
+ explicit concurrent_unordered_multiset(const Allocator& a) : base_type(base_type::initial_bucket_number, key_compare(), a)
+ {}
template
concurrent_unordered_multiset(Iterator first, Iterator last, size_type n_of_buckets = base_type::initial_bucket_number,
@@ -217,7 +207,7 @@ public:
#if __TBB_INITIALIZER_LISTS_PRESENT
//! Constructor from initializer_list
- concurrent_unordered_multiset(std::initializer_list il, size_type n_of_buckets = base_type::initial_bucket_number, const hasher& a_hasher = hasher(),
+ concurrent_unordered_multiset(std::initializer_list il, size_type n_of_buckets = base_type::initial_bucket_number, const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(), const allocator_type& a = allocator_type())
: base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
{
@@ -225,39 +215,36 @@ public:
}
#endif //# __TBB_INITIALIZER_LISTS_PRESENT
-#if __TBB_CPP11_RVALUE_REF_PRESENT && __TBB_CPP11_IMPLICIT_MOVE_MEMBERS_GENERATION_FOR_DERIVED_BROKEN
- concurrent_unordered_multiset(const concurrent_unordered_multiset& table)
+#if __TBB_CPP11_RVALUE_REF_PRESENT
+#if !__TBB_IMPLICIT_MOVE_PRESENT
+ concurrent_unordered_multiset(const concurrent_unordered_multiset& table)
: base_type(table)
- {
- }
+ {}
- concurrent_unordered_multiset& operator=(const concurrent_unordered_multiset& table)
+ concurrent_unordered_multiset& operator=(const concurrent_unordered_multiset& table)
{
return static_cast(base_type::operator=(table));
}
- concurrent_unordered_multiset(concurrent_unordered_multiset&& table)
+ concurrent_unordered_multiset(concurrent_unordered_multiset&& table)
: base_type(std::move(table))
- {
- }
+ {}
- concurrent_unordered_multiset& operator=(concurrent_unordered_multiset&& table)
+ concurrent_unordered_multiset& operator=(concurrent_unordered_multiset&& table)
{
return static_cast(base_type::operator=(std::move(table)));
}
-#endif //__TBB_CPP11_IMPLICIT_MOVE_MEMBERS_GENERATION_FOR_DERIVED_BROKEN
+#endif //!__TBB_IMPLICIT_MOVE_PRESENT
- concurrent_unordered_multiset(const concurrent_unordered_multiset& table, const Allocator& a)
- : base_type(table, a)
- {
- }
-
-#if __TBB_CPP11_RVALUE_REF_PRESENT
concurrent_unordered_multiset(concurrent_unordered_multiset&& table, const Allocator& a)
: base_type(std::move(table), a)
{
}
#endif //__TBB_CPP11_RVALUE_REF_PRESENT
+
+ concurrent_unordered_multiset(const concurrent_unordered_multiset& table, const Allocator& a)
+ : base_type(table, a)
+ {}
};
} // namespace interface5
diff --git a/lib/3rdParty/tbb/include/tbb/concurrent_vector.h b/lib/3rdParty/tbb/include/tbb/concurrent_vector.h
index aeca317..370129e 100644
--- a/lib/3rdParty/tbb/include/tbb/concurrent_vector.h
+++ b/lib/3rdParty/tbb/include/tbb/concurrent_vector.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_concurrent_vector_H
@@ -30,6 +30,7 @@
#include "tbb_profiling.h"
#include
#include // for memset()
+#include __TBB_STD_SWAP_HEADER
#if !TBB_USE_EXCEPTIONS && _MSC_VER
// Suppress "C++ exception handler used, but unwind semantics are not enabled" warning in STL headers
@@ -72,12 +73,12 @@ namespace tbb {
template >
class concurrent_vector;
-template
-class vector_iterator;
-
//! @cond INTERNAL
namespace internal {
+ template
+ class vector_iterator;
+
//! Bad allocation marker
static void *const vector_allocation_error_flag = reinterpret_cast(size_t(63));
diff --git a/lib/3rdParty/tbb/include/tbb/critical_section.h b/lib/3rdParty/tbb/include/tbb/critical_section.h
index 596f7fe..324b3e1 100644
--- a/lib/3rdParty/tbb/include/tbb/critical_section.h
+++ b/lib/3rdParty/tbb/include/tbb/critical_section.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef _TBB_CRITICAL_SECTION_H_
diff --git a/lib/3rdParty/tbb/include/tbb/enumerable_thread_specific.h b/lib/3rdParty/tbb/include/tbb/enumerable_thread_specific.h
index c457c03..f31f533 100644
--- a/lib/3rdParty/tbb/include/tbb/enumerable_thread_specific.h
+++ b/lib/3rdParty/tbb/include/tbb/enumerable_thread_specific.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_enumerable_thread_specific_H
@@ -73,7 +73,7 @@ namespace interface6 {
slot& at( size_t k ) {
return ((slot*)(void*)(this+1))[k];
}
- size_t size() const {return (size_t)1<>(8*sizeof(size_t)-lg_size);
@@ -102,14 +102,14 @@ namespace interface6 {
virtual void* create_array(size_t _size) = 0; // _size in bytes
virtual void free_array(void* ptr, size_t _size) = 0; // _size in bytes
array* allocate( size_t lg_size ) {
- size_t n = 1<(create_array( sizeof(array)+n*sizeof(slot) ));
a->lg_size = lg_size;
std::memset( a+1, 0, n*sizeof(slot) );
return a;
}
void free(array* a) {
- size_t n = 1<<(a->lg_size);
+ size_t n = size_t(1)<<(a->lg_size);
free_array( (void *)a, size_t(sizeof(array)+n*sizeof(slot)) );
}
@@ -266,9 +266,9 @@ namespace interface6 {
void* get_tls() const { return pthread_getspecific(my_key); }
#endif
tls_key_t my_key;
- virtual void* create_local() = 0;
- virtual void* create_array(size_t _size) = 0; // _size in bytes
- virtual void free_array(void* ptr, size_t _size) = 0; // size in bytes
+ virtual void* create_local() __TBB_override = 0;
+ virtual void* create_array(size_t _size) __TBB_override = 0; // _size in bytes
+ virtual void free_array(void* ptr, size_t _size) __TBB_override = 0; // size in bytes
protected:
ets_base() {create_key();}
~ets_base() {destroy_key();}
@@ -663,16 +663,16 @@ namespace interface6 {
// TODO: make the construction/destruction consistent (use allocator.construct/destroy)
typedef typename tbb::tbb_allocator my_allocator_type;
- /*override*/ callback_base* clone() const {
+ callback_base* clone() const __TBB_override {
return make(*this);
}
- /*override*/ void destroy() {
+ void destroy() __TBB_override {
my_allocator_type().destroy(this);
my_allocator_type().deallocate(this,1);
}
- /*override*/ void construct(void* where) {
+ void construct(void* where) __TBB_override {
Constructor::construct(where);
}
public:
@@ -700,7 +700,6 @@ namespace interface6 {
successfully-constructed, set the flag to true or call value_committed().
If the constructor throws, the flag will be false.
*/
- // TODO: make a constructor for ets_element that takes a callback_base. make is_built private
template
struct ets_element {
tbb::aligned_space my_space;
@@ -794,7 +793,7 @@ namespace interface6 {
// TODO: consider unifying the callback mechanism for all create_local* methods below
// (likely non-compatible and requires interface version increase)
- /*override*/ void* create_local() {
+ void* create_local() __TBB_override {
padded_element& lref = *my_locals.grow_by(1);
my_construct_callback->construct(lref.value());
return lref.value_committed();
@@ -819,12 +818,12 @@ namespace interface6 {
typedef typename Allocator::template rebind< uintptr_t >::other array_allocator_type;
// _size is in bytes
- /*override*/ void* create_array(size_t _size) {
+ void* create_array(size_t _size) __TBB_override {
size_t nelements = (_size + sizeof(uintptr_t) -1) / sizeof(uintptr_t);
return array_allocator_type().allocate(nelements);
}
- /*override*/ void free_array( void* _ptr, size_t _size) {
+ void free_array( void* _ptr, size_t _size) __TBB_override {
size_t nelements = (_size + sizeof(uintptr_t) -1) / sizeof(uintptr_t);
array_allocator_type().deallocate( reinterpret_cast(_ptr),nelements);
}
@@ -860,17 +859,17 @@ namespace interface6 {
, typename = typename internal::enable_if::type>::value>::type
#endif
>
- enumerable_thread_specific( Finit finit ) : my_construct_callback(
+ explicit enumerable_thread_specific( Finit finit ) : my_construct_callback(
internal::callback_leaf >::make( tbb::internal::move(finit) )
){}
//! Constructor with exemplar. Each local instance of T is copy-constructed from the exemplar.
- enumerable_thread_specific( const T& exemplar ) : my_construct_callback(
+ explicit enumerable_thread_specific( const T& exemplar ) : my_construct_callback(
internal::callback_leaf >::make( exemplar )
){}
#if __TBB_ETS_USE_CPP11
- enumerable_thread_specific( T&& exemplar ) : my_construct_callback(
+ explicit enumerable_thread_specific( T&& exemplar ) : my_construct_callback(
internal::callback_leaf >::make( std::move(exemplar) )
){}
@@ -1089,7 +1088,7 @@ namespace interface6 {
flattened2d( const Container &c, typename Container::const_iterator b, typename Container::const_iterator e ) :
my_container(const_cast(&c)), my_begin(b), my_end(e) { }
- flattened2d( const Container &c ) :
+ explicit flattened2d( const Container &c ) :
my_container(const_cast(&c)), my_begin(c.begin()), my_end(c.end()) { }
iterator begin() { return iterator(*my_container) = my_begin; }
diff --git a/lib/3rdParty/tbb/include/tbb/flow_graph.h b/lib/3rdParty/tbb/include/tbb/flow_graph.h
index 3c5f305..7b03c0e 100644
--- a/lib/3rdParty/tbb/include/tbb/flow_graph.h
+++ b/lib/3rdParty/tbb/include/tbb/flow_graph.h
@@ -1,21 +1,21 @@
/*
- Copyright 2005-2016 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2005-2017 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.
+
+
- This file is part of Threading Building Blocks. Threading Building Blocks is free software;
- you can redistribute it and/or modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation. Threading Building Blocks is
- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details. You should have received a copy of
- the GNU General Public License along with Threading Building Blocks; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- As a special exception, you may use this file as part of a free software library without
- restriction. Specifically, if other files instantiate templates or use macros or inline
- functions from this file, or you compile this file and link it with other files to produce
- an executable, this file does not by itself cause the resulting executable to be covered
- by the GNU General Public License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef __TBB_flow_graph_H
@@ -33,11 +33,21 @@
#include "internal/_template_helpers.h"
#include "internal/_aggregator_impl.h"
#include "tbb_profiling.h"
-
-#if __TBB_PREVIEW_ASYNC_NODE
#include "task_arena.h"
+#include "flow_graph_abstractions.h"
+
+#if __TBB_PREVIEW_ASYNC_MSG
+#include // std::vector in internal::async_storage
+#include // std::shared_ptr in async_msg
#endif
+#if __TBB_PREVIEW_STREAMING_NODE
+// For streaming_node
+#include // std::array
+#include // std::unordered_map
+#include // std::decay, std::true_type, std::false_type
+#endif // __TBB_PREVIEW_STREAMING_NODE
+
#if TBB_DEPRECATED_FLOW_ENQUEUE
#define FLOW_SPAWN(a) tbb::task::enqueue((a))
#else
@@ -78,16 +88,20 @@ namespace flow {
//! An enumeration the provides the two most common concurrency levels: unlimited and serial
enum concurrency { unlimited = 0, serial = 1 };
-namespace interface8 {
+namespace internal {
+static tbb::task * const SUCCESSFULLY_ENQUEUED = (task *)-1;
+}
+
+namespace interface9 {
+
+using tbb::flow::internal::SUCCESSFULLY_ENQUEUED;
namespace internal {
template class successor_cache;
template class broadcast_cache;
template class round_robin_cache;
-
-#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
- template< typename C> class edge_container;
-#endif
+ template class predecessor_cache;
+ template class reservable_predecessor_cache;
}
//A generic null type
@@ -100,53 +114,9 @@ template< typename T > class sender;
template< typename T > class receiver;
class continue_receiver;
-//! Pure virtual template class that defines a sender of messages of type T
-template< typename T >
-class sender {
-public:
- //! The output type of this sender
- typedef T output_type;
-
- //! The successor type for this node
- typedef receiver successor_type;
-
- virtual ~sender() {}
-
- //! Add a new successor to this node
- virtual bool register_successor( successor_type &r ) = 0;
-
- //! Removes a successor from this node
- virtual bool remove_successor( successor_type &r ) = 0;
-
- //! Request an item from the sender
- virtual bool try_get( T & ) { return false; }
-
- //! Reserves an item in the sender
- virtual bool try_reserve( T & ) { return false; }
-
- //! Releases the reserved item
- virtual bool try_release( ) { return false; }
-
- //! Consumes the reserved item
- virtual bool try_consume( ) { return false; }
-
-#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
- //! interface to record edges for traversal & deletion
- typedef typename internal::edge_container built_successors_type;
- typedef typename built_successors_type::edge_list_type successor_list_type;
- virtual built_successors_type &built_successors() = 0;
- virtual void internal_add_built_successor( successor_type & ) = 0;
- virtual void internal_delete_built_successor( successor_type & ) = 0;
- virtual void copy_successors( successor_list_type &) = 0;
- virtual size_t successor_count() = 0;
-#endif
-}; // class sender
-
template< typename T > class limiter_node; // needed for resetting decrementer
template< typename R, typename B > class run_and_put_task;
-static tbb::task * const SUCCESSFULLY_ENQUEUED = (task *)-1;
-
// flags to modify the behavior of the graph reset(). Can be combined.
enum reset_flags {
rf_reset_protocol = 0,
@@ -154,80 +124,6 @@ enum reset_flags {
rf_clear_edges = 1<<1 // delete edges
};
-// enqueue left task if necessary. Returns the non-enqueued task if there is one.
-static inline tbb::task *combine_tasks( tbb::task * left, tbb::task * right) {
- // if no RHS task, don't change left.
- if(right == NULL) return left;
- // right != NULL
- if(left == NULL) return right;
- if(left == SUCCESSFULLY_ENQUEUED) return right;
- // left contains a task
- if(right != SUCCESSFULLY_ENQUEUED) {
- // both are valid tasks
- FLOW_SPAWN(*left);
- return right;
- }
- return left;
-}
-
-//! Pure virtual template class that defines a receiver of messages of type T
-template< typename T >
-class receiver {
-public:
- //! The input type of this receiver
- typedef T input_type;
-
- //! The predecessor type for this node
- typedef sender predecessor_type;
-
- //! Destructor
- virtual ~receiver() {}
-
- //! Put an item to the receiver
- bool try_put( const T& t ) {
- task *res = try_put_task(t);
- if (!res) return false;
- if (res != SUCCESSFULLY_ENQUEUED) FLOW_SPAWN(*res);
- return true;
- }
-
- //! put item to successor; return task to run the successor if possible.
-protected:
- template< typename R, typename B > friend class run_and_put_task;
- template friend class internal::broadcast_cache;
- template friend class internal::round_robin_cache;
- virtual task *try_put_task(const T& t) = 0;
-public:
-
- //! Add a predecessor to the node
- virtual bool register_predecessor( predecessor_type & ) { return false; }
-
- //! Remove a predecessor from the node
- virtual bool remove_predecessor( predecessor_type & ) { return false; }
-
-#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
- typedef typename internal::edge_container built_predecessors_type;
- typedef typename built_predecessors_type::edge_list_type predecessor_list_type;
- virtual built_predecessors_type &built_predecessors() = 0;
- virtual void internal_add_built_predecessor( predecessor_type & ) = 0;
- virtual void internal_delete_built_predecessor( predecessor_type & ) = 0;
- virtual void copy_predecessors( predecessor_list_type & ) = 0;
- virtual size_t predecessor_count() = 0;
-#endif
-
-protected:
- //! put receiver back in initial state
- template friend class limiter_node;
- virtual void reset_receiver(reset_flags f = rf_reset_protocol) = 0;
-
- template friend class internal::successor_cache;
- virtual bool is_continue_receiver() { return false; }
-
-#if __TBB_PREVIEW_OPENCL_NODE
- template< typename, typename > friend class proxy_dependency_receiver;
-#endif /* __TBB_PREVIEW_OPENCL_NODE */
-}; // class receiver
-
#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
//* holder of edges both for caches and for those nodes which do not have predecessor caches.
// C == receiver< ... > or sender< ... >, depending.
@@ -265,15 +161,329 @@ public:
// methods remove the statement from all predecessors/successors liste in the edge
// container.
- template< typename S > void sender_extract( S &s );
- template< typename R > void receiver_extract( R &r );
+ template< typename S > void sender_extract( S &s );
+ template< typename R > void receiver_extract( R &r );
-private:
+private:
edge_list_type built_edges;
}; // class edge_container
} // namespace internal
#endif /* TBB_PREVIEW_FLOW_GRAPH_FEATURES */
+#if __TBB_PREVIEW_ASYNC_MSG
+
+#include "internal/_flow_graph_async_msg_impl.h"
+
+namespace internal {
+
+class untyped_receiver;
+
+class untyped_sender {
+ template< typename, typename > friend class internal::predecessor_cache;
+ template< typename, typename > friend class internal::reservable_predecessor_cache;
+public:
+ //! The successor type for this node
+ typedef untyped_receiver successor_type;
+
+ virtual ~untyped_sender() {}
+
+ // NOTE: Following part of PUBLIC section is copy-paste from original sender class
+
+ // TODO: Prevent untyped successor registration
+
+ //! Add a new successor to this node
+ virtual bool register_successor( successor_type &r ) = 0;
+
+ //! Removes a successor from this node
+ virtual bool remove_successor( successor_type &r ) = 0;
+
+ //! Releases the reserved item
+ virtual bool try_release( ) { return false; }
+
+ //! Consumes the reserved item
+ virtual bool try_consume( ) { return false; }
+
+#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
+ //! interface to record edges for traversal & deletion
+ typedef internal::edge_container built_successors_type;
+ typedef built_successors_type::edge_list_type successor_list_type;
+ virtual built_successors_type &built_successors() = 0;
+ virtual void internal_add_built_successor( successor_type & ) = 0;
+ virtual void internal_delete_built_successor( successor_type & ) = 0;
+ virtual void copy_successors( successor_list_type &) = 0;
+ virtual size_t successor_count() = 0;
+#endif
+protected:
+ //! Request an item from the sender
+ template< typename X >
+ bool try_get( X &t ) {
+ return try_get_wrapper( internal::async_helpers::to_void_ptr(t), internal::async_helpers::is_async_type );
+ }
+
+ //! Reserves an item in the sender
+ template< typename X >
+ bool try_reserve( X &t ) {
+ return try_reserve_wrapper( internal::async_helpers::to_void_ptr(t), internal::async_helpers::is_async_type );
+ }
+
+ virtual bool try_get_wrapper( void* p, bool is_async ) = 0;
+ virtual bool try_reserve_wrapper( void* p, bool is_async ) = 0;
+};
+
+class untyped_receiver {
+ template< typename, typename > friend class run_and_put_task;
+ template< typename > friend class limiter_node;
+
+ template< typename, typename > friend class internal::broadcast_cache;
+ template< typename, typename > friend class internal::round_robin_cache;
+ template< typename, typename > friend class internal::successor_cache;
+
+#if __TBB_PREVIEW_OPENCL_NODE
+ template< typename, typename > friend class proxy_dependency_receiver;
+#endif /* __TBB_PREVIEW_OPENCL_NODE */
+public:
+ //! The predecessor type for this node
+ typedef untyped_sender predecessor_type;
+
+ //! Destructor
+ virtual ~untyped_receiver() {}
+
+ //! Put an item to the receiver
+ template
+ bool try_put(const X& t) {
+ task *res = try_put_task(t);
+ if (!res) return false;
+ if (res != SUCCESSFULLY_ENQUEUED) FLOW_SPAWN(*res);
+ return true;
+ }
+
+ // NOTE: Following part of PUBLIC section is copy-paste from original receiver class
+
+ // TODO: Prevent untyped predecessor registration
+
+ //! Add a predecessor to the node
+ virtual bool register_predecessor( predecessor_type & ) { return false; }
+
+ //! Remove a predecessor from the node
+ virtual bool remove_predecessor( predecessor_type & ) { return false; }
+
+#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
+ typedef internal::edge_container built_predecessors_type;
+ typedef built_predecessors_type::edge_list_type predecessor_list_type;
+ virtual built_predecessors_type &built_predecessors() = 0;
+ virtual void internal_add_built_predecessor( predecessor_type & ) = 0;
+ virtual void internal_delete_built_predecessor( predecessor_type & ) = 0;
+ virtual void copy_predecessors( predecessor_list_type & ) = 0;
+ virtual size_t predecessor_count() = 0;
+#endif
+protected:
+ template
+ task *try_put_task(const X& t) {
+ return try_put_task_wrapper( internal::async_helpers::to_void_ptr(t), internal::async_helpers::is_async_type );
+ }
+
+ virtual task* try_put_task_wrapper( const void* p, bool is_async ) = 0;
+
+ // NOTE: Following part of PROTECTED and PRIVATE sections is copy-paste from original receiver class
+
+ //! put receiver back in initial state
+ virtual void reset_receiver(reset_flags f = rf_reset_protocol) = 0;
+
+ virtual bool is_continue_receiver() { return false; }
+};
+
+} // namespace internal
+
+//! Pure virtual template class that defines a sender of messages of type T
+template< typename T >
+class sender : public internal::untyped_sender {
+public:
+ //! The output type of this sender
+ typedef T output_type;
+
+ typedef typename internal::async_helpers::filtered_type filtered_type;
+
+ //! Request an item from the sender
+ virtual bool try_get( T & ) { return false; }
+
+ //! Reserves an item in the sender
+ virtual bool try_reserve( T & ) { return false; }
+
+protected:
+ virtual bool try_get_wrapper( void* p, bool is_async ) __TBB_override {
+ // Both async OR both are NOT async
+ if ( internal::async_helpers::is_async_type == is_async ) {
+ return try_get( internal::async_helpers::from_void_ptr(p) );
+ }
+ // Else: this (T) is async OR incoming 't' is async
+ __TBB_ASSERT(false, "async_msg interface does not support 'pull' protocol in try_get()");
+ return false;
+ }
+
+ virtual bool try_reserve_wrapper( void* p, bool is_async ) __TBB_override {
+ // Both async OR both are NOT async
+ if ( internal::async_helpers::is_async_type == is_async ) {
+ return try_reserve( internal::async_helpers::from_void_ptr(p) );
+ }
+ // Else: this (T) is async OR incoming 't' is async
+ __TBB_ASSERT(false, "async_msg interface does not support 'pull' protocol in try_reserve()");
+ return false;
+ }
+}; // class sender
+
+//! Pure virtual template class that defines a receiver of messages of type T
+template< typename T >
+class receiver : public internal::untyped_receiver {
+ template< typename > friend class internal::async_storage;
+ template< typename, typename > friend struct internal::async_helpers;
+public:
+ //! The input type of this receiver
+ typedef T input_type;
+
+ typedef typename internal::async_helpers::filtered_type filtered_type;
+
+ //! Put an item to the receiver
+ bool try_put( const typename internal::async_helpers::filtered_type& t ) {
+ return internal::untyped_receiver::try_put(t);
+ }
+
+ bool try_put( const typename internal::async_helpers::async_type& t ) {
+ return internal::untyped_receiver::try_put(t);
+ }
+
+protected:
+ virtual task* try_put_task_wrapper( const void *p, bool is_async ) __TBB_override {
+ return internal::async_helpers::try_put_task_wrapper_impl(this, p, is_async);
+ }
+
+ //! Put item to successor; return task to run the successor if possible.
+ virtual task *try_put_task(const T& t) = 0;
+
+}; // class receiver
+
+#else // __TBB_PREVIEW_ASYNC_MSG
+
+//! Pure virtual template class that defines a sender of messages of type T
+template< typename T >
+class sender {
+public:
+ //! The output type of this sender
+ typedef T output_type;
+
+ //! The successor type for this node
+ typedef receiver successor_type;
+
+ virtual ~sender() {}
+
+ // NOTE: Following part of PUBLIC section is partly copy-pasted in sender under #if __TBB_PREVIEW_ASYNC_MSG
+
+ //! Add a new successor to this node
+ virtual bool register_successor( successor_type &r ) = 0;
+
+ //! Removes a successor from this node
+ virtual bool remove_successor( successor_type &r ) = 0;
+
+ //! Request an item from the sender
+ virtual bool try_get( T & ) { return false; }
+
+ //! Reserves an item in the sender
+ virtual bool try_reserve( T & ) { return false; }
+
+ //! Releases the reserved item
+ virtual bool try_release( ) { return false; }
+
+ //! Consumes the reserved item
+ virtual bool try_consume( ) { return false; }
+
+#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
+ //! interface to record edges for traversal & deletion
+ typedef typename internal::edge_container built_successors_type;
+ typedef typename built_successors_type::edge_list_type successor_list_type;
+ virtual built_successors_type &built_successors() = 0;
+ virtual void internal_add_built_successor( successor_type & ) = 0;
+ virtual void internal_delete_built_successor( successor_type & ) = 0;
+ virtual void copy_successors( successor_list_type &) = 0;
+ virtual size_t successor_count() = 0;
+#endif
+}; // class sender
+
+//! Pure virtual template class that defines a receiver of messages of type T
+template< typename T >
+class receiver {
+public:
+ //! The input type of this receiver
+ typedef T input_type;
+
+ //! The predecessor type for this node
+ typedef sender predecessor_type;
+
+ //! Destructor
+ virtual ~receiver() {}
+
+ //! Put an item to the receiver
+ bool try_put( const T& t ) {
+ task *res = try_put_task(t);
+ if (!res) return false;
+ if (res != SUCCESSFULLY_ENQUEUED) FLOW_SPAWN(*res);
+ return true;
+ }
+
+ //! put item to successor; return task to run the successor if possible.
+protected:
+ template< typename R, typename B > friend class run_and_put_task;
+ template< typename X, typename Y > friend class internal::broadcast_cache;
+ template< typename X, typename Y > friend class internal::round_robin_cache;
+ virtual task *try_put_task(const T& t) = 0;
+public:
+ // NOTE: Following part of PUBLIC and PROTECTED sections is copy-pasted in receiver under #if __TBB_PREVIEW_ASYNC_MSG
+
+ //! Add a predecessor to the node
+ virtual bool register_predecessor( predecessor_type & ) { return false; }
+
+ //! Remove a predecessor from the node
+ virtual bool remove_predecessor( predecessor_type & ) { return false; }
+
+#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
+ typedef typename internal::edge_container built_predecessors_type;
+ typedef typename built_predecessors_type::edge_list_type predecessor_list_type;
+ virtual built_predecessors_type &built_predecessors() = 0;
+ virtual void internal_add_built_predecessor( predecessor_type & ) = 0;
+ virtual void internal_delete_built_predecessor( predecessor_type & ) = 0;
+ virtual void copy_predecessors( predecessor_list_type & ) = 0;
+ virtual size_t predecessor_count() = 0;
+#endif
+
+protected:
+ //! put receiver back in initial state
+ template friend class limiter_node;
+ virtual void reset_receiver(reset_flags f = rf_reset_protocol) = 0;
+
+ template friend class internal::successor_cache;
+ virtual bool is_continue_receiver() { return false; }
+
+#if __TBB_PREVIEW_OPENCL_NODE
+ template< typename, typename > friend class proxy_dependency_receiver;
+#endif /* __TBB_PREVIEW_OPENCL_NODE */
+}; // class receiver
+
+#endif // __TBB_PREVIEW_ASYNC_MSG
+
+// enqueue left task if necessary. Returns the non-enqueued task if there is one.
+static inline tbb::task *combine_tasks( tbb::task * left, tbb::task * right) {
+ // if no RHS task, don't change left.
+ if(right == NULL) return left;
+ // right != NULL
+ if(left == NULL) return right;
+ if(left == SUCCESSFULLY_ENQUEUED) return right;
+ // left contains a task
+ if(right != SUCCESSFULLY_ENQUEUED) {
+ // both are valid tasks
+ FLOW_SPAWN(*left);
+ return right;
+ }
+ return left;
+}
+
//! Base class for receivers of completion messages
/** These receivers automatically reset, but cannot be explicitly waited on */
class continue_receiver : public receiver< continue_msg > {
@@ -283,10 +493,10 @@ public:
typedef continue_msg input_type;
//! The predecessor type for this node
- typedef sender< continue_msg > predecessor_type;
+ typedef receiver::predecessor_type predecessor_type;
//! Constructor
- continue_receiver( int number_of_predecessors = 0 ) {
+ explicit continue_receiver( int number_of_predecessors = 0 ) {
my_predecessor_count = my_initial_predecessor_count = number_of_predecessors;
my_current_count = 0;
}
@@ -297,11 +507,8 @@ public:
my_current_count = 0;
}
- //! Destructor
- virtual ~continue_receiver() { }
-
//! Increments the trigger threshold
- /* override */ bool register_predecessor( predecessor_type & ) {
+ bool register_predecessor( predecessor_type & ) __TBB_override {
spin_mutex::scoped_lock l(my_mutex);
++my_predecessor_count;
return true;
@@ -311,7 +518,7 @@ public:
/** Does not check to see if the removal of the predecessor now makes the current count
exceed the new threshold. So removing a predecessor while the graph is active can cause
unexpected results. */
- /* override */ bool remove_predecessor( predecessor_type & ) {
+ bool remove_predecessor( predecessor_type & ) __TBB_override {
spin_mutex::scoped_lock l(my_mutex);
--my_predecessor_count;
return true;
@@ -320,24 +527,24 @@ public:
#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
typedef internal::edge_container built_predecessors_type;
typedef built_predecessors_type::edge_list_type predecessor_list_type;
- /*override*/ built_predecessors_type &built_predecessors() { return my_built_predecessors; }
+ built_predecessors_type &built_predecessors() __TBB_override { return my_built_predecessors; }
- /*override*/ void internal_add_built_predecessor( predecessor_type &s) {
+ void internal_add_built_predecessor( predecessor_type &s) __TBB_override {
spin_mutex::scoped_lock l(my_mutex);
my_built_predecessors.add_edge( s );
}
- /*override*/ void internal_delete_built_predecessor( predecessor_type &s) {
+ void internal_delete_built_predecessor( predecessor_type &s) __TBB_override {
spin_mutex::scoped_lock l(my_mutex);
my_built_predecessors.delete_edge(s);
}
- /*override*/ void copy_predecessors( predecessor_list_type &v) {
+ void copy_predecessors( predecessor_list_type &v) __TBB_override {
spin_mutex::scoped_lock l(my_mutex);
my_built_predecessors.copy_edges(v);
}
- /*override*/ size_t predecessor_count() {
+ size_t predecessor_count() __TBB_override {
spin_mutex::scoped_lock l(my_mutex);
return my_built_predecessors.edge_count();
}
@@ -349,7 +556,7 @@ protected:
template friend class internal::broadcast_cache;
template friend class internal::round_robin_cache;
// execute body is supposed to be too small to create a task for.
- /* override */ task *try_put_task( const input_type & ) {
+ task *try_put_task( const input_type & ) __TBB_override {
{
spin_mutex::scoped_lock l(my_mutex);
if ( ++my_current_count < my_predecessor_count )
@@ -374,7 +581,7 @@ protected:
// error in gcc 4.1.2
template friend class limiter_node;
- /*override*/void reset_receiver( reset_flags f ) {
+ void reset_receiver( reset_flags f ) __TBB_override {
my_current_count = 0;
if (f & rf_clear_edges) {
#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
@@ -389,10 +596,10 @@ protected:
called while the sender is blocked in the try_put(). */
virtual task * execute() = 0;
template friend class internal::successor_cache;
- /*override*/ bool is_continue_receiver() { return true; }
+ bool is_continue_receiver() __TBB_override { return true; }
}; // class continue_receiver
-} // interface8
+} // interface9
#if __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING
template
@@ -401,9 +608,9 @@ protected:
}
#endif /* __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING */
- using interface8::sender;
- using interface8::receiver;
- using interface8::continue_receiver;
+ using interface9::sender;
+ using interface9::receiver;
+ using interface9::continue_receiver;
} // flow
} // tbb
@@ -412,7 +619,7 @@ protected:
namespace tbb {
namespace flow {
-namespace interface8 {
+namespace interface9 {
#include "internal/_flow_graph_impl.h"
#include "internal/_flow_graph_types_impl.h"
@@ -490,14 +697,14 @@ private:
//! The graph class
/** This class serves as a handle to the graph */
-class graph : tbb::internal::no_copy {
+class graph : tbb::internal::no_copy, public graph_proxy {
friend class graph_node;
template< typename Body >
class run_task : public task {
public:
run_task( Body& body ) : my_body(body) {}
- task *execute() {
+ task *execute() __TBB_override {
my_body();
return NULL;
}
@@ -509,7 +716,7 @@ class graph : tbb::internal::no_copy {
class run_and_put_task : public task {
public:
run_and_put_task( Receiver &r, Body& body ) : my_receiver(r), my_body(body) {}
- task *execute() {
+ task *execute() __TBB_override {
task *res = my_receiver.try_put_task( my_body() );
if (res == SUCCESSFULLY_ENQUEUED) res = NULL;
return res;
@@ -520,7 +727,6 @@ class graph : tbb::internal::no_copy {
};
typedef std::list task_list_type;
-#if __TBB_PREVIEW_ASYNC_NODE
class wait_functor {
task* graph_root_task;
public:
@@ -530,24 +736,22 @@ class graph : tbb::internal::no_copy {
void prepare_task_arena( bool reinit = false ) {
if (reinit) {
- __TBB_ASSERT( my_task_arena, NULL );
+ __TBB_ASSERT( my_task_arena, "task arena is NULL");
my_task_arena->terminate();
my_task_arena->initialize(tbb::task_arena::attach());
} else {
+ __TBB_ASSERT(my_task_arena == NULL, "task arena is not NULL");
my_task_arena = new tbb::task_arena(tbb::task_arena::attach());
}
if (!my_task_arena->is_active()) // failed to attach
my_task_arena->initialize(); // create a new, default-initialized arena
- __TBB_ASSERT(my_task_arena->is_active(), NULL);
+ __TBB_ASSERT(my_task_arena->is_active(), "task arena is not active");
}
-#endif
public:
//! Constructs a graph with isolated task_group_context
- graph() : my_nodes(NULL), my_nodes_last(NULL) {
-#if __TBB_PREVIEW_ASYNC_NODE
+ graph() : my_nodes(NULL), my_nodes_last(NULL), my_task_arena(NULL) {
prepare_task_arena();
-#endif
own_context = true;
cancelled = false;
caught_exception = false;
@@ -560,10 +764,8 @@ public:
//! Constructs a graph with use_this_context as context
explicit graph(task_group_context& use_this_context) :
- my_context(&use_this_context), my_nodes(NULL), my_nodes_last(NULL) {
-#if __TBB_PREVIEW_ASYNC_NODE
+ my_context(&use_this_context), my_nodes(NULL), my_nodes_last(NULL), my_task_arena(NULL) {
prepare_task_arena();
-#endif
own_context = false;
my_root_task = ( new ( task::allocate_root(*my_context) ) empty_task );
my_root_task->set_ref_count(1);
@@ -578,9 +780,7 @@ public:
my_root_task->set_ref_count(0);
task::destroy( *my_root_task );
if (own_context) delete my_context;
-#if __TBB_PREVIEW_ASYNC_NODE
delete my_task_arena;
-#endif
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
@@ -605,6 +805,14 @@ public:
my_root_task->decrement_ref_count();
}
+ void reserve_wait() __TBB_override {
+ increment_wait_count();
+ }
+
+ void release_wait() __TBB_override {
+ decrement_wait_count();
+ }
+
//! Spawns a task that runs a body and puts its output to a specific receiver
/** The task is spawned as a child of the graph. This is useful for running tasks
that need to block a wait_for_all() on the graph. For example a one-off source. */
@@ -635,11 +843,7 @@ public:
#if TBB_USE_EXCEPTIONS
try {
#endif
-#if __TBB_PREVIEW_ASYNC_NODE
my_task_arena->execute(wait_functor(my_root_task));
-#else
- my_root_task->wait_for_all();
-#endif
cancelled = my_context->is_group_execution_cancelled();
#if TBB_USE_EXCEPTIONS
}
@@ -652,7 +856,7 @@ public:
}
#endif
// TODO: the "if" condition below is just a work-around to support the concurrent wait
- // mode. The cancelation and exception mechanisms are still broken in this mode.
+ // mode. The cancellation and exception mechanisms are still broken in this mode.
// Consider using task group not to re-implement the same functionality.
if ( !(my_context->traits() & task_group_context::concurrent_wait) ) {
my_context->reset(); // consistent with behavior in catch()
@@ -722,11 +926,9 @@ private:
void register_node(graph_node *n);
void remove_node(graph_node *n);
-#if __TBB_PREVIEW_ASYNC_NODE
template < typename Input, typename Output, typename Policy, typename Allocator >
friend class async_node;
task_arena* my_task_arena;
-#endif
}; // class graph
template
@@ -747,14 +949,13 @@ typename graph_iterator::pointer graph_iterator::operator->() const {
return current_node;
}
-
template
void graph_iterator::internal_forward() {
if (current_node) current_node = current_node->next;
}
//! The base of all graph nodes.
-class graph_node : tbb::internal::no_assign {
+class graph_node : tbb::internal::no_copy {
friend class graph;
template
friend class graph_iterator;
@@ -762,7 +963,7 @@ protected:
graph& my_graph;
graph_node *next, *prev;
public:
- graph_node(graph& g) : my_graph(g) {
+ explicit graph_node(graph& g) : my_graph(g) {
my_graph.register_node(this);
}
virtual ~graph_node() {
@@ -805,7 +1006,7 @@ inline void graph::remove_node(graph_node *n) {
n->prev = n->next = NULL;
}
-inline void graph::reset( reset_flags f ) {
+inline void graph::reset( reset_flags f ) {
// reset context
set_active(false);
if(my_context) my_context->reset();
@@ -816,11 +1017,9 @@ inline void graph::reset( reset_flags f ) {
graph_node *my_p = &(*ii);
my_p->reset_node(f);
}
-#if __TBB_PREVIEW_ASYNC_NODE
// Reattach the arena. Might be useful to run the graph in a particular task_arena
// while not limiting graph lifetime to a single task_arena::execute() call.
prepare_task_arena( /*reinit=*/true );
-#endif
set_active(true);
// now spawn the tasks necessary to start the graph
for(task_list_type::iterator rti = my_reset_task_list.begin(); rti != my_reset_task_list.end(); ++rti) {
@@ -829,20 +1028,17 @@ inline void graph::reset( reset_flags f ) {
my_reset_task_list.clear();
}
-
#include "internal/_flow_graph_node_impl.h"
//! An executable node that acts as a source, i.e. it has no predecessors
template < typename Output >
class source_node : public graph_node, public sender< Output > {
-protected:
- using graph_node::my_graph;
public:
//! The type of the output message, which is complete
typedef Output output_type;
//! The type of successors of this node
- typedef receiver< Output > successor_type;
+ typedef typename sender::successor_type successor_type;
//Source node has no input type
typedef null_type input_type;
@@ -881,13 +1077,13 @@ public:
~source_node() { delete my_body; delete my_init_body; }
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
- /* override */ void set_name( const char *name ) {
+ void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
//! Add a new successor to this node
- /* override */ bool register_successor( successor_type &r ) {
+ bool register_successor( successor_type &r ) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
my_successors.register_successor(r);
if ( my_active )
@@ -896,7 +1092,7 @@ public:
}
//! Removes a successor from this node
- /* override */ bool remove_successor( successor_type &r ) {
+ bool remove_successor( successor_type &r ) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
my_successors.remove_successor(r);
return true;
@@ -904,31 +1100,31 @@ public:
#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
- /*override*/ built_successors_type &built_successors() { return my_successors.built_successors(); }
+ built_successors_type &built_successors() __TBB_override { return my_successors.built_successors(); }
- /*override*/void internal_add_built_successor( successor_type &r) {
+ void internal_add_built_successor( successor_type &r) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
my_successors.internal_add_built_successor(r);
}
- /*override*/void internal_delete_built_successor( successor_type &r) {
+ void internal_delete_built_successor( successor_type &r) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
my_successors.internal_delete_built_successor(r);
}
- /*override*/size_t successor_count() {
+ size_t successor_count() __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
return my_successors.successor_count();
}
- /*override*/void copy_successors(successor_list_type &v) {
+ void copy_successors(successor_list_type &v) __TBB_override {
spin_mutex::scoped_lock l(my_mutex);
my_successors.copy_successors(v);
}
#endif /* TBB_PREVIEW_FLOW_GRAPH_FEATURES */
//! Request an item from the node
- /*override */ bool try_get( output_type &v ) {
+ bool try_get( output_type &v ) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
if ( my_reserved )
return false;
@@ -945,7 +1141,7 @@ public:
}
//! Reserves an item.
- /* override */ bool try_reserve( output_type &v ) {
+ bool try_reserve( output_type &v ) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
if ( my_reserved ) {
return false;
@@ -962,7 +1158,7 @@ public:
//! Release a reserved item.
/** true = item has been released and so remains in sender, dest must request or reserve future items */
- /* override */ bool try_release( ) {
+ bool try_release( ) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
__TBB_ASSERT( my_reserved && my_has_cached_item, "releasing non-existent reservation" );
my_reserved = false;
@@ -972,7 +1168,7 @@ public:
}
//! Consumes a reserved item
- /* override */ bool try_consume( ) {
+ bool try_consume( ) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
__TBB_ASSERT( my_reserved && my_has_cached_item, "consuming non-existent reservation" );
my_reserved = false;
@@ -998,7 +1194,7 @@ public:
}
#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
- /*override*/void extract( ) {
+ void extract( ) __TBB_override {
my_successors.built_successors().sender_extract(*this); // removes "my_owner" == this from each successor
my_active = init_my_active;
my_reserved = false;
@@ -1009,7 +1205,7 @@ public:
protected:
//! resets the source_node to its initial state
- /*override*/void reset_node( reset_flags f) {
+ void reset_node( reset_flags f) __TBB_override {
my_active = init_my_active;
my_reserved =false;
if(my_has_cached_item) {
@@ -1069,7 +1265,7 @@ private:
}
//! Spawns a task that applies the body
- /* override */ void spawn_put( ) {
+ void spawn_put( ) {
if(this->my_graph.is_active()) {
FLOW_SPAWN( *create_put_task());
}
@@ -1077,7 +1273,7 @@ private:
friend class internal::source_task_bypass< source_node< output_type > >;
//! Applies the body. Returning SUCCESSFULLY_ENQUEUED okay; forward_task_bypass will handle it.
- /* override */ task * apply_body_bypass( ) {
+ task * apply_body_bypass( ) {
output_type v;
if ( !try_reserve_apply_body(v) )
return NULL;
@@ -1107,11 +1303,11 @@ class function_node : public graph_node, public internal::function_input predecessor_type;
- typedef receiver< output_type > successor_type;
typedef internal::function_input fInput_type;
typedef internal::function_input_queue input_queue_type;
typedef internal::function_output fOutput_type;
+ typedef typename fInput_type::predecessor_type predecessor_type;
+ typedef typename fOutput_type::successor_type successor_type;
#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
typedef typename fInput_type::predecessor_list_type predecessor_list_type;
typedef typename fOutput_type::successor_list_type successor_list_type;
@@ -1126,27 +1322,27 @@ public:
function_node( graph &g, size_t concurrency, Body body ) :
graph_node(g), fInput_type(g, concurrency, body, allocate_buffer::value ?
new input_queue_type( ) : NULL ) {
- tbb::internal::fgt_node_with_body( tbb::internal::FLOW_FUNCTION_NODE, &this->graph_node::my_graph,
+ tbb::internal::fgt_node_with_body( tbb::internal::FLOW_FUNCTION_NODE, &this->my_graph,
static_cast *>(this), static_cast *>(this), this->my_body );
}
//! Copy constructor
function_node( const function_node& src ) :
- graph_node(src.graph_node::my_graph),
+ graph_node(src.my_graph),
fInput_type(src, allocate_buffer::value ? new input_queue_type : NULL),
fOutput_type() {
- tbb::internal::fgt_node_with_body( tbb::internal::FLOW_FUNCTION_NODE, &this->graph_node::my_graph,
+ tbb::internal::fgt_node_with_body( tbb::internal::FLOW_FUNCTION_NODE, &this->my_graph,
static_cast *>(this), static_cast *>(this), this->my_body );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
- /* override */ void set_name( const char *name ) {
+ void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
- /*override*/void extract( ) {
+ void extract( ) __TBB_override {
my_predecessors.built_predecessors().receiver_extract(*this);
successors().built_successors().sender_extract(*this);
}
@@ -1158,10 +1354,9 @@ protected:
template friend class internal::round_robin_cache;
using fInput_type::try_put_task;
- /* override */ internal::broadcast_cache &successors () { return fOutput_type::my_successors; }
+ internal::broadcast_cache &successors () __TBB_override { return fOutput_type::my_successors; }
- // override of graph_node's reset.
- /*override*/void reset_node(reset_flags f) {
+ void reset_node(reset_flags f) __TBB_override {
fInput_type::reset_function_input(f);
// TODO: use clear() instead.
if(f & rf_clear_edges) {
@@ -1174,7 +1369,6 @@ protected:
}; // class function_node
-
//! implements a function node that supports Input -> (set of outputs)
// Output is a tuple of output types.
template < typename Input, typename Output, typename Policy = queueing, typename Allocator=cache_aligned_allocator >
@@ -1191,7 +1385,6 @@ class multifunction_node :
Allocator
> {
protected:
- using graph_node::my_graph;
static const int N = tbb::flow::tuple_size::value;
public:
typedef Input input_type;
@@ -1207,83 +1400,125 @@ public:
multifunction_node( graph &g, size_t concurrency, Body body ) :
graph_node(g), base_type(g,concurrency, body, allocate_buffer::value ? new input_queue_type : NULL) {
tbb::internal::fgt_multioutput_node_with_body( tbb::internal::FLOW_MULTIFUNCTION_NODE,
- &this->graph_node::my_graph, static_cast *>(this),
+ &this->my_graph, static_cast *>(this),
this->output_ports(), this->my_body );
}
multifunction_node( const multifunction_node &other) :
- graph_node(other.graph_node::my_graph), base_type(other, allocate_buffer::value ? new input_queue_type : NULL) {
+ graph_node(other.my_graph), base_type(other, allocate_buffer::value ? new input_queue_type : NULL) {
tbb::internal::fgt_multioutput_node_with_body( tbb::internal::FLOW_MULTIFUNCTION_NODE,
- &this->graph_node::my_graph, static_cast *>(this),
+ &this->my_graph, static_cast *>(this),
this->output_ports(), this->my_body );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
- /* override */ void set_name( const char *name ) {
+ void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_multioutput_node_desc( this, name );
}
#endif
#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
- void extract( ) {
+ void extract( ) __TBB_override {
my_predecessors.built_predecessors().receiver_extract(*this);
base_type::extract();
}
#endif
// all the guts are in multifunction_input...
protected:
- /*override*/void reset_node(reset_flags f) { base_type::reset(f); }
+ void reset_node(reset_flags f) __TBB_override { base_type::reset(f); }
}; // multifunction_node
//! split_node: accepts a tuple as input, forwards each element of the tuple to its
-// successors. The node has unlimited concurrency, so though it is marked as
-// "rejecting" it does not reject inputs.
+// successors. The node has unlimited concurrency, so it does not reject inputs.
template >
-class split_node : public multifunction_node {
+class split_node : public graph_node, public receiver {
static const int N = tbb::flow::tuple_size::value;
- typedef multifunction_node base_type;
-public:
- typedef typename base_type::output_ports_type output_ports_type;
- typedef typename base_type::output_type output_type;
-private:
- struct splitting_body {
- void operator()(const TupleType& t, output_ports_type &p) {
- internal::emit_element::emit_this(t, p);
- }
- };
+ typedef receiver base_type;
public:
typedef TupleType input_type;
typedef Allocator allocator_type;
- split_node(graph &g) : base_type(g, unlimited, splitting_body()) {
- tbb::internal::fgt_multioutput_node( tbb::internal::FLOW_SPLIT_NODE, &this->graph_node::my_graph,
- static_cast *>(this), this->output_ports() );
- }
+#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
+ typedef typename base_type::predecessor_type predecessor_type;
+ typedef typename base_type::predecessor_list_type predecessor_list_type;
+ typedef internal::predecessor_cache predecessor_cache_type;
+ typedef typename predecessor_cache_type::built_predecessors_type built_predecessors_type;
+#endif
- split_node( const split_node & other) : base_type(other) {
- tbb::internal::fgt_multioutput_node( tbb::internal::FLOW_SPLIT_NODE, &this->graph_node::my_graph,
- static_cast *>(this), this->output_ports() );
+ typedef typename internal::wrap_tuple_elements<
+ N, // #elements in tuple
+ internal::multifunction_output, // wrap this around each element
+ TupleType // the tuple providing the types
+ >::type output_ports_type;
+
+ explicit split_node(graph &g) : graph_node(g)
+ {
+ tbb::internal::fgt_multioutput_node(tbb::internal::FLOW_SPLIT_NODE, &this->my_graph,
+ static_cast *>(this), this->output_ports());
+ }
+ split_node( const split_node & other) : graph_node(other.my_graph), base_type(other)
+ {
+ tbb::internal::fgt_multioutput_node(tbb::internal::FLOW_SPLIT_NODE, &this->my_graph,
+ static_cast *>(this), this->output_ports());
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
- /* override */ void set_name( const char *name ) {
+ void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_multioutput_node_desc( this, name );
}
#endif
+ output_ports_type &output_ports() { return my_output_ports; }
+
+protected:
+ task *try_put_task(const TupleType& t) __TBB_override {
+ // Sending split messages in parallel is not justified, as overheads would prevail
+ internal::emit_element::emit_this(t, output_ports());
+
+ //we do not have successors here.So we just tell the task is successful.
+ return SUCCESSFULLY_ENQUEUED;
+ }
+ void reset_node(reset_flags f) __TBB_override {
+ if (f & rf_clear_edges)
+ internal::clear_element::clear_this(my_output_ports);
+
+ __TBB_ASSERT(!(f & rf_clear_edges) || internal::clear_element::this_empty(my_output_ports), "split_node reset failed");
+ }
+ void reset_receiver(reset_flags /*f*/) __TBB_override {}
+
+#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
+private: //! split_node doesn't use this "predecessors" functionality; so, we have "dummies" here;
+ void extract() __TBB_override {}
+
+ //! Adds to list of predecessors added by make_edge
+ void internal_add_built_predecessor(predecessor_type&) __TBB_override {}
+
+ //! removes from to list of predecessors (used by remove_edge)
+ void internal_delete_built_predecessor(predecessor_type&) __TBB_override {}
+
+ size_t predecessor_count() __TBB_override { return 0; }
+
+ void copy_predecessors(predecessor_list_type&) __TBB_override {}
+
+ built_predecessors_type &built_predecessors() __TBB_override { return my_predessors; }
+
+ //! dummy member
+ built_predecessors_type my_predessors;
+#endif /* TBB_PREVIEW_FLOW_GRAPH_FEATURES */
+
+private:
+ output_ports_type my_output_ports;
};
//! Implements an executable node that supports continue_msg -> Output
template
class continue_node : public graph_node, public internal::continue_input, public internal::function_output {
-protected:
- using graph_node::my_graph;
public:
typedef continue_msg input_type;
typedef Output output_type;
- typedef sender< input_type > predecessor_type;
- typedef receiver< output_type > successor_type;
typedef internal::continue_input fInput_type;
typedef internal::function_output fOutput_type;
+ typedef typename fInput_type::predecessor_type predecessor_type;
+ typedef typename fOutput_type::successor_type successor_type;
//! Constructor for executable node with continue_msg -> Output
template
@@ -1306,7 +1541,7 @@ public:
//! Copy constructor
continue_node( const continue_node& src ) :
- graph_node(src.graph_node::my_graph), internal::continue_input(src),
+ graph_node(src.my_graph), internal::continue_input(src),
internal::function_output() {
tbb::internal::fgt_node_with_body( tbb::internal::FLOW_CONTINUE_NODE, &this->my_graph,
static_cast *>(this),
@@ -1314,13 +1549,13 @@ public:
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
- /* override */ void set_name( const char *name ) {
+ void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
- /*override graph_node*/ void extract() {
+ void extract() __TBB_override {
fInput_type::my_built_predecessors.receiver_extract(*this);
successors().built_successors().sender_extract(*this);
}
@@ -1331,25 +1566,22 @@ protected:
template friend class internal::broadcast_cache;
template friend class internal::round_robin_cache;
using fInput_type::try_put_task;
- /* override */ internal::broadcast_cache &successors () { return fOutput_type::my_successors; }
+ internal::broadcast_cache &successors () __TBB_override { return fOutput_type::my_successors; }
- /*override*/void reset_node(reset_flags f) {
+ void reset_node(reset_flags f) __TBB_override {
fInput_type::reset_receiver(f);
if(f & rf_clear_edges)successors().clear();
__TBB_ASSERT(!(f & rf_clear_edges) || successors().empty(), "continue_node not reset");
}
-
}; // continue_node
template< typename T >
class overwrite_node : public graph_node, public receiver, public sender {
-protected:
- using graph_node::my_graph;
public:
typedef T input_type;
typedef T output_type;
- typedef sender< input_type > predecessor_type;
- typedef receiver< output_type > successor_type;
+ typedef typename receiver::predecessor_type predecessor_type;
+ typedef typename sender::successor_type successor_type;
#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
typedef typename receiver::built_predecessors_type built_predecessors_type;
typedef typename sender::built_successors_type built_successors_type;
@@ -1357,7 +1589,7 @@ public:
typedef typename sender::successor_list_type successor_list_type;
#endif
- overwrite_node(graph &g) : graph_node(g), my_buffer_is_valid(false) {
+ explicit overwrite_node(graph &g) : graph_node(g), my_buffer_is_valid(false) {
my_successors.set_owner( this );
tbb::internal::fgt_node( tbb::internal::FLOW_OVERWRITE_NODE, &this->my_graph,
static_cast *>(this), static_cast *>(this) );
@@ -1375,12 +1607,12 @@ public:
~overwrite_node() {}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
- /* override */ void set_name( const char *name ) {
+ void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
- /* override */ bool register_successor( successor_type &s ) {
+ bool register_successor( successor_type &s ) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
if (my_buffer_is_valid && this->my_graph.is_active()) {
// We have a valid value that must be forwarded immediately.
@@ -1398,57 +1630,57 @@ public:
return true;
}
- /* override */ bool remove_successor( successor_type &s ) {
+ bool remove_successor( successor_type &s ) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
my_successors.remove_successor(s);
return true;
}
#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
- /*override*/built_predecessors_type &built_predecessors() { return my_built_predecessors; }
- /*override*/built_successors_type &built_successors() { return my_successors.built_successors(); }
+ built_predecessors_type &built_predecessors() __TBB_override { return my_built_predecessors; }
+ built_successors_type &built_successors() __TBB_override { return my_successors.built_successors(); }
- /*override*/void internal_add_built_successor( successor_type &s) {
+ void internal_add_built_successor( successor_type &s) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
my_successors.internal_add_built_successor(s);
}
- /*override*/void internal_delete_built_successor( successor_type &s) {
+ void internal_delete_built_successor( successor_type &s) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
my_successors.internal_delete_built_successor(s);
}
- /*override*/size_t successor_count() {
+ size_t successor_count() __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
return my_successors.successor_count();
}
- /*override*/ void copy_successors(successor_list_type &v) {
+ void copy_successors(successor_list_type &v) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
my_successors.copy_successors(v);
}
- /*override*/ void internal_add_built_predecessor( predecessor_type &p) {
+ void internal_add_built_predecessor( predecessor_type &p) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
my_built_predecessors.add_edge(p);
}
- /*override*/ void internal_delete_built_predecessor( predecessor_type &p) {
+ void internal_delete_built_predecessor( predecessor_type &p) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
my_built_predecessors.delete_edge(p);
}
- /*override*/size_t predecessor_count() {
+ size_t predecessor_count() __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
return my_built_predecessors.edge_count();
}
- /*override*/void copy_predecessors(predecessor_list_type &v) {
+ void copy_predecessors(predecessor_list_type &v) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
my_built_predecessors.copy_edges(v);
}
- /*override*/ void extract() {
+ void extract() __TBB_override {
my_buffer_is_valid = false;
built_successors().sender_extract(*this);
built_predecessors().receiver_extract(*this);
@@ -1456,7 +1688,7 @@ public:
#endif /* TBB_PREVIEW_FLOW_GRAPH_FEATURES */
- /* override */ bool try_get( input_type &v ) {
+ bool try_get( input_type &v ) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
if ( my_buffer_is_valid ) {
v = my_buffer;
@@ -1479,8 +1711,12 @@ protected:
template< typename R, typename B > friend class run_and_put_task;
template friend class internal::broadcast_cache;
template friend class internal::round_robin_cache;
- /* override */ task * try_put_task( const input_type &v ) {
+ task * try_put_task( const input_type &v ) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
+ return try_put_task_impl(v);
+ }
+
+ task * try_put_task_impl(const input_type &v) {
my_buffer = v;
my_buffer_is_valid = true;
task * rtask = my_successors.try_put_task(v);
@@ -1495,9 +1731,9 @@ protected:
#endif
input_type my_buffer;
bool my_buffer_is_valid;
- /*override*/void reset_receiver(reset_flags /*f*/) {}
+ void reset_receiver(reset_flags /*f*/) __TBB_override {}
- /*override*/void reset_node( reset_flags f) {
+ void reset_node( reset_flags f) __TBB_override {
my_buffer_is_valid = false;
if (f&rf_clear_edges) {
my_successors.clear();
@@ -1510,11 +1746,11 @@ class write_once_node : public overwrite_node {
public:
typedef T input_type;
typedef T output_type;
- typedef sender< input_type > predecessor_type;
- typedef receiver< output_type > successor_type;
+ typedef typename receiver::predecessor_type predecessor_type;
+ typedef typename sender::successor_type successor_type;
//! Constructor
- write_once_node(graph& g) : overwrite_node(g) {
+ explicit write_once_node(graph& g) : overwrite_node(g) {
tbb::internal::fgt_node( tbb::internal::FLOW_WRITE_ONCE_NODE, &(this->my_graph),
static_cast *>(this),
static_cast *>(this) );
@@ -1528,7 +1764,7 @@ public:
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
- /* override */ void set_name( const char *name ) {
+ void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
@@ -1537,30 +1773,20 @@ protected:
template< typename R, typename B > friend class run_and_put_task;
template friend class internal::broadcast_cache;
template friend class internal::round_robin_cache;
- /* override */ task *try_put_task( const T &v ) {
+ task *try_put_task( const T &v ) __TBB_override {
spin_mutex::scoped_lock l( this->my_mutex );
- if ( this->my_buffer_is_valid ) {
- return NULL;
- } else {
- this->my_buffer = v;
- this->my_buffer_is_valid = true;
- task *res = this->my_successors.try_put_task(v);
- if (!res) res = SUCCESSFULLY_ENQUEUED;
- return res;
- }
+ return this->my_buffer_is_valid ? NULL : this->try_put_task_impl(v);
}
};
//! Forwards messages of type T to all successors
template
class broadcast_node : public graph_node, public receiver, public sender {
-protected:
- using graph_node::my_graph;
public:
typedef T input_type;
typedef T output_type;
- typedef sender< input_type > predecessor_type;
- typedef receiver< output_type > successor_type;
+ typedef typename receiver::predecessor_type predecessor_type;
+ typedef typename sender::successor_type successor_type;
#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
typedef typename receiver::predecessor_list_type predecessor_list_type;
typedef typename sender::successor_list_type successor_list_type;
@@ -1573,7 +1799,7 @@ private:
#endif
public:
- broadcast_node(graph& g) : graph_node(g) {
+ explicit broadcast_node(graph& g) : graph_node(g) {
my_successors.set_owner( this );
tbb::internal::fgt_node( tbb::internal::FLOW_BROADCAST_NODE, &this->my_graph,
static_cast *>(this), static_cast *>(this) );
@@ -1589,19 +1815,19 @@ public:
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
- /* override */ void set_name( const char *name ) {
+ void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
//! Adds a successor
- virtual bool register_successor( receiver &r ) {
+ bool register_successor( successor_type &r ) __TBB_override {
my_successors.register_successor( r );
return true;
}
//! Removes s as a successor
- virtual bool remove_successor( receiver &r ) {
+ bool remove_successor( successor_type &r ) __TBB_override {
my_successors.remove_successor( r );
return true;
}
@@ -1609,49 +1835,49 @@ public:
#if TBB_PREVIEW_FLOW_GRAPH_FEATURES
typedef typename sender::built_successors_type built_successors_type;
- /*override sender*/ built_successors_type &built_successors() { return my_successors.built_successors(); }
+ built_successors_type &built_successors() __TBB_override { return my_successors.built_successors(); }
- /*override sender*/ void internal_add_built_successor(successor_type &r) {
+ void internal_add_built_successor(successor_type &r) __TBB_override {
my_successors.internal_add_built_successor(r);
}
- /*override sender*/ void internal_delete_built_successor(successor_type &r) {
+ void internal_delete_built_successor(successor_type &r) __TBB_override {
my_successors.internal_delete_built_successor(r);
}
- /*override sender*/ size_t successor_count() {
+ size_t successor_count() __TBB_override {
return my_successors.successor_count();
}
- /*override*/ void copy_successors(successor_list_type &v) {
+ void copy_successors(successor_list_type &v) __TBB_override {
my_successors.copy_successors(v);
}
typedef typename receiver::built_predecessors_type built_predecessors_type;
- /*override receiver*/ built_predecessors_type &built_predecessors() { return my_built_predecessors; }
+ built_predecessors_type &built_predecessors() __TBB_override { return my_built_predecessors; }
- /*override*/ void internal_add_built_predecessor( predecessor_type &p) {
+ void internal_add_built_predecessor( predecessor_type &p) __TBB_override {
spin_mutex::scoped_lock l(pred_mutex);
my_built_predecessors.add_edge(p);
}
- /*override*/ void internal_delete_built_predecessor( predecessor_type &p) {
+ void internal_delete_built_predecessor( predecessor_type &p) __TBB_override {
spin_mutex::scoped_lock l(pred_mutex);
my_built_predecessors.delete_edge(p);
}
- /*override*/ size_t predecessor_count() {
+ size_t predecessor_count() __TBB_override {
spin_mutex::scoped_lock l(pred_mutex);
return my_built_predecessors.edge_count();
}
- /*override*/ void copy_predecessors(predecessor_list_type &v) {
+ void copy_predecessors(predecessor_list_type &v) __TBB_override {
spin_mutex::scoped_lock l(pred_mutex);
my_built_predecessors.copy_edges(v);
}
- /*override graph_node*/ void extract() {
+ void extract() __TBB_override {
my_built_predecessors.receiver_extract(*this);
my_successors.built_successors().sender_extract(*this);
}
@@ -1662,15 +1888,15 @@ protected:
template friend class internal::broadcast_cache;
template