├── examples ├── common │ ├── gui │ │ ├── xcode │ │ │ └── tbbExample │ │ │ │ ├── PkgInfo │ │ │ │ ├── en.lproj │ │ │ │ ├── InfoPlist.strings │ │ │ │ └── MainMenu.nib │ │ │ │ ├── tbbExample-Prefix.pch │ │ │ │ ├── tbbAppDelegate.h │ │ │ │ ├── tbbExample-Info.ios.plist │ │ │ │ ├── OpenGLView.h │ │ │ │ ├── main.m │ │ │ │ ├── tbbExample-Info.plist │ │ │ │ ├── iOS.storyboard │ │ │ │ └── tbbAppDelegate.m │ │ └── dxcheck.bat │ ├── toolset.props │ ├── utility │ │ └── get_default_num_threads.h │ └── examples-common.inc ├── task_arena │ └── fractal │ │ └── msvs │ │ ├── gui.ico │ │ ├── small.ico │ │ └── resource.h ├── parallel_for │ ├── tachyon │ │ └── msvs │ │ │ ├── gui.ico │ │ │ ├── small.ico │ │ │ ├── uwp │ │ │ ├── Assets │ │ │ │ ├── Logo.png │ │ │ │ ├── SmallLogo.png │ │ │ │ ├── StoreLogo.png │ │ │ │ └── SplashScreen.png │ │ │ ├── App.xaml │ │ │ ├── pch.h │ │ │ ├── App.xaml.h │ │ │ ├── tbbTachyonRenderer.h │ │ │ ├── DirectXPage.xaml.h │ │ │ ├── tbbTachyon.sln │ │ │ ├── Package.appxmanifest │ │ │ └── App.xaml.cpp │ │ │ └── resource.h │ ├── seismic │ │ ├── msvs │ │ │ ├── small.ico │ │ │ └── SeismicSimulation.ico │ │ └── seismic_video.h │ ├── game_of_life │ │ ├── msvs │ │ │ ├── app.ico │ │ │ ├── resource.h │ │ │ └── app.rc │ │ ├── Makefile.windows │ │ └── Makefile │ └── polygon_overlay │ │ ├── speedup.gif │ │ ├── msvs │ │ ├── resource.h │ │ └── pover.rc │ │ ├── polymain.h │ │ └── polyover.h ├── task_group │ └── sudoku │ │ ├── input2 │ │ ├── input1 │ │ ├── input3 │ │ ├── input4 │ │ ├── msvs │ │ └── sudoku.sln │ │ └── Makefile.windows ├── task │ └── tree_sum │ │ ├── SerialSumTree.cpp │ │ ├── common.h │ │ ├── msvs │ │ └── tree_sum.sln │ │ └── Makefile ├── test_all │ └── fibonacci │ │ ├── CMakeLists.txt │ │ ├── msvs │ │ └── fibonacci.sln │ │ ├── Makefile │ │ └── Makefile.windows ├── graph │ ├── som │ │ ├── msvs │ │ │ └── som.sln │ │ └── Makefile.windows │ ├── stereo │ │ └── msvs │ │ │ └── stereo.sln │ ├── binpack │ │ ├── msvs │ │ │ └── binpack.sln │ │ └── Makefile │ ├── fgbzip2 │ │ ├── msvs │ │ │ └── fgbzip2.sln │ │ └── Makefile │ ├── cholesky │ │ ├── msvs │ │ │ └── cholesky.sln │ │ └── Makefile │ ├── logic_sim │ │ ├── msvs │ │ │ └── logic_sim.sln │ │ ├── Makefile │ │ └── Makefile.windows │ └── dining_philosophers │ │ ├── msvs │ │ └── dining_philosophers.sln │ │ ├── Makefile │ │ └── Makefile.windows ├── pipeline │ └── square │ │ ├── msvs │ │ └── square.sln │ │ ├── gen_input.cpp │ │ └── Makefile ├── parallel_reduce │ └── primes │ │ ├── msvs │ │ └── primes.sln │ │ └── primes.h ├── concurrent_priority_queue │ └── shortpath │ │ ├── msvs │ │ └── shortpath.sln │ │ ├── Makefile │ │ └── Makefile.windows ├── concurrent_hash_map │ └── count_strings │ │ ├── msvs │ │ └── count_strings.sln │ │ ├── Makefile │ │ └── Makefile.windows └── parallel_do │ └── parallel_preorder │ ├── msvs │ └── parallel_preorder.sln │ └── Makefile ├── src ├── test │ ├── test_opencl_kernel_32.spir │ ├── test_opencl_kernel_64.spir │ ├── test_opencl_precompiled_kernel_gpu_32.ir │ ├── test_opencl_precompiled_kernel_gpu_64.ir │ ├── test_tbb_condition_variable.cpp │ ├── test_tbb_thread.cpp │ ├── test_std_thread.cpp │ ├── harness_runtime_loader.h │ ├── harness_mic.h │ ├── harness_assert.h │ ├── test_arena_constraints_stubs.cpp │ ├── test_handle_perror.cpp │ ├── test_cache_aligned_allocator_STL.cpp │ ├── harness_allocator_overload.h │ └── harness_task.h ├── rml │ ├── server │ │ ├── index.html │ │ ├── win32-rml-export.def │ │ ├── win64-rml-export.def │ │ └── lin-rml-export.def │ ├── test │ │ └── test_rml_omp_c_linkage.c │ ├── client │ │ ├── omp_dynamic_link.cpp │ │ ├── omp_dynamic_link.h │ │ ├── library_assert.h │ │ ├── rml_omp.cpp │ │ ├── index.html │ │ └── rml_tbb.cpp │ ├── include │ │ └── index.html │ └── index.html ├── tbb │ ├── mac32-tbb-export.def │ ├── mac64-tbb-export.def │ ├── win32-tbbbind-export.def │ ├── win64-tbbbind-export.def │ ├── win32-tbb-export.def │ ├── lin32-tbbbind-export.def │ ├── lin64-tbbbind-export.def │ ├── win64-tbb-export.def │ ├── intel64-masm │ │ ├── intel64_misc.asm │ │ └── atomic_support.asm │ ├── critical_section.cpp │ ├── ia64-gas │ │ ├── pause.s │ │ ├── lock_byte.s │ │ └── log2.s │ ├── win64-gcc-tbb-export.def │ ├── index.html │ ├── lin64-tbb-export.def │ ├── ia32-masm │ │ └── lock_byte.asm │ ├── lin64ipf-tbb-export.def │ ├── lin32-tbb-export.def │ ├── tools_api │ │ └── disable_warnings.h │ ├── ibm_aix51 │ │ └── atomic_support.c │ └── spin_mutex.cpp ├── perf │ ├── run_statistics.sh │ └── harness_perf.h ├── old │ └── task_v2.cpp └── tbbmalloc │ ├── lin32-proxy-export.def │ ├── lin64-proxy-export.def │ ├── lin64ipf-proxy-export.def │ ├── tbbmalloc_internal_api.h │ ├── win32-tbbmalloc-export.def │ ├── mac32-tbbmalloc-export.def │ ├── mac64-tbbmalloc-export.def │ ├── win32-gcc-tbbmalloc-export.def │ ├── win64-gcc-tbbmalloc-export.def │ └── win64-tbbmalloc-export.def ├── README ├── doc └── copyright_brand_disclaimer_doxygen.txt ├── .appveyor.yml ├── python ├── tbb │ └── __main__.py ├── TBB.py ├── rml │ └── ipc_utils.h └── Makefile ├── include ├── index.html ├── tbb │ ├── internal │ │ ├── _warning_suppress_disable_notice.h │ │ └── _warning_suppress_enable_notice.h │ ├── index.html │ ├── tbb_disable_exceptions.h │ ├── null_mutex.h │ ├── flow_graph_abstractions.h │ ├── info.h │ └── null_rw_mutex.h └── serial │ └── tbb │ └── tbb_annotate.h ├── .gitattributes ├── cmake └── templates │ └── TBBConfigVersion.cmake.in ├── .travis.yml └── .gitignore /examples/common/gui/xcode/tbbExample/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? -------------------------------------------------------------------------------- /examples/common/gui/xcode/tbbExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /src/test/test_opencl_kernel_32.spir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/src/test/test_opencl_kernel_32.spir -------------------------------------------------------------------------------- /src/test/test_opencl_kernel_64.spir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/src/test/test_opencl_kernel_64.spir -------------------------------------------------------------------------------- /examples/task_arena/fractal/msvs/gui.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/examples/task_arena/fractal/msvs/gui.ico -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/msvs/gui.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/examples/parallel_for/tachyon/msvs/gui.ico -------------------------------------------------------------------------------- /examples/task_arena/fractal/msvs/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/examples/task_arena/fractal/msvs/small.ico -------------------------------------------------------------------------------- /examples/parallel_for/seismic/msvs/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/examples/parallel_for/seismic/msvs/small.ico -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/msvs/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/examples/parallel_for/tachyon/msvs/small.ico -------------------------------------------------------------------------------- /examples/parallel_for/game_of_life/msvs/app.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/examples/parallel_for/game_of_life/msvs/app.ico -------------------------------------------------------------------------------- /examples/parallel_for/polygon_overlay/speedup.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/examples/parallel_for/polygon_overlay/speedup.gif -------------------------------------------------------------------------------- /src/test/test_opencl_precompiled_kernel_gpu_32.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/src/test/test_opencl_precompiled_kernel_gpu_32.ir -------------------------------------------------------------------------------- /src/test/test_opencl_precompiled_kernel_gpu_64.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/src/test/test_opencl_precompiled_kernel_gpu_64.ir -------------------------------------------------------------------------------- /examples/parallel_for/seismic/msvs/SeismicSimulation.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/examples/parallel_for/seismic/msvs/SeismicSimulation.ico -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/msvs/uwp/Assets/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/examples/parallel_for/tachyon/msvs/uwp/Assets/Logo.png -------------------------------------------------------------------------------- /examples/common/gui/xcode/tbbExample/en.lproj/MainMenu.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/examples/common/gui/xcode/tbbExample/en.lproj/MainMenu.nib -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/msvs/uwp/Assets/SmallLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/examples/parallel_for/tachyon/msvs/uwp/Assets/SmallLogo.png -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/msvs/uwp/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/examples/parallel_for/tachyon/msvs/uwp/Assets/StoreLogo.png -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/msvs/uwp/Assets/SplashScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjakob/tbb/HEAD/examples/parallel_for/tachyon/msvs/uwp/Assets/SplashScreen.png -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Intel(R) Threading Building Blocks - README 2 | 3 | See index.html for directions and documentation. 4 | 5 | If source is present (./Makefile and src/ directories), 6 | type 'gmake' in this directory to build and test. 7 | 8 | See examples/index.html for runnable examples and directions. 9 | 10 | See http://threadingbuildingblocks.org for full documentation 11 | and software information. 12 | -------------------------------------------------------------------------------- /doc/copyright_brand_disclaimer_doxygen.txt: -------------------------------------------------------------------------------- 1 |
2 |

3 | Copyright © 2005-2020 Intel Corporation. All Rights Reserved. 4 |

5 | Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are 6 | registered trademarks or trademarks of Intel Corporation or its 7 | subsidiaries in the United States and other countries. 8 |

9 | * Other names and brands may be claimed as the property of others. 10 | -------------------------------------------------------------------------------- /examples/task_group/sudoku/input2: -------------------------------------------------------------------------------- 1 | 2 0 1 0 0 0 0 8 0 0 8 0 2 1 9 6 0 0 0 0 5 0 0 0 7 0 0 0 5 2 1 0 0 4 0 0 0 0 0 0 0 5 0 0 7 4 0 0 7 0 0 0 3 0 0 3 0 0 0 2 0 0 5 0 0 0 0 3 0 1 0 0 5 0 0 0 8 0 0 0 6 2 | 3 | 4 | 5 | 6 | 7 | 8 | 2 0 1 0 0 0 0 8 0 9 | 0 8 0 2 1 9 6 0 0 10 | 0 0 5 0 0 0 7 0 0 11 | 12 | 0 5 2 1 0 0 4 0 0 13 | 0 0 0 0 0 5 0 0 7 14 | 4 0 0 7 0 0 0 3 0 15 | 16 | 0 3 0 0 0 2 0 0 5 17 | 0 0 0 0 3 0 1 0 0 18 | 5 0 0 0 8 0 0 0 6 19 | -------------------------------------------------------------------------------- /examples/task_group/sudoku/input1: -------------------------------------------------------------------------------- 1 | 1 0 0 9 0 0 0 8 0 0 8 0 2 0 0 0 0 0 0 0 5 0 0 0 7 0 0 0 5 2 1 0 0 4 0 0 0 0 0 0 0 5 0 0 7 4 0 0 7 0 0 0 3 0 0 3 0 0 0 2 0 0 5 0 0 0 0 0 0 1 0 0 5 0 0 0 1 0 0 0 0 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 0 0 9 0 0 0 8 0 10 | 0 8 0 2 0 0 0 0 0 11 | 0 0 5 0 0 0 7 0 0 12 | 13 | 0 5 2 1 0 0 4 0 0 14 | 0 0 0 0 0 5 0 0 7 15 | 4 0 0 7 0 0 0 3 0 16 | 17 | 0 3 0 0 0 2 0 0 5 18 | 0 0 0 0 0 0 1 0 0 19 | 5 0 0 0 1 0 0 0 0 20 | -------------------------------------------------------------------------------- /examples/task_group/sudoku/input3: -------------------------------------------------------------------------------- 1 | 1 0 0 9 0 0 0 8 0 0 0 0 2 0 0 0 0 0 0 0 5 0 0 0 7 0 0 0 5 2 6 0 0 4 0 0 0 0 0 0 0 5 0 0 7 4 0 0 7 0 0 0 3 0 0 3 0 0 0 2 0 0 5 0 0 0 0 0 0 1 0 0 5 0 0 0 1 0 0 0 0 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 0 0 9 0 0 0 8 0 10 | 0 0 0 2 0 0 0 0 0 11 | 0 0 5 0 0 0 7 0 0 12 | 13 | 0 5 2 6 0 0 4 0 0 14 | 0 0 0 0 0 5 0 0 7 15 | 4 0 0 7 0 0 0 3 0 16 | 17 | 0 3 0 0 0 2 0 0 5 18 | 0 0 0 0 0 0 1 0 0 19 | 5 0 0 0 1 0 0 0 0 20 | -------------------------------------------------------------------------------- /examples/task_group/sudoku/input4: -------------------------------------------------------------------------------- 1 | 1 0 0 9 0 0 0 8 0 0 0 0 2 0 0 0 0 0 0 0 5 0 0 0 7 0 0 0 0 2 6 0 0 0 0 0 0 0 0 0 0 5 0 0 7 4 0 0 0 0 0 0 3 0 0 3 0 0 0 2 0 0 5 0 0 0 0 0 0 1 0 0 5 0 0 0 1 0 0 0 0 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 0 0 9 0 0 0 8 0 10 | 0 0 0 2 0 0 0 0 0 11 | 0 0 5 0 0 0 7 0 0 12 | 13 | 0 0 2 6 0 0 0 0 0 14 | 0 0 0 0 0 5 0 0 7 15 | 4 0 0 0 0 0 0 3 0 16 | 17 | 0 3 0 0 0 2 0 0 5 18 | 0 0 0 0 0 0 1 0 0 19 | 5 0 0 0 1 0 0 0 0 20 | -------------------------------------------------------------------------------- /src/rml/server/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Overview

4 | 5 | This directory has source code internal to the server. 6 | 7 |
8 | Up to parent directory 9 |

10 | Copyright © 2005-2020 Intel Corporation. All Rights Reserved. 11 |

12 | Intel is a registered trademark or trademark of Intel Corporation 13 | or its subsidiaries in the United States and other countries. 14 |

15 | * Other names and brands may be claimed as the property of others. 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/msvs/uwp/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.appveyor.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | matrix: 3 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 4 | VS_GEN: Visual Studio 14 2015 5 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 6 | VS_GEN: Visual Studio 15 2017 Win64 7 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 8 | VS_GEN: Visual Studio 16 2019 9 | 10 | install: 11 | - cinstall: python 12 | build_script: 13 | - echo Running cmake... 14 | - cmake -G "%VS_GEN%" -DCMAKE_SUPPRESS_REGENERATION=1 . 15 | - set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" 16 | - cmake --build . --config Release -- /v:m /logger:%MSBuildLogger% 17 | - ctest -C Release --output-on-failure --timeout 500 -E parallel_for 18 | -------------------------------------------------------------------------------- /python/tbb/__main__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (c) 2016-2020 Intel Corporation 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | 18 | from . import _main 19 | from sys import exit 20 | exit(_main()) 21 | -------------------------------------------------------------------------------- /src/tbb/mac32-tbb-export.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #define __TBB_SYMBOL( sym ) _##sym 18 | #include "mac32-tbb-export.lst" 19 | 20 | -------------------------------------------------------------------------------- /src/tbb/mac64-tbb-export.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #define __TBB_SYMBOL( sym ) _##sym 18 | #include "mac64-tbb-export.lst" 19 | 20 | -------------------------------------------------------------------------------- /src/rml/test/test_rml_omp_c_linkage.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | void Cplusplus(); 18 | 19 | int main() { 20 | Cplusplus(); 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /examples/parallel_for/game_of_life/msvs/resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | //{{NO_DEPENDENCIES}} 18 | // Microsoft Visual C++ generated include file. 19 | // Used by app.rc 20 | -------------------------------------------------------------------------------- /include/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Overview

5 | Include files for Intel® Threading Building Blocks (Intel® TBB). 6 | 7 |

Directories

8 |
9 |
tbb 10 |
Include files for Intel TBB classes and functions. 11 |
serial/tbb 12 |
Include files for a sequential implementation of the parallel_for algorithm. 13 |
14 | 15 |
16 | Up to parent directory 17 |

18 | Copyright © 2005-2020 Intel Corporation. All Rights Reserved. 19 |

20 | Intel is a registered trademark or trademark of Intel Corporation 21 | or its subsidiaries in the United States and other countries. 22 |

23 | * Other names and brands may be claimed as the property of others. 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/tbb/win32-tbbbind-export.def: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2005-2020 Intel Corporation 2 | ; 3 | ; Licensed under the Apache License, Version 2.0 (the "License"); 4 | ; you may not use this file except in compliance with the License. 5 | ; You may obtain a copy of the License at 6 | ; 7 | ; http://www.apache.org/licenses/LICENSE-2.0 8 | ; 9 | ; Unless required by applicable law or agreed to in writing, software 10 | ; distributed under the License is distributed on an "AS IS" BASIS, 11 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ; See the License for the specific language governing permissions and 13 | ; limitations under the License. 14 | 15 | EXPORTS 16 | 17 | global 18 | initialize_numa_topology 19 | bind_to_node 20 | restore_affinity 21 | allocate_binding_handler 22 | deallocate_binding_handler 23 | -------------------------------------------------------------------------------- /src/tbb/win64-tbbbind-export.def: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2005-2020 Intel Corporation 2 | ; 3 | ; Licensed under the Apache License, Version 2.0 (the "License"); 4 | ; you may not use this file except in compliance with the License. 5 | ; You may obtain a copy of the License at 6 | ; 7 | ; http://www.apache.org/licenses/LICENSE-2.0 8 | ; 9 | ; Unless required by applicable law or agreed to in writing, software 10 | ; distributed under the License is distributed on an "AS IS" BASIS, 11 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ; See the License for the specific language governing permissions and 13 | ; limitations under the License. 14 | 15 | EXPORTS 16 | 17 | global 18 | initialize_numa_topology 19 | bind_to_node 20 | restore_affinity 21 | allocate_binding_handler 22 | deallocate_binding_handler 23 | -------------------------------------------------------------------------------- /src/tbb/win32-tbb-export.def: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2005-2020 Intel Corporation 2 | ; 3 | ; Licensed under the Apache License, Version 2.0 (the "License"); 4 | ; you may not use this file except in compliance with the License. 5 | ; You may obtain a copy of the License at 6 | ; 7 | ; http://www.apache.org/licenses/LICENSE-2.0 8 | ; 9 | ; Unless required by applicable law or agreed to in writing, software 10 | ; distributed under the License is distributed on an "AS IS" BASIS, 11 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ; See the License for the specific language governing permissions and 13 | ; limitations under the License. 14 | 15 | EXPORTS 16 | 17 | #define __TBB_SYMBOL( sym ) sym 18 | #if _M_ARM 19 | #include "winrt-tbb-export.lst" 20 | #else 21 | #include "win32-tbb-export.lst" 22 | #endif 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/rml/client/omp_dynamic_link.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "omp_dynamic_link.h" 18 | #include "library_assert.h" 19 | #include "tbb/dynamic_link.cpp" // Refers to src/tbb, not include/tbb 20 | 21 | -------------------------------------------------------------------------------- /python/TBB.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (c) 2016-2020 Intel Corporation 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | 18 | from tbb import * 19 | from tbb import __all__, __doc__ 20 | 21 | if __name__ == "__main__": 22 | from tbb import _main 23 | import sys 24 | sys.exit(_main()) 25 | -------------------------------------------------------------------------------- /src/tbb/lin32-tbbbind-export.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | { 18 | global: 19 | initialize_numa_topology; 20 | bind_to_node; 21 | restore_affinity; 22 | allocate_binding_handler; 23 | deallocate_binding_handler; 24 | }; 25 | -------------------------------------------------------------------------------- /src/tbb/lin64-tbbbind-export.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | { 18 | global: 19 | initialize_numa_topology; 20 | bind_to_node; 21 | restore_affinity; 22 | allocate_binding_handler; 23 | deallocate_binding_handler; 24 | }; 25 | -------------------------------------------------------------------------------- /examples/common/toolset.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Intel C++ Compiler 15.0 [Intel(R) System Studio] 5 | Intel C++ Compiler XE 15.0 6 | Intel C++ Compiler 16.0 7 | true 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/rml/server/win32-rml-export.def: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2005-2020 Intel Corporation 2 | ; 3 | ; Licensed under the Apache License, Version 2.0 (the "License"); 4 | ; you may not use this file except in compliance with the License. 5 | ; You may obtain a copy of the License at 6 | ; 7 | ; http://www.apache.org/licenses/LICENSE-2.0 8 | ; 9 | ; Unless required by applicable law or agreed to in writing, software 10 | ; distributed under the License is distributed on an "AS IS" BASIS, 11 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ; See the License for the specific language governing permissions and 13 | ; limitations under the License. 14 | 15 | EXPORTS 16 | 17 | __RML_open_factory 18 | __RML_close_factory 19 | __TBB_make_rml_server 20 | __KMP_make_rml_server 21 | __TBB_call_with_my_server_info 22 | __KMP_call_with_my_server_info 23 | 24 | -------------------------------------------------------------------------------- /src/rml/server/win64-rml-export.def: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2005-2020 Intel Corporation 2 | ; 3 | ; Licensed under the Apache License, Version 2.0 (the "License"); 4 | ; you may not use this file except in compliance with the License. 5 | ; You may obtain a copy of the License at 6 | ; 7 | ; http://www.apache.org/licenses/LICENSE-2.0 8 | ; 9 | ; Unless required by applicable law or agreed to in writing, software 10 | ; distributed under the License is distributed on an "AS IS" BASIS, 11 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ; See the License for the specific language governing permissions and 13 | ; limitations under the License. 14 | 15 | EXPORTS 16 | 17 | __RML_open_factory 18 | __RML_close_factory 19 | __TBB_make_rml_server 20 | __KMP_make_rml_server 21 | __TBB_call_with_my_server_info 22 | __KMP_call_with_my_server_info 23 | 24 | -------------------------------------------------------------------------------- /src/rml/include/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Overview

4 | 5 | This directory has the include files for the Resource Management Layer (RML). 6 | 7 |

Files

8 | 9 |
10 |

rml_base.h 11 |

Interfaces shared by TBB and OpenMP.

12 |

rml_omp.h 13 |

Interface exclusive to OpenMP.

14 |

rml_tbb.h 15 |

Interface exclusive to TBB.

16 |
17 | 18 |
19 | Up to parent directory 20 |

21 | Copyright © 2005-2020 Intel Corporation. All Rights Reserved. 22 |

23 | Intel is a registered trademark or trademark of Intel Corporation 24 | or its subsidiaries in the United States and other countries. 25 |

26 | * Other names and brands may be claimed as the property of others. 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/tbb/win64-tbb-export.def: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2005-2020 Intel Corporation 2 | ; 3 | ; Licensed under the Apache License, Version 2.0 (the "License"); 4 | ; you may not use this file except in compliance with the License. 5 | ; You may obtain a copy of the License at 6 | ; 7 | ; http://www.apache.org/licenses/LICENSE-2.0 8 | ; 9 | ; Unless required by applicable law or agreed to in writing, software 10 | ; distributed under the License is distributed on an "AS IS" BASIS, 11 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ; See the License for the specific language governing permissions and 13 | ; limitations under the License. 14 | 15 | ; This file is organized with a section for each .cpp file. 16 | ; Each of these sections is in alphabetical order. 17 | 18 | EXPORTS 19 | 20 | #define __TBB_SYMBOL( sym ) sym 21 | #include "win64-tbb-export.lst" 22 | 23 | -------------------------------------------------------------------------------- /src/rml/server/lin-rml-export.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | { 18 | global: 19 | __RML_open_factory; 20 | __RML_close_factory; 21 | __TBB_make_rml_server; 22 | __KMP_make_rml_server; 23 | __TBB_call_with_my_server_info; 24 | __KMP_call_with_my_server_info; 25 | local:*; 26 | }; 27 | -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/msvs/uwp/pch.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include "App.xaml.h" 26 | -------------------------------------------------------------------------------- /src/test/test_tbb_condition_variable.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "tbb/tbb_config.h" 18 | 19 | #include "test_condition_variable.h" 20 | 21 | int TestMain() { 22 | REMARK( "testing with tbb condvar\n" ); 23 | DoCondVarTest(); 24 | return Harness::Done; 25 | } 26 | -------------------------------------------------------------------------------- /src/tbb/intel64-masm/intel64_misc.asm: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2005-2020 Intel Corporation 2 | ; 3 | ; Licensed under the Apache License, Version 2.0 (the "License"); 4 | ; you may not use this file except in compliance with the License. 5 | ; You may obtain a copy of the License at 6 | ; 7 | ; http://www.apache.org/licenses/LICENSE-2.0 8 | ; 9 | ; Unless required by applicable law or agreed to in writing, software 10 | ; distributed under the License is distributed on an "AS IS" BASIS, 11 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ; See the License for the specific language governing permissions and 13 | ; limitations under the License. 14 | 15 | .code 16 | ALIGN 8 17 | PUBLIC __TBB_get_cpu_ctl_env 18 | __TBB_get_cpu_ctl_env: 19 | stmxcsr [rcx] 20 | fstcw [rcx+4] 21 | ret 22 | .code 23 | ALIGN 8 24 | PUBLIC __TBB_set_cpu_ctl_env 25 | __TBB_set_cpu_ctl_env: 26 | ldmxcsr [rcx] 27 | fldcw [rcx+4] 28 | ret 29 | end 30 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Explicitly declare text files you want to always be normalized and converted 5 | # to native line endings on checkout. 6 | *.c text 7 | *.h text 8 | *.cpp text 9 | *.def text 10 | *.rc text 11 | *.i text 12 | *.sh text 13 | *.csh text 14 | *.mk text 15 | *.java text 16 | *.csv text 17 | *.lst text 18 | *.asm text 19 | *.cfg text 20 | *.css text 21 | *.inc text 22 | *.js text 23 | *.rb text 24 | *.strings text 25 | *.txt text 26 | *export.lst text 27 | *.xml text 28 | *.py text 29 | *.md text 30 | *.classpath text 31 | *.cproject text 32 | *.project text 33 | *.properties text 34 | *.java text 35 | *.gradle text 36 | 37 | # Declare files that will always have CRLF line endings on checkout. 38 | *.sln text eol=crlf 39 | *.bat text eol=crlf 40 | 41 | # Denote all files that are truly binary and should not be modified. 42 | *.png binary 43 | *.jpg binary 44 | *.ico binary 45 | *.spir binary 46 | -------------------------------------------------------------------------------- /examples/task/tree_sum/SerialSumTree.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "common.h" 18 | 19 | Value SerialSumTree( TreeNode* root ) { 20 | Value result = root->value; 21 | if( root->left ) 22 | result += SerialSumTree(root->left); 23 | if( root->right ) 24 | result += SerialSumTree(root->right); 25 | return result; 26 | } 27 | -------------------------------------------------------------------------------- /src/tbb/critical_section.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "tbb/critical_section.h" 18 | #include "itt_notify.h" 19 | 20 | namespace tbb { 21 | namespace internal { 22 | 23 | void critical_section_v4::internal_construct() { 24 | ITT_SYNC_CREATE(&my_impl, _T("ppl::critical_section"), _T("")); 25 | } 26 | } // namespace internal 27 | } // namespace tbb 28 | -------------------------------------------------------------------------------- /python/rml/ipc_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2017-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef __IPC_UTILS_H 18 | #define __IPC_UTILS_H 19 | 20 | namespace tbb { 21 | namespace internal { 22 | namespace rml { 23 | 24 | char* get_shared_name(const char* prefix); 25 | int get_num_threads(const char* env_var); 26 | bool get_enable_flag(const char* env_var); 27 | 28 | }}} //tbb::internal::rml 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/tbb/internal/_warning_suppress_disable_notice.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #if __TBB_SUPPRESS_INTERNAL_DEPRECATED_MESSAGES 18 | 19 | #if __INTEL_COMPILER || _MSC_VER 20 | #pragma warning( pop ) 21 | #elif __GNUC__ 22 | #pragma GCC diagnostic pop 23 | #elif __clang__ 24 | #pragma clang diagnostic pop 25 | #endif 26 | 27 | #endif // __TBB_SUPPRESS_INTERNAL_DEPRECATED_MESSAGES 28 | -------------------------------------------------------------------------------- /src/rml/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Overview

4 | 5 | The subdirectories pertain to the Resource Management Layer (RML). 6 | 7 |

Directories

8 | 9 |
10 |

include/ 11 |

Include files used by clients of RML.

12 |

client/ 13 |

Source files for code that must be statically linked with a client.

14 |

server/ 15 |

Source files for the RML server.

16 |

test/ 17 |

Unit tests for RML server and its components.

18 |
19 | 20 |
21 | Up to parent directory 22 |

23 | Copyright © 2005-2020 Intel Corporation. All Rights Reserved. 24 |

25 | Intel is a registered trademark or trademark of Intel Corporation 26 | or its subsidiaries in the United States and other countries. 27 |

28 | * Other names and brands may be claimed as the property of others. 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/rml/client/omp_dynamic_link.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef __KMP_omp_dynamic_link_H 18 | #define __KMP_omp_dynamic_link_H 19 | 20 | #define OPEN_INTERNAL_NAMESPACE namespace __kmp { 21 | #define CLOSE_INTERNAL_NAMESPACE } 22 | 23 | #include "library_assert.h" 24 | #include "tbb/dynamic_link.h" // Refers to src/tbb, not include/tbb 25 | 26 | #endif /* __KMP_omp_dynamic_link_H */ 27 | -------------------------------------------------------------------------------- /examples/common/gui/dxcheck.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM 3 | REM Copyright (c) 2005-2020 Intel Corporation 4 | REM 5 | REM Licensed under the Apache License, Version 2.0 (the "License"); 6 | REM you may not use this file except in compliance with the License. 7 | REM You may obtain a copy of the License at 8 | REM 9 | REM http://www.apache.org/licenses/LICENSE-2.0 10 | REM 11 | REM Unless required by applicable law or agreed to in writing, software 12 | REM distributed under the License is distributed on an "AS IS" BASIS, 13 | REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | REM See the License for the specific language governing permissions and 15 | REM limitations under the License. 16 | REM 17 | if "%DXSDK_DIR%"=="" goto error_no_DXSDK 18 | goto end 19 | 20 | :error_no_DXSDK 21 | echo DirectX SDK Check : error : This example requires the DirectX SDK. Either (re)-install the DirectX SDK, or set the DXSDK_DIR environment variable to indicate where it is installed. 22 | 23 | :end 24 | 25 | -------------------------------------------------------------------------------- /include/tbb/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Overview

5 | Include files for Intel® Threading Building Blocks classes and functions. 6 | 7 |
Click here to see all files in the directory. 8 | 9 |

Directories

10 |
11 |
compat 12 |
Include files for source level compatibility with other frameworks. 13 |
internal 14 |
Include files with implementation details; not for direct use. 15 |
machine 16 |
Include files for low-level architecture specific functionality; not for direct use. 17 |
18 | 19 |
20 | Up to parent directory 21 |

22 | Copyright © 2005-2020 Intel Corporation. All Rights Reserved. 23 |

24 | Intel is a registered trademark or trademark of Intel Corporation 25 | or its subsidiaries in the United States and other countries. 26 |

27 | * Other names and brands may be claimed as the property of others. 28 | 29 | 30 | -------------------------------------------------------------------------------- /cmake/templates/TBBConfigVersion.cmake.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | set(PACKAGE_VERSION @TBB_VERSION@) 16 | 17 | if ("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") 18 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 19 | else() 20 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 21 | if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") 22 | set(PACKAGE_VERSION_EXACT TRUE) 23 | endif() 24 | endif() 25 | -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/msvs/resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #define IDC_MYICON 2 18 | #define IDD_GUI 102 19 | #define IDS_APP_TITLE 103 20 | #define IDI_GUI 107 21 | #define IDI_SMALL 108 22 | #define IDC_GUI 109 23 | #define IDR_MAINFRAME 128 24 | #define IDC_STATIC -1 25 | -------------------------------------------------------------------------------- /src/test/test_tbb_thread.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "tbb/tbb_thread.h" 18 | #define THREAD tbb::tbb_thread 19 | #define THIS_THREAD tbb::this_tbb_thread 20 | #define THIS_THREAD_SLEEP THIS_THREAD::sleep 21 | #include "test_thread.h" 22 | #include "harness.h" 23 | 24 | /* we want to test tbb::tbb_thread */ 25 | int TestMain () { 26 | CheckSignatures(); 27 | RunTests(); 28 | return Harness::Done; 29 | } 30 | -------------------------------------------------------------------------------- /src/tbb/ia64-gas/pause.s: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2005-2020 Intel Corporation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | .section .text 16 | .align 16 17 | // void __TBB_machine_pause( long count ); 18 | // r32 = count 19 | .proc __TBB_machine_pause# 20 | .global __TBB_machine_pause# 21 | count = r32 22 | __TBB_machine_pause: 23 | hint.m 0 24 | add count=-1,count 25 | ;; 26 | cmp.eq p6,p7=0,count 27 | (p7) br.cond.dpnt __TBB_machine_pause 28 | (p6) br.ret.sptk.many b0 29 | .endp __TBB_machine_pause# 30 | -------------------------------------------------------------------------------- /src/rml/client/library_assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef LIBRARY_ASSERT_H 18 | #define LIBRARY_ASSERT_H 19 | 20 | #ifndef LIBRARY_ASSERT 21 | #ifdef KMP_ASSERT2 22 | #define LIBRARY_ASSERT(x,y) KMP_ASSERT2((x),(y)) 23 | #else 24 | #include 25 | #define LIBRARY_ASSERT(x,y) assert(x) 26 | #define __TBB_DYNAMIC_LOAD_ENABLED 1 27 | #endif 28 | #endif /* LIBRARY_ASSERT */ 29 | 30 | #endif /* LIBRARY_ASSERT_H */ 31 | -------------------------------------------------------------------------------- /src/tbb/win64-gcc-tbb-export.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | { 18 | global: 19 | 20 | #define __TBB_SYMBOL( sym ) sym; 21 | #include "win64-gcc-tbb-export.lst" 22 | 23 | local: 24 | 25 | /* TBB symbols */ 26 | *3tbb*; 27 | *__TBB*; 28 | 29 | /* Intel Compiler (libirc) symbols */ 30 | __intel_*; 31 | _intel_*; 32 | get_msg_buf; 33 | get_text_buf; 34 | message_catalog; 35 | print_buf; 36 | irc__get_msg; 37 | irc__print; 38 | 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /examples/task_arena/fractal/msvs/resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #define IDC_MYICON 2 18 | #define IDD_GUI 102 19 | #define IDS_APP_TITLE 103 20 | #define IDI_GUI 107 21 | #define IDI_SMALL 108 22 | #define IDC_GUI 109 23 | #define IDR_MAINFRAME 128 24 | #define IDC_STATIC -1 25 | -------------------------------------------------------------------------------- /src/tbb/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Overview

5 | This directory contains the source code of the TBB core components. 6 | 7 |

Directories

8 |
9 |
tools_api 10 |
Source code of the interface components provided by the Intel® Parallel Studio tools. 11 |
intel64-masm 12 |
Assembly code for the Intel® 64 architecture. 13 |
ia32-masm 14 |
Assembly code for IA32 architecture. 15 |
ia64-gas 16 |
Assembly code for IA-64 architecture. 17 |
ibm_aix51 18 |
Assembly code for AIX 5.1 port. 19 |
20 | 21 |
22 | Up to parent directory 23 |

24 | Copyright © 2005-2020 Intel Corporation. All Rights Reserved. 25 |

26 | Intel is a registered trademark or trademark of Intel Corporation 27 | or its subsidiaries in the United States and other countries. 28 |

29 | * Other names and brands may be claimed as the property of others. 30 | 31 | 32 | -------------------------------------------------------------------------------- /examples/common/gui/xcode/tbbExample/tbbExample-Prefix.pch: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // 18 | // Prefix header for all source files of the 'tbbExample' target in the 'tbbExample' project 19 | // 20 | 21 | #import 22 | 23 | #if TARGET_OS_IPHONE 24 | #ifdef __OBJC__ 25 | #import 26 | #import 27 | #endif 28 | #elif TARGET_OS_MAC 29 | #ifdef __OBJC__ 30 | #import 31 | #endif 32 | #endif 33 | -------------------------------------------------------------------------------- /src/tbb/lin64-tbb-export.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | { 18 | global: 19 | 20 | #define __TBB_SYMBOL( sym ) sym; 21 | #include "lin64-tbb-export.lst" 22 | 23 | local: 24 | 25 | /* TBB symbols */ 26 | *3tbb*; 27 | *__TBB*; 28 | 29 | /* ITT symbols */ 30 | __itt_*; 31 | 32 | /* Intel Compiler (libirc) symbols */ 33 | __intel_*; 34 | _intel_*; 35 | get_msg_buf; 36 | get_text_buf; 37 | message_catalog; 38 | print_buf; 39 | irc__get_msg; 40 | irc__print; 41 | 42 | }; 43 | -------------------------------------------------------------------------------- /src/tbb/ia32-masm/lock_byte.asm: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2005-2020 Intel Corporation 2 | ; 3 | ; Licensed under the Apache License, Version 2.0 (the "License"); 4 | ; you may not use this file except in compliance with the License. 5 | ; You may obtain a copy of the License at 6 | ; 7 | ; http://www.apache.org/licenses/LICENSE-2.0 8 | ; 9 | ; Unless required by applicable law or agreed to in writing, software 10 | ; distributed under the License is distributed on an "AS IS" BASIS, 11 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ; See the License for the specific language governing permissions and 13 | ; limitations under the License. 14 | 15 | ; DO NOT EDIT - AUTOMATICALLY GENERATED FROM .s FILE 16 | .686 17 | .model flat,c 18 | .code 19 | ALIGN 4 20 | PUBLIC c __TBB_machine_trylockbyte 21 | __TBB_machine_trylockbyte: 22 | mov edx,4[esp] 23 | mov al,[edx] 24 | mov cl,1 25 | test al,1 26 | jnz __TBB_machine_trylockbyte_contended 27 | lock cmpxchg [edx],cl 28 | jne __TBB_machine_trylockbyte_contended 29 | mov eax,1 30 | ret 31 | __TBB_machine_trylockbyte_contended: 32 | xor eax,eax 33 | ret 34 | end 35 | -------------------------------------------------------------------------------- /src/tbb/lin64ipf-tbb-export.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | { 18 | global: 19 | 20 | #define __TBB_SYMBOL( sym ) sym; 21 | #include "lin64ipf-tbb-export.lst" 22 | 23 | local: 24 | 25 | /* TBB symbols */ 26 | *3tbb*; 27 | *__TBB*; 28 | 29 | /* ITT symbols */ 30 | __itt_*; 31 | 32 | /* Intel Compiler (libirc) symbols */ 33 | __intel_*; 34 | _intel_*; 35 | ?0_memcopyA; 36 | ?0_memcopyDu; 37 | ?0_memcpyD; 38 | ?1__memcpy; 39 | ?1__memmove; 40 | ?1__serial_memmove; 41 | memcpy; 42 | memset; 43 | 44 | }; 45 | -------------------------------------------------------------------------------- /examples/parallel_for/polygon_overlay/msvs/resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | //{{NO_DEPENDENCIES}} 18 | // Microsoft Visual C++ generated include file. 19 | // Used by pover.rc 20 | 21 | // Next default values for new objects 22 | // 23 | #ifdef APSTUDIO_INVOKED 24 | #ifndef APSTUDIO_READONLY_SYMBOLS 25 | #define _APS_NEXT_RESOURCE_VALUE 101 26 | #define _APS_NEXT_COMMAND_VALUE 40001 27 | #define _APS_NEXT_CONTROL_VALUE 1001 28 | #define _APS_NEXT_SYMED_VALUE 101 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /examples/task/tree_sum/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | typedef float Value; 18 | 19 | struct TreeNode { 20 | //! Pointer to left subtree 21 | TreeNode* left; 22 | //! Pointer to right subtree 23 | TreeNode* right; 24 | //! Number of nodes in this subtree, including this node. 25 | long node_count; 26 | //! Value associated with the node. 27 | Value value; 28 | }; 29 | 30 | Value SerialSumTree( TreeNode* root ); 31 | Value SimpleParallelSumTree( TreeNode* root ); 32 | Value OptimizedParallelSumTree( TreeNode* root ); 33 | -------------------------------------------------------------------------------- /include/serial/tbb/tbb_annotate.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef __TBB_annotate_H 18 | #define __TBB_annotate_H 19 | 20 | // Macros used by the Intel(R) Parallel Advisor. 21 | #ifdef __TBB_NORMAL_EXECUTION 22 | #define ANNOTATE_SITE_BEGIN( site ) 23 | #define ANNOTATE_SITE_END( site ) 24 | #define ANNOTATE_TASK_BEGIN( task ) 25 | #define ANNOTATE_TASK_END( task ) 26 | #define ANNOTATE_LOCK_ACQUIRE( lock ) 27 | #define ANNOTATE_LOCK_RELEASE( lock ) 28 | #else 29 | #include 30 | #endif 31 | 32 | #endif /* __TBB_annotate_H */ 33 | -------------------------------------------------------------------------------- /src/perf/run_statistics.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2005-2020 Intel Corporation 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH 18 | #setting output format .csv, 'pivot' - is pivot table mode, ++ means append 19 | export STAT_FORMAT=pivot-csv++ 20 | #check existing files because of append mode 21 | ls *.csv 22 | rm -i *.csv 23 | #setting a delimiter in txt or csv file 24 | #export STAT_DELIMITER=, 25 | export STAT_RUNINFO1=Host=`hostname -s` 26 | #append a suffix after the filename 27 | #export STAT_SUFFIX=$STAT_RUNINFO1 28 | for ((i=1;i<=${repeat:=100};++i)); do echo $i of $repeat: && STAT_RUNINFO2=Run=$i $* || break; done 29 | -------------------------------------------------------------------------------- /include/tbb/internal/_warning_suppress_enable_notice.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "../tbb_config.h" 18 | 19 | #if __TBB_SUPPRESS_INTERNAL_DEPRECATED_MESSAGES 20 | 21 | #if _MSC_VER || __INTEL_COMPILER 22 | #pragma warning( push ) 23 | #pragma warning( disable: 4996 ) 24 | #elif __GNUC__ 25 | #pragma GCC diagnostic push 26 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 27 | #elif __clang__ 28 | #pragma clang diagnostic push 29 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" 30 | #endif 31 | 32 | #endif // __TBB_SUPPRESS_INTERNAL_DEPRECATED_MESSAGES 33 | -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/msvs/uwp/App.xaml.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | #pragma once 19 | 20 | #include "App.g.h" 21 | #include "DirectXPage.xaml.h" 22 | 23 | namespace tbbTachyon 24 | { 25 | /// 26 | /// Provides application-specific behavior to supplement the default Application class. 27 | /// 28 | ref class App sealed 29 | { 30 | public: 31 | App(); 32 | virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ pArgs) override; 33 | 34 | private: 35 | DirectXPage^ m_directXPage; 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /src/tbb/lin32-tbb-export.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | { 18 | global: 19 | 20 | #define __TBB_SYMBOL( sym ) sym; 21 | #include "lin32-tbb-export.lst" 22 | 23 | local: 24 | 25 | /* TBB symbols */ 26 | *3tbb*; 27 | *__TBB*; 28 | 29 | /* ITT symbols */ 30 | __itt_*; 31 | 32 | /* Intel Compiler (libirc) symbols */ 33 | __intel_*; 34 | _intel_*; 35 | get_memcpy_largest_cachelinesize; 36 | get_memcpy_largest_cache_size; 37 | get_mem_ops_method; 38 | init_mem_ops_method; 39 | irc__get_msg; 40 | irc__print; 41 | override_mem_ops_method; 42 | set_memcpy_largest_cachelinesize; 43 | set_memcpy_largest_cache_size; 44 | 45 | }; 46 | -------------------------------------------------------------------------------- /include/tbb/tbb_disable_exceptions.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | //! To disable use of exceptions, include this header before any other header file from the library. 18 | 19 | //! The macro that prevents use of exceptions in the library files 20 | #undef TBB_USE_EXCEPTIONS 21 | #define TBB_USE_EXCEPTIONS 0 22 | 23 | //! Prevent compilers from issuing exception related warnings. 24 | /** Note that the warnings are suppressed for all the code after this header is included. */ 25 | #if _MSC_VER 26 | #if __INTEL_COMPILER 27 | #pragma warning (disable: 583) 28 | #else 29 | #pragma warning (disable: 4530 4577) 30 | #endif 31 | #endif 32 | -------------------------------------------------------------------------------- /src/test/test_std_thread.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #define TBB_IMPLEMENT_CPP0X 1 18 | #include "tbb/tbb_config.h" 19 | 20 | #if __TBB_WIN8UI_SUPPORT 21 | #define HARNESS_NO_PARSE_COMMAND_LINE 1 22 | #include "harness.h" 23 | int TestMain() { 24 | return Harness::Skipped; 25 | } 26 | #else 27 | #include "tbb/compat/thread" 28 | #define THREAD std::thread 29 | #define THIS_THREAD std::this_thread 30 | #define THIS_THREAD_SLEEP THIS_THREAD::sleep_for 31 | #include "test_thread.h" 32 | #include "harness.h" 33 | 34 | int TestMain () { 35 | CheckSignatures(); 36 | RunTests(); 37 | return Harness::Done; 38 | } 39 | #endif 40 | -------------------------------------------------------------------------------- /src/old/task_v2.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* This compilation unit provides definition of task::destroy( task& ) 18 | that is binary compatible with TBB 2.x. In TBB 3.0, the method became 19 | static, and its name decoration changed, though the definition remained. 20 | 21 | The macro switch should be set prior to including task.h 22 | or any TBB file that might bring task.h up. 23 | */ 24 | #define __TBB_DEPRECATED_TASK_INTERFACE 1 25 | #include "tbb/task.h" 26 | 27 | namespace tbb { 28 | 29 | void task::destroy( task& victim ) { 30 | // Forward to static version 31 | task_base::destroy( victim ); 32 | } 33 | 34 | } // namespace tbb 35 | -------------------------------------------------------------------------------- /examples/common/utility/get_default_num_threads.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef GET_DEFAULT_NUM_THREADS_H_ 18 | #define GET_DEFAULT_NUM_THREADS_H_ 19 | 20 | #include "tbb/global_control.h" 21 | 22 | namespace utility { 23 | inline int get_default_num_threads() { 24 | #if __TBB_MIC_OFFLOAD 25 | #pragma offload target(mic) out(default_num_threads) 26 | #endif // __TBB_MIC_OFFLOAD 27 | static size_t default_num_threads = tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism); 28 | return static_cast(default_num_threads); 29 | } 30 | } 31 | 32 | #endif /* GET_DEFAULT_NUM_THREADS_H_ */ 33 | -------------------------------------------------------------------------------- /src/tbbmalloc/lin32-proxy-export.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | { 18 | global: 19 | calloc; 20 | free; 21 | malloc; 22 | realloc; 23 | posix_memalign; 24 | memalign; 25 | aligned_alloc; 26 | valloc; 27 | pvalloc; 28 | mallinfo; 29 | mallopt; 30 | malloc_usable_size; 31 | __libc_malloc; 32 | __libc_realloc; 33 | __libc_calloc; 34 | __libc_free; 35 | __libc_memalign; 36 | __libc_pvalloc; 37 | __libc_valloc; 38 | __TBB_malloc_proxy; 39 | _ZdaPv; /* next ones are new/delete */ 40 | _ZdaPvRKSt9nothrow_t; 41 | _ZdlPv; 42 | _ZdlPvRKSt9nothrow_t; 43 | _Znaj; 44 | _ZnajRKSt9nothrow_t; 45 | _Znwj; 46 | _ZnwjRKSt9nothrow_t; 47 | 48 | local: 49 | 50 | /* TBB symbols */ 51 | *3rml8internal*; 52 | *3tbb*; 53 | *__TBB*; 54 | 55 | }; 56 | -------------------------------------------------------------------------------- /examples/test_all/fibonacci/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) 16 | 17 | project(fibonacci CXX) 18 | 19 | if (NOT CMAKE_CXX_STANDARD) 20 | set(CMAKE_CXX_STANDARD 11) 21 | set(CXX_STANDARD_REQUIRED ON) 22 | endif() 23 | 24 | add_executable(fibonacci Fibonacci.cpp) 25 | 26 | # find_package will search for available TBBConfig using variables CMAKE_PREFIX_PATH and TBB_DIR. 27 | find_package(TBB REQUIRED tbb) 28 | 29 | target_link_libraries(fibonacci 30 | ${TBB_IMPORTED_TARGETS} # Link TBB imported targets to the executable; "TBB::tbb" can be used instead of "${TBB_IMPORTED_TARGETS}". 31 | $<$:rt>) # Link "rt" library on Linux 32 | -------------------------------------------------------------------------------- /src/tbbmalloc/lin64-proxy-export.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | { 18 | global: 19 | calloc; 20 | free; 21 | malloc; 22 | realloc; 23 | posix_memalign; 24 | memalign; 25 | aligned_alloc; 26 | valloc; 27 | pvalloc; 28 | mallinfo; 29 | mallopt; 30 | malloc_usable_size; 31 | __libc_malloc; 32 | __libc_realloc; 33 | __libc_calloc; 34 | __libc_free; 35 | __libc_memalign; 36 | __libc_pvalloc; 37 | __libc_valloc; 38 | __TBB_malloc_proxy; 39 | _ZdaPv; /* next ones are new/delete */ 40 | _ZdaPvRKSt9nothrow_t; 41 | _ZdlPv; 42 | _ZdlPvRKSt9nothrow_t; 43 | _Znam; 44 | _ZnamRKSt9nothrow_t; 45 | _Znwm; 46 | _ZnwmRKSt9nothrow_t; 47 | 48 | local: 49 | 50 | /* TBB symbols */ 51 | *3rml8internal*; 52 | *3tbb*; 53 | *__TBB*; 54 | 55 | }; 56 | -------------------------------------------------------------------------------- /src/tbbmalloc/lin64ipf-proxy-export.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | { 18 | global: 19 | calloc; 20 | free; 21 | malloc; 22 | realloc; 23 | posix_memalign; 24 | memalign; 25 | aligned_alloc; 26 | valloc; 27 | pvalloc; 28 | mallinfo; 29 | mallopt; 30 | malloc_usable_size; 31 | __libc_malloc; 32 | __libc_realloc; 33 | __libc_calloc; 34 | __libc_free; 35 | __libc_memalign; 36 | __libc_pvalloc; 37 | __libc_valloc; 38 | __TBB_malloc_proxy; 39 | _ZdaPv; /* next ones are new/delete */ 40 | _ZdaPvRKSt9nothrow_t; 41 | _ZdlPv; 42 | _ZdlPvRKSt9nothrow_t; 43 | _Znam; 44 | _ZnamRKSt9nothrow_t; 45 | _Znwm; 46 | _ZnwmRKSt9nothrow_t; 47 | 48 | local: 49 | 50 | /* TBB symbols */ 51 | *3rml8internal*; 52 | *3tbb*; 53 | *__TBB*; 54 | 55 | }; 56 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | sudo: false 3 | 4 | matrix: 5 | include: 6 | - os: linux 7 | compiler: g++ 8 | script: 9 | - cmake -DTBB_BUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=~/.local . 10 | - make install -j2 11 | - ctest -j2 --output-on-failure --timeout 500 12 | addons: 13 | apt: 14 | packages: 15 | - g++ 16 | - cmake 17 | - swig 18 | - python-dev 19 | - os: osx 20 | compiler: clang 21 | script: 22 | - cmake -DCMAKE_INSTALL_PREFIX=~/.local . 23 | - make install -j2 24 | - ctest -j2 --output-on-failure --timeout 500 25 | - os: linux 26 | compiler: x86_64-w64-mingw32-g++ 27 | script: 28 | - cmake -DCMAKE_TOOLCHAIN_FILE=build/mingw_cross_toolchain.cmake -DCMAKE_INSTALL_PREFIX=~/.local -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/wine-development . 29 | - make install -j2 30 | - cp -v /usr/lib/gcc/x86_64-w64-mingw32/5.3-posix/*.dll /usr/x86_64-w64-mingw32/lib/*.dll . 31 | - ctest -j2 --output-on-failure --timeout 500 32 | addons: 33 | apt: 34 | packages: 35 | - g++-mingw-w64-x86-64 36 | - gcc-mingw-w64-x86-64 37 | - binutils-mingw-w64-x86-64 38 | - cmake 39 | - make 40 | - wine-development 41 | -------------------------------------------------------------------------------- /src/test/harness_runtime_loader.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef harness_runtime_loader_H 18 | #define harness_runtime_loader_H 19 | 20 | #if HARNESS_USE_RUNTIME_LOADER 21 | #if TEST_USES_TBB 22 | #define TBB_PREVIEW_RUNTIME_LOADER 1 23 | #include "tbb/runtime_loader.h" 24 | static char const * _path[] = { ".", NULL }; 25 | // declaration must be placed before 1st TBB call 26 | static tbb::runtime_loader _runtime_loader( _path ); 27 | #else // TEST_USES_TBB 28 | // if TBB library is not used, no need to test Runtime Loader 29 | #define HARNESS_SKIP_TEST 1 30 | #endif // TEST_USES_TBB 31 | #endif // HARNESS_USE_RUNTIME_LOADER 32 | 33 | #endif /* harness_runtime_loader_H */ 34 | -------------------------------------------------------------------------------- /examples/common/gui/xcode/tbbExample/tbbAppDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // 18 | // Created by Xcode* 4.3.2 19 | // 20 | 21 | #import 22 | 23 | #if TARGET_OS_IPHONE 24 | 25 | #import 26 | 27 | @interface tbbAppDelegate : UIResponder 28 | 29 | @property (strong, nonatomic) UIWindow *window; 30 | 31 | @end 32 | 33 | #elif TARGET_OS_MAC 34 | 35 | #import 36 | 37 | @interface tbbAppDelegate : NSObject { 38 | __unsafe_unretained NSWindow *_window; 39 | } 40 | 41 | @property (assign) IBOutlet NSWindow *window; 42 | 43 | - (BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication *) sender; 44 | 45 | @end 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/perf/harness_perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef __TBB_HARNESS_PERF 18 | #define __TBB_HARNESS_PERF 19 | 20 | #include 21 | #include 22 | 23 | namespace harness_perf { 24 | 25 | template 26 | typename InputIterator::value_type median(InputIterator first, InputIterator last) { 27 | std::sort(first, last); 28 | typename InputIterator::difference_type distance = std::distance(first, last); 29 | std::advance(first, distance / 2 - 1); 30 | if (distance % 2 == 0) 31 | return typename InputIterator::value_type((*first + *(++first)) / 2); 32 | else 33 | return typename InputIterator::value_type(*first); 34 | } 35 | 36 | } // namespace harness_perf 37 | 38 | #endif // !__TBB_HARNESS_PERF 39 | 40 | -------------------------------------------------------------------------------- /src/test/harness_mic.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef tbb_test_harness_mic_H 18 | #define tbb_test_harness_mic_H 19 | 20 | #if ! __TBB_DEFINE_MIC 21 | #error test/harness_mic.h should be included only when building for Intel(R) Many Integrated Core Architecture 22 | #endif 23 | 24 | // test for unifed sources. See makefiles 25 | #undef HARNESS_INCOMPLETE_SOURCES 26 | 27 | #include 28 | #include 29 | 30 | #define TBB_TEST_LOW_WORKLOAD 1 31 | 32 | #define REPORT_FATAL_ERROR REPORT 33 | #define HARNESS_EXPORT 34 | 35 | #if __TBB_MIC_NATIVE 36 | #define HARNESS_EXIT_ON_ASSERT 1 37 | #define __TBB_PLACEMENT_NEW_EXCEPTION_SAFETY_BROKEN 1 38 | #else 39 | #define HARNESS_TERMINATE_ON_ASSERT 1 40 | #endif 41 | 42 | #endif /* tbb_test_harness_mic_H */ 43 | -------------------------------------------------------------------------------- /examples/graph/som/msvs/som.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "som", "som.vcxproj", "{B2AE2EDC-697B-4C85-AC0D-E3E523D20D6D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {B2AE2EDC-697B-4C85-AC0D-E3E523D20D6D}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {B2AE2EDC-697B-4C85-AC0D-E3E523D20D6D}.Debug|Win32.Build.0 = Debug|Win32 18 | {B2AE2EDC-697B-4C85-AC0D-E3E523D20D6D}.Debug|x64.ActiveCfg = Debug|x64 19 | {B2AE2EDC-697B-4C85-AC0D-E3E523D20D6D}.Debug|x64.Build.0 = Debug|x64 20 | {B2AE2EDC-697B-4C85-AC0D-E3E523D20D6D}.Release|Win32.ActiveCfg = Release|Win32 21 | {B2AE2EDC-697B-4C85-AC0D-E3E523D20D6D}.Release|Win32.Build.0 = Release|Win32 22 | {B2AE2EDC-697B-4C85-AC0D-E3E523D20D6D}.Release|x64.ActiveCfg = Release|x64 23 | {B2AE2EDC-697B-4C85-AC0D-E3E523D20D6D}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /examples/graph/stereo/msvs/stereo.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stereo", "stereo.vcxproj", "{9C777D75-70FF-4C24-AB74-EBCDF3328AB9}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {9C777D75-70FF-4C24-AB74-EBCDF3328AB9}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {9C777D75-70FF-4C24-AB74-EBCDF3328AB9}.Debug|Win32.Build.0 = Debug|Win32 18 | {9C777D75-70FF-4C24-AB74-EBCDF3328AB9}.Debug|x64.ActiveCfg = Debug|x64 19 | {9C777D75-70FF-4C24-AB74-EBCDF3328AB9}.Debug|x64.Build.0 = Debug|x64 20 | {9C777D75-70FF-4C24-AB74-EBCDF3328AB9}.Release|Win32.ActiveCfg = Release|Win32 21 | {9C777D75-70FF-4C24-AB74-EBCDF3328AB9}.Release|Win32.Build.0 = Release|Win32 22 | {9C777D75-70FF-4C24-AB74-EBCDF3328AB9}.Release|x64.ActiveCfg = Release|x64 23 | {9C777D75-70FF-4C24-AB74-EBCDF3328AB9}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /examples/graph/binpack/msvs/binpack.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "binpack", "binpack.vcxproj", "{C931C7A2-074E-4150-9E7A-39A03250411E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Debug|Win32.Build.0 = Debug|Win32 18 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Debug|x64.ActiveCfg = Debug|x64 19 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Debug|x64.Build.0 = Debug|x64 20 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Release|Win32.ActiveCfg = Release|Win32 21 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Release|Win32.Build.0 = Release|Win32 22 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Release|x64.ActiveCfg = Release|x64 23 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /examples/graph/fgbzip2/msvs/fgbzip2.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fgbzip2", "fgbzip2.vcxproj", "{C931C7A2-074E-4150-9E7A-39A03250411E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Debug|Win32.Build.0 = Debug|Win32 18 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Debug|x64.ActiveCfg = Debug|x64 19 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Debug|x64.Build.0 = Debug|x64 20 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Release|Win32.ActiveCfg = Release|Win32 21 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Release|Win32.Build.0 = Release|Win32 22 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Release|x64.ActiveCfg = Release|x64 23 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /examples/pipeline/square/msvs/square.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "square", "square.vcxproj", "{A21C0AEE-ADDC-45F0-A668-58FF10351D23}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {A21C0AEE-ADDC-45F0-A668-58FF10351D23}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {A21C0AEE-ADDC-45F0-A668-58FF10351D23}.Debug|Win32.Build.0 = Debug|Win32 18 | {A21C0AEE-ADDC-45F0-A668-58FF10351D23}.Debug|x64.ActiveCfg = Debug|x64 19 | {A21C0AEE-ADDC-45F0-A668-58FF10351D23}.Debug|x64.Build.0 = Debug|x64 20 | {A21C0AEE-ADDC-45F0-A668-58FF10351D23}.Release|Win32.ActiveCfg = Release|Win32 21 | {A21C0AEE-ADDC-45F0-A668-58FF10351D23}.Release|Win32.Build.0 = Release|Win32 22 | {A21C0AEE-ADDC-45F0-A668-58FF10351D23}.Release|x64.ActiveCfg = Release|x64 23 | {A21C0AEE-ADDC-45F0-A668-58FF10351D23}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /examples/task/tree_sum/msvs/tree_sum.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tree_sum", "tree_sum.vcxproj", "{C931C7A2-074E-4150-9E7A-39A03250411E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Debug|Win32.Build.0 = Debug|Win32 18 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Debug|x64.ActiveCfg = Debug|x64 19 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Debug|x64.Build.0 = Debug|x64 20 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Release|Win32.ActiveCfg = Release|Win32 21 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Release|Win32.Build.0 = Release|Win32 22 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Release|x64.ActiveCfg = Release|x64 23 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /examples/task_group/sudoku/msvs/sudoku.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sudoku", "sudoku.vcxproj", "{C931C7A2-074E-4150-9E7A-39A03250411E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Debug|Win32.Build.0 = Debug|Win32 18 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Debug|x64.ActiveCfg = Debug|x64 19 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Debug|x64.Build.0 = Debug|x64 20 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Release|Win32.ActiveCfg = Release|Win32 21 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Release|Win32.Build.0 = Release|Win32 22 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Release|x64.ActiveCfg = Release|x64 23 | {C931C7A2-074E-4150-9E7A-39A03250411E}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /src/tbbmalloc/tbbmalloc_internal_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef __TBB_tbbmalloc_internal_api_H 18 | #define __TBB_tbbmalloc_internal_api_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif /* __cplusplus */ 23 | 24 | typedef enum { 25 | /* Tune usage of source included allocator. Selected value is large enough 26 | to not intercept with constants from AllocationModeParam. */ 27 | TBBMALLOC_INTERNAL_SOURCE_INCLUDED = 65536 28 | } AllocationModeInternalParam; 29 | 30 | void MallocInitializeITT(); 31 | void __TBB_mallocProcessShutdownNotification(bool); 32 | #if _WIN32||_WIN64 33 | void __TBB_mallocThreadShutdownNotification(); 34 | #endif 35 | 36 | #ifdef __cplusplus 37 | } /* extern "C" */ 38 | #endif /* __cplusplus */ 39 | 40 | #endif /* __TBB_tbbmalloc_internal_api_H */ 41 | -------------------------------------------------------------------------------- /examples/graph/cholesky/msvs/cholesky.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cholesky", "cholesky.vcxproj", "{3AA40693-F93D-4D4B-B32E-068F511A252E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {3AA40693-F93D-4D4B-B32E-068F511A252E}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {3AA40693-F93D-4D4B-B32E-068F511A252E}.Debug|Win32.Build.0 = Debug|Win32 18 | {3AA40693-F93D-4D4B-B32E-068F511A252E}.Debug|x64.ActiveCfg = Debug|x64 19 | {3AA40693-F93D-4D4B-B32E-068F511A252E}.Debug|x64.Build.0 = Debug|x64 20 | {3AA40693-F93D-4D4B-B32E-068F511A252E}.Release|Win32.ActiveCfg = Release|Win32 21 | {3AA40693-F93D-4D4B-B32E-068F511A252E}.Release|Win32.Build.0 = Release|Win32 22 | {3AA40693-F93D-4D4B-B32E-068F511A252E}.Release|x64.ActiveCfg = Release|x64 23 | {3AA40693-F93D-4D4B-B32E-068F511A252E}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /examples/graph/logic_sim/msvs/logic_sim.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logic_sim", "logic_sim.vcxproj", "{6E9B1702-78E0-4D64-B771-8B274D963B58}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {6E9B1702-78E0-4D64-B771-8B274D963B58}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {6E9B1702-78E0-4D64-B771-8B274D963B58}.Debug|Win32.Build.0 = Debug|Win32 18 | {6E9B1702-78E0-4D64-B771-8B274D963B58}.Debug|x64.ActiveCfg = Debug|x64 19 | {6E9B1702-78E0-4D64-B771-8B274D963B58}.Debug|x64.Build.0 = Debug|x64 20 | {6E9B1702-78E0-4D64-B771-8B274D963B58}.Release|Win32.ActiveCfg = Release|Win32 21 | {6E9B1702-78E0-4D64-B771-8B274D963B58}.Release|Win32.Build.0 = Release|Win32 22 | {6E9B1702-78E0-4D64-B771-8B274D963B58}.Release|x64.ActiveCfg = Release|x64 23 | {6E9B1702-78E0-4D64-B771-8B274D963B58}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /examples/parallel_reduce/primes/msvs/primes.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "primes", "primes.vcxproj", "{3AA40693-F93D-4D4B-B32E-068F511A252A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {3AA40693-F93D-4D4B-B32E-068F511A252A}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {3AA40693-F93D-4D4B-B32E-068F511A252A}.Debug|Win32.Build.0 = Debug|Win32 18 | {3AA40693-F93D-4D4B-B32E-068F511A252A}.Debug|x64.ActiveCfg = Debug|x64 19 | {3AA40693-F93D-4D4B-B32E-068F511A252A}.Debug|x64.Build.0 = Debug|x64 20 | {3AA40693-F93D-4D4B-B32E-068F511A252A}.Release|Win32.ActiveCfg = Release|Win32 21 | {3AA40693-F93D-4D4B-B32E-068F511A252A}.Release|Win32.Build.0 = Release|Win32 22 | {3AA40693-F93D-4D4B-B32E-068F511A252A}.Release|x64.ActiveCfg = Release|x64 23 | {3AA40693-F93D-4D4B-B32E-068F511A252A}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /examples/test_all/fibonacci/msvs/fibonacci.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fibonacci", "fibonacci.vcxproj", "{3AA40693-F93D-4D4B-B32E-068F511A252E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {3AA40693-F93D-4D4B-B32E-068F511A252E}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {3AA40693-F93D-4D4B-B32E-068F511A252E}.Debug|Win32.Build.0 = Debug|Win32 18 | {3AA40693-F93D-4D4B-B32E-068F511A252E}.Debug|x64.ActiveCfg = Debug|x64 19 | {3AA40693-F93D-4D4B-B32E-068F511A252E}.Debug|x64.Build.0 = Debug|x64 20 | {3AA40693-F93D-4D4B-B32E-068F511A252E}.Release|Win32.ActiveCfg = Release|Win32 21 | {3AA40693-F93D-4D4B-B32E-068F511A252E}.Release|Win32.Build.0 = Release|Win32 22 | {3AA40693-F93D-4D4B-B32E-068F511A252E}.Release|x64.ActiveCfg = Release|x64 23 | {3AA40693-F93D-4D4B-B32E-068F511A252E}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /src/tbb/ia64-gas/lock_byte.s: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2005-2020 Intel Corporation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Support for class TinyLock 16 | .section .text 17 | .align 16 18 | // unsigned int __TBB_machine_trylockbyte( byte& flag ); 19 | // r32 = address of flag 20 | .proc __TBB_machine_trylockbyte# 21 | .global __TBB_machine_trylockbyte# 22 | ADDRESS_OF_FLAG=r32 23 | RETCODE=r8 24 | FLAG=r9 25 | BUSY=r10 26 | SCRATCH=r11 27 | __TBB_machine_trylockbyte: 28 | ld1.acq FLAG=[ADDRESS_OF_FLAG] 29 | mov BUSY=1 30 | mov RETCODE=0 31 | ;; 32 | cmp.ne p6,p0=0,FLAG 33 | mov ar.ccv=r0 34 | (p6) br.ret.sptk.many b0 35 | ;; 36 | cmpxchg1.acq SCRATCH=[ADDRESS_OF_FLAG],BUSY,ar.ccv // Try to acquire lock 37 | ;; 38 | cmp.eq p6,p0=0,SCRATCH 39 | ;; 40 | (p6) mov RETCODE=1 41 | br.ret.sptk.many b0 42 | .endp __TBB_machine_trylockbyte# 43 | -------------------------------------------------------------------------------- /examples/concurrent_priority_queue/shortpath/msvs/shortpath.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shortpath", "shortpath.vcxproj", "{3AA40693-F93D-4D4B-B32E-068F511A252A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {3AA40693-F93D-4D4B-B32E-068F511A252A}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {3AA40693-F93D-4D4B-B32E-068F511A252A}.Debug|Win32.Build.0 = Debug|Win32 18 | {3AA40693-F93D-4D4B-B32E-068F511A252A}.Debug|x64.ActiveCfg = Debug|x64 19 | {3AA40693-F93D-4D4B-B32E-068F511A252A}.Debug|x64.Build.0 = Debug|x64 20 | {3AA40693-F93D-4D4B-B32E-068F511A252A}.Release|Win32.ActiveCfg = Release|Win32 21 | {3AA40693-F93D-4D4B-B32E-068F511A252A}.Release|Win32.Build.0 = Release|Win32 22 | {3AA40693-F93D-4D4B-B32E-068F511A252A}.Release|x64.ActiveCfg = Release|x64 23 | {3AA40693-F93D-4D4B-B32E-068F511A252A}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /examples/concurrent_hash_map/count_strings/msvs/count_strings.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "count_strings", "count_strings.vcxproj", "{3AA40693-F93D-4D4B-B32E-068F511A252C}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {3AA40693-F93D-4D4B-B32E-068F511A252C}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {3AA40693-F93D-4D4B-B32E-068F511A252C}.Debug|Win32.Build.0 = Debug|Win32 18 | {3AA40693-F93D-4D4B-B32E-068F511A252C}.Debug|x64.ActiveCfg = Debug|x64 19 | {3AA40693-F93D-4D4B-B32E-068F511A252C}.Debug|x64.Build.0 = Debug|x64 20 | {3AA40693-F93D-4D4B-B32E-068F511A252C}.Release|Win32.ActiveCfg = Release|Win32 21 | {3AA40693-F93D-4D4B-B32E-068F511A252C}.Release|Win32.Build.0 = Release|Win32 22 | {3AA40693-F93D-4D4B-B32E-068F511A252C}.Release|x64.ActiveCfg = Release|x64 23 | {3AA40693-F93D-4D4B-B32E-068F511A252C}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /examples/graph/dining_philosophers/msvs/dining_philosophers.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dining_philosophers", "dining_philosophers.vcxproj", "{3894D1D2-A574-4937-AD56-726758EFE5B7}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {3894D1D2-A574-4937-AD56-726758EFE5B7}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {3894D1D2-A574-4937-AD56-726758EFE5B7}.Debug|Win32.Build.0 = Debug|Win32 18 | {3894D1D2-A574-4937-AD56-726758EFE5B7}.Debug|x64.ActiveCfg = Debug|x64 19 | {3894D1D2-A574-4937-AD56-726758EFE5B7}.Debug|x64.Build.0 = Debug|x64 20 | {3894D1D2-A574-4937-AD56-726758EFE5B7}.Release|Win32.ActiveCfg = Release|Win32 21 | {3894D1D2-A574-4937-AD56-726758EFE5B7}.Release|Win32.Build.0 = Release|Win32 22 | {3894D1D2-A574-4937-AD56-726758EFE5B7}.Release|x64.ActiveCfg = Release|x64 23 | {3894D1D2-A574-4937-AD56-726758EFE5B7}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /examples/parallel_do/parallel_preorder/msvs/parallel_preorder.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "parallel_preorder", "parallel_preorder.vcxproj", "{3AA40693-F93D-4D4B-B32E-068F511A252B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {3AA40693-F93D-4D4B-B32E-068F511A252B}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {3AA40693-F93D-4D4B-B32E-068F511A252B}.Debug|Win32.Build.0 = Debug|Win32 18 | {3AA40693-F93D-4D4B-B32E-068F511A252B}.Debug|x64.ActiveCfg = Debug|x64 19 | {3AA40693-F93D-4D4B-B32E-068F511A252B}.Debug|x64.Build.0 = Debug|x64 20 | {3AA40693-F93D-4D4B-B32E-068F511A252B}.Release|Win32.ActiveCfg = Release|Win32 21 | {3AA40693-F93D-4D4B-B32E-068F511A252B}.Release|Win32.Build.0 = Release|Win32 22 | {3AA40693-F93D-4D4B-B32E-068F511A252B}.Release|x64.ActiveCfg = Release|x64 23 | {3AA40693-F93D-4D4B-B32E-068F511A252B}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /examples/parallel_reduce/primes/primes.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef PRIMES_H_ 18 | #define PRIMES_H_ 19 | 20 | #if __TBB_MIC_OFFLOAD 21 | #pragma offload_attribute (push,target(mic)) 22 | #endif // __TBB_MIC_OFFLOAD 23 | 24 | #include "../../common/utility/get_default_num_threads.h" 25 | #include 26 | typedef std::size_t NumberType; 27 | 28 | //! Count number of primes between 0 and n 29 | /** This is the serial version. */ 30 | NumberType SerialCountPrimes( NumberType n); 31 | 32 | //! Count number of primes between 0 and n 33 | /** This is the parallel version. */ 34 | NumberType ParallelCountPrimes( NumberType n, int numberOfThreads= utility::get_default_num_threads(), NumberType grainSize = 1000); 35 | 36 | #if __TBB_MIC_OFFLOAD 37 | #pragma offload_attribute (pop) 38 | #endif // __TBB_MIC_OFFLOAD 39 | 40 | #endif /* PRIMES_H_ */ 41 | -------------------------------------------------------------------------------- /examples/common/examples-common.inc: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # detect if a compiler can support C++11 16 | # If CXX0XFLAGS already set, do not change it 17 | ifneq (,$(findstring icc, $(CXX))$(findstring icpc, $(CXX))$(findstring clang++, $(CXX))) 18 | # every supported icc or clang is OK 19 | CXX0XFLAGS ?= -std=c++11 20 | else 21 | ifneq (,$(findstring g++, $(CXX))$(findstring gcc, $(CXX))) 22 | ifneq (, $(strip $(shell $(CXX) -v 2>&1 | grep "clang-"))) 23 | # This is clang actually, 24 | # every supported clang is OK 25 | CXX0XFLAGS ?= -std=c++11 26 | else 27 | # support of lambda started GCC 4.5 28 | ifneq (, $(strip $(shell g++ -dumpfullversion -dumpversion | egrep "^(4\.[5-9]|[5-9]|1[0-9])"))) 29 | CXX0XFLAGS ?= -std=c++11 30 | endif 31 | endif 32 | endif 33 | endif 34 | 35 | -------------------------------------------------------------------------------- /src/rml/client/rml_omp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "rml_omp.h" 18 | #include "omp_dynamic_link.h" 19 | #include 20 | 21 | namespace __kmp { 22 | namespace rml { 23 | 24 | #define MAKE_SERVER(x) DLD(__KMP_make_rml_server,x) 25 | #define GET_INFO(x) DLD(__KMP_call_with_my_server_info,x) 26 | #define SERVER omp_server 27 | #define CLIENT omp_client 28 | #define FACTORY omp_factory 29 | 30 | #if __TBB_WEAK_SYMBOLS_PRESENT 31 | #pragma weak __KMP_make_rml_server 32 | #pragma weak __KMP_call_with_my_server_info 33 | extern "C" { 34 | omp_factory::status_type __KMP_make_rml_server( omp_factory& f, omp_server*& server, omp_client& client ); 35 | void __KMP_call_with_my_server_info( ::rml::server_info_callback_t cb, void* arg ); 36 | } 37 | #endif /* __TBB_WEAK_SYMBOLS_PRESENT */ 38 | 39 | #include "rml_factory.h" 40 | 41 | } // rml 42 | } // __kmp 43 | -------------------------------------------------------------------------------- /examples/parallel_for/game_of_life/msvs/app.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | 7 | ///////////////////////////////////////////////////////////////////////////// 8 | #undef APSTUDIO_READONLY_SYMBOLS 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // English (U.S.) resources 12 | 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // 16 | // Icon 17 | // 18 | 19 | // Icon placed first or with lowest ID value becomes application icon 20 | 21 | LANGUAGE 9, 1 22 | #pragma code_page(1252) 23 | 1 ICON "app.ico" 24 | 25 | #ifdef APSTUDIO_INVOKED 26 | ///////////////////////////////////////////////////////////////////////////// 27 | // 28 | // TEXTINCLUDE 29 | // 30 | 31 | 1 TEXTINCLUDE 32 | BEGIN 33 | "resource.h\0" 34 | "\0" 35 | END 36 | 37 | 2 TEXTINCLUDE 38 | BEGIN 39 | "#include ""afxres.h""\r\n" 40 | "\0" 41 | END 42 | 43 | 3 TEXTINCLUDE 44 | BEGIN 45 | "\0" 46 | END 47 | 48 | #endif // APSTUDIO_INVOKED 49 | 50 | ///////////////////////////////////////////////////////////////////////////// 51 | 52 | 53 | 54 | #ifndef APSTUDIO_INVOKED 55 | ///////////////////////////////////////////////////////////////////////////// 56 | // 57 | // Generated from the TEXTINCLUDE 3 resource. 58 | // 59 | 60 | 61 | ///////////////////////////////////////////////////////////////////////////// 62 | #endif // not APSTUDIO_INVOKED 63 | 64 | -------------------------------------------------------------------------------- /src/tbb/ia64-gas/log2.s: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2005-2020 Intel Corporation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | .section .text 16 | .align 16 17 | // unsigned long __TBB_machine_lg( unsigned long x ); 18 | // r32 = x 19 | .proc __TBB_machine_lg# 20 | .global __TBB_machine_lg# 21 | __TBB_machine_lg: 22 | shr r16=r32,1 // .x 23 | ;; 24 | shr r17=r32,2 // ..x 25 | or r32=r32,r16 // xx 26 | ;; 27 | shr r16=r32,3 // ...xx 28 | or r32=r32,r17 // xxx 29 | ;; 30 | shr r17=r32,5 // .....xxx 31 | or r32=r32,r16 // xxxxx 32 | ;; 33 | shr r16=r32,8 // ........xxxxx 34 | or r32=r32,r17 // xxxxxxxx 35 | ;; 36 | shr r17=r32,13 37 | or r32=r32,r16 // 13x 38 | ;; 39 | shr r16=r32,21 40 | or r32=r32,r17 // 21x 41 | ;; 42 | shr r17=r32,34 43 | or r32=r32,r16 // 34x 44 | ;; 45 | shr r16=r32,55 46 | or r32=r32,r17 // 55x 47 | ;; 48 | or r32=r32,r16 // 64x 49 | ;; 50 | popcnt r8=r32 51 | ;; 52 | add r8=-1,r8 53 | br.ret.sptk.many b0 54 | .endp __TBB_machine_lg# 55 | -------------------------------------------------------------------------------- /examples/common/gui/xcode/tbbExample/tbbExample-Info.ios.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | iOS 27 | UIMainStoryboardFile 28 | iOS 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationLandscapeLeft 36 | UIInterfaceOrientationLandscapeRight 37 | 38 | UISupportedInterfaceOrientations~ipad 39 | 40 | UIInterfaceOrientationLandscapeLeft 41 | UIInterfaceOrientationLandscapeRight 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /examples/test_all/fibonacci/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # GNU Makefile that builds and runs example. 16 | run_cmd= 17 | PROG=fibonacci 18 | ARGS= 19 | 20 | # The C++ compiler 21 | ifneq (,$(shell which icc 2>/dev/null)) 22 | CXX=icc 23 | endif # icc 24 | 25 | ifeq ($(shell uname), Linux) 26 | ifeq ($(target), android) 27 | LIBS+= --sysroot=$(SYSROOT) 28 | run_cmd=../../common/android.linux.launcher.sh 29 | else 30 | LIBS+= -lrt 31 | endif 32 | else ifeq ($(shell uname), Darwin) 33 | override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib 34 | endif 35 | 36 | # autodetect C++11 support 37 | include ../../common/examples-common.inc 38 | 39 | all: release test 40 | 41 | release: *.cpp 42 | $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS) $(CXX0XFLAGS) 43 | 44 | debug: *.cpp 45 | $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS) $(CXX0XFLAGS) 46 | 47 | clean: 48 | $(RM) $(PROG) *.o *.d 49 | 50 | test: 51 | $(run_cmd) ./$(PROG) $(ARGS) 52 | -------------------------------------------------------------------------------- /examples/parallel_for/polygon_overlay/msvs/pover.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | LANGUAGE 9, 1 20 | #pragma code_page(1252) 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""afxres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | #endif // English (U.S.) resources 48 | ///////////////////////////////////////////////////////////////////////////// 49 | 50 | 51 | 52 | #ifndef APSTUDIO_INVOKED 53 | ///////////////////////////////////////////////////////////////////////////// 54 | // 55 | // Generated from the TEXTINCLUDE 3 resource. 56 | // 57 | 58 | 59 | ///////////////////////////////////////////////////////////////////////////// 60 | #endif // not APSTUDIO_INVOKED 61 | 62 | -------------------------------------------------------------------------------- /python/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | tbb_root?=.. 16 | BUILDING_PHASE:=0 17 | include $(tbb_root)/build/common.inc 18 | .PHONY: all release test install test-install 19 | 20 | export TBBROOT=$(abspath $(tbb_root)) 21 | SRC=$(tbb_root)/python/*.py $(tbb_root)/python/tbb/* 22 | PY_SETUP=python $(tbb_root)/python/setup.py 23 | 24 | all: install test 25 | 26 | clean: 27 | $(PY_SETUP) clean -b$(work_dir)_release 28 | 29 | release: CC=$(compiler) 30 | release: $(SRC) rml 31 | $(PY_SETUP) build -b$(work_dir)_release -f check 32 | 33 | install: CC=$(compiler) 34 | install: $(SRC) rml 35 | $(PY_SETUP) build -b$(work_dir)_release build_ext -f -I$(tbb_root)/include -L$(work_dir)_release install -f 36 | 37 | test: 38 | python -m tbb test 39 | 40 | rml: 41 | ifeq (linux,$(tbb_os)) 42 | $(MAKE) -C "$(work_dir)_release" -rf $(tbb_root)/python/rml/Makefile cfg=release rml 43 | rml_%: 44 | $(MAKE) -C "$(work_dir)_release" -rf $(tbb_root)/python/rml/Makefile cfg=release $(subst rml_,,$@) 45 | endif 46 | -------------------------------------------------------------------------------- /src/rml/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Overview

4 | 5 | This directory has source code that must be statically linked into an RML client. 6 | 7 |

Files

8 | 9 |
10 |
rml_factory.h 11 |
Text shared by rml_omp.cpp and rml_tbb.cpp. 12 | This is not an ordinary include file, so it does not have an #ifndef guard.
13 |
14 | 15 |

Specific to client=OpenMP

16 |
17 |
rml_omp.cpp 18 |
Source file for OpenMP client.
19 |
omp_dynamic_link.h
20 |
omp_dynamic_link.cpp 21 |
Source files for dynamic linking support. 22 | The code is the code from the TBB source directory, but adjusted so that it 23 | appears in namespace __kmp instead of namespace tbb::internal.
24 |
25 |

Specific to client=TBB

26 |
27 |
rml_tbb.cpp 28 |
Source file for TBB client. It uses the dynamic linking support from the TBB source directory.
29 |
30 | 31 |
32 | Up to parent directory 33 |

34 | Copyright © 2005-2020 Intel Corporation. All Rights Reserved. 35 |

36 | Intel is a registered trademark or trademark of Intel Corporation 37 | or its subsidiaries in the United States and other countries. 38 |

39 | * Other names and brands may be claimed as the property of others. 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /examples/parallel_for/seismic/seismic_video.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef SEISMIC_VIDEO_H_ 18 | #define SEISMIC_VIDEO_H_ 19 | 20 | #include "../../common/gui/video.h" 21 | 22 | class Universe; 23 | 24 | class SeismicVideo : public video 25 | { 26 | #ifdef _WINDOWS 27 | #define MAX_LOADSTRING 100 28 | TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name 29 | WNDCLASSEX wcex; 30 | #endif 31 | static const char * const titles[2]; 32 | 33 | bool initIsParallel ; 34 | 35 | Universe &u_; 36 | int numberOfFrames_; // 0 means forever, positive means number of frames, negative is undefined 37 | int threadsHigh; 38 | private: 39 | void on_mouse(int x, int y, int key); 40 | void on_process(); 41 | 42 | #ifdef _WINDOWS 43 | public: 44 | #endif 45 | void on_key(int key); 46 | 47 | public: 48 | SeismicVideo( Universe &u,int numberOfFrames, int threadsHigh, bool initIsParallel=true); 49 | }; 50 | #endif /* SEISMIC_VIDEO_H_ */ 51 | -------------------------------------------------------------------------------- /examples/common/gui/xcode/tbbExample/OpenGLView.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #import 18 | 19 | #if TARGET_OS_IPHONE 20 | 21 | #import 22 | #import "OpenGLES/ES2/gl.h" 23 | 24 | @interface OpenGLView : UIView { 25 | NSTimer *timer; 26 | CGRect imageRect; 27 | } 28 | 29 | @property (nonatomic, retain) NSTimer *timer; 30 | @property (nonatomic) CGRect imageRect; 31 | 32 | - (void) drawRect:(CGRect)rect; 33 | - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event; 34 | 35 | @end 36 | 37 | #elif TARGET_OS_MAC 38 | 39 | #import 40 | #import 41 | 42 | @interface OpenGLView : NSOpenGLView{ 43 | NSTimer *timer; 44 | } 45 | 46 | @property (nonatomic,retain) NSTimer *timer; 47 | 48 | - (void) drawRect:(NSRect)start; 49 | - (void) mouseDown:(NSEvent *)theEvent; 50 | - (void) keyDown:(NSEvent *)theEvent; 51 | - (BOOL) acceptsFirstResponder; 52 | - (void) viewDidEndLiveResize; 53 | 54 | @end 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /examples/parallel_for/polygon_overlay/polymain.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "pover_global.h" // for declaration of DEFINE and INIT 18 | 19 | DEFINE Polygon_map_t *gPolymap1 INIT(0); 20 | DEFINE Polygon_map_t *gPolymap2 INIT(0); 21 | DEFINE Polygon_map_t *gResultMap INIT(0); 22 | 23 | extern void Usage(int argc, char **argv); 24 | 25 | extern bool ParseCmdLine(int argc, char **argv ); 26 | 27 | extern bool GenerateMap(Polygon_map_t **newMap, int xSize, int ySize, int gNPolygons, colorcomp_t maxR, colorcomp_t maxG, colorcomp_t maxB); 28 | 29 | extern bool PolygonsOverlap(RPolygon *p1, RPolygon *p2, int &xl, int &yl, int &xh, int &yh); 30 | 31 | extern void CheckPolygonMap(Polygon_map_t *checkMap); 32 | 33 | extern bool CompOnePolygon(RPolygon *p1, RPolygon *p2); 34 | 35 | extern bool PolygonsEqual(RPolygon *p1, RPolygon *p2); 36 | 37 | extern bool ComparePolygonMaps(Polygon_map_t *map1, Polygon_map_t *map2); 38 | 39 | extern void SetRandomSeed(int newSeed); 40 | 41 | extern int NextRan(int n); 42 | -------------------------------------------------------------------------------- /src/rml/client/rml_tbb.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "../include/rml_tbb.h" 18 | #include "tbb/dynamic_link.h" 19 | #include 20 | 21 | namespace tbb { 22 | namespace internal { 23 | namespace rml { 24 | 25 | #define MAKE_SERVER(x) DLD(__TBB_make_rml_server,x) 26 | #define GET_INFO(x) DLD(__TBB_call_with_my_server_info,x) 27 | #define SERVER tbb_server 28 | #define CLIENT tbb_client 29 | #define FACTORY tbb_factory 30 | 31 | #if __TBB_WEAK_SYMBOLS_PRESENT 32 | #pragma weak __TBB_make_rml_server 33 | #pragma weak __TBB_call_with_my_server_info 34 | extern "C" { 35 | ::rml::factory::status_type __TBB_make_rml_server( tbb::internal::rml::tbb_factory& f, tbb::internal::rml::tbb_server*& server, tbb::internal::rml::tbb_client& client ); 36 | void __TBB_call_with_my_server_info( ::rml::server_info_callback_t cb, void* arg ); 37 | } 38 | #endif /* __TBB_WEAK_SYMBOLS_PRESENT */ 39 | 40 | #include "rml_factory.h" 41 | 42 | } // rml 43 | } // internal 44 | } // tbb 45 | -------------------------------------------------------------------------------- /examples/common/gui/xcode/tbbExample/main.m: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #import 18 | #import 19 | 20 | #if TARGET_OS_IPHONE 21 | 22 | #import 23 | #import "tbbAppDelegate.h" 24 | 25 | void get_screen_resolution(int *x, int *y) { 26 | // Getting landscape screen resolution in any case 27 | CGRect imageRect = [[UIScreen mainScreen] bounds]; 28 | *x=imageRect.size.width>imageRect.size.height?imageRect.size.width:imageRect.size.height; 29 | *y=imageRect.size.width 42 | 43 | int cocoa_main(int argc, char *argv[]) 44 | { 45 | return NSApplicationMain(argc, (const char **)argv); 46 | } 47 | #endif 48 | -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/msvs/uwp/tbbTachyonRenderer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include "DirectXBase.h" 21 | 22 | ref class tbbTachyonRenderer sealed : public DirectXBase 23 | { 24 | public: 25 | tbbTachyonRenderer(); 26 | virtual void CreateDeviceIndependentResources() override; 27 | virtual void CreateDeviceResources() override; 28 | virtual void CreateWindowSizeDependentResources() override; 29 | virtual void Render() override; 30 | void Update(float timeTotal, float timeDelta); 31 | 32 | void UpdateView(Windows::Foundation::Point deltaViewPosition); 33 | 34 | private: 35 | Microsoft::WRL::ComPtr m_Brush; 36 | Microsoft::WRL::ComPtr m_textFormat; 37 | Microsoft::WRL::ComPtr m_opacityBitmap; 38 | Microsoft::WRL::ComPtr m_textLayout; 39 | DWRITE_TEXT_METRICS m_textMetrics; 40 | bool m_renderNeeded; 41 | ~tbbTachyonRenderer(); 42 | }; 43 | -------------------------------------------------------------------------------- /examples/pipeline/square/gen_input.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #if _WIN32 22 | #include 23 | #ifndef F_OK 24 | #define F_OK 0 25 | #endif 26 | #define access _access 27 | #else 28 | #include 29 | #endif 30 | 31 | const long INPUT_SIZE = 1000000; 32 | 33 | //! Generates sample input for square.cpp 34 | void gen_input( const char *fname ) { 35 | long num = INPUT_SIZE; 36 | FILE *fptr = fopen(fname, "w"); 37 | if(!fptr) { 38 | throw std::runtime_error("Could not open file for generating input"); 39 | } 40 | 41 | int a=0; 42 | int b=1; 43 | for( long j=0; j 35 | void AssertSameType( const T& /*x*/, const T& /*y*/ ) {} 36 | 37 | #endif /* harness_assert_H */ 38 | -------------------------------------------------------------------------------- /src/test/test_arena_constraints_stubs.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2019-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #define TBB_PREVIEW_NUMA_SUPPORT 1 17 | #include "tbb/tbb_config.h" 18 | 19 | #include "harness.h" 20 | 21 | #include "tbb/task_arena.h" 22 | #include "tbb/task_scheduler_init.h" 23 | 24 | #include 25 | 26 | void test_stubs(std::vector numa_indexes) { 27 | ASSERT(numa_indexes.size() == 1, "Number of NUMA nodes must be pinned to 1," 28 | " if we have no HWLOC on the system."); 29 | ASSERT(numa_indexes[0] == -1, "Index of NUMA node must be pinned to 0," 30 | " if we have no HWLOC on the system."); 31 | ASSERT(tbb::info::default_concurrency(numa_indexes[0]) == tbb::task_scheduler_init::default_num_threads(), 32 | "Concurrency for NUMA node must be equal to default_num_threads()," 33 | " if we have no HWLOC on the system."); 34 | } 35 | 36 | int TestMain() { 37 | std::vector numa_indexes = tbb::info::numa_nodes(); 38 | test_stubs(numa_indexes); 39 | 40 | return Harness::Done; 41 | } 42 | -------------------------------------------------------------------------------- /examples/common/gui/xcode/tbbExample/tbbExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1 27 | LSApplicationCategoryType 28 | public.app-category.business 29 | LSEnvironment 30 | 31 | DYLD_LIBRARY_PATH 32 | Contents/Resources:.:../Resources:/tmp:$DYLD_LIBRARY_PATH 33 | LIBRARY_PATH 34 | Contents/Resources:.:../:/tmp:$DYLD_LIBRARY_PATH 35 | 36 | LSMinimumSystemVersion 37 | ${MACOSX_DEPLOYMENT_TARGET} 38 | NSHumanReadableCopyright 39 | Copyright 2005-2020 Intel Corporation. All Rights Reserved. 40 | NSMainNibFile 41 | MainMenu 42 | NSPrincipalClass 43 | NSApplication 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/tbb/tools_api/disable_warnings.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "ittnotify_config.h" 18 | 19 | #if ITT_PLATFORM==ITT_PLATFORM_WIN 20 | 21 | #pragma warning (disable: 593) /* parameter "XXXX" was set but never used */ 22 | #pragma warning (disable: 344) /* typedef name has already been declared (with same type) */ 23 | #pragma warning (disable: 174) /* expression has no effect */ 24 | #pragma warning (disable: 4127) /* conditional expression is constant */ 25 | #pragma warning (disable: 4306) /* conversion from '?' to '?' of greater size */ 26 | 27 | #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 28 | 29 | #if defined __INTEL_COMPILER 30 | 31 | #pragma warning (disable: 869) /* parameter "XXXXX" was never referenced */ 32 | #pragma warning (disable: 1418) /* external function definition with no prior declaration */ 33 | #pragma warning (disable: 1419) /* external declaration in primary source file */ 34 | 35 | #endif /* __INTEL_COMPILER */ 36 | -------------------------------------------------------------------------------- /examples/graph/fgbzip2/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # GNU Makefile that builds and runs example. 16 | 17 | run_cmd= 18 | PROG=fgbzip2 19 | ARGS=-b=9 -a=async_node $(PROG) 20 | PERF_RUN_ARGS=-b=9 -a=async_node $(PROG) 21 | 22 | # icpc by default 23 | ifneq (,$(shell which icc 2>/dev/null)) 24 | CXX=icpc 25 | endif 26 | 27 | ifeq ($(shell uname), Linux) 28 | LIBS+= -lrt -lpthread 29 | else ifeq ($(shell uname), Darwin) 30 | override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib 31 | endif 32 | 33 | # autodetect C++11 support 34 | include ../../common/examples-common.inc 35 | 36 | all: release test 37 | 38 | release: 39 | $(CXX) -O2 -DNDEBUG *.cpp $(CXXFLAGS) -o $(PROG) -ltbb $(LIBS) $(CXX0XFLAGS) 40 | 41 | debug: 42 | $(CXX) -O0 -g -DTBB_USE_DEBUG *.cpp $(CXXFLAGS) -o $(PROG) -ltbb_debug $(LIBS) $(CXX0XFLAGS) 43 | 44 | profile: override CXXFLAGS += -DTBB_USE_THREADING_TOOLS -g 45 | profile: release 46 | 47 | clean: 48 | $(RM) $(PROG) *.o *.d *.bz2 49 | 50 | test: 51 | $(run_cmd) ./$(PROG) $(ARGS) 52 | 53 | perf_build: release 54 | 55 | perf_run: 56 | $(run_cmd) ./$(PROG) $(PERF_RUN_ARGS) 57 | -------------------------------------------------------------------------------- /examples/parallel_for/game_of_life/Makefile.windows: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Common Makefile that builds and runs example. 16 | 17 | # Just specify your program basename 18 | PROG=game_of_life 19 | ARGS=2:4 -t 5 20 | LIGHT_ARGS=1:2 -t 5 21 | 22 | # Trying to find if icl.exe is set 23 | CXX1 = $(TBB_CXX)- 24 | CXX2 = $(CXX1:icl.exe-=icl.exe) 25 | CXX = $(CXX2:-=cl.exe) 26 | 27 | # The C++ compiler options 28 | MYCXXFLAGS = /TP /EHsc /W3 /nologo /D _CONSOLE /D _MBCS /D WIN32 /D _CRT_SECURE_NO_DEPRECATE $(CXXFLAGS) 29 | MYLDFLAGS =/INCREMENTAL:NO /NOLOGO /DEBUG /FIXED:NO $(LDFLAGS) 30 | 31 | all: release test 32 | release: 33 | $(CXX) ./src/Evolution.cpp ./src/Game_of_life.cpp ./src/Update_state.cpp /MD /O2 /D NDEBUG $(MYCXXFLAGS) /link tbb.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 34 | debug: 35 | $(CXX) ./src/Evolution.cpp ./src/Game_of_life.cpp ./src/Update_state.cpp /MDd /Od /Zi /D _DEBUG $(MYCXXFLAGS) /link tbb_debug.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 36 | clean: 37 | @cmd.exe /C del $(PROG).exe *.obj *.?db *.manifest 38 | test: 39 | $(PROG) $(ARGS) 40 | light_test: 41 | $(PROG) $(LIGHT_ARGS) 42 | 43 | -------------------------------------------------------------------------------- /examples/concurrent_hash_map/count_strings/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # GNU Makefile that builds and runs example. 16 | run_cmd= 17 | PROG=count_strings 18 | ARGS= 19 | PERF_RUN_ARGS=auto 10000000 silent 20 | 21 | # The C++ compiler 22 | ifneq (,$(shell which icc 2>/dev/null)) 23 | CXX=icc 24 | endif # icc 25 | 26 | ifeq ($(shell uname), Linux) 27 | ifeq ($(target), android) 28 | LIBS+= --sysroot=$(SYSROOT) 29 | run_cmd=../../common/android.linux.launcher.sh 30 | else 31 | LIBS+= -lrt 32 | endif 33 | else ifeq ($(shell uname), Darwin) 34 | override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib 35 | endif 36 | 37 | # autodetect C++11 support 38 | include ../../common/examples-common.inc 39 | 40 | all: release test 41 | 42 | release: *.cpp 43 | $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS) $(CXX0XFLAGS) 44 | 45 | debug: *.cpp 46 | $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS) $(CXX0XFLAGS) 47 | 48 | clean: 49 | $(RM) $(PROG) *.o *.d 50 | 51 | test: 52 | $(run_cmd) ./$(PROG) $(ARGS) 53 | 54 | perf_build: release 55 | 56 | perf_run: 57 | $(run_cmd) ./$(PROG) $(PERF_RUN_ARGS) 58 | 59 | -------------------------------------------------------------------------------- /src/test/test_handle_perror.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Program for basic correctness of handle_perror, which is internal 18 | // to the TBB shared library. 19 | 20 | #include 21 | #include 22 | 23 | #include "../tbb/tbb_misc.h" 24 | #include "harness.h" 25 | 26 | #if TBB_USE_EXCEPTIONS 27 | 28 | static void TestHandlePerror() { 29 | bool caught = false; 30 | try { 31 | tbb::internal::handle_perror( EAGAIN, "apple" ); 32 | } catch( std::runtime_error& e ) { 33 | #if TBB_USE_EXCEPTIONS 34 | REMARK("caught runtime_exception('%s')\n",e.what()); 35 | ASSERT( memcmp(e.what(),"apple: ",7)==0, NULL ); 36 | ASSERT( strlen(strstr(e.what(), strerror(EAGAIN))), "bad error message?" ); 37 | #endif /* TBB_USE_EXCEPTIONS */ 38 | caught = true; 39 | } 40 | ASSERT( caught, NULL ); 41 | } 42 | 43 | int TestMain () { 44 | TestHandlePerror(); 45 | return Harness::Done; 46 | } 47 | 48 | #else /* !TBB_USE_EXCEPTIONS */ 49 | 50 | int TestMain () { 51 | return Harness::Skipped; 52 | } 53 | 54 | #endif /* TBB_USE_EXCEPTIONS */ 55 | -------------------------------------------------------------------------------- /examples/concurrent_priority_queue/shortpath/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # GNU Makefile that builds and runs example. 16 | run_cmd= 17 | PROG=shortpath 18 | ARGS=4 N=1000 start=0 end=999 verbose 19 | PERF_RUN_ARGS=auto N=1000 start=0 end=99 silent 20 | 21 | # icpc by default 22 | ifneq (,$(shell which icc 2>/dev/null)) 23 | CXX=icpc 24 | endif 25 | 26 | ifeq ($(shell uname), Linux) 27 | ifeq ($(target), android) 28 | LIBS+= --sysroot=$(SYSROOT) 29 | run_cmd=../../common/android.linux.launcher.sh 30 | else 31 | LIBS+= -lrt 32 | endif 33 | else ifeq ($(shell uname), Darwin) 34 | override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib 35 | endif 36 | 37 | include ../../common/examples-common.inc 38 | 39 | all: release test 40 | 41 | release: *.cpp 42 | $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS) $(CXX0XFLAGS) 43 | 44 | debug: *.cpp 45 | $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS) $(CXX0XFLAGS) 46 | 47 | clean: 48 | $(RM) $(PROG) *.o *.d 49 | 50 | test: 51 | $(run_cmd) ./$(PROG) $(ARGS) 52 | 53 | perf_build: release 54 | 55 | perf_run: 56 | $(run_cmd) ./$(PROG) $(PERF_RUN_ARGS) 57 | -------------------------------------------------------------------------------- /src/tbbmalloc/win32-tbbmalloc-export.def: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2005-2020 Intel Corporation 2 | ; 3 | ; Licensed under the Apache License, Version 2.0 (the "License"); 4 | ; you may not use this file except in compliance with the License. 5 | ; You may obtain a copy of the License at 6 | ; 7 | ; http://www.apache.org/licenses/LICENSE-2.0 8 | ; 9 | ; Unless required by applicable law or agreed to in writing, software 10 | ; distributed under the License is distributed on an "AS IS" BASIS, 11 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ; See the License for the specific language governing permissions and 13 | ; limitations under the License. 14 | 15 | EXPORTS 16 | 17 | ; frontend.cpp 18 | scalable_calloc 19 | scalable_free 20 | scalable_malloc 21 | scalable_realloc 22 | scalable_posix_memalign 23 | scalable_aligned_malloc 24 | scalable_aligned_realloc 25 | scalable_aligned_free 26 | scalable_msize 27 | scalable_allocation_mode 28 | scalable_allocation_command 29 | __TBB_malloc_safer_free 30 | __TBB_malloc_safer_realloc 31 | __TBB_malloc_safer_msize 32 | __TBB_malloc_safer_aligned_msize 33 | __TBB_malloc_safer_aligned_realloc 34 | ?pool_create@rml@@YAPAVMemoryPool@1@HPBUMemPoolPolicy@1@@Z 35 | ?pool_create_v1@rml@@YA?AW4MemPoolError@1@HPBUMemPoolPolicy@1@PAPAVMemoryPool@1@@Z 36 | ?pool_destroy@rml@@YA_NPAVMemoryPool@1@@Z 37 | ?pool_malloc@rml@@YAPAXPAVMemoryPool@1@I@Z 38 | ?pool_free@rml@@YA_NPAVMemoryPool@1@PAX@Z 39 | ?pool_reset@rml@@YA_NPAVMemoryPool@1@@Z 40 | ?pool_realloc@rml@@YAPAXPAVMemoryPool@1@PAXI@Z 41 | ?pool_aligned_realloc@rml@@YAPAXPAVMemoryPool@1@PAXII@Z 42 | ?pool_aligned_malloc@rml@@YAPAXPAVMemoryPool@1@II@Z 43 | ?pool_identify@rml@@YAPAVMemoryPool@1@PAX@Z 44 | ?pool_msize@rml@@YAIPAVMemoryPool@1@PAX@Z 45 | 46 | -------------------------------------------------------------------------------- /examples/graph/cholesky/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # GNU Makefile that builds and runs example. 16 | run_cmd= 17 | PROG=cholesky 18 | ARGS=4 2 19 | 20 | # The C++ compiler 21 | ifneq (,$(shell which icpc 2>/dev/null)) 22 | CXX=icpc 23 | endif # which icpc 24 | 25 | ifeq ($(shell uname), Darwin) 26 | override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib -Wl,-rpath,$(MKLROOT)/lib 27 | # MKL support 28 | override MKL_LIBS += -lmkl_intel_lp64 -lmkl_sequential -lmkl_core 29 | else 30 | ifeq ($(shell uname), Linux) 31 | LIBS+= -lrt 32 | endif 33 | # MKL support 34 | override MKL_LIBS += -lmkl_rt 35 | endif 36 | 37 | # autodetect C++11 support 38 | include ../../common/examples-common.inc 39 | 40 | all: release test 41 | 42 | release: *.cpp 43 | $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(MKL_LIBS) $(LIBS) $(CXX0XFLAGS) 44 | 45 | debug: *.cpp 46 | $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(MKL_LIBS) $(LIBS) $(CXX0XFLAGS) 47 | 48 | profile: override CXXFLAGS += -DTBB_USE_THREADING_TOOLS -g 49 | profile: release 50 | 51 | clean: 52 | $(RM) $(PROG) *.o *.d 53 | 54 | test: 55 | $(run_cmd) ./$(PROG) $(ARGS) 56 | -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/msvs/uwp/tbbTachyon.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tbbTachyon", "tbbTachyon.vcxproj", "{77FEB0A5-648A-4561-8A9D-61C7818B4490}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Debug|x64.ActiveCfg = Debug|x64 17 | {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Debug|x64.Build.0 = Debug|x64 18 | {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Debug|x64.Deploy.0 = Debug|x64 19 | {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Debug|x86.ActiveCfg = Debug|Win32 20 | {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Debug|x86.Build.0 = Debug|Win32 21 | {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Debug|x86.Deploy.0 = Debug|Win32 22 | {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Release|x64.ActiveCfg = Release|x64 23 | {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Release|x64.Build.0 = Release|x64 24 | {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Release|x64.Deploy.0 = Release|x64 25 | {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Release|x86.ActiveCfg = Release|Win32 26 | {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Release|x86.Build.0 = Release|Win32 27 | {77FEB0A5-648A-4561-8A9D-61C7818B4490}.Release|x86.Deploy.0 = Release|Win32 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /examples/test_all/fibonacci/Makefile.windows: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Common Makefile that builds and runs example. 16 | 17 | # Just specify your program basename 18 | PROG=Fibonacci 19 | ARGS= 20 | 21 | # Trying to find if icl.exe is set 22 | CXX1 = $(TBB_CXX)- 23 | CXX2 = $(CXX1:icl.exe-=icl.exe) 24 | CXX = $(CXX2:-=cl.exe) 25 | 26 | # The C++ compiler options 27 | MYCXXFLAGS = /TP /EHsc /W3 /nologo /D _CONSOLE /D _MBCS /D WIN32 /D _WIN32_WINNT=0x0501 $(CXXFLAGS) 28 | MYLDFLAGS =/INCREMENTAL:NO /NOLOGO /DEBUG /FIXED:NO $(LDFLAGS) 29 | 30 | all: release test 31 | release: compiler_check 32 | $(CXX) *.cpp /MD /O2 /D NDEBUG $(MYCXXFLAGS) /link tbb.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 33 | debug: compiler_check 34 | $(CXX) *.cpp /MDd /Od /Zi /D TBB_USE_DEBUG /D _DEBUG $(MYCXXFLAGS) /link tbb_debug.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 35 | clean: 36 | @cmd.exe /C del $(PROG).exe *.obj *.?db *.manifest 37 | test: 38 | $(PROG) $(ARGS) 39 | compiler_check: 40 | @echo compiler_test>compiler_test && @$(CXX) /E compiler_test >nul 2>&1 || echo "$(CXX) command not found. Check if CXX=$(CXX) is set properly" 41 | @cmd.exe /C del compiler_test 42 | -------------------------------------------------------------------------------- /src/tbbmalloc/mac32-tbbmalloc-export.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | _scalable_calloc 18 | _scalable_free 19 | _scalable_malloc 20 | _scalable_realloc 21 | _scalable_posix_memalign 22 | _scalable_aligned_malloc 23 | _scalable_aligned_realloc 24 | _scalable_aligned_free 25 | _scalable_msize 26 | _scalable_allocation_mode 27 | _scalable_allocation_command 28 | ___TBB_malloc_safer_aligned_msize 29 | ___TBB_malloc_safer_aligned_realloc 30 | ___TBB_malloc_safer_free 31 | ___TBB_malloc_safer_msize 32 | ___TBB_malloc_safer_realloc 33 | ___TBB_malloc_free_definite_size 34 | /* memory pool stuff */ 35 | __ZN3rml11pool_createElPKNS_13MemPoolPolicyE 36 | __ZN3rml14pool_create_v1ElPKNS_13MemPoolPolicyEPPNS_10MemoryPoolE 37 | __ZN3rml10pool_resetEPNS_10MemoryPoolE 38 | __ZN3rml12pool_destroyEPNS_10MemoryPoolE 39 | __ZN3rml11pool_mallocEPNS_10MemoryPoolEm 40 | __ZN3rml9pool_freeEPNS_10MemoryPoolEPv 41 | __ZN3rml12pool_reallocEPNS_10MemoryPoolEPvm 42 | __ZN3rml20pool_aligned_reallocEPNS_10MemoryPoolEPvmm 43 | __ZN3rml19pool_aligned_mallocEPNS_10MemoryPoolEmm 44 | __ZN3rml13pool_identifyEPv 45 | __ZN3rml10pool_msizeEPNS_10MemoryPoolEPv 46 | 47 | -------------------------------------------------------------------------------- /src/tbbmalloc/mac64-tbbmalloc-export.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | _scalable_calloc 18 | _scalable_free 19 | _scalable_malloc 20 | _scalable_realloc 21 | _scalable_posix_memalign 22 | _scalable_aligned_malloc 23 | _scalable_aligned_realloc 24 | _scalable_aligned_free 25 | _scalable_msize 26 | _scalable_allocation_mode 27 | _scalable_allocation_command 28 | ___TBB_malloc_safer_aligned_msize 29 | ___TBB_malloc_safer_aligned_realloc 30 | ___TBB_malloc_safer_free 31 | ___TBB_malloc_safer_msize 32 | ___TBB_malloc_safer_realloc 33 | ___TBB_malloc_free_definite_size 34 | /* memory pool stuff */ 35 | __ZN3rml11pool_createElPKNS_13MemPoolPolicyE 36 | __ZN3rml14pool_create_v1ElPKNS_13MemPoolPolicyEPPNS_10MemoryPoolE 37 | __ZN3rml10pool_resetEPNS_10MemoryPoolE 38 | __ZN3rml12pool_destroyEPNS_10MemoryPoolE 39 | __ZN3rml11pool_mallocEPNS_10MemoryPoolEm 40 | __ZN3rml9pool_freeEPNS_10MemoryPoolEPv 41 | __ZN3rml12pool_reallocEPNS_10MemoryPoolEPvm 42 | __ZN3rml20pool_aligned_reallocEPNS_10MemoryPoolEPvmm 43 | __ZN3rml19pool_aligned_mallocEPNS_10MemoryPoolEmm 44 | __ZN3rml13pool_identifyEPv 45 | __ZN3rml10pool_msizeEPNS_10MemoryPoolEPv 46 | 47 | -------------------------------------------------------------------------------- /src/tbbmalloc/win32-gcc-tbbmalloc-export.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | { 18 | global: 19 | scalable_calloc; 20 | scalable_free; 21 | scalable_malloc; 22 | scalable_realloc; 23 | scalable_posix_memalign; 24 | scalable_aligned_malloc; 25 | scalable_aligned_realloc; 26 | scalable_aligned_free; 27 | scalable_msize; 28 | scalable_allocation_mode; 29 | scalable_allocation_command; 30 | __TBB_malloc_safer_free; 31 | __TBB_malloc_safer_realloc; 32 | __TBB_malloc_safer_msize; 33 | __TBB_malloc_safer_aligned_msize; 34 | __TBB_malloc_safer_aligned_realloc; 35 | /* memory pool stuff */ 36 | _ZN3rml10pool_resetEPNS_10MemoryPoolE; 37 | _ZN3rml11pool_createEiPKNS_13MemPoolPolicyE; 38 | _ZN3rml14pool_create_v1EiPKNS_13MemPoolPolicyEPPNS_10MemoryPoolE; 39 | _ZN3rml11pool_mallocEPNS_10MemoryPoolEj; 40 | _ZN3rml12pool_destroyEPNS_10MemoryPoolE; 41 | _ZN3rml9pool_freeEPNS_10MemoryPoolEPv; 42 | _ZN3rml12pool_reallocEPNS_10MemoryPoolEPvj; 43 | _ZN3rml20pool_aligned_reallocEPNS_10MemoryPoolEPvjj; 44 | _ZN3rml19pool_aligned_mallocEPNS_10MemoryPoolEjj; 45 | _ZN3rml13pool_identifyEPv; 46 | _ZN3rml10pool_msizeEPNS_10MemoryPoolEPv; 47 | 48 | local:*; 49 | }; 50 | -------------------------------------------------------------------------------- /src/tbbmalloc/win64-gcc-tbbmalloc-export.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | { 18 | global: 19 | scalable_calloc; 20 | scalable_free; 21 | scalable_malloc; 22 | scalable_realloc; 23 | scalable_posix_memalign; 24 | scalable_aligned_malloc; 25 | scalable_aligned_realloc; 26 | scalable_aligned_free; 27 | scalable_msize; 28 | scalable_allocation_mode; 29 | scalable_allocation_command; 30 | __TBB_malloc_safer_free; 31 | __TBB_malloc_safer_realloc; 32 | __TBB_malloc_safer_msize; 33 | __TBB_malloc_safer_aligned_msize; 34 | __TBB_malloc_safer_aligned_realloc; 35 | /* memory pool stuff */ 36 | _ZN3rml10pool_resetEPNS_10MemoryPoolE; 37 | _ZN3rml11pool_createExPKNS_13MemPoolPolicyE; 38 | _ZN3rml14pool_create_v1ExPKNS_13MemPoolPolicyEPPNS_10MemoryPoolE; 39 | _ZN3rml11pool_mallocEPNS_10MemoryPoolEy; 40 | _ZN3rml12pool_destroyEPNS_10MemoryPoolE; 41 | _ZN3rml9pool_freeEPNS_10MemoryPoolEPv; 42 | _ZN3rml12pool_reallocEPNS_10MemoryPoolEPvy; 43 | _ZN3rml20pool_aligned_reallocEPNS_10MemoryPoolEPvyy; 44 | _ZN3rml19pool_aligned_mallocEPNS_10MemoryPoolEyy; 45 | _ZN3rml13pool_identifyEPv; 46 | _ZN3rml10pool_msizeEPNS_10MemoryPoolEPv; 47 | 48 | local:*; 49 | }; 50 | -------------------------------------------------------------------------------- /include/tbb/flow_graph_abstractions.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef __TBB_flow_graph_abstractions_H 18 | #define __TBB_flow_graph_abstractions_H 19 | 20 | namespace tbb { 21 | namespace flow { 22 | namespace interface11 { 23 | 24 | //! Pure virtual template classes that define interfaces for async communication 25 | class graph_proxy { 26 | public: 27 | //! Inform a graph that messages may come from outside, to prevent premature graph completion 28 | virtual void reserve_wait() = 0; 29 | 30 | //! Inform a graph that a previous call to reserve_wait is no longer in effect 31 | virtual void release_wait() = 0; 32 | 33 | virtual ~graph_proxy() {} 34 | }; 35 | 36 | template 37 | class receiver_gateway : public graph_proxy { 38 | public: 39 | //! Type of inputing data into FG. 40 | typedef Input input_type; 41 | 42 | //! Submit signal from an asynchronous activity to FG. 43 | virtual bool try_put(const input_type&) = 0; 44 | }; 45 | 46 | } //interfaceX 47 | 48 | using interface11::graph_proxy; 49 | using interface11::receiver_gateway; 50 | 51 | } //flow 52 | } //tbb 53 | #endif 54 | -------------------------------------------------------------------------------- /examples/graph/som/Makefile.windows: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Common Makefile that builds and runs example. 16 | 17 | # Just specify your program basename 18 | PROG=som 19 | ARGS= 20 | LIGHT_ARGS=4 21 | 22 | # Trying to find if icl.exe is set 23 | CXX1 = $(TBB_CXX)- 24 | CXX2 = $(CXX1:icl.exe-=icl.exe) 25 | CXX = $(CXX2:-=cl.exe) 26 | 27 | # The C++ compiler options 28 | MYCXXFLAGS = /TP /EHsc /W3 /nologo /D _CONSOLE /D _MBCS /D WIN32 /D _CRT_SECURE_NO_DEPRECATE $(CXXFLAGS) 29 | MYLDFLAGS =/INCREMENTAL:NO /NOLOGO /DEBUG /FIXED:NO $(LDFLAGS) 30 | 31 | all: release test 32 | release: 33 | $(CXX) ./som_graph.cpp ./som.cpp /MD /O2 /D NDEBUG $(MYCXXFLAGS) /link tbb.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 34 | debug: 35 | $(CXX) ./som_graph.cpp ./som.cpp /MDd /Od /Zi /D _DEBUG $(MYCXXFLAGS) /link tbb_debug.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 36 | profile: 37 | $(CXX) ./som_graph.cpp ./som.cpp /MD /O2 /Zi /D NDEBUG $(MYCXXFLAGS) /D TBB_USE_THREADING_TOOLS /link tbb.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 38 | clean: 39 | @cmd.exe /C del $(PROG).exe *.obj *.?db *.manifest 40 | test: 41 | $(PROG) $(ARGS) 42 | light_test: 43 | $(PROG) $(LIGHT_ARGS) 44 | 45 | -------------------------------------------------------------------------------- /examples/task_group/sudoku/Makefile.windows: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Common Makefile that builds and runs example. 16 | 17 | # Just specify your program basename 18 | PROG=sudoku 19 | ARGS= 4 input1 verbose 20 | PERF_RUN_ARGS=auto input1 silent 21 | 22 | # Trying to find if icl.exe is set 23 | CXX1 = $(TBB_CXX)- 24 | CXX2 = $(CXX1:icl.exe-=icl.exe) 25 | CXX = $(CXX2:-=cl.exe) 26 | 27 | # The C++ compiler options 28 | MYCXXFLAGS = /TP /EHsc /W3 /nologo /D _CONSOLE /D _MBCS /D WIN32 /D _CRT_SECURE_NO_DEPRECATE $(CXXFLAGS) 29 | MYLDFLAGS =/INCREMENTAL:NO /NOLOGO /DEBUG /FIXED:NO $(LDFLAGS) 30 | 31 | all: release test 32 | release: 33 | $(CXX) *.cpp /MD /O2 /D NDEBUG $(MYCXXFLAGS) /link tbb.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 34 | debug: 35 | $(CXX) *.cpp /MDd /Od /Zi /D TBB_USE_DEBUG /D _DEBUG $(MYCXXFLAGS) /link tbb_debug.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 36 | clean: 37 | @cmd.exe /C del $(PROG).exe *.obj *.?db *.manifest 38 | test: 39 | $(PROG) $(ARGS) 40 | compiler_check: 41 | @$(CXX) >nul 2>&1 || echo "$(CXX) command not found. Check if CXX=$(CXX) is set properly" 42 | 43 | perf_build: release 44 | 45 | perf_run: 46 | $(PROG) $(PERF_RUN_ARGS) 47 | -------------------------------------------------------------------------------- /include/tbb/info.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2019-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef __TBB_info_H 18 | #define __TBB_info_H 19 | 20 | #include "tbb_config.h" 21 | 22 | #if __TBB_NUMA_SUPPORT 23 | 24 | #include 25 | 26 | namespace tbb { 27 | namespace internal { 28 | namespace numa_topology { 29 | unsigned nodes_count(); 30 | void fill(int* indexes_array); 31 | int default_concurrency(int node_id); 32 | } //namespace numa_topology 33 | } // namespace internal 34 | 35 | typedef int numa_node_id; 36 | 37 | namespace info { 38 | inline std::vector numa_nodes() { 39 | std::vector nodes_indexes(tbb::internal::numa_topology::nodes_count()); 40 | internal::numa_topology::fill(&nodes_indexes.front()); 41 | return nodes_indexes; 42 | } 43 | 44 | inline int default_concurrency(numa_node_id id = -1) { 45 | return internal::numa_topology::default_concurrency(id); 46 | } 47 | } // namespace info 48 | } // namespace tbb 49 | 50 | #endif /*__TBB_NUMA_SUPPORT*/ 51 | 52 | #endif /*__TBB_info_H*/ 53 | -------------------------------------------------------------------------------- /examples/parallel_for/game_of_life/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # GNU Makefile that builds and runs example. 16 | run_cmd= 17 | PROG=game_of_life 18 | ARGS=2:4 -t 5 19 | LIGHT_ARGS=1:2 -t 5 20 | ifneq (,$(shell which icc 2>/dev/null)) 21 | CXX=icc 22 | endif # icc 23 | 24 | ifeq ($(shell uname), Linux) 25 | ifeq ($(target), android) 26 | LIBS+= --sysroot=$(SYSROOT) 27 | run_cmd=../../common/android.linux.launcher.sh 28 | else 29 | LIBS+= -lrt 30 | endif 31 | else ifeq ($(shell uname), Darwin) 32 | override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib 33 | endif 34 | 35 | # autodetect C++11 support 36 | include ../../common/examples-common.inc 37 | 38 | all: release test 39 | 40 | release: src/Evolution.cpp src/Update_state.cpp src/Game_of_life.cpp 41 | $(CXX) -O2 -DNDEBUG -D_CONSOLE $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS) $(CXX0XFLAGS) 42 | 43 | debug: src/Evolution.cpp src/Update_state.cpp src/Game_of_life.cpp 44 | $(CXX) -O0 -D_CONSOLE -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS) $(CXX0XFLAGS) 45 | 46 | clean: 47 | rm -f $(PROG) *.o *.d 48 | 49 | test: 50 | $(run_cmd) ./$(PROG) $(ARGS) 51 | light_test: 52 | $(run_cmd) ./$(PROG) $(LIGHT_ARGS) 53 | -------------------------------------------------------------------------------- /examples/task/tree_sum/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # GNU Makefile that builds and runs example. 16 | run_cmd= 17 | PROG=tree_sum 18 | ARGS= 19 | PERF_RUN_ARGS=auto 100000000 silent 20 | 21 | # The C++ compiler 22 | ifneq (,$(shell which icc 2>/dev/null)) 23 | CXX=icc 24 | endif # icc 25 | 26 | ifeq ($(shell uname), Linux) 27 | ifeq ($(target), android) 28 | LIBS+= --sysroot=$(SYSROOT) 29 | run_cmd=../../common/android.linux.launcher.sh 30 | else 31 | LIBS+= -lrt 32 | endif 33 | else ifeq ($(shell uname), Darwin) 34 | override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib 35 | endif 36 | 37 | # autodetect C++11 support 38 | include ../../common/examples-common.inc 39 | 40 | all: release test 41 | 42 | release: *.cpp 43 | $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbbmalloc -ltbb $(LIBS) $(CXX0XFLAGS) 44 | 45 | debug: *.cpp 46 | $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbbmalloc_debug -ltbb_debug $(LIBS) $(CXX0XFLAGS) 47 | 48 | clean: 49 | $(RM) $(PROG) *.o *.d 50 | 51 | test: 52 | $(run_cmd) ./$(PROG) $(ARGS) 53 | $(run_cmd) ./$(PROG) stdmalloc $(ARGS) 54 | 55 | perf_build: release 56 | 57 | perf_run: 58 | $(run_cmd) ./$(PROG) $(PERF_RUN_ARGS) 59 | -------------------------------------------------------------------------------- /src/tbb/intel64-masm/atomic_support.asm: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2005-2020 Intel Corporation 2 | ; 3 | ; Licensed under the Apache License, Version 2.0 (the "License"); 4 | ; you may not use this file except in compliance with the License. 5 | ; You may obtain a copy of the License at 6 | ; 7 | ; http://www.apache.org/licenses/LICENSE-2.0 8 | ; 9 | ; Unless required by applicable law or agreed to in writing, software 10 | ; distributed under the License is distributed on an "AS IS" BASIS, 11 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ; See the License for the specific language governing permissions and 13 | ; limitations under the License. 14 | 15 | ; DO NOT EDIT - AUTOMATICALLY GENERATED FROM .s FILE 16 | .code 17 | ALIGN 8 18 | PUBLIC __TBB_machine_fetchadd1 19 | __TBB_machine_fetchadd1: 20 | mov rax,rdx 21 | lock xadd [rcx],al 22 | ret 23 | .code 24 | ALIGN 8 25 | PUBLIC __TBB_machine_fetchstore1 26 | __TBB_machine_fetchstore1: 27 | mov rax,rdx 28 | lock xchg [rcx],al 29 | ret 30 | .code 31 | ALIGN 8 32 | PUBLIC __TBB_machine_cmpswp1 33 | __TBB_machine_cmpswp1: 34 | mov rax,r8 35 | lock cmpxchg [rcx],dl 36 | ret 37 | .code 38 | ALIGN 8 39 | PUBLIC __TBB_machine_fetchadd2 40 | __TBB_machine_fetchadd2: 41 | mov rax,rdx 42 | lock xadd [rcx],ax 43 | ret 44 | .code 45 | ALIGN 8 46 | PUBLIC __TBB_machine_fetchstore2 47 | __TBB_machine_fetchstore2: 48 | mov rax,rdx 49 | lock xchg [rcx],ax 50 | ret 51 | .code 52 | ALIGN 8 53 | PUBLIC __TBB_machine_cmpswp2 54 | __TBB_machine_cmpswp2: 55 | mov rax,r8 56 | lock cmpxchg [rcx],dx 57 | ret 58 | .code 59 | ALIGN 8 60 | PUBLIC __TBB_machine_pause 61 | __TBB_machine_pause: 62 | L1: 63 | dw 090f3H; pause 64 | add ecx,-1 65 | jne L1 66 | ret 67 | end 68 | 69 | -------------------------------------------------------------------------------- /src/tbbmalloc/win64-tbbmalloc-export.def: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2005-2020 Intel Corporation 2 | ; 3 | ; Licensed under the Apache License, Version 2.0 (the "License"); 4 | ; you may not use this file except in compliance with the License. 5 | ; You may obtain a copy of the License at 6 | ; 7 | ; http://www.apache.org/licenses/LICENSE-2.0 8 | ; 9 | ; Unless required by applicable law or agreed to in writing, software 10 | ; distributed under the License is distributed on an "AS IS" BASIS, 11 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ; See the License for the specific language governing permissions and 13 | ; limitations under the License. 14 | 15 | EXPORTS 16 | 17 | ; frontend.cpp 18 | scalable_calloc 19 | scalable_free 20 | scalable_malloc 21 | scalable_realloc 22 | scalable_posix_memalign 23 | scalable_aligned_malloc 24 | scalable_aligned_realloc 25 | scalable_aligned_free 26 | scalable_msize 27 | scalable_allocation_mode 28 | scalable_allocation_command 29 | __TBB_malloc_safer_free 30 | __TBB_malloc_safer_realloc 31 | __TBB_malloc_safer_msize 32 | __TBB_malloc_safer_aligned_msize 33 | __TBB_malloc_safer_aligned_realloc 34 | ; memory pool stuff 35 | ?pool_create@rml@@YAPEAVMemoryPool@1@_JPEBUMemPoolPolicy@1@@Z 36 | ?pool_create_v1@rml@@YA?AW4MemPoolError@1@_JPEBUMemPoolPolicy@1@PEAPEAVMemoryPool@1@@Z 37 | ?pool_destroy@rml@@YA_NPEAVMemoryPool@1@@Z 38 | ?pool_malloc@rml@@YAPEAXPEAVMemoryPool@1@_K@Z 39 | ?pool_free@rml@@YA_NPEAVMemoryPool@1@PEAX@Z 40 | ?pool_reset@rml@@YA_NPEAVMemoryPool@1@@Z 41 | ?pool_realloc@rml@@YAPEAXPEAVMemoryPool@1@PEAX_K@Z 42 | ?pool_aligned_realloc@rml@@YAPEAXPEAVMemoryPool@1@PEAX_K2@Z 43 | ?pool_aligned_malloc@rml@@YAPEAXPEAVMemoryPool@1@_K1@Z 44 | ?pool_identify@rml@@YAPEAVMemoryPool@1@PEAX@Z 45 | ?pool_msize@rml@@YA_KPEAVMemoryPool@1@PEAX@Z 46 | 47 | -------------------------------------------------------------------------------- /examples/common/gui/xcode/tbbExample/iOS.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/graph/binpack/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # GNU Makefile that builds and runs example. 16 | run_cmd= 17 | PROG=binpack 18 | ARGS=4 N=1000 19 | PERF_RUN_ARGS=auto N=1000 silent 20 | 21 | # The C++ compiler 22 | ifneq (,$(shell which icc 2>/dev/null)) 23 | CXX=icc 24 | endif # which icc 25 | 26 | ifeq ($(shell uname), Linux) 27 | ifeq ($(target), android) 28 | LIBS+= --sysroot=$(SYSROOT) 29 | run_cmd=../../common/android.linux.launcher.sh 30 | else 31 | LIBS+= -lrt 32 | endif 33 | else ifeq ($(shell uname), Darwin) 34 | override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib 35 | endif 36 | 37 | # autodetect C++11 support 38 | include ../../common/examples-common.inc 39 | 40 | all: release test 41 | 42 | release: *.cpp 43 | $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS) $(CXX0XFLAGS) 44 | 45 | debug: *.cpp 46 | $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS) $(CXX0XFLAGS) 47 | 48 | profile: override CXXFLAGS += -DTBB_USE_THREADING_TOOLS -g 49 | profile: release 50 | 51 | clean: 52 | $(RM) $(PROG) *.o *.d 53 | 54 | test: 55 | $(run_cmd) ./$(PROG) $(ARGS) 56 | 57 | perf_build: release 58 | 59 | perf_run: 60 | $(run_cmd) ./$(PROG) $(PERF_RUN_ARGS) 61 | -------------------------------------------------------------------------------- /examples/graph/dining_philosophers/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # GNU Makefile that builds and runs example. 16 | run_cmd= 17 | PROG=dining_philosophers 18 | ARGS= auto 5 19 | LIGHT_ARGS= auto 3 20 | 21 | ifneq (,$(shell which icc 2>/dev/null)) 22 | CXX=icc 23 | endif # icc 24 | 25 | ifeq ($(shell uname), Linux) 26 | ifeq ($(target), android) 27 | LIBS+= --sysroot=$(SYSROOT) 28 | run_cmd=../../common/android.linux.launcher.sh 29 | else 30 | LIBS+= -lrt 31 | endif 32 | else ifeq ($(shell uname), Darwin) 33 | override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib 34 | endif 35 | 36 | # autodetect C++11 support 37 | include ../../common/examples-common.inc 38 | 39 | all: release test 40 | 41 | release: dining_philosophers.cpp 42 | $(CXX) -O2 -DNDEBUG -D_CONSOLE $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS) $(CXX0XFLAGS) 43 | 44 | debug: dining_philosophers.cpp 45 | $(CXX) -O0 -D_CONSOLE -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS) $(CXX0XFLAGS) 46 | 47 | profile: override CXXFLAGS += -DTBB_USE_THREADING_TOOLS -g 48 | profile: release 49 | 50 | clean: 51 | rm -f $(PROG) *.o *.d 52 | 53 | test: 54 | $(run_cmd) ./$(PROG) $(ARGS) 55 | 56 | light_test: 57 | $(run_cmd) ./$(PROG) $(LIGHT_ARGS) 58 | -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/msvs/uwp/Package.appxmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | tbbTachyon 18 | Administrator 19 | Assets\StoreLogo.png 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /examples/common/gui/xcode/tbbExample/tbbAppDelegate.m: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #import "tbbAppDelegate.h" 18 | 19 | #if TARGET_OS_IPHONE 20 | 21 | @implementation tbbAppDelegate 22 | 23 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 24 | { 25 | return YES; 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application 29 | { 30 | exit(EXIT_SUCCESS); 31 | } 32 | 33 | @end 34 | 35 | #elif TARGET_OS_MAC 36 | 37 | @implementation tbbAppDelegate 38 | 39 | @synthesize window = _window; 40 | 41 | //declared in macvideo.cpp file 42 | extern int g_sizex, g_sizey; 43 | 44 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 45 | { 46 | // Insert code here to initialize your application 47 | NSRect windowSize; 48 | windowSize.size.height = g_sizey; 49 | windowSize.size.width = g_sizex; 50 | windowSize.origin=_window.frame.origin; 51 | [_window setFrame:windowSize display:YES]; 52 | 53 | } 54 | 55 | - (BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication *) sender 56 | { 57 | return YES; 58 | } 59 | 60 | @end 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /examples/graph/dining_philosophers/Makefile.windows: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Common Makefile that builds and runs example. 16 | 17 | # Just specify your program basename 18 | PROG=dining_philosophers 19 | ARGS= auto 5 20 | LIGHT_ARGS= auto 3 21 | 22 | # Trying to find if icl.exe is set 23 | CXX1 = $(TBB_CXX)- 24 | CXX2 = $(CXX1:icl.exe-=icl.exe) 25 | CXX = $(CXX2:-=cl.exe) 26 | 27 | # The C++ compiler options 28 | MYCXXFLAGS = /TP /EHsc /W3 /nologo /D _CONSOLE /D _MBCS /D WIN32 /D _CRT_SECURE_NO_DEPRECATE $(CXXFLAGS) 29 | MYLDFLAGS =/INCREMENTAL:NO /NOLOGO /DEBUG /FIXED:NO $(LDFLAGS) 30 | 31 | all: release test 32 | release: 33 | $(CXX) ./dining_philosophers.cpp /MD /O2 /D NDEBUG $(MYCXXFLAGS) /link tbb.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 34 | debug: 35 | $(CXX) ./dining_philosophers.cpp /MDd /Od /Zi /D _DEBUG $(MYCXXFLAGS) /link tbb_debug.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 36 | profile: 37 | $(CXX) ./dining_philosophers.cpp /MD /O2 /Zi /D NDEBUG $(MYCXXFLAGS) /D TBB_USE_THREADING_TOOLS /link tbb.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 38 | clean: 39 | @cmd.exe /C del $(PROG).exe *.obj *.?db *.manifest 40 | test: 41 | $(PROG) $(ARGS) 42 | light_test: 43 | $(PROG) $(LIGHT_ARGS) 44 | 45 | -------------------------------------------------------------------------------- /examples/concurrent_priority_queue/shortpath/Makefile.windows: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Common Makefile that builds and runs example. 16 | 17 | # Just specify your program basename 18 | PROG=shortpath 19 | ARGS=4 N=1000 start=0 end=999 verbose 20 | PERF_RUN_ARGS=auto N=1000 start=0 end=99 silent 21 | 22 | # Trying to find if icl.exe is set 23 | CXX1 = $(TBB_CXX)- 24 | CXX2 = $(CXX1:icl.exe-=icl.exe) 25 | CXX = $(CXX2:-=cl.exe) 26 | 27 | # The C++ compiler options 28 | MYCXXFLAGS = /TP /EHsc /W3 /nologo /D _CONSOLE /D _MBCS /D WIN32 /D _CRT_SECURE_NO_DEPRECATE $(CXXFLAGS) 29 | MYLDFLAGS =/INCREMENTAL:NO /NOLOGO /DEBUG /FIXED:NO $(LDFLAGS) 30 | 31 | all: release test 32 | release: 33 | $(CXX) *.cpp /MD /O2 /D NDEBUG $(MYCXXFLAGS) /link tbb.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 34 | debug: 35 | $(CXX) *.cpp /MDd /Od /Zi /D TBB_USE_DEBUG /D _DEBUG $(MYCXXFLAGS) /link tbb_debug.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 36 | clean: 37 | @cmd.exe /C del $(PROG).exe *.obj *.?db *.manifest 38 | test: 39 | $(PROG) $(ARGS) 40 | compiler_check: 41 | @$(CXX) >nul 2>&1 || echo "$(CXX) command not found. Check if CXX=$(CXX) is set properly" 42 | 43 | perf_build: release 44 | 45 | perf_run: 46 | $(PROG) $(PERF_RUN_ARGS) 47 | -------------------------------------------------------------------------------- /src/test/test_cache_aligned_allocator_STL.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Test whether cache_aligned_allocator works with some of the host's STL containers. 18 | 19 | #include "tbb/cache_aligned_allocator.h" 20 | #include "tbb/tbb_allocator.h" 21 | 22 | #define HARNESS_NO_PARSE_COMMAND_LINE 1 23 | #include "test_allocator_STL.h" 24 | 25 | int TestMain () { 26 | TestAllocatorWithSTL >(); 27 | TestAllocatorWithSTL >(); 28 | TestAllocatorWithSTL >(); 29 | 30 | #if __TBB_CPP17_MEMORY_RESOURCE_PRESENT 31 | tbb::cache_aligned_resource aligned_resource; 32 | tbb::cache_aligned_resource equal_aligned_resource(std::pmr::get_default_resource()); 33 | ASSERT(aligned_resource.is_equal(equal_aligned_resource), 34 | "Underlying upstream resources should be equal."); 35 | ASSERT(!aligned_resource.is_equal(*std::pmr::null_memory_resource()), 36 | "Cache aligned resource upstream shouldn't be equal to the standard resource."); 37 | TestAllocatorWithSTL(std::pmr::polymorphic_allocator(&aligned_resource)); 38 | #endif 39 | 40 | return Harness::Done; 41 | } 42 | 43 | -------------------------------------------------------------------------------- /examples/graph/logic_sim/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # GNU Makefile that builds and runs example. 16 | run_cmd= 17 | PROG=test_all 18 | ARGS=4 19 | PERF_RUN_ARGS=auto silent 20 | 21 | # The C++ compiler 22 | ifneq (,$(shell which icc 2>/dev/null)) 23 | CXX=icc 24 | endif # which icc 25 | 26 | ifeq ($(shell uname), Linux) 27 | ifeq ($(target), android) 28 | LIBS+= --sysroot=$(SYSROOT) 29 | run_cmd=../../common/android.linux.launcher.sh 30 | else 31 | LIBS+= -lrt 32 | endif 33 | else ifeq ($(shell uname), Darwin) 34 | override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib 35 | endif 36 | 37 | # autodetect C++11 support 38 | include ../../common/examples-common.inc 39 | 40 | all: release test 41 | 42 | release: *.cpp 43 | $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $(PROG).cpp -std=c++11 -ltbb $(LIBS) $(CXX0XFLAGS) 44 | 45 | debug: *.cpp 46 | $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $(PROG).cpp -std=c++11 -ltbb_debug $(LIBS) $(CXX0XFLAGS) 47 | 48 | profile: override CXXFLAGS += -DTBB_USE_THREADING_TOOLS -g 49 | profile: release 50 | 51 | clean: 52 | $(RM) $(PROG) *.o *.d 53 | 54 | test: 55 | $(run_cmd) ./$(PROG) $(ARGS) 56 | 57 | perf_build: release 58 | 59 | perf_run: 60 | $(run_cmd) ./$(PROG) $(PERF_RUN_ARGS) 61 | -------------------------------------------------------------------------------- /examples/parallel_for/polygon_overlay/polyover.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /*! 18 | * polyover.h : extern declarations for polyover.cpp 19 | */ 20 | #include "rpolygon.h" 21 | #include "tbb/spin_mutex.h" 22 | 23 | extern void OverlayOnePolygonWithMap(Polygon_map_t *resultMap, RPolygon *myPoly, Polygon_map_t *map2, tbb::spin_mutex *rMutex); 24 | 25 | extern void SerialOverlayMaps(Polygon_map_t **resultMap, Polygon_map_t *map1, Polygon_map_t *map2); 26 | 27 | // extern void NaiveParallelOverlay(Polygon_map_t **result_map, Polygon_map_t *polymap1, Polygon_map_t *polymap2); 28 | extern void NaiveParallelOverlay(Polygon_map_t *&result_map, Polygon_map_t &polymap1, Polygon_map_t &polymap2); 29 | 30 | extern void SplitParallelOverlay(Polygon_map_t **result_map, Polygon_map_t *polymap1, Polygon_map_t *polymap2); 31 | extern void SplitParallelOverlayCV(concurrent_Polygon_map_t **result_map, Polygon_map_t *polymap1, Polygon_map_t *polymap2); 32 | extern void SplitParallelOverlayETS(ETS_Polygon_map_t **result_map, Polygon_map_t *polymap1, Polygon_map_t *polymap2); 33 | 34 | extern void CheckPolygonMap(Polygon_map_t *checkMap); 35 | extern bool ComparePolygonMaps(Polygon_map_t *map1, Polygon_map_t *map2); 36 | 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore the debug and release directories created with Makefile builds # 2 | ######################################################################### 3 | build/*_debug/ 4 | build/*_release/ 5 | 6 | # Compiled source # 7 | ################### 8 | *.com 9 | *.class 10 | *.dll 11 | *.lib 12 | *.pdb 13 | *.exe 14 | *.o 15 | *.so 16 | *.so.1 17 | *.so.2 18 | *.dylib 19 | *.a 20 | *.obj 21 | *.pyc 22 | 23 | *.orig 24 | *.raw 25 | *.sample 26 | *.slo 27 | *.swp 28 | *.config 29 | *.la 30 | *.lai 31 | *.lo 32 | *.nhdr 33 | *.nii.gz 34 | *.nrrd 35 | 36 | # Packages # 37 | ############ 38 | # it's better to unpack these files and commit the raw source 39 | # git has its own built in compression methods 40 | *.7z 41 | *.dmg 42 | *.gz 43 | *.iso 44 | *.jar 45 | *.rar 46 | *.tar 47 | *.tgz 48 | *.zip 49 | 50 | # Logs and databases # 51 | ###################### 52 | *.log 53 | *.sql 54 | *.sqlite 55 | 56 | # OS generated files # 57 | ###################### 58 | .DS_Store 59 | .DS_Store? 60 | ._* 61 | .Spotlight-V100 62 | .Trashes 63 | ehthumbs.db 64 | Thumbs.db 65 | 66 | # IDE generated files # 67 | ###################### 68 | /.ninja_deps 69 | /.ninja_log 70 | /build.ninja 71 | /rules.ninja 72 | *~ 73 | .emacs.desktop 74 | 75 | # Build system generated files # 76 | ################################ 77 | CMakeCache.txt 78 | CMakeFiles/ 79 | 80 | *.cmake 81 | libtbb.dylib 82 | libtbb.so 83 | libtbb_static.a 84 | libtbbmalloc.dylib 85 | libtbbmalloc.so 86 | libtbbmalloc_proxy.dylib 87 | libtbbmalloc_proxy.so 88 | libtbbmalloc_proxy_static.a 89 | libtbbmalloc_static.a 90 | tbb.def 91 | tbbmalloc.def 92 | version_string.ver 93 | src/tbb/win32-gcc-tbb-export.def 94 | 95 | # Other # 96 | ######### 97 | .clang_complete 98 | .idea 99 | .svn 100 | crash* 101 | *.tmp 102 | -------------------------------------------------------------------------------- /examples/parallel_do/parallel_preorder/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # GNU Makefile that builds and runs example. 16 | run_cmd= 17 | PROG=parallel_preorder 18 | ARGS= 19 | PERF_RUN_ARGS=auto silent 500000 100 20 | LIGHT_ARGS=1:auto:+4 n-of-traversals=50 21 | 22 | # The C++ compiler 23 | ifneq (,$(shell which icc 2>/dev/null)) 24 | CXX=icc 25 | endif # icc 26 | 27 | ifeq ($(shell uname), Linux) 28 | ifeq ($(target), android) 29 | LIBS+= --sysroot=$(SYSROOT) 30 | run_cmd=../../common/android.linux.launcher.sh 31 | else 32 | LIBS+= -lrt 33 | endif 34 | else ifeq ($(shell uname), Darwin) 35 | override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib 36 | endif 37 | 38 | # autodetect C++11 support 39 | include ../../common/examples-common.inc 40 | 41 | all: release test 42 | 43 | release: *.cpp 44 | $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS) $(CXX0XFLAGS) 45 | 46 | debug: *.cpp 47 | $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS) $(CXX0XFLAGS) 48 | 49 | clean: 50 | $(RM) $(PROG) *.o *.d 51 | 52 | test: 53 | $(run_cmd) ./$(PROG) $(ARGS) 54 | 55 | light_test: 56 | $(run_cmd) ./$(PROG) $(LIGHT_ARGS) 57 | 58 | perf_build: release 59 | 60 | perf_run: 61 | $(run_cmd) ./$(PROG) $(PERF_RUN_ARGS) 62 | 63 | -------------------------------------------------------------------------------- /include/tbb/null_rw_mutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef __TBB_null_rw_mutex_H 18 | #define __TBB_null_rw_mutex_H 19 | 20 | #include "tbb_stddef.h" 21 | 22 | namespace tbb { 23 | 24 | //! A rw mutex which does nothing 25 | /** A null_rw_mutex is a rw mutex that does nothing and simulates successful operation. 26 | @ingroup synchronization */ 27 | class null_rw_mutex : internal::mutex_copy_deprecated_and_disabled { 28 | public: 29 | //! Represents acquisition of a mutex. 30 | class scoped_lock : internal::no_copy { 31 | public: 32 | scoped_lock() {} 33 | scoped_lock( null_rw_mutex& , bool = true ) {} 34 | ~scoped_lock() {} 35 | void acquire( null_rw_mutex& , bool = true ) {} 36 | bool upgrade_to_writer() { return true; } 37 | bool downgrade_to_reader() { return true; } 38 | bool try_acquire( null_rw_mutex& , bool = true ) { return true; } 39 | void release() {} 40 | }; 41 | 42 | null_rw_mutex() {} 43 | 44 | // Mutex traits 45 | static const bool is_rw_mutex = true; 46 | static const bool is_recursive_mutex = true; 47 | static const bool is_fair_mutex = true; 48 | }; 49 | 50 | } 51 | 52 | #endif /* __TBB_null_rw_mutex_H */ 53 | -------------------------------------------------------------------------------- /examples/concurrent_hash_map/count_strings/Makefile.windows: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Common Makefile that builds and runs example. 16 | 17 | # Just specify your program basename 18 | PROG=Count_Strings 19 | ARGS= 20 | PERF_RUN_ARGS=auto 10000000 silent 21 | 22 | # The C++ compiler options 23 | 24 | # Trying to find if icl.exe is set 25 | CXX1 = $(TBB_CXX)- 26 | CXX2 = $(CXX1:icl.exe-=icl.exe) 27 | CXX = $(CXX2:-=cl.exe) 28 | 29 | MYCXXFLAGS = /TP /EHsc /W3 /nologo /D _CONSOLE /D _MBCS /D WIN32 $(CXXFLAGS) 30 | MYLDFLAGS =/INCREMENTAL:NO /NOLOGO /DEBUG /FIXED:NO $(LDFLAGS) 31 | 32 | all: release test 33 | release: compiler_check 34 | $(CXX) *.cpp /MD /O2 /D NDEBUG $(MYCXXFLAGS) /link tbb.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 35 | debug: compiler_check 36 | $(CXX) *.cpp /MDd /Od /Zi /D TBB_USE_DEBUG /D _DEBUG $(MYCXXFLAGS) /link tbb_debug.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 37 | clean: 38 | @cmd.exe /C del $(PROG).exe *.obj *.?db *.manifest 39 | test: 40 | $(PROG) $(ARGS) 41 | compiler_check: 42 | @echo compiler_test>compiler_test && @$(CXX) /E compiler_test >nul 2>&1 || echo "$(CXX) command not found. Check if CXX=$(CXX) is set properly" 43 | @cmd.exe /C del compiler_test 44 | perf_build: release 45 | perf_run: 46 | $(PROG) $(PERF_RUN_ARGS) 47 | 48 | -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/msvs/uwp/App.xaml.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "DirectXPage.xaml.h" 18 | 19 | using namespace tbbTachyon; 20 | 21 | using namespace Platform; 22 | using namespace Windows::ApplicationModel; 23 | using namespace Windows::ApplicationModel::Activation; 24 | using namespace Windows::Foundation; 25 | using namespace Windows::Foundation::Collections; 26 | using namespace Windows::Storage; 27 | using namespace Windows::UI::Xaml; 28 | using namespace Windows::UI::Xaml::Controls; 29 | using namespace Windows::UI::Xaml::Controls::Primitives; 30 | using namespace Windows::UI::Xaml::Data; 31 | using namespace Windows::UI::Xaml::Input; 32 | using namespace Windows::UI::Xaml::Interop; 33 | using namespace Windows::UI::Xaml::Media; 34 | using namespace Windows::UI::Xaml::Navigation; 35 | 36 | #include "src/tachyon_video.h" 37 | 38 | App::App() 39 | { 40 | InitializeComponent(); 41 | } 42 | 43 | void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ pArgs) 44 | { 45 | m_directXPage = ref new DirectXPage(); 46 | 47 | // Place the frame in the current Window and ensure that it is active 48 | Window::Current->Content = m_directXPage; 49 | Window::Current->Activate(); 50 | } 51 | -------------------------------------------------------------------------------- /src/test/harness_allocator_overload.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef tbb_test_harness_allocator_overload_H 18 | #define tbb_test_harness_allocator_overload_H 19 | 20 | #include "../tbbmalloc/proxy.h" // for MALLOC_UNIXLIKE_OVERLOAD_ENABLED, MALLOC_ZONE_OVERLOAD_ENABLED 21 | #include "tbb/tbb_config.h" // for __TBB_WIN8UI_SUPPORT 22 | 23 | // Skip configurations with unsupported system malloc overload: 24 | // skip unsupported MSVCs, WIN8UI and MINGW (it doesn't define _MSC_VER), 25 | // no support for MSVC 2015 and greater in debug for now, 26 | // don't use defined(_MSC_VER), because result of using defined() in macro expansion is undefined 27 | #define MALLOC_WINDOWS_OVERLOAD_ENABLED ((_WIN32||_WIN64) && !__TBB_WIN8UI_SUPPORT && _MSC_VER >= 1500 && !(_MSC_VER >= 1900 && _DEBUG)) 28 | 29 | // Skip configurations with unsupported system malloc overload: 30 | // * overload via linking with -lmalloc_proxy is broken in offload, 31 | // as the library is loaded too late in that mode, 32 | // * LD_PRELOAD mechanism is broken in offload 33 | #define HARNESS_SKIP_TEST ((!MALLOC_WINDOWS_OVERLOAD_ENABLED && !MALLOC_UNIXLIKE_OVERLOAD_ENABLED && !MALLOC_ZONE_OVERLOAD_ENABLED) || __TBB_MIC_OFFLOAD) 34 | 35 | #endif // tbb_test_harness_allocator_overload_H 36 | -------------------------------------------------------------------------------- /examples/pipeline/square/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # GNU Makefile that builds and runs example. 16 | run_cmd= 17 | PROG=square 18 | ARGS=0 input.txt output.txt 19 | PERF_RUN_ARGS=auto input.txt output.txt silent 20 | 21 | # The C++ compiler 22 | ifneq (,$(shell which icc 2>/dev/null)) 23 | CXX=icc 24 | endif # icc 25 | 26 | SOURCES = square.cpp gen_input.cpp 27 | 28 | ifeq ($(shell uname), Linux) 29 | ifeq ($(target), android) 30 | LIBS+= --sysroot=$(SYSROOT) 31 | run_cmd=../../common/android.linux.launcher.sh 32 | else 33 | LIBS+= -lrt 34 | endif 35 | else ifeq ($(shell uname), Darwin) 36 | override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib 37 | endif 38 | 39 | # autodetect C++11 support 40 | include ../../common/examples-common.inc 41 | 42 | all: release test 43 | 44 | release: $(SOURCES) 45 | $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS) $(CXX0XFLAGS) 46 | 47 | debug: $(SOURCES) 48 | $(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS) $(CXX0XFLAGS) 49 | 50 | clean: 51 | $(RM) $(PROG) *.o *.d input.txt output.txt 52 | 53 | test: 54 | $(run_cmd) ./$(PROG) $(ARGS) 55 | 56 | perf_build: $(SOURCES) 57 | $(CXX) -O2 -msse2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS) 58 | 59 | perf_run: 60 | $(run_cmd) ./$(PROG) $(PERF_RUN_ARGS) 61 | -------------------------------------------------------------------------------- /src/test/harness_task.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "tbb/task.h" 18 | #include "harness.h" 19 | 20 | //! Helper for verifying that old use cases of spawn syntax still work. 21 | tbb::task* GetTaskPtr( int& counter ) { 22 | ++counter; 23 | return NULL; 24 | } 25 | 26 | class TaskGenerator: public tbb::task { 27 | int m_ChildCount; 28 | int m_Depth; 29 | 30 | public: 31 | TaskGenerator( int child_count, int _depth ) : m_ChildCount(child_count), m_Depth(_depth) {} 32 | ~TaskGenerator( ) { m_ChildCount = m_Depth = -125; } 33 | 34 | tbb::task* execute() __TBB_override { 35 | ASSERT( m_ChildCount>=0 && m_Depth>=0, NULL ); 36 | if( m_Depth>0 ) { 37 | recycle_as_safe_continuation(); 38 | set_ref_count( m_ChildCount+1 ); 39 | int k=0; 40 | for( int j=0; jspawn(t); 43 | } 44 | ASSERT(k==m_ChildCount,NULL); 45 | --m_Depth; 46 | __TBB_Yield(); 47 | ASSERT( state()==recycle && ref_count()>0, NULL); 48 | } 49 | return NULL; 50 | } 51 | }; 52 | -------------------------------------------------------------------------------- /src/tbb/ibm_aix51/atomic_support.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | /* This file must be compiled with gcc. The IBM compiler doesn't seem to 21 | support inline assembly statements (October 2007). */ 22 | 23 | #ifdef __GNUC__ 24 | 25 | int32_t __TBB_machine_cas_32 (volatile void* ptr, int32_t value, int32_t comparand) { 26 | __asm__ __volatile__ ("sync\n"); /* memory release operation */ 27 | compare_and_swap ((atomic_p) ptr, &comparand, value); 28 | __asm__ __volatile__ ("isync\n"); /* memory acquire operation */ 29 | return comparand; 30 | } 31 | 32 | int64_t __TBB_machine_cas_64 (volatile void* ptr, int64_t value, int64_t comparand) { 33 | __asm__ __volatile__ ("sync\n"); /* memory release operation */ 34 | compare_and_swaplp ((atomic_l) ptr, &comparand, value); 35 | __asm__ __volatile__ ("isync\n"); /* memory acquire operation */ 36 | return comparand; 37 | } 38 | 39 | void __TBB_machine_flush () { 40 | __asm__ __volatile__ ("sync\n"); 41 | } 42 | 43 | void __TBB_machine_lwsync () { 44 | __asm__ __volatile__ ("lwsync\n"); 45 | } 46 | 47 | void __TBB_machine_isync () { 48 | __asm__ __volatile__ ("isync\n"); 49 | } 50 | 51 | #endif /* __GNUC__ */ 52 | -------------------------------------------------------------------------------- /src/tbb/spin_mutex.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "tbb/tbb_machine.h" 18 | #include "tbb/spin_mutex.h" 19 | #include "itt_notify.h" 20 | #include "tbb_misc.h" 21 | 22 | namespace tbb { 23 | 24 | void spin_mutex::scoped_lock::internal_acquire( spin_mutex& m ) { 25 | __TBB_ASSERT( !my_mutex, "already holding a lock on a spin_mutex" ); 26 | ITT_NOTIFY(sync_prepare, &m); 27 | __TBB_LockByte(m.flag); 28 | my_mutex = &m; 29 | ITT_NOTIFY(sync_acquired, &m); 30 | } 31 | 32 | void spin_mutex::scoped_lock::internal_release() { 33 | __TBB_ASSERT( my_mutex, "release on spin_mutex::scoped_lock that is not holding a lock" ); 34 | 35 | ITT_NOTIFY(sync_releasing, my_mutex); 36 | __TBB_UnlockByte(my_mutex->flag); 37 | my_mutex = NULL; 38 | } 39 | 40 | bool spin_mutex::scoped_lock::internal_try_acquire( spin_mutex& m ) { 41 | __TBB_ASSERT( !my_mutex, "already holding a lock on a spin_mutex" ); 42 | bool result = bool( __TBB_TryLockByte(m.flag) ); 43 | if( result ) { 44 | my_mutex = &m; 45 | ITT_NOTIFY(sync_acquired, &m); 46 | } 47 | return result; 48 | } 49 | 50 | void spin_mutex::internal_construct() { 51 | ITT_SYNC_CREATE(this, _T("tbb::spin_mutex"), _T("")); 52 | } 53 | 54 | } // namespace tbb 55 | -------------------------------------------------------------------------------- /examples/graph/logic_sim/Makefile.windows: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005-2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Common Makefile that builds and runs example. 16 | PROG=test_all 17 | ARGS=4 18 | PERF_RUN_ARGS=auto silent 19 | 20 | # Try to find icl.exe 21 | CXX1 = $(TBB_CXX)- 22 | CXX2 = $(CXX1:icl.exe-=icl.exe) 23 | CXX = $(CXX2:-=cl.exe) 24 | 25 | # The C++ compiler options 26 | MYCXXFLAGS = /TP /EHsc /W3 /nologo /D _CONSOLE /D _MBCS /D WIN32 /D _CRT_SECURE_NO_DEPRECATE $(CXXFLAGS) 27 | MYLDFLAGS =/INCREMENTAL:NO /NOLOGO /DEBUG /FIXED:NO $(LDFLAGS) 28 | 29 | all: release test 30 | 31 | release: *.cpp 32 | $(CXX) $(PROG).cpp /MD /O2 /D NDEBUG $(MYCXXFLAGS) /link tbb.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 33 | 34 | debug: *.cpp 35 | $(CXX) $(PROG).cpp /MDd /Od /Zi /D TBB_USE_DEBUG /D _DEBUG $(MYCXXFLAGS) /link tbb_debug.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 36 | 37 | profile: *.cpp 38 | $(CXX) $(PROG).cpp /MD /O2 /Zi /D NDEBUG $(MYCXXFLAGS) /D TBB_USE_THREADING_TOOLS /link tbb.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe 39 | 40 | clean: 41 | @cmd.exe /C del $(PROG).exe *.obj *.?db *.manifest 42 | 43 | test: 44 | $(PROG) $(ARGS) 45 | 46 | compiler_check: 47 | @$(CXX) >nul 2>&1 || echo "$(CXX) command not found. Check if CXX=$(CXX) is set properly" 48 | 49 | perf_build: release 50 | 51 | perf_run: 52 | $(PROG) $(PERF_RUN_ARGS) 53 | --------------------------------------------------------------------------------