├── .bazelversion ├── .gitattributes ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── 1_question.md │ ├── 2_bug_report.md │ ├── 3_feature_request.md │ └── 4_documentation.md ├── dependabot.yml ├── issue_labeler.yml ├── labeler.yml ├── pull_request_template.md ├── scripts │ └── codespell.sh └── workflows │ ├── ci.yml │ ├── codeql.yml │ ├── coverity.yml │ ├── issue_labeler.yml │ ├── labeler.yml │ └── ossf-scorecard.yml ├── .gitignore ├── BUILD.bazel ├── Bazel.md ├── CMakeLists.txt ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── INSTALL.md ├── LICENSE.txt ├── MAINTAINERS.md ├── MODULE.bazel ├── README.md ├── RELEASE_NOTES.md ├── SECURITY.md ├── SUPPORT.md ├── SYSTEM_REQUIREMENTS.md ├── VERSIONING.md ├── WASM_Support.md ├── WORKSPACE.bazel ├── cmake ├── README.md ├── android │ ├── device_environment_cleanup.cmake │ ├── environment.cmake │ └── test_launcher.cmake ├── compilers │ ├── AppleClang.cmake │ ├── Clang.cmake │ ├── GNU.cmake │ ├── Intel.cmake │ ├── IntelLLVM.cmake │ ├── MSVC.cmake │ └── QCC.cmake ├── config_generation.cmake ├── hwloc_detection.cmake ├── memcheck.cmake ├── packaging.cmake ├── post_install │ └── CMakeLists.txt ├── python │ └── test_launcher.cmake ├── resumable_tasks.cmake ├── sanitize.cmake ├── scripts │ └── cmake_gen_github_configs.cmake ├── suppressions │ ├── lsan.suppressions │ └── tsan.suppressions ├── templates │ ├── TBBConfig.cmake.in │ └── TBBConfigVersion.cmake.in ├── test_spec.cmake ├── toolchains │ ├── mips.cmake │ └── riscv64.cmake ├── utils.cmake └── vars_utils.cmake ├── doc ├── Doxyfile.in ├── DoxygenLayout.xml ├── GSG │ ├── Images │ │ └── how-oneTBB-works.png │ ├── get_started.rst │ ├── installation.rst │ ├── integrate.rst │ ├── intro_gsg.rst │ ├── next_steps.rst │ ├── samples.rst │ └── system_requirements.rst ├── Makefile ├── README.md ├── _static │ ├── custom.js │ ├── favicons.png │ ├── oneAPI-rgb-rev-100.png │ └── theme_overrides.css ├── conf.py ├── index.rst ├── index │ ├── index_intro.rst │ ├── toctree.rst │ └── useful_topics.rst ├── main │ ├── _templates │ │ └── layout.html │ ├── examples_testing │ │ └── CMakeLists.txt │ ├── intro │ │ ├── Benefits.rst │ │ ├── Resources │ │ │ └── TBB-128x128.gif │ │ ├── help_support.rst │ │ ├── intro_os.rst │ │ ├── limitations.rst │ │ ├── notation.rst │ │ └── testing_approach.rst │ ├── reference │ │ ├── Resources │ │ │ ├── fg_api_graph_structure.png │ │ │ ├── make_edges_example.png │ │ │ └── make_edges_usage.png │ │ ├── blocked_nd_range_ctad.rst │ │ ├── concurrent_lru_cache_cls.rst │ │ ├── constructors_for_nodes.rst │ │ ├── custom_mutex_chmap.rst │ │ ├── examples │ │ │ ├── blocked_nd_range_ctad_example.cpp │ │ │ ├── custom_mutex_chmap_example.cpp │ │ │ ├── fixed_pool_example.cpp │ │ │ ├── helpers_for_expressing_graphs_preview_api_example.cpp │ │ │ ├── helpers_for_expressing_graphs_regular_api_example.cpp │ │ │ ├── make_edges_function_example.cpp │ │ │ ├── malloc_replacement_log_example.cpp │ │ │ ├── memory_pool_allocator_example.cpp │ │ │ ├── memory_pool_example.cpp │ │ │ ├── parallel_phase_example.cpp │ │ │ ├── parallel_sort_ranges_extension_example.cpp │ │ │ ├── rvalue_reduce.cpp │ │ │ └── try_put_and_wait_example.cpp │ │ ├── follows_and_precedes_functions.rst │ │ ├── helpers_for_expressing_graphs.rst │ │ ├── make_edges_function.rst │ │ ├── make_node_set_function.rst │ │ ├── parallel_for_each_semantics.rst │ │ ├── parallel_phase_for_task_arena.rst │ │ ├── parallel_sort_ranges_extension.rst │ │ ├── reference.rst │ │ ├── rvalue_reduce.rst │ │ ├── scalable_memory_pools.rst │ │ ├── scalable_memory_pools │ │ │ ├── fixed_pool_cls.rst │ │ │ ├── malloc_replacement_log.rst │ │ │ ├── memory_pool_allocator_cls.rst │ │ │ └── memory_pool_cls.rst │ │ ├── task_group_extensions.rst │ │ ├── try_put_and_wait.rst │ │ └── type_specified_message_keys.rst │ └── tbb_userguide │ │ ├── Advanced_Example.rst │ │ ├── Advanced_Topic_Other_Kinds_of_Iteration_Spaces.rst │ │ ├── Allocator_Configuration.rst │ │ ├── Automatic_Chunking.rst │ │ ├── Bandwidth_and_Cache_Affinity_os.rst │ │ ├── Basic_Flow_Graph_concepts.rst │ │ ├── Cancellation_Without_An_Exception.rst │ │ ├── Cancellation_and_Nested_Parallelism.rst │ │ ├── Concurrent_Queue_Classes.rst │ │ ├── Constraints.rst │ │ ├── Containers.rst │ │ ├── Controlling_Chunking_os.rst │ │ ├── Cook_Until_Done_parallel_do.rst │ │ ├── Data_Flow_Graph.rst │ │ ├── Debug_Versus_Release_Libraries.rst │ │ ├── Dependence_Graph.rst │ │ ├── Edges.rst │ │ ├── Exceptions_and_Cancellation.rst │ │ ├── Floating_Point_Settings.rst │ │ ├── Flow-Graph-exception-tips.rst │ │ ├── Flow-Graph-waiting-tips.rst │ │ ├── Flow_Graph.rst │ │ ├── Flow_Graph_Buffering_in_Nodes.rst │ │ ├── Flow_Graph_Message_Passing_Protocol.rst │ │ ├── Flow_Graph_Reservation.rst │ │ ├── Flow_Graph_Single_Vs_Broadcast.rst │ │ ├── Flow_Graph_Tips.rst │ │ ├── Flow_Graph_making_edges_tips.rst │ │ ├── Flow_Graph_nested_parallelism_tips.rst │ │ ├── Flow_Graph_resource_tips.rst │ │ ├── Graph_Main_Categories.rst │ │ ├── Graph_Object.rst │ │ ├── Guiding_Task_Scheduler_Execution.rst │ │ ├── How_Task_Scheduler_Works.rst │ │ ├── Images │ │ ├── dependence_graph.jpg │ │ ├── execution_timeline2node.jpg │ │ ├── execution_timeline_dependence.jpg │ │ ├── flow_graph.jpg │ │ ├── flow_graph_complex.jpg │ │ ├── flow_graph_message_passing_protocol.jpg │ │ ├── flow_graph_reserve_buffers_1.png │ │ ├── flow_graph_reserve_buffers_2.png │ │ ├── flow_graph_reserve_buffers_3.png │ │ ├── flow_graph_reserve_buffers_4.png │ │ ├── flow_graph_reserve_buffers_5.png │ │ ├── flow_graph_reserve_buffers_6.png │ │ ├── flow_graph_reserve_buffers_7.png │ │ ├── image002.jpg │ │ ├── image004.jpg │ │ ├── image006.jpg │ │ ├── image007.jpg │ │ ├── image008.jpg │ │ ├── image009.jpg │ │ ├── image010.jpg │ │ ├── image011.jpg │ │ ├── image012.jpg │ │ └── image013.jpg │ │ ├── Initializing_and_Terminating_the_Library.rst │ │ ├── Iterating_Over_a_Concurrent_Queue_for_Debugging.rst │ │ ├── Lambda_Expressions.rst │ │ ├── Linux_C_Dynamic_Memory_Interface_Replacement.rst │ │ ├── Linux_OS.rst │ │ ├── Lock_Pathologies.rst │ │ ├── Mac_OS.rst │ │ ├── Mapping_Nodes2Tasks.rst │ │ ├── Memory_Allocation.rst │ │ ├── Migration_Guide.rst │ │ ├── Migration_Guide │ │ ├── Mixing_Two_Runtimes.rst │ │ ├── Task_API.rst │ │ └── Task_Scheduler_Init.rst │ │ ├── More_on_HashCompare.rst │ │ ├── Mutex_Flavors.rst │ │ ├── Mutual_Exclusion.rst │ │ ├── Nodes.rst │ │ ├── Non-Linear_Pipelines.rst │ │ ├── Package_Contents_os.rst │ │ ├── Parallelizing_Complex_Loops.rst │ │ ├── Parallelizing_Flow_Graph.rst │ │ ├── Parallelizing_Simple_Loops_os.rst │ │ ├── Parallelizing_Simple_Loops_toctree.rst │ │ ├── Partitioner_Summary.rst │ │ ├── Predefined_Node_Types.rst │ │ ├── Reader_Writer_Mutexes.rst │ │ ├── References.rst │ │ ├── Scalable_Memory_Allocator.rst │ │ ├── Summary_of_Containers.rst │ │ ├── Summary_of_Loops_and_Pipelines.rst │ │ ├── Task-Based_Programming.rst │ │ ├── Task_Scheduler_Bypass.rst │ │ ├── The_Task_Scheduler.rst │ │ ├── Throughput_of_pipeline.rst │ │ ├── Timing.rst │ │ ├── UpgradeDowngrade.rst │ │ ├── Using_Circular_Buffers.rst │ │ ├── When_Not_to_Use_Queues.rst │ │ ├── When_Task-Based_Programming_Is_Inappropriate.rst │ │ ├── Which_Dynamic_Libraries_to_Use.rst │ │ ├── Windows_C_Dynamic_Memory_Interface_Replacement.rst │ │ ├── Windows_OS_ug.rst │ │ ├── Working_on_the_Assembly_Line_pipeline.rst │ │ ├── always_use_wait_for_all.rst │ │ ├── appendix_A.rst │ │ ├── appendix_B.rst │ │ ├── attach_flow_graph_to_arena.rst │ │ ├── automatically-replacing-malloc.rst │ │ ├── avoid_dynamic_node_removal.rst │ │ ├── avoiding_data_races.rst │ │ ├── broadcast_or_send.rst │ │ ├── cancel_a_graph.rst │ │ ├── cancelling_nested_parallelism.rst │ │ ├── catching_exceptions.rst │ │ ├── communicate_with_nodes.rst │ │ ├── concurrent_hash_map.rst │ │ ├── concurrent_vector_ug.rst │ │ ├── create_token_based_system.rst │ │ ├── design_patterns │ │ ├── Agglomeration.rst │ │ ├── Design_Patterns.rst │ │ ├── Divide_and_Conquer.rst │ │ ├── Elementwise.rst │ │ ├── Fenced_Data_Transfer.rst │ │ ├── GUI_Thread.rst │ │ ├── General_References.rst │ │ ├── Images │ │ │ ├── image002a.jpg │ │ │ ├── image003a.jpg │ │ │ ├── image004a.jpg │ │ │ ├── image005a.jpg │ │ │ ├── image006a.jpg │ │ │ ├── image007a.jpg │ │ │ ├── image008a.jpg │ │ │ └── image009a.jpg │ │ ├── Lazy_Initialization.rst │ │ ├── Local_Serializer.rst │ │ ├── Non-Preemptive_Priorities.rst │ │ ├── Odd-Even_Communication.rst │ │ ├── Reduction.rst │ │ ├── Reference_Counting.rst │ │ └── Wavefront.rst │ │ ├── destroy_graphs_outside_main_thread.rst │ │ ├── estimate_flow_graph_performance.rst │ │ ├── examples │ │ ├── blocked_nd_range_example.cpp │ │ ├── flow_graph_examples.cpp │ │ ├── parallel_for_lambda_example_1.cpp │ │ ├── parallel_for_lambda_example_2.cpp │ │ ├── parallel_for_os_example.cpp │ │ └── tbb_mixing_other_runtimes_example.cpp │ │ ├── parallel_for_os.rst │ │ ├── parallel_for_toctree.rst │ │ ├── parallel_reduce.rst │ │ ├── std_invoke.rst │ │ ├── title.rst │ │ ├── use_concurrency_limits.rst │ │ ├── use_graph_reset.rst │ │ ├── use_input_node.rst │ │ ├── use_limiter_node.rst │ │ ├── use_make_edge.rst │ │ ├── use_nested_algorithms.rst │ │ ├── use_nested_flow_graphs.rst │ │ └── work_isolation.rst ├── make.bat └── test_classification.dox ├── examples ├── .clang-format ├── CMakeLists.txt ├── README.md ├── common │ ├── cmake │ │ ├── common.cmake │ │ └── modules │ │ │ └── FindTBB.cmake │ ├── gui │ │ ├── CMakeLists.txt │ │ ├── convideo.cpp │ │ ├── d2dvideo.cpp │ │ ├── gdivideo.cpp │ │ ├── macvideo.cpp │ │ ├── video.hpp │ │ ├── winvideo.hpp │ │ ├── xcode │ │ │ └── tbbExample │ │ │ │ ├── OpenGLView.h │ │ │ │ ├── OpenGLView.m │ │ │ │ ├── PkgInfo │ │ │ │ ├── en.lproj │ │ │ │ ├── InfoPlist.strings │ │ │ │ ├── MainMenu.nib │ │ │ │ └── MainMenu.xib │ │ │ │ ├── iOS.storyboard │ │ │ │ ├── main.m │ │ │ │ ├── tbbAppDelegate.h │ │ │ │ ├── tbbAppDelegate.m │ │ │ │ ├── tbbExample-Info.ios.plist │ │ │ │ └── tbbExample-Info.plist │ │ └── xvideo.cpp │ └── utility │ │ ├── fast_random.hpp │ │ ├── get_default_num_threads.hpp │ │ ├── measurements.hpp │ │ └── utility.hpp ├── concurrent_hash_map │ ├── README.md │ └── count_strings │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── count_strings.cpp ├── concurrent_priority_queue │ ├── README.md │ └── shortpath │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── shortpath.cpp ├── getting_started │ ├── README.md │ └── sub_string_finder │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── sub_string_finder.cpp │ │ ├── sub_string_finder_extended.cpp │ │ └── sub_string_finder_pretty.cpp ├── graph │ ├── README.md │ ├── binpack │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── binpack.cpp │ ├── cholesky │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── cholesky.cpp │ │ └── init.cpp │ ├── dining_philosophers │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── dining_philosophers.cpp │ ├── fgbzip2 │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── blocksort.cpp │ │ ├── bzlib.cpp │ │ ├── bzlib.hpp │ │ ├── bzlib_private.hpp │ │ ├── compress.cpp │ │ ├── crctable.cpp │ │ ├── decompress.cpp │ │ ├── fgbzip2.cpp │ │ ├── huffman.cpp │ │ └── randtable.cpp │ ├── logic_sim │ │ ├── CMakeLists.txt │ │ ├── D_latch.hpp │ │ ├── README.md │ │ ├── basics.hpp │ │ ├── four_bit_adder.hpp │ │ ├── one_bit_adder.hpp │ │ ├── test_all.cpp │ │ └── two_bit_adder.hpp │ └── som │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── som.cpp │ │ ├── som.hpp │ │ └── som_graph.cpp ├── migration │ ├── README.md │ └── recursive_fibonacci │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── fibonacci.cpp │ │ ├── fibonacci_single_task.h │ │ ├── fibonacci_two_tasks.h │ │ └── task_emulation_layer.h ├── parallel_for │ ├── README.md │ ├── game_of_life │ │ ├── Board.hpp │ │ ├── CMakeLists.txt │ │ ├── Evolution.cpp │ │ ├── Evolution.hpp │ │ ├── Game_of_life.cpp │ │ ├── README.md │ │ └── Update_state.cpp │ ├── polygon_overlay │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── gui │ │ │ ├── polygon_overlay.rc │ │ │ └── resource.h │ │ ├── polymain.cpp │ │ ├── polymain.hpp │ │ ├── polyover.cpp │ │ ├── polyover.hpp │ │ ├── pover_global.hpp │ │ ├── pover_video.cpp │ │ ├── pover_video.hpp │ │ ├── rpolygon.hpp │ │ └── speedup.gif │ ├── seismic │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── gui │ │ │ ├── SeismicSimulation.ico │ │ │ ├── resource.h │ │ │ ├── seismic.rc │ │ │ └── small.ico │ │ ├── main.cpp │ │ ├── resource.hpp │ │ ├── seismic_video.cpp │ │ ├── seismic_video.hpp │ │ ├── universe.cpp │ │ └── universe.hpp │ └── tachyon │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── benchmark_tachyon_data.awk │ │ ├── dat │ │ ├── 820spheres.dat │ │ ├── balls.dat │ │ ├── balls3.dat │ │ ├── lattice.dat │ │ ├── model2.dat │ │ ├── teapot.dat │ │ └── trypsin4pti.dat │ │ ├── gui │ │ ├── gui.ico │ │ ├── resource.h │ │ ├── small.ico │ │ └── tachyon.rc │ │ └── src │ │ ├── api.cpp │ │ ├── api.hpp │ │ ├── apigeom.cpp │ │ ├── apitrigeom.cpp │ │ ├── apitrigeom.hpp │ │ ├── bndbox.cpp │ │ ├── bndbox.hpp │ │ ├── box.cpp │ │ ├── box.hpp │ │ ├── camera.cpp │ │ ├── camera.hpp │ │ ├── coordsys.cpp │ │ ├── coordsys.hpp │ │ ├── cylinder.cpp │ │ ├── cylinder.hpp │ │ ├── extvol.cpp │ │ ├── extvol.hpp │ │ ├── global.cpp │ │ ├── global.hpp │ │ ├── grid.cpp │ │ ├── grid.hpp │ │ ├── imageio.cpp │ │ ├── imageio.hpp │ │ ├── imap.cpp │ │ ├── imap.hpp │ │ ├── intersect.cpp │ │ ├── intersect.hpp │ │ ├── light.cpp │ │ ├── light.hpp │ │ ├── machine.hpp │ │ ├── macros.hpp │ │ ├── main.cpp │ │ ├── objbound.cpp │ │ ├── objbound.hpp │ │ ├── parse.cpp │ │ ├── parse.hpp │ │ ├── plane.cpp │ │ ├── plane.hpp │ │ ├── ppm.cpp │ │ ├── ppm.hpp │ │ ├── pthread.cpp │ │ ├── pthread_w.hpp │ │ ├── quadric.cpp │ │ ├── quadric.hpp │ │ ├── render.cpp │ │ ├── render.hpp │ │ ├── ring.cpp │ │ ├── ring.hpp │ │ ├── shade.cpp │ │ ├── shade.hpp │ │ ├── sphere.cpp │ │ ├── sphere.hpp │ │ ├── tachyon_video.cpp │ │ ├── tachyon_video.hpp │ │ ├── texture.cpp │ │ ├── texture.hpp │ │ ├── tgafile.cpp │ │ ├── tgafile.hpp │ │ ├── trace.hpp │ │ ├── trace.omp.cpp │ │ ├── trace.serial.cpp │ │ ├── trace.simple.cpp │ │ ├── trace.taskq.cpp │ │ ├── trace.tbb.cpp │ │ ├── trace.tbb1d.cpp │ │ ├── trace.threads.cpp │ │ ├── trace.threads2d.cpp │ │ ├── trace_rest.cpp │ │ ├── triangle.cpp │ │ ├── triangle.hpp │ │ ├── types.hpp │ │ ├── ui.cpp │ │ ├── ui.hpp │ │ ├── util.cpp │ │ ├── util.hpp │ │ ├── vector.cpp │ │ ├── vector.hpp │ │ ├── vol.cpp │ │ └── vol.hpp ├── parallel_for_each │ ├── README.md │ └── parallel_preorder │ │ ├── CMakeLists.txt │ │ ├── Graph.cpp │ │ ├── Graph.hpp │ │ ├── Matrix.hpp │ │ ├── README.md │ │ ├── main.cpp │ │ └── parallel_preorder.cpp ├── parallel_pipeline │ ├── README.md │ └── square │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── gen_input.cpp │ │ └── square.cpp ├── parallel_reduce │ ├── README.md │ ├── convex_hull │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── convex_hull.hpp │ │ ├── convex_hull_bench.cpp │ │ └── convex_hull_sample.cpp │ ├── pi │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── common.h │ │ ├── main.cpp │ │ └── pi.cpp │ └── primes │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── benchmark_primes_data.awk │ │ ├── main.cpp │ │ ├── primes.cpp │ │ └── primes.hpp ├── task_arena │ ├── README.md │ └── fractal │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── fractal.cpp │ │ ├── fractal.hpp │ │ ├── fractal_video.hpp │ │ ├── gui │ │ ├── fractal.rc │ │ ├── gui.ico │ │ ├── resource.h │ │ └── small.ico │ │ └── main.cpp ├── task_group │ ├── README.md │ └── sudoku │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── benchmark_sudoku_data.awk │ │ ├── input1 │ │ ├── input2 │ │ ├── input3 │ │ ├── input4 │ │ └── sudoku.cpp └── test_all │ ├── README.md │ └── fibonacci │ ├── CMakeLists.txt │ ├── README.md │ └── fibonacci.cpp ├── include ├── oneapi │ ├── tbb.h │ └── tbb │ │ ├── blocked_nd_range.h │ │ ├── blocked_range.h │ │ ├── blocked_range2d.h │ │ ├── blocked_range3d.h │ │ ├── cache_aligned_allocator.h │ │ ├── collaborative_call_once.h │ │ ├── combinable.h │ │ ├── concurrent_hash_map.h │ │ ├── concurrent_lru_cache.h │ │ ├── concurrent_map.h │ │ ├── concurrent_priority_queue.h │ │ ├── concurrent_queue.h │ │ ├── concurrent_set.h │ │ ├── concurrent_unordered_map.h │ │ ├── concurrent_unordered_set.h │ │ ├── concurrent_vector.h │ │ ├── detail │ │ ├── _aggregator.h │ │ ├── _aligned_space.h │ │ ├── _allocator_traits.h │ │ ├── _assert.h │ │ ├── _attach.h │ │ ├── _concurrent_queue_base.h │ │ ├── _concurrent_skip_list.h │ │ ├── _concurrent_unordered_base.h │ │ ├── _config.h │ │ ├── _containers_helpers.h │ │ ├── _exception.h │ │ ├── _export.h │ │ ├── _flow_graph_body_impl.h │ │ ├── _flow_graph_cache_impl.h │ │ ├── _flow_graph_impl.h │ │ ├── _flow_graph_indexer_impl.h │ │ ├── _flow_graph_item_buffer_impl.h │ │ ├── _flow_graph_join_impl.h │ │ ├── _flow_graph_node_impl.h │ │ ├── _flow_graph_node_set_impl.h │ │ ├── _flow_graph_nodes_deduction.h │ │ ├── _flow_graph_tagged_buffer_impl.h │ │ ├── _flow_graph_trace_impl.h │ │ ├── _flow_graph_types_impl.h │ │ ├── _hash_compare.h │ │ ├── _intrusive_list_node.h │ │ ├── _machine.h │ │ ├── _mutex_common.h │ │ ├── _namespace_injection.h │ │ ├── _node_handle.h │ │ ├── _pipeline_filters.h │ │ ├── _pipeline_filters_deduction.h │ │ ├── _range_common.h │ │ ├── _rtm_mutex.h │ │ ├── _rtm_rw_mutex.h │ │ ├── _scoped_lock.h │ │ ├── _segment_table.h │ │ ├── _small_object_pool.h │ │ ├── _string_resource.h │ │ ├── _task.h │ │ ├── _task_handle.h │ │ ├── _template_helpers.h │ │ ├── _utils.h │ │ └── _waitable_atomic.h │ │ ├── enumerable_thread_specific.h │ │ ├── flow_graph.h │ │ ├── flow_graph_abstractions.h │ │ ├── global_control.h │ │ ├── info.h │ │ ├── memory_pool.h │ │ ├── mutex.h │ │ ├── null_mutex.h │ │ ├── null_rw_mutex.h │ │ ├── parallel_for.h │ │ ├── parallel_for_each.h │ │ ├── parallel_invoke.h │ │ ├── parallel_pipeline.h │ │ ├── parallel_reduce.h │ │ ├── parallel_scan.h │ │ ├── parallel_sort.h │ │ ├── partitioner.h │ │ ├── profiling.h │ │ ├── queuing_mutex.h │ │ ├── queuing_rw_mutex.h │ │ ├── rw_mutex.h │ │ ├── scalable_allocator.h │ │ ├── spin_mutex.h │ │ ├── spin_rw_mutex.h │ │ ├── task.h │ │ ├── task_arena.h │ │ ├── task_group.h │ │ ├── task_scheduler_observer.h │ │ ├── tbb_allocator.h │ │ ├── tbbmalloc_proxy.h │ │ ├── tick_count.h │ │ └── version.h └── tbb │ ├── blocked_nd_range.h │ ├── blocked_range.h │ ├── blocked_range2d.h │ ├── blocked_range3d.h │ ├── cache_aligned_allocator.h │ ├── collaborative_call_once.h │ ├── combinable.h │ ├── concurrent_hash_map.h │ ├── concurrent_lru_cache.h │ ├── concurrent_map.h │ ├── concurrent_priority_queue.h │ ├── concurrent_queue.h │ ├── concurrent_set.h │ ├── concurrent_unordered_map.h │ ├── concurrent_unordered_set.h │ ├── concurrent_vector.h │ ├── enumerable_thread_specific.h │ ├── flow_graph.h │ ├── flow_graph_abstractions.h │ ├── global_control.h │ ├── info.h │ ├── memory_pool.h │ ├── mutex.h │ ├── null_mutex.h │ ├── null_rw_mutex.h │ ├── parallel_for.h │ ├── parallel_for_each.h │ ├── parallel_invoke.h │ ├── parallel_pipeline.h │ ├── parallel_reduce.h │ ├── parallel_scan.h │ ├── parallel_sort.h │ ├── partitioner.h │ ├── profiling.h │ ├── queuing_mutex.h │ ├── queuing_rw_mutex.h │ ├── rw_mutex.h │ ├── scalable_allocator.h │ ├── spin_mutex.h │ ├── spin_rw_mutex.h │ ├── task.h │ ├── task_arena.h │ ├── task_group.h │ ├── task_scheduler_observer.h │ ├── tbb.h │ ├── tbb_allocator.h │ ├── tbbmalloc_proxy.h │ ├── tick_count.h │ └── version.h ├── integration ├── cmake │ └── generate_vars.cmake ├── linux │ ├── env │ │ ├── vars.sh │ │ └── vars.sh.in │ ├── modulefiles │ │ ├── tbb │ │ └── tbb32 │ ├── oneapi │ │ └── vars.sh │ └── sys_check │ │ └── sys_check.sh ├── mac │ └── env │ │ ├── vars.sh │ │ └── vars.sh.in ├── pkg-config │ └── tbb.pc.in └── windows │ ├── env │ ├── vars.bat │ └── vars.bat.in │ ├── nuget │ ├── inteltbb.devel.win.targets │ └── inteltbb.redist.win.targets │ ├── oneapi │ └── vars.bat │ ├── sys_check │ └── sys_check.bat │ └── vs │ └── onetbb.natvis ├── python ├── CMakeLists.txt ├── README.md ├── TBB.py ├── rml │ ├── CMakeLists.txt │ ├── ipc_server.cpp │ ├── ipc_utils.cpp │ └── ipc_utils.h ├── setup.py └── tbb │ ├── __init__.py │ ├── __main__.py │ ├── api.i │ ├── pool.py │ └── test.py ├── rfcs ├── README.md ├── archived │ └── README.md ├── experimental │ ├── README.md │ ├── blocked_nd_range_ctad │ │ └── README.md │ ├── flow_graph_msg_keys │ │ ├── JoinGraph.png │ │ └── README.md │ ├── flow_graph_node_sets │ │ ├── README.md │ │ ├── graph_with_many_edges.png │ │ └── make_edges.png │ └── parallel_phase_for_task_arena │ │ ├── README.md │ │ ├── alternative_proposal.png │ │ ├── completely_disable_new_behavior.png │ │ ├── parallel_phase_introduction.png │ │ ├── parallel_phase_sequence_diagram.png │ │ ├── parallel_phase_state_final.png │ │ └── parallel_phase_state_initial.png ├── proposed │ ├── README.md │ ├── flow_graph_serializers │ │ ├── README.md │ │ ├── README.qmd │ │ ├── README_files │ │ │ └── figure-commonmark │ │ │ │ ├── fig-delay-distribution-1.png │ │ │ │ ├── fig-program-start-1.png │ │ │ │ ├── fig-program-start-after-first-1.png │ │ │ │ ├── fig-program-wind-down-1.png │ │ │ │ ├── fig-source-durations-1.png │ │ │ │ ├── fig-source-time-structure-by-message-1.png │ │ │ │ ├── fig-source-time-structure-by-start-1.png │ │ │ │ └── fig-thread-busy-1.png │ │ ├── analyzed-graph-with-limiters.gv │ │ ├── analyzed-graph-with-limiters.png │ │ ├── custom.scss │ │ ├── function-serialization.png │ │ ├── functions.R │ │ └── serial_fanout.tsv │ ├── loading-dependencies │ │ └── loading-dependencies-by-module-name.org │ ├── numa_support │ │ ├── README.md │ │ ├── create-numa-arenas.md │ │ └── tbbbind-link-static-hwloc.org │ ├── task_arena_waiting │ │ ├── readme.md │ │ └── task_group_interop.md │ └── task_group_dynamic_dependencies │ │ ├── README.md │ │ ├── add_dependency.png │ │ ├── merge_sort.png │ │ ├── three_task_graph.png │ │ └── unknown_states.png ├── supported │ └── README.md └── template.md ├── src ├── tbb │ ├── CMakeLists.txt │ ├── address_waiter.cpp │ ├── allocator.cpp │ ├── arena.cpp │ ├── arena.h │ ├── arena_slot.cpp │ ├── arena_slot.h │ ├── assert_impl.h │ ├── cancellation_disseminator.h │ ├── co_context.h │ ├── concurrent_bounded_queue.cpp │ ├── concurrent_monitor.h │ ├── concurrent_monitor_mutex.h │ ├── def │ │ ├── lin32-tbb.def │ │ ├── lin64-tbb.def │ │ ├── mac64-tbb.def │ │ ├── win32-tbb.def │ │ └── win64-tbb.def │ ├── dynamic_link.cpp │ ├── dynamic_link.h │ ├── environment.h │ ├── exception.cpp │ ├── global_control.cpp │ ├── governor.cpp │ ├── governor.h │ ├── intrusive_list.h │ ├── itt_notify.cpp │ ├── itt_notify.h │ ├── mailbox.h │ ├── main.cpp │ ├── main.h │ ├── market.cpp │ ├── market.h │ ├── misc.cpp │ ├── misc.h │ ├── misc_ex.cpp │ ├── observer_proxy.cpp │ ├── observer_proxy.h │ ├── parallel_pipeline.cpp │ ├── permit_manager.h │ ├── pm_client.h │ ├── private_server.cpp │ ├── profiling.cpp │ ├── queuing_rw_mutex.cpp │ ├── rml_base.h │ ├── rml_tbb.cpp │ ├── rml_tbb.h │ ├── rml_thread_monitor.h │ ├── rtm_mutex.cpp │ ├── rtm_rw_mutex.cpp │ ├── scheduler_common.h │ ├── semaphore.cpp │ ├── semaphore.h │ ├── small_object_pool.cpp │ ├── small_object_pool_impl.h │ ├── task.cpp │ ├── task_dispatcher.cpp │ ├── task_dispatcher.h │ ├── task_group_context.cpp │ ├── task_stream.h │ ├── tbb.rc │ ├── tcm.h │ ├── tcm_adaptor.cpp │ ├── tcm_adaptor.h │ ├── thread_control_monitor.h │ ├── thread_data.h │ ├── thread_dispatcher.cpp │ ├── thread_dispatcher.h │ ├── thread_dispatcher_client.h │ ├── thread_request_serializer.cpp │ ├── thread_request_serializer.h │ ├── threading_control.cpp │ ├── threading_control.h │ ├── threading_control_client.h │ ├── tls.h │ ├── tools_api │ │ ├── disable_warnings.h │ │ ├── ittnotify.h │ │ ├── ittnotify_config.h │ │ ├── ittnotify_static.c │ │ ├── ittnotify_static.h │ │ ├── ittnotify_types.h │ │ └── legacy │ │ │ └── ittnotify.h │ ├── version.cpp │ └── waiters.h ├── tbbbind │ ├── CMakeLists.txt │ ├── def │ │ ├── lin32-tbbbind.def │ │ ├── lin64-tbbbind.def │ │ ├── mac64-tbbbind.def │ │ ├── win32-tbbbind.def │ │ └── win64-tbbbind.def │ ├── tbb_bind.cpp │ └── tbb_bind.rc ├── tbbmalloc │ ├── CMakeLists.txt │ ├── Customize.h │ ├── MapMemory.h │ ├── Statistics.h │ ├── Synchronize.h │ ├── TypeDefinitions.h │ ├── backend.cpp │ ├── backend.h │ ├── backref.cpp │ ├── def │ │ ├── lin32-tbbmalloc.def │ │ ├── lin64-tbbmalloc.def │ │ ├── mac64-tbbmalloc.def │ │ ├── win32-tbbmalloc.def │ │ └── win64-tbbmalloc.def │ ├── frontend.cpp │ ├── large_objects.cpp │ ├── large_objects.h │ ├── shared_utils.h │ ├── tbbmalloc.cpp │ ├── tbbmalloc.rc │ ├── tbbmalloc_internal.h │ └── tbbmalloc_internal_api.h └── tbbmalloc_proxy │ ├── CMakeLists.txt │ ├── def │ ├── lin32-proxy.def │ └── lin64-proxy.def │ ├── function_replacement.cpp │ ├── function_replacement.h │ ├── proxy.cpp │ ├── proxy.h │ ├── proxy_overload_osx.h │ └── tbbmalloc_proxy.rc ├── test ├── CMakeLists.txt ├── common │ ├── allocator_overload.h │ ├── allocator_stl_test_common.h │ ├── allocator_test_common.h │ ├── checktype.h │ ├── common_arena_constraints.h │ ├── concepts_common.h │ ├── concurrency_tracker.h │ ├── concurrent_associative_common.h │ ├── concurrent_lru_cache_common.h │ ├── concurrent_ordered_common.h │ ├── concurrent_priority_queue_common.h │ ├── concurrent_unordered_common.h │ ├── config.h │ ├── container_move_support.h │ ├── containers_common.h │ ├── cpu_usertime.h │ ├── custom_allocators.h │ ├── doctest.h │ ├── dummy_body.h │ ├── exception_handling.h │ ├── fp_control.h │ ├── graph_utils.h │ ├── initializer_list_support.h │ ├── inject_scheduler.h │ ├── iterator.h │ ├── memory_usage.h │ ├── node_handling_support.h │ ├── parallel_for_each_common.h │ ├── parallel_invoke_common.h │ ├── parallel_reduce_common.h │ ├── range_based_for_support.h │ ├── rwm_upgrade_downgrade.h │ ├── spin_barrier.h │ ├── state_trackable.h │ ├── test.h │ ├── test_comparisons.h │ ├── test_follows_and_precedes_api.h │ ├── test_invoke.h │ ├── test_join_node_multiple_predecessors.h │ ├── tls_limit.h │ ├── utils.h │ ├── utils_assert.h │ ├── utils_concurrency_limit.h │ ├── utils_dynamic_libs.h │ ├── utils_env.h │ ├── utils_report.h │ ├── utils_yield.h │ └── vector_types.h ├── conformance │ ├── conformance_allocators.cpp │ ├── conformance_arena_constraints.cpp │ ├── conformance_async_node.cpp │ ├── conformance_blocked_nd_range.cpp │ ├── conformance_blocked_range.cpp │ ├── conformance_blocked_range2d.cpp │ ├── conformance_blocked_range3d.cpp │ ├── conformance_broadcast_node.cpp │ ├── conformance_buffer_node.cpp │ ├── conformance_collaborative_call_once.cpp │ ├── conformance_combinable.cpp │ ├── conformance_composite_node.cpp │ ├── conformance_concurrent_hash_map.cpp │ ├── conformance_concurrent_lru_cache.cpp │ ├── conformance_concurrent_map.cpp │ ├── conformance_concurrent_priority_queue.cpp │ ├── conformance_concurrent_queue.cpp │ ├── conformance_concurrent_set.cpp │ ├── conformance_concurrent_unordered_map.cpp │ ├── conformance_concurrent_unordered_set.cpp │ ├── conformance_concurrent_vector.cpp │ ├── conformance_continue_node.cpp │ ├── conformance_enumerable_thread_specific.cpp │ ├── conformance_flowgraph.h │ ├── conformance_function_node.cpp │ ├── conformance_global_control.cpp │ ├── conformance_graph.cpp │ ├── conformance_indexer_node.cpp │ ├── conformance_input_node.cpp │ ├── conformance_join_node.cpp │ ├── conformance_limiter_node.cpp │ ├── conformance_multifunction_node.cpp │ ├── conformance_mutex.cpp │ ├── conformance_mutex.h │ ├── conformance_overwrite_node.cpp │ ├── conformance_parallel_for.cpp │ ├── conformance_parallel_for_each.cpp │ ├── conformance_parallel_invoke.cpp │ ├── conformance_parallel_pipeline.cpp │ ├── conformance_parallel_reduce.cpp │ ├── conformance_parallel_scan.cpp │ ├── conformance_parallel_sort.cpp │ ├── conformance_priority_queue_node.cpp │ ├── conformance_queue_node.cpp │ ├── conformance_resumable_tasks.cpp │ ├── conformance_sequencer_node.cpp │ ├── conformance_split_node.cpp │ ├── conformance_task_arena.cpp │ ├── conformance_task_group.cpp │ ├── conformance_task_group_context.cpp │ ├── conformance_tick_count.cpp │ ├── conformance_version.cpp │ └── conformance_write_once_node.cpp ├── tbb │ ├── stub_unsigned_lib.cpp │ ├── test_allocators.cpp │ ├── test_arena_constraints.cpp │ ├── test_arena_priorities.cpp │ ├── test_async_node.cpp │ ├── test_blocked_range.cpp │ ├── test_broadcast_node.cpp │ ├── test_buffer_node.cpp │ ├── test_buffering_try_put_and_wait.h │ ├── test_collaborative_call_once.cpp │ ├── test_composite_node.cpp │ ├── test_concurrent_hash_map.cpp │ ├── test_concurrent_lru_cache.cpp │ ├── test_concurrent_map.cpp │ ├── test_concurrent_monitor.cpp │ ├── test_concurrent_priority_queue.cpp │ ├── test_concurrent_queue.cpp │ ├── test_concurrent_queue_whitebox.cpp │ ├── test_concurrent_set.cpp │ ├── test_concurrent_unordered_map.cpp │ ├── test_concurrent_unordered_set.cpp │ ├── test_concurrent_vector.cpp │ ├── test_continue_node.cpp │ ├── test_dynamic_link.cpp │ ├── test_eh_algorithms.cpp │ ├── test_eh_flow_graph.cpp │ ├── test_eh_thread.cpp │ ├── test_enumerable_thread_specific.cpp │ ├── test_environment_whitebox.cpp │ ├── test_flow_graph.cpp │ ├── test_flow_graph_priorities.cpp │ ├── test_flow_graph_whitebox.cpp │ ├── test_function_node.cpp │ ├── test_fuzzing.cpp │ ├── test_global_control.cpp │ ├── test_handle_perror.cpp │ ├── test_hw_concurrency.cpp │ ├── test_implicit_linkage_on_windows.cpp │ ├── test_indexer_node.cpp │ ├── test_input_node.cpp │ ├── test_intrusive_list.cpp │ ├── test_join_node.cpp │ ├── test_join_node.h │ ├── test_join_node_key_matching.cpp │ ├── test_join_node_key_matching_n_args.cpp │ ├── test_join_node_msg_key_matching.cpp │ ├── test_join_node_msg_key_matching_n_args.cpp │ ├── test_join_node_preview.cpp │ ├── test_limiter_node.cpp │ ├── test_multifunction_node.cpp │ ├── test_mutex.cpp │ ├── test_mutex.h │ ├── test_numa_dist.cpp │ ├── test_openmp.cpp │ ├── test_overwrite_node.cpp │ ├── test_parallel_for.cpp │ ├── test_parallel_for_each.cpp │ ├── test_parallel_invoke.cpp │ ├── test_parallel_phase.cpp │ ├── test_parallel_pipeline.cpp │ ├── test_parallel_reduce.cpp │ ├── test_parallel_scan.cpp │ ├── test_parallel_sort.cpp │ ├── test_partitioner.cpp │ ├── test_partitioner.h │ ├── test_priority_queue_node.cpp │ ├── test_profiling.cpp │ ├── test_queue_node.cpp │ ├── test_resumable_tasks.cpp │ ├── test_scheduler_mix.cpp │ ├── test_semaphore.cpp │ ├── test_sequencer_node.cpp │ ├── test_split_node.cpp │ ├── test_tagged_msg.cpp │ ├── test_task.cpp │ ├── test_task_arena.cpp │ ├── test_task_group.cpp │ ├── test_tbb_fork.cpp │ ├── test_tbb_header.cpp │ ├── test_tbb_header_secondary.cpp │ ├── test_tick_count.cpp │ └── test_write_once_node.cpp └── tbbmalloc │ ├── test_malloc_atexit.cpp │ ├── test_malloc_compliance.cpp │ ├── test_malloc_init_shutdown.cpp │ ├── test_malloc_lib_unload.cpp │ ├── test_malloc_new_handler.cpp │ ├── test_malloc_overload.cpp │ ├── test_malloc_overload_disable.cpp │ ├── test_malloc_pools.cpp │ ├── test_malloc_pure_c.c │ ├── test_malloc_regression.cpp │ ├── test_malloc_shutdown_hang.cpp │ ├── test_malloc_used_by_lib.cpp │ ├── test_malloc_whitebox.cpp │ └── test_scalable_allocator.cpp └── third-party-programs.txt /.bazelversion: -------------------------------------------------------------------------------- 1 | 8.1.1 2 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Lines starting with '#' are comments. 2 | # Each line is a file pattern followed by one or more owners. 3 | 4 | # More details are here: https://help.github.com/articles/about-codeowners/ 5 | 6 | src/tbbmalloc @ldorau @lplewa @kfilipek 7 | src/tbbmalloc_proxy @ldorau @lplewa @kfilipek 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/1_question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Ask a question 3 | about: Use this template for any questions 4 | title: '' 5 | labels: 'question' 6 | assignees: '' 7 | --- -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/2_bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Report a bug or a performance issue 3 | about: Use this template to report unexpected behavior 4 | title: '' 5 | labels: 'bug' 6 | assignees: '' 7 | --- 8 | 9 | # Summary 10 | Provide a short summary of the issue. 11 | See the sections below 12 | for factors important for the reproduction of an issue. 13 | 14 | # Version 15 | Report oneTBB version used to reproduce the problem. 16 | 17 | # Environment 18 | Provide any environmental details that you consider significant for reproducing the issue. 19 | The following information is important: 20 | * Hardware 21 | * OS name and version 22 | * Compiler version 23 | 24 | # Observed Behavior 25 | Document behavior you observe. 26 | 27 | # Expected Behavior 28 | Document behavior you expect. 29 | 30 | # Steps To Reproduce 31 | Check that the issue is reproducible with the latest revision 32 | of the master branch. Include all the steps to reproduce the issue. -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/3_feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Request a feature 3 | about: Use this template to request new functionality or change the behavior of the library 4 | title: '' 5 | labels: 'new feature' 6 | assignees: '' 7 | --- 8 | 9 | # Summary 10 | Include a short summary of the request. 11 | 12 | See the sections below 13 | for factors important for a feature request. 14 | 15 | # Problem Statement 16 | Describe the problem you want to solve with a reasonable level of detail. 17 | 18 | # Preferred Solution 19 | Provide your ideas regarding problem solutions. -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/4_documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Request a documentation change 3 | about: Use this template to report documentation issue or request documentation changes 4 | title: '' 5 | labels: 'documentation' 6 | assignees: '' 7 | --- 8 | 9 | # Summary 10 | Include a short summary of the issue or request. 11 | See the sections below 12 | for factors important for a documentation 13 | issue. 14 | 15 | # URLs 16 | Include pointers to documents that are impacted. 17 | 18 | # Additional Details 19 | Provide a detailed description of the expected changes in documentation 20 | and suggestions you have. -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | -------------------------------------------------------------------------------- /.github/issue_labeler.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 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 | # PR template regexp's for issue labeler 16 | bug fix: 17 | - '\[(x|X)\]\sbug\sfix' 18 | enhancement: 19 | - '\[(x|X)\]\snew\sfeature' 20 | tests: 21 | - '\[(x|X)\]\stests' 22 | infrastructure: 23 | - '\[(x|X)\]\sinfrastructure' 24 | documentation: 25 | - '\[(x|X)\]\sdocumentation' 26 | allocator: 27 | - '\[(x|X)\]\sallocator' -------------------------------------------------------------------------------- /.github/labeler.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023-2024 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 | allocator: 16 | - changed-files: 17 | - any-glob-to-any-file: ['src/tbbmalloc/**/*', 'src/tbbmalloc_proxy/**/*', 'test/tbbmalloc/**/*'] 18 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Description 2 | _Add a comprehensive description of proposed changes_ 3 | 4 | 5 | Fixes # - _issue number(s) if exists_ 6 | 7 | ### Type of change 8 | 9 | _Choose one or multiple, leave empty if none of the other choices apply_ 10 | 11 | _Add a respective label(s) to PR if you have permissions_ 12 | 13 | - [ ] bug fix - _change that fixes an issue_ 14 | - [ ] new feature - _change that adds functionality_ 15 | - [ ] tests - _change in tests_ 16 | - [ ] infrastructure - _change in infrastructure and CI_ 17 | - [ ] documentation - _documentation update_ 18 | 19 | ### Tests 20 | 21 | - [ ] added - _required for new features and some bug fixes_ 22 | - [ ] not needed 23 | 24 | ### Documentation 25 | 26 | - [ ] updated in # - _add PR number_ 27 | - [ ] needs to be updated 28 | - [ ] not needed 29 | 30 | ### Breaks backward compatibility 31 | - [ ] Yes 32 | - [ ] No 33 | - [ ] Unknown 34 | 35 | ### Notify the following users 36 | _List users with `@` to send notifications_ 37 | 38 | ### Other information 39 | -------------------------------------------------------------------------------- /.github/workflows/issue_labeler.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023-2024 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 | name: "Issue Labeler" 16 | on: 17 | issues: 18 | types: [opened, edited] 19 | pull_request: 20 | types: [opened, edited] 21 | 22 | permissions: read-all 23 | 24 | jobs: 25 | triage: 26 | runs-on: ubuntu-latest 27 | permissions: 28 | pull-requests: write 29 | issues: write 30 | contents: read 31 | steps: 32 | - uses: github/issue-labeler@v3.4 #May not be the latest version 33 | with: 34 | repo-token: "${{ secrets.GITHUB_TOKEN }}" 35 | configuration-path: .github/issue_labeler.yml 36 | enable-versioned-regex: 0 37 | -------------------------------------------------------------------------------- /.github/workflows/labeler.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023-2024 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 | name: "Pull Request Labeler" 15 | on: 16 | - pull_request_target 17 | 18 | permissions: read-all 19 | 20 | jobs: 21 | triage: 22 | permissions: 23 | contents: read 24 | pull-requests: write 25 | runs-on: ubuntu-latest 26 | steps: 27 | - uses: actions/checkout@v4 28 | - uses: actions/labeler@v5 29 | with: 30 | configuration-path: .github/labeler.yml 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # -------- C++ -------- 2 | # Prerequisites 3 | *.d 4 | 5 | # Compiled Object files 6 | *.slo 7 | *.lo 8 | *.o 9 | *.obj 10 | 11 | # Precompiled Headers 12 | *.gch 13 | *.pch 14 | 15 | # Compiled Dynamic libraries 16 | *.so 17 | *.so.* 18 | *.dylib 19 | *.dll 20 | 21 | # Fortran module files 22 | *.mod 23 | *.smod 24 | 25 | # Compiled Static libraries 26 | *.lai 27 | *.la 28 | *.a 29 | *.lib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | 36 | # -------- CMake -------- 37 | CMakeCache.txt 38 | CMakeFiles 39 | CMakeScripts 40 | Testing 41 | Makefile 42 | cmake_install.cmake 43 | install_manifest.txt 44 | compile_commands.json 45 | CTestTestfile.cmake 46 | build/* 47 | 48 | # -------- Python -------- 49 | __pycache__/ 50 | *.py[cod] 51 | *$py.class 52 | 53 | # -------- IDE -------- 54 | .vscode/* 55 | .vs/* 56 | out/* 57 | CMakeSettings.json 58 | 59 | # -------- CTags -------- 60 | .tags 61 | .ctags 62 | 63 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Where component owners are known, add them here. 2 | 3 | /oneTBB/src/tbb/ @pavelkumbrasev 4 | /oneTBB/src/tbb/ @dnmokhov 5 | /oneTBB/src/tbb/ @sarathnandu 6 | /oneTBB/include/oneapi/tbb/parallel_* @pavelkumbrasev 7 | /oneTBB/include/oneapi/tbb/concurrent_* @kboyarinov 8 | /oneTBB/include/oneapi/tbb/flow_graph* @kboyarinov 9 | /oneTBB/include/oneapi/tbb/flow_graph* @aleksei-fedotov 10 | /oneTBB/include/oneapi/tbb/detail/_flow_graph* @kboyarinov 11 | /oneTBB/include/oneapi/tbb/detail/_flow_graph* @aleksei-fedotov 12 | /oneTBB/include/oneapi/tbb/detail/_concurrent* @kboyarinov 13 | /oneTBB/src/doc @aepanchi 14 | /oneTBB/src/tbbbind/ @isaevil 15 | /oneTBB/src/tbbmalloc/ @lplewa 16 | /oneTBB/src/tbbmalloc_proxy/ @lplewa 17 | /oneTBB/cmake/ @isaevil 18 | /oneTBB/*CMakeLists.txt @isaevil 19 | /oneTBB/python/ @sarathnandu 20 | /oneTBB/python/ @isaevil 21 | 22 | # Bazel build related files. 23 | /oneTBB/.bazelversion @Vertexwahn 24 | /oneTBB/Bazel.md @Vertexwahn 25 | /oneTBB/BUILD.bazel @Vertexwahn 26 | /oneTBB/MODULE.bazel @Vertexwahn 27 | -------------------------------------------------------------------------------- /MODULE.bazel: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021-2025 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 | # DISCLAIMER: Bazel support is community-based. The maintainers do not 16 | # use Bazel internally. The Bazel build can have security risks or 17 | # optimization gaps. 18 | 19 | module( 20 | name = "onetbb", 21 | compatibility_level = 1, 22 | ) 23 | 24 | bazel_dep(name = "platforms", version = "0.0.11") 25 | bazel_dep(name = "rules_cc", version = "0.1.1") 26 | bazel_dep(name = "rules_license", version = "1.0.0") 27 | -------------------------------------------------------------------------------- /WORKSPACE.bazel: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021-2025 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 | # DISCLAIMER: Bazel support is community-based. The maintainers do not 16 | # use Bazel internally. The Bazel build can have security risks or 17 | # optimization gaps. 18 | 19 | # WORKSPACE marker file needed by Bazel 20 | -------------------------------------------------------------------------------- /cmake/android/device_environment_cleanup.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020-2021 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 | include(${CMAKE_CURRENT_LIST_DIR}/environment.cmake) 16 | 17 | execute_on_device("rm -rf ${ANDROID_DEVICE_TESTING_DIRECTORY}") 18 | -------------------------------------------------------------------------------- /cmake/android/test_launcher.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020-2021 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 | include(${CMAKE_CURRENT_LIST_DIR}/environment.cmake) 16 | 17 | # transfer data to device 18 | execute_on_device("mkdir -m 755 -p ${ANDROID_DEVICE_TESTING_DIRECTORY}") 19 | 20 | file (GLOB_RECURSE BINARIES_LIST "${BINARIES_PATH}/*.so*" "${BINARIES_PATH}/${TEST_NAME}") 21 | foreach(BINARY_FILE ${BINARIES_LIST}) 22 | transfer_data(${BINARY_FILE}) 23 | endforeach() 24 | 25 | # execute binary 26 | execute_on_device("chmod -R 755 ${ANDROID_DEVICE_TESTING_DIRECTORY}") 27 | execute_on_device("LD_LIBRARY_PATH=${ANDROID_DEVICE_TESTING_DIRECTORY} ${ANDROID_DEVICE_TESTING_DIRECTORY}/${TEST_NAME}") 28 | -------------------------------------------------------------------------------- /cmake/compilers/IntelLLVM.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020-2024 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 | if (WIN32) 16 | include(${CMAKE_CURRENT_LIST_DIR}/MSVC.cmake) 17 | set(TBB_OPENMP_FLAG /Qopenmp) 18 | set(TBB_IPO_COMPILE_FLAGS $<$>:/Qipo>) 19 | set(TBB_IPO_LINK_FLAGS $<$>:/INCREMENTAL:NO>) 20 | else() 21 | include(${CMAKE_CURRENT_LIST_DIR}/Clang.cmake) 22 | set(TBB_IPO_COMPILE_FLAGS $<$>:-ipo>) 23 | # "--exclude-libs,ALL" is used to avoid accidental exporting of symbols 24 | # from statically linked libraries 25 | set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -static-intel -Wl,--exclude-libs,ALL) 26 | set(TBB_OPENMP_FLAG -qopenmp) 27 | endif() 28 | set(TBB_IPO_LINK_FLAGS ${TBB_IPO_LINK_FLAGS} ${TBB_IPO_COMPILE_FLAGS}) 29 | -------------------------------------------------------------------------------- /cmake/compilers/QCC.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021 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 | include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/compilers/GNU.cmake) 16 | 17 | # Remove dl library not present in QNX systems 18 | unset(TBB_COMMON_LINK_LIBS) 19 | -------------------------------------------------------------------------------- /cmake/packaging.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020-2023 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 | # Note: current implementation uses CMAKE_BUILD_TYPE, 16 | # this parameter is not defined for multi-config generators. 17 | set(CPACK_PACKAGE_NAME "${PROJECT_NAME}") 18 | set(CPACK_PACKAGE_VERSION "${TBB_VERSION}") 19 | string(TOLOWER ${CPACK_PACKAGE_NAME}-${PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}_${TBB_OUTPUT_DIR_BASE}_${CMAKE_BUILD_TYPE} CPACK_PACKAGE_FILE_NAME) 20 | set(CPACK_GENERATOR ZIP) 21 | # Note: this is an internal non-documented variable set by CPack 22 | if (NOT CPack_CMake_INCLUDED) 23 | include(CPack) 24 | endif() 25 | -------------------------------------------------------------------------------- /cmake/post_install/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020-2021 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 | # Add code signing as post-install step. 16 | if (DEFINED TBB_SIGNTOOL) 17 | file(TO_CMAKE_PATH "${TBB_SIGNTOOL}" TBB_SIGNTOOL) 18 | install(CODE " 19 | file(GLOB_RECURSE FILES_TO_SIGN \${CMAKE_INSTALL_PREFIX}/*${CMAKE_SHARED_LIBRARY_SUFFIX}) 20 | execute_process(COMMAND ${TBB_SIGNTOOL} \${FILES_TO_SIGN} ${TBB_SIGNTOOL_ARGS}) 21 | ") 22 | endif() 23 | -------------------------------------------------------------------------------- /cmake/resumable_tasks.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 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 | include(CheckSymbolExists) 16 | 17 | if (UNIX) 18 | set(CMAKE_REQUIRED_FLAGS -Wno-deprecated-declarations) 19 | if (APPLE) 20 | set(CMAKE_REQUIRED_DEFINITIONS -D_XOPEN_SOURCE) 21 | endif() 22 | 23 | check_symbol_exists("getcontext" "ucontext.h" _tbb_have_ucontext) 24 | if (NOT _tbb_have_ucontext) 25 | set(TBB_RESUMABLE_TASKS_USE_THREADS "__TBB_RESUMABLE_TASKS_USE_THREADS=1") 26 | endif() 27 | 28 | unset(_tbb_have_ucontext) 29 | unset(CMAKE_REQUIRED_DEFINITIONS) 30 | unset(CMAKE_REQUIRED_FLAGS) 31 | endif() 32 | -------------------------------------------------------------------------------- /cmake/suppressions/lsan.suppressions: -------------------------------------------------------------------------------- 1 | # LSAN suppression for ltdl library known issue. 2 | leak:libltdl.so 3 | -------------------------------------------------------------------------------- /cmake/suppressions/tsan.suppressions: -------------------------------------------------------------------------------- 1 | # TSAN suppression for known issues. 2 | # Possible data race during ittnotify initialization. Low impact. 3 | race:__itt_nullify_all_pointers 4 | race:__itt_init_ittlib 5 | -------------------------------------------------------------------------------- /cmake/templates/TBBConfigVersion.cmake.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-2021 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 | -------------------------------------------------------------------------------- /cmake/test_spec.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020-2021 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 | option(TBB_TEST_SPEC "Generate test specification (Doxygen)" OFF) 16 | 17 | if (TBB_TEST_SPEC) 18 | find_package(Doxygen REQUIRED) 19 | 20 | set(DOXYGEN_PREDEFINED_MACROS 21 | "TBB_USE_EXCEPTIONS \ 22 | __TBB_RESUMABLE_TASKS \ 23 | __TBB_HWLOC_PRESENT \ 24 | __TBB_CPP17_DEDUCTION_GUIDES_PRESENT \ 25 | __TBB_CPP17_MEMORY_RESOURCE_PRESENT \ 26 | __TBB_CPP14_GENERIC_LAMBDAS_PRESENT" 27 | ) 28 | 29 | add_custom_target( 30 | test_spec ALL 31 | COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile 32 | COMMENT "Generating test specification with Doxygen" 33 | VERBATIM) 34 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) 35 | endif() 36 | -------------------------------------------------------------------------------- /doc/GSG/Images/how-oneTBB-works.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/GSG/Images/how-oneTBB-works.png -------------------------------------------------------------------------------- /doc/GSG/get_started.rst: -------------------------------------------------------------------------------- 1 | .. _Get_Started_Guide: 2 | 3 | Get Started with |full_name| 4 | ============================= 5 | 6 | .. include:: /GSG/intro_gsg.rst 7 | 8 | To start using oneTBB, follow the next steps: 9 | ********************************************* 10 | 11 | #. See the :ref:`System Requirements`. 12 | #. :ref:`Install oneTBB`. 13 | #. Run your program using oneTBB following the :ref:`Next Steps `. 14 | #. Learn how to :ref:`Integrate oneTBB into your project ` using CMake* and pkg-config tool. 15 | #. See :ref:`oneTBB Samples `. 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/GSG/installation.rst: -------------------------------------------------------------------------------- 1 | .. _installation: 2 | 3 | Installation 4 | ============ 5 | 6 | See the `installation instructions `_ 7 | that will help you to install |short_name| successfully. -------------------------------------------------------------------------------- /doc/GSG/system_requirements.rst: -------------------------------------------------------------------------------- 1 | .. _System_Requirements: 2 | 3 | System Requirements 4 | ******************* 5 | 6 | |full_name| supports a broad list of hardware platforms, operating systems, and compilers. 7 | For details, see `oneTBB System Requirements `_. -------------------------------------------------------------------------------- /doc/README.md: -------------------------------------------------------------------------------- 1 | # How to build oneTBB documentation 2 | 3 | Our documentation is written in restructured text markup (.rst) and built using [Sphinx](http://www.sphinx-doc.org/en/master/). 4 | 5 | This document explains how to build oneTBB documentation locally. 6 | 7 | ## Prerequisites 8 | - Python 3.7.0 or higher 9 | - Sphinx 10 | 11 | ## Build documentation 12 | 13 | Do the following to generate HTML output of the documentation: 14 | 15 | 1. Clone oneTBB repository: 16 | 17 | ``` 18 | git clone https://github.com/uxlfoundation/oneTBB.git 19 | ``` 20 | 21 | 2. Go to the `doc` folder: 22 | 23 | ``` 24 | cd oneTBB/doc 25 | ``` 26 | 27 | 3. Run in the command line: 28 | 29 | ``` 30 | make html 31 | ``` 32 | 33 | 34 | That's it! Your built documentation is located in the ``build/html`` folder. 35 | -------------------------------------------------------------------------------- /doc/_static/favicons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/_static/favicons.png -------------------------------------------------------------------------------- /doc/_static/oneAPI-rgb-rev-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/_static/oneAPI-rgb-rev-100.png -------------------------------------------------------------------------------- /doc/_static/theme_overrides.css: -------------------------------------------------------------------------------- 1 | /* override table width restrictions */ 2 | @media screen and (min-width: 767px) { 3 | 4 | .wy-table-responsive table td { 5 | /* !important prevents the common CSS stylesheets from overriding 6 | this as on RTD they are loaded after this stylesheet */ 7 | white-space: normal !important; 8 | } 9 | 10 | .wy-table-responsive { 11 | overflow: visible !important; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /doc/index.rst: -------------------------------------------------------------------------------- 1 | |full_name| 2 | =========== 3 | 4 | .. include:: index/index_intro.rst 5 | 6 | 7 | The following are some important topics for the ``novice user``: 8 | 9 | * :ref:`Get_Started_Guide` gives you a brief explanation of what oneTBB is. 10 | * :ref:`Benefits` describes how |short_name| differs from typical threading packages. 11 | * :ref:`Package_Contents` describes dynamic library files and header files for Windows*, Linux*, and macOS* operating systems used in |short_name|. 12 | 13 | .. include:: index/useful_topics.rst 14 | 15 | .. include:: index/toctree.rst 16 | -------------------------------------------------------------------------------- /doc/index/index_intro.rst: -------------------------------------------------------------------------------- 1 | .. _index_intro: 2 | 3 | This document contains information about |short_name|. 4 | It is a flexible performance library that let you break computation into parallel running tasks. 5 | 6 | -------------------------------------------------------------------------------- /doc/index/toctree.rst: -------------------------------------------------------------------------------- 1 | .. _toctree: 2 | 3 | .. toctree:: 4 | :caption: About 5 | :hidden: 6 | :maxdepth: 1 7 | 8 | /main/intro/help_support 9 | /main/intro/notation 10 | /main/intro/intro_os 11 | /main/intro/Benefits 12 | /main/intro/testing_approach 13 | /main/intro/limitations.rst 14 | 15 | 16 | .. toctree:: 17 | :caption: Get Started 18 | :hidden: 19 | :maxdepth: 1 20 | 21 | /GSG/get_started 22 | /GSG/system_requirements 23 | /GSG/installation 24 | /GSG/next_steps 25 | /GSG/integrate 26 | /GSG/samples 27 | 28 | 29 | .. toctree:: 30 | :maxdepth: 3 31 | :hidden: 32 | :caption: Developer Guide 33 | 34 | /main/tbb_userguide/title 35 | 36 | 37 | .. toctree:: 38 | :maxdepth: 3 39 | :hidden: 40 | :caption: Developer Reference 41 | 42 | /main/reference/reference 43 | -------------------------------------------------------------------------------- /doc/index/useful_topics.rst: -------------------------------------------------------------------------------- 1 | .. _Usefull_Topics: 2 | 3 | The following is an important topic for the ``experienced user``: 4 | 5 | :ref:`Migration_Guide` describes how to migrate from TBB to oneTBB. -------------------------------------------------------------------------------- /doc/main/_templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | {% block extrahead %} 3 | 4 | 15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /doc/main/intro/Resources/TBB-128x128.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/intro/Resources/TBB-128x128.gif -------------------------------------------------------------------------------- /doc/main/intro/help_support.rst: -------------------------------------------------------------------------------- 1 | .. _help_support: 2 | 3 | Getting Help and Support 4 | ======================== 5 | 6 | 7 | .. container:: section 8 | 9 | 10 | .. rubric:: Getting Technical Support 11 | :class: sectiontitle 12 | 13 | For general information about |short_name| technical support, product 14 | updates, user forums, FAQs, tips and tricks and other support 15 | questions, see `oneTBB Support `_. 16 | -------------------------------------------------------------------------------- /doc/main/intro/intro_os.rst: -------------------------------------------------------------------------------- 1 | .. _intro: 2 | 3 | Introduction 4 | ============ 5 | 6 | 7 | |full_name| is a library that supports scalable parallel programming using 8 | standard ISO C++ code. It does not require special languages or 9 | compilers. It is designed to promote scalable data parallel programming. 10 | Additionally, it fully supports nested parallelism, so you can build 11 | larger parallel components from smaller parallel components. To use the 12 | library, you specify tasks, not threads, and let the library map tasks 13 | onto threads in an efficient manner. 14 | 15 | 16 | Many of the library interfaces employ generic programming, in which 17 | interfaces are defined by requirements on types and not specific types. 18 | The C++ Standard Template Library (STL) is an example of generic 19 | programming. Generic programming enables oneTBB to be flexible yet 20 | efficient. The generic interfaces enable you to customize components to 21 | your specific needs. 22 | 23 | 24 | .. note:: 25 | |full_name| requires C++11 standard compiler support. 26 | 27 | 28 | The net result is that oneTBB enables you to specify parallelism far 29 | more conveniently than using raw threads, and at the same time can 30 | improve performance. 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /doc/main/reference/Resources/fg_api_graph_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/reference/Resources/fg_api_graph_structure.png -------------------------------------------------------------------------------- /doc/main/reference/Resources/make_edges_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/reference/Resources/make_edges_example.png -------------------------------------------------------------------------------- /doc/main/reference/Resources/make_edges_usage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/reference/Resources/make_edges_usage.png -------------------------------------------------------------------------------- /doc/main/reference/examples/fixed_pool_example.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 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 | /*begin_fixed_pool_example*/ 18 | #define TBB_PREVIEW_MEMORY_POOL 1 19 | #include "oneapi/tbb/memory_pool.h" 20 | 21 | int main() { 22 | char buf[1024]; 23 | oneapi::tbb::fixed_pool my_pool(buf, 1024); 24 | 25 | void* my_ptr = my_pool.malloc(10); 26 | my_pool.free(my_ptr); 27 | } 28 | /*end_fixed_pool_example*/ 29 | -------------------------------------------------------------------------------- /doc/main/reference/examples/malloc_replacement_log_example.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 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 _WIN32 18 | 19 | /*begin_malloc_replacement_log_example*/ 20 | #include "oneapi/tbb/tbbmalloc_proxy.h" 21 | #include 22 | 23 | int main(){ 24 | char **func_replacement_log; 25 | int func_replacement_status = TBB_malloc_replacement_log(&func_replacement_log); 26 | 27 | if (func_replacement_status != 0) { 28 | printf("tbbmalloc_proxy cannot replace memory allocation routines\n"); 29 | for (char** log_string = func_replacement_log; *log_string != 0; log_string++) { 30 | printf("%s\n",*log_string); 31 | } 32 | } 33 | 34 | return 0; 35 | } 36 | /*end_malloc_replacement_log_example*/ 37 | 38 | #else 39 | // Skip 40 | int main() {} 41 | #endif 42 | -------------------------------------------------------------------------------- /doc/main/reference/examples/memory_pool_allocator_example.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 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 | /*begin_memory_pool_allocator_example*/ 18 | #define TBB_PREVIEW_MEMORY_POOL 1 19 | #include "oneapi/tbb/memory_pool.h" 20 | #include 21 | 22 | int main() { 23 | oneapi::tbb::memory_pool> my_pool; 24 | 25 | typedef oneapi::tbb::memory_pool_allocator pool_allocator_t; 26 | std::list my_list(pool_allocator_t{my_pool}); 27 | 28 | my_list.emplace_back(1); 29 | } 30 | /*end_memory_pool_allocator_example*/ 31 | -------------------------------------------------------------------------------- /doc/main/reference/examples/memory_pool_example.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 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 | /*begin_memory_pool_example*/ 18 | #define TBB_PREVIEW_MEMORY_POOL 1 19 | #include "oneapi/tbb/memory_pool.h" 20 | 21 | int main() { 22 | oneapi::tbb::memory_pool> my_pool; 23 | 24 | void* my_ptr = my_pool.malloc(10); 25 | my_pool.free(my_ptr); 26 | } 27 | /*end_memory_pool_example*/ 28 | -------------------------------------------------------------------------------- /doc/main/reference/examples/parallel_sort_ranges_extension_example.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 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 __cplusplus >= 202002L 18 | 19 | /*begin_parallel_sort_ranges_extension_example*/ 20 | #include 21 | #include // requires C++20 22 | #include 23 | 24 | std::span get_span() { 25 | static std::array arr = {3, 2, 1}; 26 | return std::span(arr); 27 | } 28 | 29 | int main() { 30 | tbb::parallel_sort(get_span()); 31 | } 32 | /*end_parallel_sort_ranges_extension_example*/ 33 | 34 | #else 35 | // Skip 36 | int main() {} 37 | #endif 38 | -------------------------------------------------------------------------------- /doc/main/reference/make_node_set_function.rst: -------------------------------------------------------------------------------- 1 | .. _make_node_set: 2 | 3 | ``make_node_set`` function template 4 | =================================== 5 | 6 | .. note:: 7 | To enable this feature, define the ``TBB_PREVIEW_FLOW_GRAPH_FEATURES`` macro to 1. 8 | 9 | .. contents:: 10 | :local: 11 | :depth: 1 12 | 13 | Description 14 | *********** 15 | 16 | The ``make_node_set`` function template creates a set of nodes that 17 | can be passed as arguments to ``make_edges``, ``follows`` and ``precedes`` functions. 18 | 19 | API 20 | *** 21 | 22 | Header 23 | ------ 24 | 25 | .. code:: cpp 26 | 27 | #include 28 | 29 | Syntax 30 | ------ 31 | 32 | .. code:: cpp 33 | 34 | template 35 | /*unspecified*/ make_node_set( Node& node, Nodes&... nodes ); 36 | 37 | See Also 38 | ******** 39 | 40 | :ref:`make_edges` 41 | 42 | :ref:`follows_precedes` -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Automatic_Chunking.rst: -------------------------------------------------------------------------------- 1 | .. _Automatic_Chunking: 2 | 3 | Automatic Chunking 4 | ================== 5 | 6 | 7 | A parallel loop construct incurs overhead cost for every chunk of work 8 | that it schedules. |full_name| 9 | chooses chunk sizes automatically, depending upon load balancing 10 | needs. The heuristic attempts to limit overheads while 11 | still providing ample opportunities for load balancing. 12 | 13 | 14 | .. CAUTION:: 15 | Typically a loop needs to take at least a million clock cycles to 16 | make it worth using ``parallel_for``. For example, a loop that takes 17 | at least 500 microseconds on a 2 GHz processor might benefit from 18 | ``parallel_for``. 19 | 20 | 21 | The default automatic chunking is recommended for most uses. As with 22 | most heuristics, however, there are situations where controlling the 23 | chunk size more precisely might yield better performance. 24 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Basic_Flow_Graph_concepts.rst: -------------------------------------------------------------------------------- 1 | .. _Basic_Flow_Graph_concepts: 2 | 3 | Basic Flow Graph Concepts 4 | ========================= 5 | 6 | .. toctree:: 7 | :maxdepth: 4 8 | 9 | ../tbb_userguide/Graph_Object 10 | ../tbb_userguide/Nodes 11 | ../tbb_userguide/Edges 12 | ../tbb_userguide/Mapping_Nodes2Tasks 13 | ../tbb_userguide/Flow_Graph_Message_Passing_Protocol 14 | ../tbb_userguide/Flow_Graph_Single_Vs_Broadcast 15 | ../tbb_userguide/Flow_Graph_Buffering_in_Nodes 16 | ../tbb_userguide/Flow_Graph_Reservation -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Constraints.rst: -------------------------------------------------------------------------------- 1 | .. _Constraints: 2 | 3 | Constrained APIs 4 | ================ 5 | 6 | Starting from C++20, most of |full_name| APIs are constrained to 7 | enforce `named requirements `_ on 8 | template arguments types. 9 | 10 | The violations of these requirements are detected at a compile time during the template instantiation. 11 | 12 | .. rubric:: Example 13 | 14 | .. code:: cpp 15 | 16 | // Call for body(oneapi::tbb::blocked_range) is ill-formed 17 | // oneapi::tbb::parallel_for call results in constraint failure 18 | auto body = [](const int& r) { /*...*/ }; 19 | oneapi::tbb::parallel_for(oneapi::tbb::blocked_range{1, 10}, body); 20 | 21 | // Error example: 22 | // error: no matching function to call to oneapi::tbb::parallel_for 23 | // note: constraints not satisfied 24 | // note: the required expression 'body(range)' is invalid 25 | body(range); 26 | 27 | .. caution:: 28 | 29 | The code that violates named requirements but compiles successfully until C++20, 30 | may not compile in C++20 mode due to early and strict constraints diagnostics. 31 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Flow-Graph-exception-tips.rst: -------------------------------------------------------------------------------- 1 | .. _Flow_Graph_exception_tips: 2 | 3 | Flow Graph Tips for Exception Handling and Cancellation 4 | ======================================================= 5 | 6 | 7 | The execution of a flow graph can be canceled directly or as a result of 8 | an exception that propagates beyond a node's body. You can then 9 | optionally reset the graph so that it can be re-executed. 10 | 11 | .. toctree:: 12 | :maxdepth: 4 13 | 14 | ../tbb_userguide/catching_exceptions 15 | ../tbb_userguide/cancel_a_graph 16 | ../tbb_userguide/use_graph_reset 17 | ../tbb_userguide/cancelling_nested_parallelism 18 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Flow-Graph-waiting-tips.rst: -------------------------------------------------------------------------------- 1 | .. _Flow_Graph_waiting_tips: 2 | 3 | Flow Graph Tips for Waiting for and Destroying a Flow Graph 4 | =========================================================== 5 | 6 | .. toctree:: 7 | :maxdepth: 4 8 | 9 | ../tbb_userguide/always_use_wait_for_all 10 | ../tbb_userguide/avoid_dynamic_node_removal 11 | ../tbb_userguide/destroy_graphs_outside_main_thread 12 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Flow_Graph.rst: -------------------------------------------------------------------------------- 1 | .. _Flow_Graph: 2 | 3 | Parallelizing Data Flow and Dependence Graphs 4 | ============================================= 5 | 6 | .. toctree:: 7 | :maxdepth: 4 8 | 9 | ../tbb_userguide/Parallelizing_Flow_Graph 10 | ../tbb_userguide/Basic_Flow_Graph_concepts 11 | ../tbb_userguide/Graph_Main_Categories 12 | ../tbb_userguide/Predefined_Node_Types 13 | ../tbb_userguide/Flow_Graph_Tips 14 | ../tbb_userguide/estimate_flow_graph_performance 15 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Flow_Graph_Tips.rst: -------------------------------------------------------------------------------- 1 | .. _Flow_Graph_Tips: 2 | 3 | Flow Graph Tips and Tricks 4 | ========================== 5 | 6 | .. toctree:: 7 | :maxdepth: 4 8 | 9 | ../tbb_userguide/Flow-Graph-waiting-tips 10 | ../tbb_userguide/Flow_Graph_making_edges_tips 11 | ../tbb_userguide/Flow_Graph_nested_parallelism_tips 12 | ../tbb_userguide/Flow_Graph_resource_tips 13 | ../tbb_userguide/Flow-Graph-exception-tips -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Flow_Graph_making_edges_tips.rst: -------------------------------------------------------------------------------- 1 | .. _Flow_Graph_making_edges_tips: 2 | 3 | Flow Graph Tips on Making Edges 4 | =============================== 5 | 6 | .. toctree:: 7 | :maxdepth: 4 8 | 9 | ../tbb_userguide/use_make_edge 10 | ../tbb_userguide/broadcast_or_send 11 | ../tbb_userguide/communicate_with_nodes 12 | ../tbb_userguide/use_input_node 13 | ../tbb_userguide/avoiding_data_races 14 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Flow_Graph_nested_parallelism_tips.rst: -------------------------------------------------------------------------------- 1 | .. _Flow_Graph_nested_parallelism_tips: 2 | 3 | Flow Graph Tips on Nested Parallelism 4 | ===================================== 5 | 6 | .. toctree:: 7 | :maxdepth: 4 8 | 9 | ../tbb_userguide/use_nested_algorithms 10 | ../tbb_userguide/use_nested_flow_graphs -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Flow_Graph_resource_tips.rst: -------------------------------------------------------------------------------- 1 | .. _Flow_Graph_resource_tips: 2 | 3 | Flow Graph Tips for Limiting Resource Consumption 4 | ================================================= 5 | 6 | 7 | You may want to control the number of messages allowed to enter parts of 8 | your graph, or control the maximum number of tasks in the work pool. 9 | There are several mechanisms available for limiting resource consumption 10 | in a flow graph. 11 | 12 | .. toctree:: 13 | :maxdepth: 4 14 | 15 | ../tbb_userguide/use_limiter_node 16 | ../tbb_userguide/use_concurrency_limits 17 | ../tbb_userguide/create_token_based_system 18 | ../tbb_userguide/attach_flow_graph_to_arena -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Graph_Main_Categories.rst: -------------------------------------------------------------------------------- 1 | .. _Graph_Main_Categories: 2 | 3 | Graph Application Categories 4 | ============================ 5 | 6 | 7 | Most flow graphs fall into one of two categories: 8 | 9 | 10 | - **Data flow graphs.** In this type of graph, data is passed along the 11 | graph's edges. The nodes receive, transform and then pass along the 12 | data messages. 13 | - **Dependence graphs.** In this type of graph, the data operated on by 14 | the nodes is obtained through shared memory directly and is not 15 | passed along the edges. 16 | 17 | .. toctree:: 18 | :maxdepth: 4 19 | 20 | ../tbb_userguide/Data_Flow_Graph 21 | ../tbb_userguide/Dependence_Graph -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/dependence_graph.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/dependence_graph.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/execution_timeline2node.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/execution_timeline2node.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/execution_timeline_dependence.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/execution_timeline_dependence.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/flow_graph.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/flow_graph.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/flow_graph_complex.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/flow_graph_complex.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/flow_graph_message_passing_protocol.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/flow_graph_message_passing_protocol.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/flow_graph_reserve_buffers_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/flow_graph_reserve_buffers_1.png -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/flow_graph_reserve_buffers_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/flow_graph_reserve_buffers_2.png -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/flow_graph_reserve_buffers_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/flow_graph_reserve_buffers_3.png -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/flow_graph_reserve_buffers_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/flow_graph_reserve_buffers_4.png -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/flow_graph_reserve_buffers_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/flow_graph_reserve_buffers_5.png -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/flow_graph_reserve_buffers_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/flow_graph_reserve_buffers_6.png -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/flow_graph_reserve_buffers_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/flow_graph_reserve_buffers_7.png -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/image002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/image002.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/image004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/image004.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/image006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/image006.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/image007.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/image007.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/image008.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/image008.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/image009.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/image009.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/image010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/image010.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/image011.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/image011.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/image012.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/image012.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Images/image013.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/Images/image013.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Initializing_and_Terminating_the_Library.rst: -------------------------------------------------------------------------------- 1 | .. _Initializing_and_Terminating_the_Library: 2 | 3 | Initializing and Terminating the Library 4 | ======================================== 5 | 6 | |full_name| automatically initializes the task scheduler. 7 | The initialization process is involved when a thread uses task scheduling services the first time, 8 | for example any parallel algorithm, flow graph or task group. 9 | The termination happens when the last such thread exits. 10 | 11 | Explicit Library Finalization 12 | ***************************** 13 | 14 | oneTBB supports an explicit library termination as a preview feature. 15 | The ``oneapi::tbb::finalize`` function called with an instance of class ``oneapi::tbb::task_scheduler_handle`` blocks the calling thread 16 | until all worker threads implicitly created by the library have completed. 17 | If waiting for thread completion is not safe, e.g. may result in a deadlock 18 | or called inside a task, a parallel algorithm, or a flow graph node, the method fails. 19 | 20 | If you know how many active ``oneapi::tbb::task_scheduler_handle`` instances exist in the program, 21 | it is recommended to call ``oneapi::tbb::release`` function on all but the last one, then call ``oneapi::tbb::finalize`` for the last instance. 22 | 23 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Iterating_Over_a_Concurrent_Queue_for_Debugging.rst: -------------------------------------------------------------------------------- 1 | .. _Iterating_Over_a_Concurrent_Queue_for_Debugging: 2 | 3 | Iterating Over a Concurrent Queue for Debugging 4 | =============================================== 5 | 6 | 7 | The template classes ``concurrent_queue`` and 8 | ``concurrent_bounded_queue`` support STL-style iteration. This support 9 | is intended only for debugging, when you need to dump a queue. The 10 | iterators go forwards only, and are too slow to be very useful in 11 | production code. If a queue is modified, all iterators pointing to it 12 | become invalid and unsafe to use. The following snippet dumps a queue. 13 | The ``operator<<`` is defined for a ``Foo``. 14 | 15 | 16 | :: 17 | 18 | 19 | concurrent_queue q; 20 | ... 21 | typedef concurrent_queue::const_iterator iter; 22 | for(iter i(q.unsafe_begin()); i!=q.unsafe_end(); ++i ) { 23 | cout << *i; 24 | } 25 | 26 | 27 | The prefix ``unsafe_`` on the methods is a reminder that they are not 28 | concurrency safe. 29 | 30 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Migration_Guide.rst: -------------------------------------------------------------------------------- 1 | .. _Migration_Guide: 2 | 3 | Migrating from Threading Building Blocks (TBB) 4 | ============================================== 5 | 6 | While oneTBB is mostly source compatible with TBB, some interfaces were deprecated 7 | in TBB and redesigned or removed in oneTBB. This section considers the most difficult use cases for 8 | migrating TBB to oneTBB. 9 | 10 | .. toctree:: 11 | :maxdepth: 4 12 | 13 | ../tbb_userguide/Migration_Guide/Task_Scheduler_Init 14 | ../tbb_userguide/Migration_Guide/Task_API 15 | ../tbb_userguide/Migration_Guide/Mixing_Two_Runtimes 16 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Package_Contents_os.rst: -------------------------------------------------------------------------------- 1 | .. _Package_Contents: 2 | 3 | Package Contents 4 | ================ 5 | 6 | 7 | |full_name| includes dynamic library files and header files for Windows\*, Linux\* 8 | and macOS\* operating systems, as well as a number of supporting files like CMake and pkg-config files, as described in this section. 9 | 10 | .. toctree:: 11 | :maxdepth: 4 12 | 13 | ../tbb_userguide/Debug_Versus_Release_Libraries 14 | ../tbb_userguide/Scalable_Memory_Allocator 15 | ../tbb_userguide/Windows_OS_ug 16 | ../tbb_userguide/Linux_OS 17 | ../tbb_userguide/Mac_OS 18 | 19 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Parallelizing_Complex_Loops.rst: -------------------------------------------------------------------------------- 1 | .. _Parallelizing_Complex_Loops: 2 | 3 | Parallelizing Complex Loops 4 | =========================== 5 | 6 | 7 | You can successfully parallelize many applications using only the 8 | constructs in the :ref:`Parallelizing_Simple_Loops` section. However, some 9 | situations call for other parallel patterns. This section describes the 10 | support for some of these alternate patterns. 11 | 12 | .. toctree:: 13 | :maxdepth: 4 14 | 15 | ../tbb_userguide/Cook_Until_Done_parallel_do 16 | ../tbb_userguide/Working_on_the_Assembly_Line_pipeline 17 | ../tbb_userguide/Summary_of_Loops_and_Pipelines -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Parallelizing_Simple_Loops_os.rst: -------------------------------------------------------------------------------- 1 | .. _Parallelizing_Simple_Loops: 2 | 3 | Parallelizing Simple Loops 4 | ========================== 5 | 6 | 7 | The simplest form of scalable parallelism is a loop of iterations that 8 | can each run simultaneously without interfering with each other. The 9 | following sections demonstrate how to parallelize simple loops. 10 | 11 | 12 | .. note:: 13 | |full_name| components are 14 | defined in namespace ``tbb``. For brevity’s sake, the namespace is 15 | explicit in the first mention of a component, but implicit 16 | afterwards. 17 | 18 | 19 | When compiling oneTBB programs, be sure to link in the oneTBB shared 20 | library, otherwise undefined references will occur. The following table 21 | shows compilation commands that use the debug version of the library. 22 | Remove the ``_debug`` portion to link against the production version 23 | of the library. 24 | 25 | 26 | .. container:: tablenoborder 27 | 28 | 29 | .. list-table:: 30 | :header-rows: 1 31 | 32 | * - Operating System 33 | - Command line 34 | * - Windows\* OS 35 | - ``icl /MD example.cpp tbb_debug.lib`` 36 | * - Linux\* OS 37 | - ``icc example.cpp -ltbb_debug`` 38 | 39 | 40 | .. include:: Parallelizing_Simple_Loops_toctree.rst -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Parallelizing_Simple_Loops_toctree.rst: -------------------------------------------------------------------------------- 1 | .. _Parallelizing_Simple_Loops_toctree: 2 | 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | ../tbb_userguide/Initializing_and_Terminating_the_Library 8 | ../tbb_userguide/parallel_for_os 9 | ../tbb_userguide/parallel_reduce 10 | ../tbb_userguide/Advanced_Example 11 | ../tbb_userguide/Advanced_Topic_Other_Kinds_of_Iteration_Spaces -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Reader_Writer_Mutexes.rst: -------------------------------------------------------------------------------- 1 | .. _Reader_Writer_Mutexes: 2 | 3 | Reader Writer Mutexes 4 | ===================== 5 | 6 | 7 | Mutual exclusion is necessary when at least one thread *writes* to a 8 | shared variable. But it does no harm to permit multiple readers into a 9 | protected region. The reader-writer variants of the mutexes, denoted by 10 | ``_rw_`` in the class names, enable multiple readers by distinguishing 11 | *reader locks* from *writer locks.* There can be more than one reader 12 | lock on a given mutex. 13 | 14 | 15 | Requests for a reader lock are distinguished from requests for a writer 16 | lock via an extra boolean parameter in the constructor for 17 | ``scoped_lock``. The parameter is false to request a reader lock and 18 | true to request a writer lock. It defaults to ``true`` so that when 19 | omitted, a ``spin_rw_mutex`` or ``queuing_rw_mutex`` behaves like its 20 | non-``_rw_`` counterpart. 21 | 22 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/References.rst: -------------------------------------------------------------------------------- 1 | .. _References: 2 | 3 | References 4 | ========== 5 | 6 | 7 | **[1]**   "Memory Consistency & .NET", Arch D. Robison, Dr. Dobb’s 8 | Journal, April 2003. 9 | 10 | 11 | **[2]**   A Formal Specification of Intel® Itanium® Processor Family 12 | Memory Ordering, Intel Corporation, October 2002. 13 | 14 | 15 | **[3]**   "Cilk: An Efficient Multithreaded Runtime System", Robert 16 | Blumofe, Christopher Joerg, Bradley Kuszmaul, C. Leiserson, and Keith 17 | Randall, Proceedings of the fifth ACM SIGPLAN symposium on Principles 18 | and practice of parallel programming, 1995. 19 | 20 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Scalable_Memory_Allocator.rst: -------------------------------------------------------------------------------- 1 | .. _Scalable_Memory_Allocator: 2 | 3 | Scalable Memory Allocator 4 | ========================= 5 | 6 | 7 | Both the debug and release versions of |full_name| 8 | consists of two dynamic shared libraries, one with 9 | general support and the other with a scalable memory allocator. The 10 | latter is distinguished by ``malloc`` in its name. For example, the 11 | release versions for Windows\* OS are ``tbb.dll`` and ``tbbmalloc.dll`` 12 | respectively. Applications may choose to use only the general library, 13 | or only the scalable memory allocator, or both. See :ref:`Memory Allocation ` for 14 | more information on memory allocation. 15 | 16 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Summary_of_Containers.rst: -------------------------------------------------------------------------------- 1 | .. _Summary_of_Containers: 2 | 3 | Summary of Containers 4 | ===================== 5 | 6 | 7 | The high-level containers in |full_name| 8 | enable common idioms for concurrent access. They are suitable for 9 | scenarios where the alternative would be a serial container with a lock 10 | around it. 11 | 12 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Summary_of_Loops_and_Pipelines.rst: -------------------------------------------------------------------------------- 1 | .. _Summary_of_Loops_and_Pipelines: 2 | 3 | Summary of Loops and Pipelines 4 | ============================== 5 | 6 | The high-level loop and pipeline templates in |full_name| 7 | give you efficient scalable ways to exploit the power of multi-core chips without having to start from scratch. 8 | They let you design your software at a high task-pattern level and not worry about low-level manipulation of threads. 9 | Because they are generic, you can customize them to your specific needs. 10 | Have fun using these templates to unlock the power of multi-core. 11 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Task_Scheduler_Bypass.rst: -------------------------------------------------------------------------------- 1 | .. _Task_Scheduler_Bypass: 2 | 3 | Task Scheduler Bypass 4 | ===================== 5 | 6 | Scheduler bypass is an optimization where you directly specify the next task to run. 7 | According to the rules of execution described in :doc:`How Task Scheduler Works `, 8 | the spawning of the new task to be executed by the current thread involves the next steps: 9 | 10 | - Push a new task onto the thread's deque. 11 | - Continue to execute the current task until it is completed. 12 | - Take a task from the thread's deque, unless it is stolen by another thread. 13 | 14 | Steps 1 and 3 introduce unnecessary deque operations or, even worse, allow stealing that can hurt 15 | locality without adding significant parallelism. These problems can be avoided by using "Task Scheduler Bypass" technique to directly point the preferable task to be executed next 16 | instead of spawning it. When, as described in :doc:`How Task Scheduler Works `, 17 | the returned task becomes the first candidate for the next task to be executed by the thread. Furthermore, this approach almost guarantees that 18 | the task is executed by the current thread and not by any other thread. 19 | 20 | Please note that at the moment the only way to use this optimization is to use `preview feature of ``onepai::tbb::task_group`` -------------------------------------------------------------------------------- /doc/main/tbb_userguide/The_Task_Scheduler.rst: -------------------------------------------------------------------------------- 1 | .. _The_Task_Scheduler: 2 | 3 | The Task Scheduler 4 | ================== 5 | 6 | 7 | This section introduces the |full_name| 8 | *task scheduler*. The task scheduler is the engine that powers the loop 9 | templates. When practical, use the loop templates instead of 10 | the task scheduler, because the templates hide the complexity of the 11 | scheduler. However, if you have an algorithm that does not naturally map 12 | onto one of the high-level templates, use the task scheduler. 13 | 14 | .. toctree:: 15 | :maxdepth: 4 16 | 17 | ../tbb_userguide/Task-Based_Programming 18 | ../tbb_userguide/When_Task-Based_Programming_Is_Inappropriate 19 | ../tbb_userguide/How_Task_Scheduler_Works 20 | ../tbb_userguide/Task_Scheduler_Bypass 21 | ../tbb_userguide/Guiding_Task_Scheduler_Execution -------------------------------------------------------------------------------- /doc/main/tbb_userguide/Using_Circular_Buffers.rst: -------------------------------------------------------------------------------- 1 | .. _Using_Circular_Buffers: 2 | 3 | Using Circular Buffers 4 | ====================== 5 | 6 | 7 | Circular buffers can sometimes be used to minimize the overhead of 8 | allocating and freeing the items passed between pipeline filters. If the 9 | first filter to create an item and last filter to consume an item are 10 | both ``serial_in_order``, the items can be allocated and freed via a 11 | circular buffer of size at least ``ntoken``, where ``ntoken`` is the 12 | first parameter to ``parallel_pipeline``. Under these conditions, no 13 | checking of whether an item is still in use is necessary. 14 | 15 | 16 | The reason this works is that at most ``ntoken`` items can be in flight, 17 | and items will be freed in the order that they were allocated. Hence by 18 | the time the circular buffer wraps around to reallocate an item, the 19 | item must have been freed from its previous use in the pipeline. If the 20 | first and last filter are *not* ``serial_in_order``, then you have to 21 | keep track of which buffers are currently in use, because buffers might 22 | not be retired in the same order they were allocated. 23 | 24 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/When_Not_to_Use_Queues.rst: -------------------------------------------------------------------------------- 1 | .. _When_Not_to_Use_Queues: 2 | 3 | When Not to Use Queues 4 | ====================== 5 | 6 | 7 | Queues are widely used in parallel programs to buffer consumers from 8 | producers. Before using an explicit queue, however, consider using 9 | ``parallel_for_each`` ``parallel_pipeline`` instead. These is often more 10 | efficient than queues for the following reasons: 11 | 12 | 13 | - A queue is inherently a bottle neck, because it must maintain 14 | first-in first-out order. 15 | 16 | 17 | - A thread that is popping a value may have to wait idly until the 18 | value is pushed. 19 | 20 | 21 | - A queue is a passive data structure. If a thread pushes a value, it 22 | could take time until it pops the value, and in the meantime the 23 | value (and whatever it references) becomes "cold" in cache. Or worse 24 | yet, another thread pops the value, and the value (and whatever it 25 | references) must be moved to the other processor. 26 | 27 | 28 | In contrast, ``parallel_pipeline`` avoids these bottlenecks. Because its 29 | threading is implicit, it optimizes use of worker threads so that they 30 | do other work until a value shows up. It also tries to keep items hot in 31 | cache. 32 | 33 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/When_Task-Based_Programming_Is_Inappropriate.rst: -------------------------------------------------------------------------------- 1 | .. _When_Task-Based_Programming_Is_Inappropriate: 2 | 3 | When Task-Based Programming Is Inappropriate 4 | ============================================ 5 | 6 | 7 | Using the task scheduler is usually the best approach to threading for 8 | performance, however there are cases when the task scheduler is not 9 | appropriate. The task scheduler is intended for high-performance 10 | algorithms composed from non-blocking tasks. It still works if the tasks 11 | rarely block. However, if threads block frequently, there is a 12 | performance loss when using the task scheduler because while the thread 13 | is blocked, it is not working on any tasks. Blocking typically occurs 14 | while waiting for I/O or mutexes for long periods. If threads hold 15 | mutexes for long periods, your code is not likely to perform well 16 | anyway, no matter how many threads it has. If you have blocking tasks, 17 | it is best to use full-blown threads for those. The task scheduler is 18 | designed so that you can safely mix your own threads with |full_name| tasks. 19 | 20 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/automatically-replacing-malloc.rst: -------------------------------------------------------------------------------- 1 | .. _automatically-replacing-malloc: 2 | 3 | Automatically Replacing ``malloc`` and Other C/C++ Functions for Dynamic Memory Allocation 4 | ========================================================================================== 5 | 6 | 7 | On Windows*, Linux\* operating systems, it is possible to automatically 8 | replace all calls to standard functions for dynamic memory allocation 9 | (such as ``malloc``) with the |full_name| scalable equivalents. 10 | Doing so can sometimes improve application performance. 11 | 12 | 13 | Replacements are provided by the proxy library (the library names can be 14 | found in platform-specific sections below). A proxy library and a 15 | scalable memory allocator library should be taken from the same release 16 | of oneTBB, otherwise the libraries may be mutually incompatible. 17 | 18 | .. toctree:: 19 | :maxdepth: 4 20 | 21 | ../tbb_userguide/Windows_C_Dynamic_Memory_Interface_Replacement 22 | ../tbb_userguide/Linux_C_Dynamic_Memory_Interface_Replacement 23 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/avoid_dynamic_node_removal.rst: -------------------------------------------------------------------------------- 1 | .. _avoid_dynamic_node_removal: 2 | 3 | Avoid Dynamic Node Removal 4 | ========================== 5 | 6 | 7 | These are the basic guidelines regarding nodes and edges: 8 | 9 | 10 | - Avoid dynamic node removal 11 | 12 | 13 | - Adding edges and nodes is supported 14 | 15 | 16 | - Removing edges is supported 17 | 18 | 19 | It is possible to add new nodes and edges and to remove old edges from a 20 | flow graph as nodes are actively processing messages in the graph. 21 | However, removing nodes is discouraged. Destroying a graph or any of its 22 | nodes while there are messages being processed in the graph can lead to 23 | premature deletion of memory that will be later touched by tasks in the 24 | graph causing program failure. Removal of nodes when the graph is not 25 | idle may lead to intermittent failures and hard to find failures, so it 26 | should be avoided. 27 | 28 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/cancelling_nested_parallelism.rst: -------------------------------------------------------------------------------- 1 | .. _cancelling_nested_parallelism: 2 | 3 | Canceling Nested Parallelism 4 | ============================ 5 | 6 | 7 | Nested parallelism is canceled if the inner context is bound to the 8 | outer context; otherwise it is not. 9 | 10 | 11 | If the execution of a flow graph is canceled, either explicitly or due 12 | to an exception, any tasks started by parallel algorithms or flow graphs 13 | nested within the nodes of the canceled flow graph may or may not be 14 | canceled. 15 | 16 | 17 | As with all of the library's nested parallelism, you can control 18 | cancellation relationships by use of explicit ``task_group_context`` 19 | objects. If you do not provide an explicit ``task_group_context`` to a flow 20 | graph, it is created with an isolated context by default. 21 | 22 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/design_patterns/General_References.rst: -------------------------------------------------------------------------------- 1 | .. _General_References: 2 | 3 | General References 4 | ================== 5 | 6 | 7 | This section lists general references. References specific to a pattern 8 | are listed at the end of the topic for the pattern. 9 | 10 | - E. Gamma, R. Helm, R. Johnson, J. Vlissides. Design Patterns (1995) 11 | - `Berkeley Pattern Language for Parallel Programming `_ 12 | - T. Mattson, B. Sanders, B. Massingill. Patterns for Parallel Programming (2005) 13 | - `ParaPLoP 2009 `_ 14 | - `ParaPLoP 2010 `_ 15 | - Eun-Gyu Kim and Marc Snir, `Parallel Programming Patterns `_ 16 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/design_patterns/Images/image002a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/design_patterns/Images/image002a.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/design_patterns/Images/image003a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/design_patterns/Images/image003a.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/design_patterns/Images/image004a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/design_patterns/Images/image004a.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/design_patterns/Images/image005a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/design_patterns/Images/image005a.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/design_patterns/Images/image006a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/design_patterns/Images/image006a.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/design_patterns/Images/image007a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/design_patterns/Images/image007a.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/design_patterns/Images/image008a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/design_patterns/Images/image008a.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/design_patterns/Images/image009a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/doc/main/tbb_userguide/design_patterns/Images/image009a.jpg -------------------------------------------------------------------------------- /doc/main/tbb_userguide/examples/parallel_for_lambda_example_1.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 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 Foo(float) {} 18 | 19 | /*begin_parallel_for_lambda_1*/ 20 | #include "oneapi/tbb.h" 21 | 22 | using namespace oneapi::tbb; 23 | 24 | void ParallelApplyFoo( float* a, size_t n ) { 25 | parallel_for( blocked_range(0,n), 26 | [=](const blocked_range& r) { 27 | for(size_t i=r.begin(); i!=r.end(); ++i) 28 | Foo(a[i]); 29 | } 30 | ); 31 | } 32 | /*end_parallel_for_lambda_1*/ 33 | 34 | int main() { 35 | constexpr std::size_t size = 10; 36 | float array[size] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; 37 | 38 | ParallelApplyFoo(array, size); 39 | } 40 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/examples/parallel_for_lambda_example_2.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 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 Foo(float) {} 18 | 19 | /*begin_parallel_for_lambda_2*/ 20 | #include "oneapi/tbb.h" 21 | 22 | using namespace oneapi::tbb; 23 | 24 | #pragma warning(disable: 588) 25 | 26 | void ParallelApplyFoo(float a[], size_t n) { 27 | parallel_for(size_t(0), n, [=](size_t i) {Foo(a[i]);}); 28 | } 29 | /*end_parallel_for_lambda_2*/ 30 | 31 | int main() { 32 | constexpr std::size_t size = 10; 33 | float array[size] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; 34 | 35 | ParallelApplyFoo(array, size); 36 | } 37 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/parallel_for_toctree.rst: -------------------------------------------------------------------------------- 1 | .. _parallel_for_toctree: 2 | 3 | .. toctree:: 4 | :maxdepth: 4 5 | 6 | ../tbb_userguide/Lambda_Expressions 7 | ../tbb_userguide/Automatic_Chunking 8 | ../tbb_userguide/Controlling_Chunking_os 9 | ../tbb_userguide/Bandwidth_and_Cache_Affinity_os 10 | ../tbb_userguide/Partitioner_Summary -------------------------------------------------------------------------------- /doc/main/tbb_userguide/title.rst: -------------------------------------------------------------------------------- 1 | .. _title: 2 | 3 | |short_name| Developer Guide 4 | ============================ 5 | 6 | |full_name| 7 | 8 | .. toctree:: 9 | :maxdepth: 4 10 | 11 | ../tbb_userguide/Package_Contents_os 12 | ../tbb_userguide/Parallelizing_Simple_Loops_os 13 | ../tbb_userguide/Parallelizing_Complex_Loops 14 | ../tbb_userguide/Flow_Graph 15 | ../tbb_userguide/work_isolation 16 | ../tbb_userguide/Exceptions_and_Cancellation 17 | ../tbb_userguide/Floating_Point_Settings 18 | ../tbb_userguide/Containers 19 | ../tbb_userguide/Mutual_Exclusion 20 | ../tbb_userguide/Timing 21 | ../tbb_userguide/Memory_Allocation 22 | ../tbb_userguide/The_Task_Scheduler 23 | ../tbb_userguide/design_patterns/Design_Patterns 24 | ../tbb_userguide/Migration_Guide 25 | ../tbb_userguide/Constraints 26 | ../tbb_userguide/std_invoke 27 | ../tbb_userguide/appendix_A 28 | ../tbb_userguide/appendix_B 29 | ../tbb_userguide/References 30 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/use_graph_reset.rst: -------------------------------------------------------------------------------- 1 | .. _use_graph_reset: 2 | 3 | Use ``graph::reset()`` to Reset a Canceled Graph 4 | ================================================ 5 | 6 | 7 | When a graph execution is canceled either because of an unhandled 8 | exception or because its ``task_group_context`` is canceled explicitly, the 9 | graph and its nodes may be left in an indeterminate state. For example, 10 | in the code samples shown in :ref:`cancel_a_graph` the input 2 may be 11 | left in a buffer. But even beyond remnants in the buffers, there are 12 | other optimizations performed during the execution of a flow graph that 13 | can leave its nodes and edges in an indeterminate state. If you want to 14 | re-execute or restart a graph, you first need to reset the graph: 15 | 16 | 17 | :: 18 | 19 | 20 | try { 21 | g.wait_for_all(); 22 | } catch ( int j ) { 23 | cout << "Caught " << j << "\n"; 24 | // do something to fix the problem 25 | g.reset(); 26 | f1.try_put(1); 27 | f1.try_put(2); 28 | g.wait_for_all(); 29 | } 30 | 31 | -------------------------------------------------------------------------------- /doc/main/tbb_userguide/use_make_edge.rst: -------------------------------------------------------------------------------- 1 | .. _use_make_edge: 2 | 3 | Use make_edge and remove_edge 4 | ============================= 5 | 6 | 7 | These are the basic guidelines for creating and removing edges: 8 | 9 | 10 | - Use ``make_edge`` and ``remove_edge`` 11 | 12 | 13 | - Avoid using ``register_successor`` and ``register_predecessor`` 14 | 15 | 16 | - Avoid using ``remove_successor`` and ``remove_predecessor`` 17 | 18 | 19 | As a convention, to communicate the topology, use only functions 20 | ``flow::make_edge`` and ``flow::remove_edge``. The runtime library uses node 21 | functions, such as ``sender::register_successor``, to create these edges, 22 | but those functions should not be called directly. The runtime library 23 | calls these node functions directly to implement optimizations on the 24 | topology at runtime. 25 | 26 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /examples/common/gui/xcode/tbbExample/en.lproj/MainMenu.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/examples/common/gui/xcode/tbbExample/en.lproj/MainMenu.nib -------------------------------------------------------------------------------- /examples/common/gui/xcode/tbbExample/tbbAppDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 | -------------------------------------------------------------------------------- /examples/common/utility/get_default_num_threads.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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_examples_num_threads_H 18 | #define TBB_examples_num_threads_H 19 | 20 | #include "oneapi/tbb/task_arena.h" 21 | 22 | namespace utility { 23 | inline int get_default_num_threads() { 24 | return oneapi::tbb::this_task_arena::max_concurrency(); 25 | } 26 | } // namespace utility 27 | 28 | #endif /* TBB_examples_num_threads_H */ 29 | -------------------------------------------------------------------------------- /examples/concurrent_hash_map/README.md: -------------------------------------------------------------------------------- 1 | # Code Samples of oneAPI Threading Building Blocks (oneTBB) 2 | This directory contains examples of the `concurrent_hash_map` container. 3 | 4 | | Code sample name | Description 5 | |:--- |:--- 6 | | count_strings | Concurrently inserts strings into a `concurrent_hash_map` container. 7 | -------------------------------------------------------------------------------- /examples/concurrent_hash_map/count_strings/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020-2025 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.5.0...3.31.3) 16 | 17 | project(count_strings CXX) 18 | 19 | include(../../common/cmake/common.cmake) 20 | 21 | set_common_project_settings(tbb) 22 | 23 | add_executable(count_strings count_strings.cpp) 24 | 25 | target_link_libraries(count_strings TBB::tbb Threads::Threads) 26 | target_compile_options(count_strings PRIVATE ${TBB_CXX_STD_FLAG}) 27 | 28 | set(EXECUTABLE "$") 29 | set(ARGS "") 30 | set(PERF_ARGS auto 10000000 silent) 31 | 32 | add_execution_target(run_count_strings count_strings ${EXECUTABLE} "${ARGS}") 33 | add_execution_target(perf_run_count_strings count_strings ${EXECUTABLE} "${PERF_ARGS}") 34 | -------------------------------------------------------------------------------- /examples/concurrent_hash_map/count_strings/README.md: -------------------------------------------------------------------------------- 1 | # Count_strings sample 2 | The example counts the number of unique words in a text. 3 | 4 | ## Building the example 5 | ``` 6 | cmake 7 | cmake --build . 8 | ``` 9 | 10 | ## Running the sample 11 | ### Predefined make targets 12 | * `make run_count_strings` - executes the example with predefined parameters. 13 | * `make perf_run_count_strings` - executes the example with suggested parameters to measure the oneTBB performance. 14 | 15 | ### Application parameters 16 | Usage: 17 | ``` 18 | count_strings [n-of-threads=value] [n-of-strings=value] [verbose] [silent] [count_collisions] [-h] [n-of-threads [n-of-strings]] 19 | ``` 20 | * `-h` - prints the help for command line options. 21 | * `n-of-threads` - number of threads to use; a range of the form low\[:high\], where low and optional high are non-negative integers or `auto` for a platform-specific default number. 22 | * `n-of-strings` - number of strings. 23 | * `verbose` - prints diagnostic output to screen. 24 | * `silent` - no output except elapsed time. 25 | -------------------------------------------------------------------------------- /examples/concurrent_priority_queue/README.md: -------------------------------------------------------------------------------- 1 | # Code Samples of oneAPI Threading Building Blocks (oneTBB) 2 | This directory contains examples of the `concurrent_priority_queue` container. 3 | 4 | | Code sample name | Description 5 | |:--- |:--- 6 | | shortpath | Solves the single source shortest path problem using a `concurrent_priority_queue` container. 7 | -------------------------------------------------------------------------------- /examples/concurrent_priority_queue/shortpath/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020-2025 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.5.0...3.31.3) 16 | 17 | project(shortpath CXX) 18 | 19 | include(../../common/cmake/common.cmake) 20 | 21 | set_common_project_settings(tbb) 22 | 23 | add_executable(shortpath shortpath.cpp) 24 | 25 | target_link_libraries(shortpath TBB::tbb Threads::Threads) 26 | target_compile_options(shortpath PRIVATE ${TBB_CXX_STD_FLAG}) 27 | 28 | set(EXECUTABLE "$") 29 | set(ARGS 4 N=1000 start=0 end=999 verbose) 30 | set(PERF_ARGS auto N=1000 start=0 end=99 silent) 31 | 32 | add_execution_target(run_shortpath shortpath ${EXECUTABLE} "${ARGS}") 33 | add_execution_target(perf_run_shortpath shortpath ${EXECUTABLE} "${PERF_ARGS}") 34 | -------------------------------------------------------------------------------- /examples/getting_started/README.md: -------------------------------------------------------------------------------- 1 | # Code Samples of oneAPI Threading Building Blocks (oneTBB) 2 | This directory contains the examples referenced by the [oneAPI Threading Building Blocks Get Started Guide](https://www.intel.com/content/www/us/en/docs/onetbb/get-started-guide/current/overview.html) 3 | 4 | | Code sample name | Description 5 | |:--- |:--- 6 | | sub_string_finder | Finds largest matching substrings. 7 | -------------------------------------------------------------------------------- /examples/graph/README.md: -------------------------------------------------------------------------------- 1 | # Code Samples of oneAPI Threading Building Blocks (oneTBB) 2 | Examples using oneTBB Flow Graph feature. 3 | 4 | | Code sample name | Description 5 | |:--- |:--- 6 | | binpack | A solution to the binpacking problem using a `queue_node`, a `buffer_node` and `function_node`s. 7 | | cholesky | Several versions of Cholesky Factorization algorithm implementation. 8 | | dining_philosophers | An implementation of dining philosophers in graph using the reserving `join_node`. 9 | | fgbzip2 | A parallel implementation of bzip2 block-sorting file compressor. 10 | | logic_sim | An example of a collection of digital logic gates that can be easily composed into larger circuits. 11 | | som | An example of a Kohonen Self-Organizing Map using cancellation. 12 | -------------------------------------------------------------------------------- /examples/graph/binpack/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020-2025 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.5.0...3.31.3) 16 | 17 | project(binpack CXX) 18 | 19 | include(../../common/cmake/common.cmake) 20 | 21 | set_common_project_settings(tbb) 22 | 23 | add_executable(binpack binpack.cpp) 24 | 25 | target_link_libraries(binpack TBB::tbb Threads::Threads) 26 | target_compile_options(binpack PRIVATE ${TBB_CXX_STD_FLAG}) 27 | 28 | set(EXECUTABLE "$") 29 | set(ARGS 4 elements_num=1000) 30 | set(PERF_ARGS auto elements_num=1000 silent) 31 | 32 | add_execution_target(run_binpack binpack ${EXECUTABLE} "${ARGS}") 33 | add_execution_target(perf_run_binpack binpack ${EXECUTABLE} "${PERF_ARGS}") 34 | -------------------------------------------------------------------------------- /examples/graph/dining_philosophers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020-2025 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.5.0...3.31.3) 16 | 17 | project(dining_philosophers CXX) 18 | 19 | include(../../common/cmake/common.cmake) 20 | 21 | set_common_project_settings(tbb) 22 | 23 | add_executable(dining_philosophers dining_philosophers.cpp) 24 | 25 | target_link_libraries(dining_philosophers TBB::tbb Threads::Threads) 26 | target_compile_options(dining_philosophers PRIVATE ${TBB_CXX_STD_FLAG}) 27 | 28 | set(EXECUTABLE "$") 29 | set(ARGS auto 5) 30 | set(LIGHT_ARGS auto 3) 31 | 32 | add_execution_target(run_dining_philosophers dining_philosophers ${EXECUTABLE} "${ARGS}") 33 | add_execution_target(light_test_dining_philosophers dining_philosophers ${EXECUTABLE} "${LIGHT_ARGS}") 34 | -------------------------------------------------------------------------------- /examples/graph/fgbzip2/README.md: -------------------------------------------------------------------------------- 1 | # fgbzip2 sample 2 | fgbzip2 is a parallel implementation of bzip2 block-sorting file compressor that uses `oneapi::tbb::flow`. The output of this application is fully compatible with bzip2 v1.0.6 or newer. 3 | 4 | This example includes software developed by Julian R Seward. See here for copyright information. 5 | It exemplifies support for asynchronous capabilities in the flow graph API. 6 | 7 | ## Building the example 8 | ``` 9 | cmake 10 | cmake --build . 11 | ``` 12 | 13 | ## Running the sample 14 | ### Predefined make targets 15 | * `make run_fgbzip2` - executes the example with predefined parameters. 16 | * `make perf_run_fgbzip2` - executes the example with suggested parameters to measure the oneTBB performance. 17 | 18 | ### Application parameters 19 | Usage: 20 | ``` 21 | fgbzip2 [-b=value] [-v] [-l=value] [-async] [filename=value] [-h] [filename] 22 | ``` 23 | * `-h` - prints the help for command line options. 24 | * `-b` - block size in 100 KB chunks, [1 .. 9]. 25 | * `-v` - prints diagnostic output to screen. 26 | * `-l` - use memory limit for compression algorithm with 1 MB (minimum) granularity. 27 | * `-async` - use graph `async_node`-based implementation. 28 | * `filename` - name of the file to compress. 29 | -------------------------------------------------------------------------------- /examples/graph/logic_sim/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020-2025 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.5.0...3.31.3) 16 | 17 | project(logic_sim CXX) 18 | 19 | include(../../common/cmake/common.cmake) 20 | 21 | set_common_project_settings(tbb) 22 | 23 | add_executable(logic_sim test_all.cpp) 24 | 25 | target_link_libraries(logic_sim TBB::tbb Threads::Threads) 26 | target_compile_options(logic_sim PRIVATE ${TBB_CXX_STD_FLAG}) 27 | 28 | set(EXECUTABLE "$") 29 | set(ARGS 4) 30 | set(PERF_ARGS auto silent) 31 | 32 | add_execution_target(run_logic_sim logic_sim ${EXECUTABLE} "${ARGS}") 33 | add_execution_target(perf_run_logic_sim logic_sim ${EXECUTABLE} "${PERF_ARGS}") 34 | -------------------------------------------------------------------------------- /examples/graph/logic_sim/README.md: -------------------------------------------------------------------------------- 1 | # Logic_sim sample 2 | This directory contains `oneapi::tbb::flow` example that performs simplistic digital logic simulations with basic logic gates that can be easily composed to create more interesting circuits. 3 | 4 | ## Building the example 5 | ``` 6 | cmake 7 | cmake --build . 8 | ``` 9 | 10 | ## Running the sample 11 | ### Predefined make targets 12 | * `make run_logic_sim` - executes the example with predefined parameters. 13 | * `make perf_run_logic_sim` - executes the example with suggested parameters to measure the oneTBB performance. 14 | 15 | ### Application parameters 16 | Usage: 17 | ``` 18 | logic_sim [#threads=value] [verbose] [silent] [-h] [#threads] 19 | ``` 20 | * `-h` - prints the help for command line options. 21 | * `#threads` - the number of threads to use; a range of the form low[:high] where low and optional high are non-negative integers, or `auto` for a platform-specific default number. 22 | * `verbose` - prints diagnostic output to screen. 23 | * `silent` limits output to timing info; overrides verbose 24 | -------------------------------------------------------------------------------- /examples/graph/som/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020-2025 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.5.0...3.31.3) 16 | 17 | include(../../common/cmake/common.cmake) 18 | project(som CXX) 19 | set_common_project_settings(tbb) 20 | 21 | add_executable(som som_graph.cpp som.cpp) 22 | 23 | target_link_libraries(som TBB::tbb Threads::Threads) 24 | target_compile_options(som PRIVATE ${TBB_CXX_STD_FLAG}) 25 | 26 | set(EXECUTABLE "$") 27 | set(ARGS) 28 | set(LIGHT_ARGS 4) 29 | 30 | add_execution_target(run_som som ${EXECUTABLE} "${ARGS}") 31 | add_execution_target(light_test_som som ${EXECUTABLE} "${LIGHT_ARGS}") 32 | -------------------------------------------------------------------------------- /examples/migration/README.md: -------------------------------------------------------------------------------- 1 | # Code Samples of oneAPI Threading Building Blocks (oneTBB) 2 | Examples of migrating from TBB APIs to the oneTBB APIs. 3 | 4 | | Code sample name | Description 5 | |:--- |:--- 6 | | recursive_fibonacci | Compute Fibonacci number in recursive way. 7 | -------------------------------------------------------------------------------- /examples/migration/recursive_fibonacci/README.md: -------------------------------------------------------------------------------- 1 | # Fibonacci sample 2 | This directory contains an example that computes Fibonacci numbers using emulation for TBB Task API. 3 | 4 | ## Building the example 5 | ``` 6 | cmake 7 | cmake --build . 8 | ``` 9 | 10 | ## Running the sample 11 | ### Predefined make targets 12 | * `make run_recursive_fibonacci` - executes the example with predefined parameters (extended testing enabled). 13 | * `make perf_run_recursive_fibonacci` - executes the example with suggested parameters to measure the oneTBB performance. 14 | 15 | ### Application parameters 16 | Usage: 17 | ``` 18 | recursive_fibonacci N C I T 19 | ``` 20 | * `N` - specifies the fibonacci number which would be calculated. 21 | * `C` - cutoff that will be used to stop recursive split. 22 | * `I` - number of iteration to measure benchmark time. 23 | * `T` - enables extended testing (recycle task in a loop). 24 | -------------------------------------------------------------------------------- /examples/parallel_for/README.md: -------------------------------------------------------------------------------- 1 | # Code Samples of oneAPI Threading Building Blocks (oneTBB) 2 | Examples using `parallel_for` algorithm. 3 | 4 | | Code sample name | Description 5 | |:--- |:--- 6 | | game_of_life | Game of life overlay. 7 | | polygon_overlay | polygon overlay. 8 | | seismic | Parallel seismic wave simulation. 9 | | tachyon | Parallel 2-D raytracer/renderer. 10 | -------------------------------------------------------------------------------- /examples/parallel_for/game_of_life/Board.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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_examples_game_of_life_board_H 18 | #define TBB_examples_game_of_life_board_H 19 | 20 | #define LabelPtr int* 21 | #define BoardPtr Board* 22 | 23 | struct Matrix { 24 | int width; 25 | int height; 26 | char* data; 27 | }; 28 | 29 | class Board { 30 | public: 31 | Board(int width, int height, int squareSize, LabelPtr counter); 32 | virtual ~Board(); 33 | void seed(int s); 34 | void seed(const BoardPtr s); 35 | 36 | public: 37 | Matrix* m_matrix; 38 | 39 | private: 40 | int m_width; 41 | int m_height; 42 | int m_squareSize; 43 | LabelPtr m_counter; 44 | }; 45 | 46 | #endif /* TBB_examples_game_of_life_board_H */ 47 | -------------------------------------------------------------------------------- /examples/parallel_for/game_of_life/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020-2025 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.5.0...3.31.3) 16 | 17 | project(game_of_life CXX) 18 | 19 | include(../../common/cmake/common.cmake) 20 | 21 | set_common_project_settings(tbb) 22 | 23 | add_executable(game_of_life Evolution.cpp Game_of_life.cpp Update_state.cpp) 24 | 25 | target_compile_definitions(game_of_life PUBLIC _CONSOLE) 26 | target_link_libraries(game_of_life TBB::tbb Threads::Threads) 27 | target_compile_options(game_of_life PRIVATE ${TBB_CXX_STD_FLAG}) 28 | 29 | set(EXECUTABLE "$") 30 | set(ARGS 2:4 -t 5) 31 | set(LIGHT_ARGS 1:2 -t 5) 32 | 33 | add_execution_target(run_game_of_life game_of_life ${EXECUTABLE} "${ARGS}") 34 | add_execution_target(light_test_game_of_life game_of_life ${EXECUTABLE} "${LIGHT_ARGS}") 35 | -------------------------------------------------------------------------------- /examples/parallel_for/game_of_life/README.md: -------------------------------------------------------------------------------- 1 | # Game_of_life sample 2 | The "Game of life" example demonstrates interoperability of oneAPI Threading Building Blocks (oneTBB) and Microsoft* .NET*. 3 | 4 | This program runs 2 simultaneous instances of the classic Conway's "Game of Life". One of these instances uses serial calculations to update the board. The other one calculates in parallel with oneTBB. The visualization is written in managed C++ and uses .NET CLR. 5 | 6 | ## Building the example 7 | ``` 8 | cmake 9 | cmake --build . 10 | ``` 11 | 12 | ## Running the sample 13 | ### Predefined make targets 14 | * `make run_game_of_life` - executes the example with predefined parameters. 15 | * `make light_test_game_of_life` - executes the example with suggested parameters to reduce execution time. 16 | 17 | ### Application parameters 18 | Usage: 19 | ``` 20 | game_of_life [M[:N] -t execution_time] [-h] 21 | ``` 22 | * `-h` - prints the help for command line options. 23 | * `M:N` - range of numbers of threads to be used. 24 | * `execution_time` - time (in sec) for execution `game_of_life` iterations. 25 | -------------------------------------------------------------------------------- /examples/parallel_for/polygon_overlay/gui/resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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/parallel_for/polygon_overlay/speedup.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/examples/parallel_for/polygon_overlay/speedup.gif -------------------------------------------------------------------------------- /examples/parallel_for/seismic/gui/SeismicSimulation.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/examples/parallel_for/seismic/gui/SeismicSimulation.ico -------------------------------------------------------------------------------- /examples/parallel_for/seismic/gui/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/examples/parallel_for/seismic/gui/small.ico -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/benchmark_tachyon_data.awk: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025 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 | BEGIN { 16 | print "infile,repetitions,avg_duration,rel_error" 17 | summ=0; 18 | cnt=0; 19 | } 20 | 21 | match($0, /tachyon.*n-of-repeats=([0-9]+) (.+): ([.0-9]+) seconds/, arr) { 22 | curr_rep = arr[1]; 23 | curr_file = arr[2]; 24 | summ += arr[3]; 25 | cnt++ 26 | } 27 | 28 | /Relative_Err/ { 29 | print curr_file "," curr_rep "," summ/cnt "," $3 30 | } 31 | -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/gui/gui.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/examples/parallel_for/tachyon/gui/gui.ico -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/gui/resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 | -------------------------------------------------------------------------------- /examples/parallel_for/tachyon/gui/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/examples/parallel_for/tachyon/gui/small.ico -------------------------------------------------------------------------------- /examples/parallel_for_each/README.md: -------------------------------------------------------------------------------- 1 | # Code Samples of oneAPI Threading Building Blocks (oneTBB) 2 | Examples using `parallel_for_each` algorithm. 3 | 4 | | Code sample name | Description 5 | |:--- |:--- 6 | | parallel_preorder | Parallel preorder traversal of a graph. 7 | -------------------------------------------------------------------------------- /examples/parallel_pipeline/README.md: -------------------------------------------------------------------------------- 1 | # Code Samples of oneAPI Threading Building Blocks (oneTBB) 2 | Examples using `parallel_pipeline` algorithm. 3 | 4 | | Code sample name | Description 5 | |:--- |:--- 6 | | square | Another string transformation example that squares numbers read from a file. 7 | -------------------------------------------------------------------------------- /examples/parallel_pipeline/square/README.md: -------------------------------------------------------------------------------- 1 | # Square sample 2 | Text filter that demonstrates the use of `parallel_pipeline`. Example program reads a file containing decimal integers in text format, and changes each to its square. 3 | 4 | ## Building the example 5 | ``` 6 | cmake 7 | cmake --build . 8 | ``` 9 | 10 | ## Running the sample 11 | ### Predefined make targets 12 | * `make run_square` - executes the example with predefined parameters 13 | * `make perf_run_square` - executes the example with suggested parameters to measure the oneTBB performance 14 | * `make light_test_square` - executes the example with suggested parameters to reduce execution time. 15 | 16 | ### Application parameters 17 | Usage: 18 | ``` 19 | square [n-of-threads=value] [input-file=value] [output-file=value] [max-slice-size=value] [silent] [-h] [n-of-threads [input-file [output-file [max-slice-size]]]] 20 | ``` 21 | * `-h` - prints the help for command line options. 22 | * `n-of-threads` - the number of threads to use; a range of the form low\[:high\], where low and optional high are non-negative integers or `auto` for a platform-specific default number. 23 | * `input`- file is an input file name. 24 | * `output`- file is an output file name. 25 | * `max-slice-size` - the maximum number of characters in one slice. 26 | * `silent` - no output except elapsed time. 27 | -------------------------------------------------------------------------------- /examples/parallel_reduce/README.md: -------------------------------------------------------------------------------- 1 | # Code Samples of oneAPI Threading Building Blocks (oneTBB) 2 | Examples using `parallel_reduce` algorithm. 3 | 4 | | Code sample name | Description 5 | |:--- |:--- 6 | | convex_hull | Parallel version of convex hull algorithm (quick hull). 7 | | pi | Parallel version of calculating π by numerical integration. 8 | | primes | Parallel version of the Sieve of Eratosthenes. 9 | -------------------------------------------------------------------------------- /examples/parallel_reduce/pi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023-2025 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.5.0...3.31.3) 16 | 17 | project(pi CXX) 18 | 19 | include(../../common/cmake/common.cmake) 20 | 21 | set_common_project_settings(tbb) 22 | 23 | add_executable(pi main.cpp pi.cpp) 24 | 25 | target_link_libraries(pi TBB::tbb Threads::Threads) 26 | target_compile_options(pi PRIVATE ${TBB_CXX_STD_FLAG}) 27 | 28 | set(EXECUTABLE "$") 29 | set(ARGS "") 30 | set(PERF_ARGS auto 100000000000) 31 | 32 | add_execution_target(run_pi pi ${EXECUTABLE} "${ARGS}") 33 | add_execution_target(perf_run_pi pi ${EXECUTABLE} "${PERF_ARGS}") 34 | -------------------------------------------------------------------------------- /examples/parallel_reduce/pi/README.md: -------------------------------------------------------------------------------- 1 | # Pi Sample 2 | Parallel version of calculating π by numerical integration. 3 | 4 | ## Build 5 | To build the sample, run the following commands: 6 | ``` 7 | cmake 8 | cmake --build . 9 | ``` 10 | 11 | ## Run 12 | ### Predefined Make Targets 13 | * `make run_pi` - executes the example with predefined parameters 14 | * `make perf_run_pi` - executes the example with suggested parameters to measure the oneTBB performance 15 | 16 | ### Application Parameters 17 | You can use the following application parameters: 18 | ``` 19 | pi [n-of-threads=value] [n-of-intervals=value] [silent] [-h] [n-of-threads [n-of-intervals]] 20 | ``` 21 | * `-h` - prints the help for command-line options. 22 | * `n-of-threads` - the number of threads to use. This number is specified in the low\[:high\] range format, where both ``low`` and, optionally, ``high`` are non-negative integers. You can also use ``auto`` to let the system choose a default number of threads suitable for the platform. 23 | * `n-of-intervals` - the number of intervals to subdivide into. Must be a positive integer. 24 | * `silent` - no output except the elapsed time. 25 | -------------------------------------------------------------------------------- /examples/parallel_reduce/primes/benchmark_primes_data.awk: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025 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 | BEGIN { 16 | print "range,repetitions,parallelism,avg_duration,rel_error" 17 | } 18 | 19 | match($0, /^#primes from \[([.0-9]+)\] .*\(([.0-9]+) sec with (.+) /, arr) { 20 | t_id=arr[3]; 21 | range[t_id] = arr[1] 22 | thread_sum[t_id] += arr[2]; 23 | thread_cnt[t_id] = thread_cnt[t_id] + 1 24 | } 25 | 26 | match($0, /(.+) (.+) Relative_Err : ([.0-9]+) %/, arr) { 27 | t_id=arr[1]; 28 | print range[t_id] "," thread_cnt[t_id] "," t_id "," thread_sum[t_id]/(thread_cnt[t_id]) "," arr[3]; 29 | } 30 | -------------------------------------------------------------------------------- /examples/parallel_reduce/primes/primes.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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_examples_primes_H 18 | #define TBB_examples_primes_H 19 | 20 | #include 21 | 22 | #include "common/utility/get_default_num_threads.hpp" 23 | 24 | typedef std::size_t NumberType; 25 | 26 | //! Count number of primes between 0 and n 27 | /** This is the serial version. */ 28 | NumberType SerialCountPrimes(NumberType n); 29 | 30 | //! Count number of primes between 0 and n 31 | /** This is the parallel version. */ 32 | NumberType ParallelCountPrimes(NumberType n, 33 | int numberOfThreads = utility::get_default_num_threads(), 34 | NumberType grainSize = 1000); 35 | 36 | #endif /* TBB_examples_primes_H */ 37 | -------------------------------------------------------------------------------- /examples/task_arena/README.md: -------------------------------------------------------------------------------- 1 | # Code Samples of oneAPI Threading Building Blocks (oneTBB) 2 | Examples using the `task_arena` feature. 3 | 4 | | Code sample name | Description 5 | |:--- |:--- 6 | | fractal |The example calculates two classical Mandelbrot fractals with different concurrency limits. 7 | -------------------------------------------------------------------------------- /examples/task_arena/fractal/gui/gui.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/examples/task_arena/fractal/gui/gui.ico -------------------------------------------------------------------------------- /examples/task_arena/fractal/gui/resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 | -------------------------------------------------------------------------------- /examples/task_arena/fractal/gui/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/examples/task_arena/fractal/gui/small.ico -------------------------------------------------------------------------------- /examples/task_group/README.md: -------------------------------------------------------------------------------- 1 | # Code Samples of oneAPI Threading Building Blocks (oneTBB) 2 | Examples using `task_group` interface. 3 | 4 | | Code sample name | Description 5 | |:--- |:--- 6 | | sudoku | Compute all solutions for a Sudoku board. 7 | -------------------------------------------------------------------------------- /examples/task_group/sudoku/benchmark_sudoku_data.awk: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025 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 | BEGIN { 16 | print "infile,repetitions,threads,avg_duration,rel_error" 17 | match(run_args, /filename=(.+)[ ;]/, run_args_); 18 | curr_file = run_args_[1] 19 | } 20 | 21 | match($0, /(Sudoku: Time to find .* on )([0-9]+)( threads: )([.0-9]+) seconds./, arr) { 22 | t_id=arr[2]; 23 | thread_sum[t_id] += arr[4]; 24 | thread_cnt[t_id] = thread_cnt[t_id] + 1 25 | } 26 | 27 | match($0, /(Sudoku: Time to find.* on )([0-9]+)( threads[:]* Relative_Err : )([.0-9]+) %/, arr) { 28 | t_id=arr[2]; 29 | print curr_file "," thread_cnt[t_id] "," t_id "," thread_sum[t_id]/(thread_cnt[t_id]) "," arr[4]; 30 | } 31 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /examples/test_all/README.md: -------------------------------------------------------------------------------- 1 | # Code Samples of oneAPI Threading Building Blocks (oneTBB) 2 | Examples that test various components of oneTBB. 3 | 4 | | Code sample name | Description 5 | |:--- |:--- 6 | | fibonacci | Compute Fibonacci numbers in different ways. 7 | -------------------------------------------------------------------------------- /examples/test_all/fibonacci/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019-2025 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.5.0...3.31.3) 16 | 17 | project(fibonacci CXX) 18 | 19 | include(../../common/cmake/common.cmake) 20 | 21 | set_common_project_settings(tbb) 22 | 23 | add_executable(fibonacci fibonacci.cpp) 24 | target_link_libraries(fibonacci 25 | TBB::tbb 26 | Threads::Threads 27 | $<$:rt>) # Link "rt" library on Linux 28 | target_compile_options(fibonacci PRIVATE ${TBB_CXX_STD_FLAG}) 29 | 30 | set(EXECUTABLE "$") 31 | set(ARGS "") 32 | 33 | add_execution_target(run_fibonacci fibonacci ${EXECUTABLE} "${ARGS}") 34 | -------------------------------------------------------------------------------- /examples/test_all/fibonacci/README.md: -------------------------------------------------------------------------------- 1 | # Fibonacci sample 2 | This directory contains an example that computes Fibonacci numbers in several different ways. 3 | 4 | The purpose of the example is to exercise every include file and class in Intel® oneAPI Threading Building Blocks. Most of the computations are deliberately silly and not expected to show any speedup on multiprocessors. 5 | 6 | ## Building the example 7 | ``` 8 | cmake 9 | cmake --build . 10 | ``` 11 | 12 | ## Running the sample 13 | ### Predefined make targets 14 | * `make run_fibonacci` - executes the example with predefined parameters. 15 | 16 | ### Application parameters 17 | Usage: 18 | ``` 19 | fibonacci K [M[:N]] [R] 20 | ``` 21 | * `K` - specifies the fibonacci number which would be calculated. 22 | * `[M:N]` -a range of numbers of threads to be used. 23 | * `R` - the number of times to repeat the calculation. 24 | -------------------------------------------------------------------------------- /include/oneapi/tbb/detail/_attach.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021 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_detail__attach_H 18 | #define __TBB_detail__attach_H 19 | 20 | #include "_config.h" 21 | 22 | namespace tbb { 23 | namespace detail { 24 | namespace d1 { 25 | 26 | struct attach {}; 27 | 28 | } // namespace d1 29 | } // namespace detail 30 | } // namespace tbb 31 | 32 | #endif // __TBB_detail__attach_H 33 | -------------------------------------------------------------------------------- /include/oneapi/tbb/detail/_namespace_injection.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2020-2021 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 | // All public entities of the OneAPI Spec are available under oneapi namespace 18 | 19 | // Define tbb namespace first as it might not be known yet 20 | namespace tbb {} 21 | 22 | namespace oneapi { 23 | namespace tbb = ::tbb; 24 | } 25 | -------------------------------------------------------------------------------- /include/oneapi/tbb/task.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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_task_H 18 | #define __TBB_task_H 19 | 20 | #include "detail/_config.h" 21 | #include "detail/_namespace_injection.h" 22 | #include "detail/_task.h" 23 | 24 | namespace tbb { 25 | inline namespace v1 { 26 | namespace task { 27 | #if __TBB_RESUMABLE_TASKS 28 | using detail::d1::suspend_point; 29 | using detail::d1::resume; 30 | using detail::d1::suspend; 31 | #endif /* __TBB_RESUMABLE_TASKS */ 32 | using detail::d1::current_context; 33 | } // namespace task 34 | } // namespace v1 35 | } // namespace tbb 36 | 37 | #endif /* __TBB_task_H */ 38 | -------------------------------------------------------------------------------- /include/tbb/blocked_nd_range.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2017-2024 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 "../oneapi/tbb/blocked_nd_range.h" 18 | -------------------------------------------------------------------------------- /include/tbb/blocked_range.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/blocked_range.h" 18 | -------------------------------------------------------------------------------- /include/tbb/blocked_range2d.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/blocked_range2d.h" 18 | -------------------------------------------------------------------------------- /include/tbb/blocked_range3d.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/blocked_range3d.h" 18 | -------------------------------------------------------------------------------- /include/tbb/cache_aligned_allocator.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/cache_aligned_allocator.h" 18 | -------------------------------------------------------------------------------- /include/tbb/collaborative_call_once.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021 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 "../oneapi/tbb/collaborative_call_once.h" 18 | -------------------------------------------------------------------------------- /include/tbb/combinable.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/combinable.h" 18 | -------------------------------------------------------------------------------- /include/tbb/concurrent_hash_map.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/concurrent_hash_map.h" 18 | -------------------------------------------------------------------------------- /include/tbb/concurrent_lru_cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/concurrent_lru_cache.h" 18 | -------------------------------------------------------------------------------- /include/tbb/concurrent_map.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2019-2021 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 "../oneapi/tbb/concurrent_map.h" 18 | -------------------------------------------------------------------------------- /include/tbb/concurrent_priority_queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/concurrent_priority_queue.h" 18 | -------------------------------------------------------------------------------- /include/tbb/concurrent_queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/concurrent_queue.h" 18 | -------------------------------------------------------------------------------- /include/tbb/concurrent_set.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2019-2021 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 "../oneapi/tbb/concurrent_set.h" 18 | -------------------------------------------------------------------------------- /include/tbb/concurrent_unordered_map.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/concurrent_unordered_map.h" 18 | -------------------------------------------------------------------------------- /include/tbb/concurrent_unordered_set.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/concurrent_unordered_set.h" 18 | -------------------------------------------------------------------------------- /include/tbb/concurrent_vector.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/concurrent_vector.h" 18 | -------------------------------------------------------------------------------- /include/tbb/enumerable_thread_specific.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/enumerable_thread_specific.h" 18 | -------------------------------------------------------------------------------- /include/tbb/flow_graph.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/flow_graph.h" 18 | -------------------------------------------------------------------------------- /include/tbb/flow_graph_abstractions.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/flow_graph_abstractions.h" 18 | -------------------------------------------------------------------------------- /include/tbb/global_control.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/global_control.h" 18 | -------------------------------------------------------------------------------- /include/tbb/info.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2019-2021 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 "../oneapi/tbb/info.h" 18 | -------------------------------------------------------------------------------- /include/tbb/memory_pool.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/memory_pool.h" 18 | -------------------------------------------------------------------------------- /include/tbb/mutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 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 "../oneapi/tbb/mutex.h" 18 | -------------------------------------------------------------------------------- /include/tbb/null_mutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/null_mutex.h" 18 | -------------------------------------------------------------------------------- /include/tbb/null_rw_mutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/null_rw_mutex.h" 18 | -------------------------------------------------------------------------------- /include/tbb/parallel_for.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/parallel_for.h" 18 | -------------------------------------------------------------------------------- /include/tbb/parallel_for_each.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/parallel_for_each.h" 18 | -------------------------------------------------------------------------------- /include/tbb/parallel_invoke.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/parallel_invoke.h" 18 | -------------------------------------------------------------------------------- /include/tbb/parallel_pipeline.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/parallel_pipeline.h" 18 | -------------------------------------------------------------------------------- /include/tbb/parallel_reduce.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/parallel_reduce.h" 18 | -------------------------------------------------------------------------------- /include/tbb/parallel_scan.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/parallel_scan.h" 18 | -------------------------------------------------------------------------------- /include/tbb/parallel_sort.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/parallel_sort.h" 18 | -------------------------------------------------------------------------------- /include/tbb/partitioner.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/partitioner.h" 18 | -------------------------------------------------------------------------------- /include/tbb/profiling.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/profiling.h" 18 | -------------------------------------------------------------------------------- /include/tbb/queuing_mutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/queuing_mutex.h" 18 | -------------------------------------------------------------------------------- /include/tbb/queuing_rw_mutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/queuing_rw_mutex.h" 18 | -------------------------------------------------------------------------------- /include/tbb/rw_mutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 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 "../oneapi/tbb/rw_mutex.h" 18 | -------------------------------------------------------------------------------- /include/tbb/scalable_allocator.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/scalable_allocator.h" 18 | -------------------------------------------------------------------------------- /include/tbb/spin_mutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/spin_mutex.h" 18 | -------------------------------------------------------------------------------- /include/tbb/spin_rw_mutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/spin_rw_mutex.h" 18 | -------------------------------------------------------------------------------- /include/tbb/task.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/task.h" 18 | -------------------------------------------------------------------------------- /include/tbb/task_arena.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/task_arena.h" 18 | -------------------------------------------------------------------------------- /include/tbb/task_group.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/task_group.h" 18 | -------------------------------------------------------------------------------- /include/tbb/task_scheduler_observer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/task_scheduler_observer.h" 18 | -------------------------------------------------------------------------------- /include/tbb/tbb.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb.h" 18 | -------------------------------------------------------------------------------- /include/tbb/tbb_allocator.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/tbb_allocator.h" 18 | -------------------------------------------------------------------------------- /include/tbb/tbbmalloc_proxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/tbbmalloc_proxy.h" 18 | -------------------------------------------------------------------------------- /include/tbb/tick_count.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/tick_count.h" 18 | -------------------------------------------------------------------------------- /include/tbb/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 "../oneapi/tbb/version.h" 18 | -------------------------------------------------------------------------------- /integration/linux/env/vars.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2005-2025 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 TBBROOT=@TBBROOT_REPLACEMENT@ 18 | 19 | LD_LIBRARY_PATH="@LIBRARY_PATH_REPLACEMENT@:${LD_LIBRARY_PATH}"; export LD_LIBRARY_PATH 20 | LIBRARY_PATH="@LIBRARY_PATH_REPLACEMENT@:${LIBRARY_PATH}"; export LIBRARY_PATH 21 | C_INCLUDE_PATH="${TBBROOT}/include:${C_INCLUDE_PATH}"; export C_INCLUDE_PATH 22 | CPLUS_INCLUDE_PATH="${TBBROOT}/include:${CPLUS_INCLUDE_PATH}"; export CPLUS_INCLUDE_PATH 23 | PKG_CONFIG_PATH="@LIBRARY_PATH_REPLACEMENT@/pkgconfig:${PKG_CONFIG_PATH}"; export PKG_CONFIG_PATH 24 | 25 | @CMAKE_ENVIRONMENT_SOURCING_STRING@ 26 | -------------------------------------------------------------------------------- /integration/linux/oneapi/vars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # shellcheck shell=sh 3 | # 4 | # Copyright (c) 2023 Intel Corporation 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | if [ -z "${SETVARS_CALL:-}" ] ; then 19 | >&2 echo " " 20 | >&2 echo ":: ERROR: This script must be sourced by setvars.sh." 21 | >&2 echo " Try 'source /setvars.sh --help' for help." 22 | >&2 echo " " 23 | return 255 24 | fi 25 | 26 | if [ -z "${ONEAPI_ROOT:-}" ] ; then 27 | >&2 echo " " 28 | >&2 echo ":: ERROR: This script requires that the ONEAPI_ROOT env variable is set." 29 | >&2 echo " Try 'source \setvars.sh --help' for help." 30 | >&2 echo " " 31 | return 254 32 | fi 33 | 34 | TBBROOT="${ONEAPI_ROOT}"; export TBBROOT 35 | -------------------------------------------------------------------------------- /integration/linux/sys_check/sys_check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2019-2021 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 | LOC=$(realpath $(dirname "${BASH_SOURCE[0]}")) 18 | source $LOC/../../../common.sh $@ 19 | 20 | ERRORSTATE=0 21 | return $ERRORSTATE 22 | -------------------------------------------------------------------------------- /integration/mac/env/vars.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2005-2025 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 TBBROOT=@TBBROOT_REPLACEMENT@ 18 | 19 | DYLD_LIBRARY_PATH="@LIBRARY_PATH_REPLACEMENT@:${DYLD_LIBRARY_PATH}"; export DYLD_LIBRARY_PATH 20 | LIBRARY_PATH="@LIBRARY_PATH_REPLACEMENT@:${LIBRARY_PATH}"; export LIBRARY_PATH 21 | C_INCLUDE_PATH="${TBBROOT}/include:${C_INCLUDE_PATH}"; export C_INCLUDE_PATH 22 | CPLUS_INCLUDE_PATH="${TBBROOT}/include:${CPLUS_INCLUDE_PATH}"; export CPLUS_INCLUDE_PATH 23 | PKG_CONFIG_PATH="@LIBRARY_PATH_REPLACEMENT@/pkgconfig:${PKG_CONFIG_PATH}"; export PKG_CONFIG_PATH 24 | 25 | @CMAKE_ENVIRONMENT_SOURCING_STRING@ 26 | -------------------------------------------------------------------------------- /integration/pkg-config/tbb.pc.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021-2024 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 | prefix=@_prefix_for_pc_file@ 16 | libdir=@_libdir_for_pc_file@ 17 | includedir=@_includedir_for_pc_file@ 18 | 19 | Name: oneAPI Threading Building Blocks (oneTBB) 20 | Description: C++ library for parallel programming on multi-core processors. 21 | URL: https://github.com/uxlfoundation/oneTBB 22 | Version: @TBB_VERSION@ 23 | Libs: -L${libdir} @_tbb_pc_extra_libdir@ -l@_tbb_pc_lib_name@ 24 | Cflags: -I${includedir} 25 | -------------------------------------------------------------------------------- /integration/windows/env/vars.bat.in: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM 3 | REM Copyright (c) 2005-2025 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 | 18 | @echo off 19 | 20 | set "TBBROOT=@TBBROOT_REPLACEMENT@" 21 | set "TBB_DLL_PATH=@BINARY_PATH_REPLACEMENT@" 22 | 23 | set "INCLUDE=%TBBROOT%\include;%INCLUDE%" 24 | set "C_INCLUDE_PATH=%TBBROOT%\include;%C_INCLUDE_PATH%" 25 | set "CPLUS_INCLUDE_PATH=%TBBROOT%\include;%CPLUS_INCLUDE_PATH%" 26 | set "LIB=@LIBRARY_PATH_REPLACEMENT@;%LIB%" 27 | set "PATH=@BINARY_PATH_REPLACEMENT@;%PATH%" 28 | set "PKG_CONFIG_PATH=@LIBRARY_PATH_REPLACEMENT@\pkgconfig;%PKG_CONFIG_PATH%" 29 | 30 | @CMAKE_ENVIRONMENT_SOURCING_STRING@ 31 | -------------------------------------------------------------------------------- /integration/windows/sys_check/sys_check.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM 3 | REM Copyright (c) 2019-2021 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 | 18 | exit /B 0 19 | -------------------------------------------------------------------------------- /python/TBB.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016-2023 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 | 16 | from tbb import * 17 | from tbb import __all__, __doc__ 18 | 19 | if __name__ == "__main__": 20 | from tbb import _main 21 | import sys 22 | sys.exit(_main()) 23 | -------------------------------------------------------------------------------- /python/rml/ipc_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2017-2021 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 | }}} // namespace tbb::internal::rml 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /python/tbb/__main__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016-2023 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 | 16 | from . import _main 17 | from sys import exit 18 | exit(_main()) 19 | -------------------------------------------------------------------------------- /rfcs/archived/README.md: -------------------------------------------------------------------------------- 1 | # Archived Design Documents 2 | 3 | Documents may appear in the `rfcs/archived` directory for one of 4 | two reasons: 5 | 6 | 1. The document describes a feature or extension that has been deprecated and 7 | then removed. 8 | 2. The document describes a proposed feature or extension that has 9 | not (ultimately) become a fully supported feature. 10 | 11 | Design documents that appear in the `rfcs/archived` folder should describe a 12 | reason for archiving. Documents may 13 | remain in this folder indefinitely to serve as a source of information about 14 | previous proposals and features. 15 | -------------------------------------------------------------------------------- /rfcs/experimental/README.md: -------------------------------------------------------------------------------- 1 | # Design Documents for Experimental Features 2 | 3 | Experimental proposals describe extensions that are implemented and 4 | released as preview features in the oneTBB library. A preview 5 | feature is expected to have an implementation that is of comparable quality 6 | to a fully supported feature. Sufficient tests are required. 7 | 8 | An experimental feature does not yet appear as part of the oneTBB 9 | specification. Therefore, the interface and design can change. 10 | There is no commitment to backward compatibility for a preview 11 | feature. 12 | 13 | The documents in this directory 14 | should include a list of the exit conditions that need to be met to move from 15 | preview to fully supported. These conditions might include demonstrated 16 | performance improvements, demonstrated interest from the community, 17 | acceptance of the required oneTBB specification changes, etc. 18 | 19 | For features that require oneTBB specification changes, the document might 20 | include wording for those changes or a link to any PRs that opened 21 | against the specification. 22 | 23 | Proposals should not remain in the experimental directory forever. 24 | It should move either to the 25 | supported folder when they become fully supported or the archived 26 | folder if they are not fully accepted. It should be highly unusual for 27 | a proposal to stay in the experimental folder for longer than a year or 28 | two. 29 | -------------------------------------------------------------------------------- /rfcs/experimental/flow_graph_msg_keys/JoinGraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/experimental/flow_graph_msg_keys/JoinGraph.png -------------------------------------------------------------------------------- /rfcs/experimental/flow_graph_node_sets/graph_with_many_edges.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/experimental/flow_graph_node_sets/graph_with_many_edges.png -------------------------------------------------------------------------------- /rfcs/experimental/flow_graph_node_sets/make_edges.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/experimental/flow_graph_node_sets/make_edges.png -------------------------------------------------------------------------------- /rfcs/experimental/parallel_phase_for_task_arena/alternative_proposal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/experimental/parallel_phase_for_task_arena/alternative_proposal.png -------------------------------------------------------------------------------- /rfcs/experimental/parallel_phase_for_task_arena/completely_disable_new_behavior.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/experimental/parallel_phase_for_task_arena/completely_disable_new_behavior.png -------------------------------------------------------------------------------- /rfcs/experimental/parallel_phase_for_task_arena/parallel_phase_introduction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/experimental/parallel_phase_for_task_arena/parallel_phase_introduction.png -------------------------------------------------------------------------------- /rfcs/experimental/parallel_phase_for_task_arena/parallel_phase_sequence_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/experimental/parallel_phase_for_task_arena/parallel_phase_sequence_diagram.png -------------------------------------------------------------------------------- /rfcs/experimental/parallel_phase_for_task_arena/parallel_phase_state_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/experimental/parallel_phase_for_task_arena/parallel_phase_state_final.png -------------------------------------------------------------------------------- /rfcs/experimental/parallel_phase_for_task_arena/parallel_phase_state_initial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/experimental/parallel_phase_for_task_arena/parallel_phase_state_initial.png -------------------------------------------------------------------------------- /rfcs/proposed/README.md: -------------------------------------------------------------------------------- 1 | # Design Documents for Proposed Features 2 | 3 | Proposed features in this directory have reached some level of consensus within the 4 | community, indicating that they have potential and deserve further development. 5 | However, the proposed changes have not yet been released as a 6 | preview or fully supported feature of the library. 7 | 8 | RFCs in the `rfcs/proposed` directory should explain the motivation, 9 | design, and open questions related to the proposed extension. 10 | -------------------------------------------------------------------------------- /rfcs/proposed/flow_graph_serializers/README_files/figure-commonmark/fig-delay-distribution-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/proposed/flow_graph_serializers/README_files/figure-commonmark/fig-delay-distribution-1.png -------------------------------------------------------------------------------- /rfcs/proposed/flow_graph_serializers/README_files/figure-commonmark/fig-program-start-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/proposed/flow_graph_serializers/README_files/figure-commonmark/fig-program-start-1.png -------------------------------------------------------------------------------- /rfcs/proposed/flow_graph_serializers/README_files/figure-commonmark/fig-program-start-after-first-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/proposed/flow_graph_serializers/README_files/figure-commonmark/fig-program-start-after-first-1.png -------------------------------------------------------------------------------- /rfcs/proposed/flow_graph_serializers/README_files/figure-commonmark/fig-program-wind-down-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/proposed/flow_graph_serializers/README_files/figure-commonmark/fig-program-wind-down-1.png -------------------------------------------------------------------------------- /rfcs/proposed/flow_graph_serializers/README_files/figure-commonmark/fig-source-durations-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/proposed/flow_graph_serializers/README_files/figure-commonmark/fig-source-durations-1.png -------------------------------------------------------------------------------- /rfcs/proposed/flow_graph_serializers/README_files/figure-commonmark/fig-source-time-structure-by-message-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/proposed/flow_graph_serializers/README_files/figure-commonmark/fig-source-time-structure-by-message-1.png -------------------------------------------------------------------------------- /rfcs/proposed/flow_graph_serializers/README_files/figure-commonmark/fig-source-time-structure-by-start-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/proposed/flow_graph_serializers/README_files/figure-commonmark/fig-source-time-structure-by-start-1.png -------------------------------------------------------------------------------- /rfcs/proposed/flow_graph_serializers/README_files/figure-commonmark/fig-thread-busy-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/proposed/flow_graph_serializers/README_files/figure-commonmark/fig-thread-busy-1.png -------------------------------------------------------------------------------- /rfcs/proposed/flow_graph_serializers/analyzed-graph-with-limiters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/proposed/flow_graph_serializers/analyzed-graph-with-limiters.png -------------------------------------------------------------------------------- /rfcs/proposed/flow_graph_serializers/custom.scss: -------------------------------------------------------------------------------- 1 | /*-- scss:defaults --*/ 2 | 3 | // $presentation-font-size-root: 32px; 4 | 5 | @import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); 6 | 7 | $font-family-serif: "Crimson Pro", serif; 8 | $presentation-heading-font: "Crimson Pro", serif; 9 | $font-family-serif: "Crimson Pro", serif; 10 | $link-color: #1111ff; 11 | $red: #dc1111; 12 | 13 | /*-- scss:rules --*/ 14 | 15 | .cell-output { 16 | border: 1px solid #ccc; 17 | padding: 0.5em; 18 | } 19 | 20 | .reveal .alert { 21 | color: $red; 22 | } 23 | 24 | .reveal .slide-number { 25 | // color: $link-color; 26 | font-size: 0.8em !important; 27 | } 28 | 29 | .reveal .title-slide h1 { 30 | text-align: center; 31 | } 32 | 33 | .reveal .footer { 34 | font-size: 0.8em !important; 35 | text-align: center !important; 36 | } 37 | 38 | .reveal code { 39 | // Monospaced fonts typically are larger than 40 | font-size: smaller; 41 | } 42 | 43 | .reveal .sourceCode { 44 | // This is used for code blocks, not inline code 45 | font-size: smaller; 46 | } 47 | -------------------------------------------------------------------------------- /rfcs/proposed/flow_graph_serializers/function-serialization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/proposed/flow_graph_serializers/function-serialization.png -------------------------------------------------------------------------------- /rfcs/proposed/flow_graph_serializers/functions.R: -------------------------------------------------------------------------------- 1 | read_times <- function(fname) { 2 | readr::read_tsv(fname, col_types = "ciccii") |> 3 | dplyr::mutate( 4 | time = as.numeric(lubridate::hms(time)), 5 | thread = as.factor(thread), 6 | event = as.factor(event), 7 | node = as.factor(node) 8 | ) |> 9 | dplyr::mutate(time = time - min(time)) |> 10 | dplyr::mutate(time = 1000 * time) 11 | } 12 | 13 | scale_x_log10_nice <- function(...) { 14 | ggplot2::scale_x_log10( 15 | breaks = scales::trans_breaks("log10", function(x) 10^x), 16 | labels = scales::trans_format("log10", scales::math_format(10^.x)) 17 | ) 18 | } 19 | 20 | scale_y_log10_nice <- function(...) { 21 | ggplot2::scale_y_log10( 22 | breaks = scales::trans_breaks("log10", function(x) 10^x), 23 | labels = scales::trans_format("log10", scales::math_format(10^.x)) 24 | ) 25 | } 26 | 27 | # Produce a vector of "black" or "white" for each given color, so that they 28 | # can be used as labels that contrast with the given color. 29 | get_contrast_color <- function(color) { 30 | rgb <- col2rgb(color) / 255 31 | luminance <- 0.2126 * rgb[1] + 0.7152 * rgb[2] + 0.0722 * rgb[3] 32 | if (luminance > 0.5) "black" else "white" 33 | } 34 | -------------------------------------------------------------------------------- /rfcs/proposed/task_group_dynamic_dependencies/add_dependency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/proposed/task_group_dynamic_dependencies/add_dependency.png -------------------------------------------------------------------------------- /rfcs/proposed/task_group_dynamic_dependencies/merge_sort.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/proposed/task_group_dynamic_dependencies/merge_sort.png -------------------------------------------------------------------------------- /rfcs/proposed/task_group_dynamic_dependencies/three_task_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/proposed/task_group_dynamic_dependencies/three_task_graph.png -------------------------------------------------------------------------------- /rfcs/proposed/task_group_dynamic_dependencies/unknown_states.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uxlfoundation/oneTBB/65f1633ff43dcddc64b9772992ecc3d4d6492965/rfcs/proposed/task_group_dynamic_dependencies/unknown_states.png -------------------------------------------------------------------------------- /rfcs/supported/README.md: -------------------------------------------------------------------------------- 1 | # Design Documents for Supported Features 2 | 3 | Supported proposals describe extensions implemented and 4 | released as fully supported features of the oneTBB library. A fully supported 5 | feature has a high-quality implementation. If the proposal impacted the 6 | public API of the library, it should appear in the oneTBB specification and 7 | have supporting documentation in the oneTBB Reference as needed. A fully 8 | supported feature is regularly tested. 9 | 10 | Proposals that appear in `rfcs/supported` may be retained indefinitely to 11 | provide insight into the design of existing features. 12 | -------------------------------------------------------------------------------- /src/tbb/version.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2020-2021 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 "oneapi/tbb/version.h" 18 | 19 | extern "C" int TBB_runtime_interface_version() { 20 | return TBB_INTERFACE_VERSION; 21 | } 22 | 23 | extern "C" const char* TBB_runtime_version() { 24 | static const char version_str[] = TBB_VERSION_STRING; 25 | return version_str; 26 | } 27 | -------------------------------------------------------------------------------- /src/tbbbind/def/lin32-tbbbind.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2019-2025 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 | __TBB_internal_initialize_system_topology; 20 | __TBB_internal_apply_affinity; 21 | __TBB_internal_restore_affinity; 22 | __TBB_internal_allocate_binding_handler; 23 | __TBB_internal_deallocate_binding_handler; 24 | __TBB_internal_get_default_concurrency; 25 | __TBB_internal_destroy_system_topology; 26 | 27 | local: 28 | *; 29 | }; 30 | -------------------------------------------------------------------------------- /src/tbbbind/def/lin64-tbbbind.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2019-2025 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 | __TBB_internal_initialize_system_topology; 20 | __TBB_internal_apply_affinity; 21 | __TBB_internal_restore_affinity; 22 | __TBB_internal_allocate_binding_handler; 23 | __TBB_internal_deallocate_binding_handler; 24 | __TBB_internal_get_default_concurrency; 25 | __TBB_internal_destroy_system_topology; 26 | 27 | local: 28 | *; 29 | }; 30 | -------------------------------------------------------------------------------- /src/tbbbind/def/mac64-tbbbind.def: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 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_internal_initialize_system_topology 16 | ___TBB_internal_get_default_concurrency 17 | ___TBB_internal_destroy_system_topology 18 | 19 | -------------------------------------------------------------------------------- /src/tbbbind/def/win32-tbbbind.def: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2019-2021 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 | __TBB_internal_initialize_system_topology 18 | __TBB_internal_apply_affinity 19 | __TBB_internal_restore_affinity 20 | __TBB_internal_allocate_binding_handler 21 | __TBB_internal_deallocate_binding_handler 22 | __TBB_internal_get_default_concurrency 23 | __TBB_internal_destroy_system_topology 24 | -------------------------------------------------------------------------------- /src/tbbbind/def/win64-tbbbind.def: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2019-2021 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 | __TBB_internal_initialize_system_topology 18 | __TBB_internal_apply_affinity 19 | __TBB_internal_restore_affinity 20 | __TBB_internal_allocate_binding_handler 21 | __TBB_internal_deallocate_binding_handler 22 | __TBB_internal_get_default_concurrency 23 | __TBB_internal_destroy_system_topology 24 | -------------------------------------------------------------------------------- /src/tbbmalloc/tbbmalloc_internal_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 | -------------------------------------------------------------------------------- /src/tbbmalloc_proxy/def/lin32-proxy.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 | -------------------------------------------------------------------------------- /src/tbbmalloc_proxy/def/lin64-proxy.def: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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 | -------------------------------------------------------------------------------- /test/common/dummy_body.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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_common_dummy_body_H 18 | #define __TBB_test_common_dummy_body_H 19 | 20 | #include "config.h" 21 | #include 22 | 23 | namespace utils { 24 | static void doDummyWork(std::size_t N) { 25 | for (volatile std::size_t i = 0; i < N; ) { i = i + 1; } 26 | } 27 | 28 | //! Functor with N dummy iterations in it`s body 29 | class DummyBody { 30 | int m_numIters; 31 | public: 32 | explicit DummyBody( int iters = 0 ) : m_numIters( iters ) {} 33 | void operator()( int ) const { 34 | doDummyWork(m_numIters); 35 | } 36 | void operator()() const { 37 | doDummyWork(m_numIters); 38 | } 39 | }; 40 | 41 | } // namespace utils 42 | 43 | #endif // __TBB_test_common_dummy_body_H 44 | -------------------------------------------------------------------------------- /test/common/test.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2020-2021 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_common_test_H 18 | #define __TBB_test_common_test_H 19 | 20 | #include "config.h" 21 | 22 | #if !defined(DOCTEST_CONFIG_IMPLEMENT) 23 | #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN 24 | #endif 25 | #if TBB_USE_EXCEPTIONS 26 | #define TBB_TEST_THROW(x) throw x 27 | #else 28 | #define DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS 29 | #define TBB_TEST_THROW(x) FAIL("Exceptions are disabled") 30 | #endif 31 | 32 | #include "doctest.h" 33 | 34 | #define CHECK_FAST(x) do { if (!(x)) { CHECK(false); } } while((void)0, 0) 35 | #define CHECK_FAST_MESSAGE(x, y) do { if (!(x)) { CHECK_MESSAGE(false, y); } } while((void)0, 0) 36 | 37 | #endif // __TBB_test_common_test_H 38 | -------------------------------------------------------------------------------- /test/common/utils_yield.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2005-2021 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_common_utils_yield_H 18 | #define __TBB_test_common_utils_yield_H 19 | 20 | #include "config.h" 21 | #include 22 | 23 | namespace utils { 24 | #if __TBB_GLIBCXX_THIS_THREAD_YIELD_BROKEN 25 | static inline void yield() { 26 | sched_yield(); 27 | } 28 | #else 29 | using std::this_thread::yield; 30 | #endif 31 | } 32 | 33 | #endif // __TBB_test_common_utils_yield_H 34 | -------------------------------------------------------------------------------- /test/tbb/test_implicit_linkage_on_windows.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2020-2021 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/test.h" 18 | 19 | #include 20 | 21 | //! \file test_implicit_linkage_on_windows.cpp 22 | //! \brief Test for [internal] functionality 23 | 24 | //! Testing the library is implicitly linked on Windows platforms 25 | //! \brief \ref error_guessing \ref interface 26 | TEST_CASE("Test implicit linkage") { 27 | // Pulling something from the library so that it is indeed required during the linkage 28 | REQUIRE_MESSAGE( 29 | TBB_runtime_interface_version()==TBB_INTERFACE_VERSION, 30 | "Running with the library of different version than the test was compiled against." 31 | ); 32 | } 33 | -------------------------------------------------------------------------------- /test/tbb/test_tbb_header_secondary.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2020-2022 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 | //! \file test_tbb_header_secondary.cpp 18 | //! \brief Test for [all] specification 19 | 20 | #if __INTEL_COMPILER && _MSC_VER 21 | #pragma warning(disable : 2586) // decorated name length exceeded, name was truncated 22 | #endif 23 | 24 | #ifndef NOMINMAX 25 | #define NOMINMAX 26 | #endif // NOMINMAX 27 | 28 | #if _MSC_VER && TBB_USE_DEBUG 29 | // Check that there is no conflict with _CRTDBG_MAP_ALLOC 30 | #define _CRTDBG_MAP_ALLOC 31 | #include "crtdbg.h" 32 | #endif 33 | 34 | #include 35 | 36 | #define CHECK(x) do { if (!(x)) { std::terminate(); } } while (false) 37 | #define CHECK_MESSAGE(x, y) CHECK(x); 38 | 39 | #define __TBB_TEST_SECONDARY 1 40 | #include "test_tbb_header.cpp" 41 | --------------------------------------------------------------------------------