Warning, /include/oneapi/tbb.cppm is written in an unsupported language. File is not indexed.
0001 /*
0002 Copyright (c) 2026 UXL Foundation Contributors
0003
0004 Licensed under the Apache License, Version 2.0 (the "License");
0005 you may not use this file except in compliance with the License.
0006 You may obtain a copy of the License at
0007
0008 http://www.apache.org/licenses/LICENSE-2.0
0009
0010 Unless required by applicable law or agreed to in writing, software
0011 distributed under the License is distributed on an "AS IS" BASIS,
0012 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013 See the License for the specific language governing permissions and
0014 limitations under the License.
0015 */
0016
0017 module;
0018
0019 #include <oneapi/tbb.h>
0020
0021 export module tbb;
0022
0023 export namespace oneapi {
0024 namespace tbb = ::tbb;
0025 } // export namespace oneapi
0026
0027 export using ::TBB_runtime_interface_version;
0028 export using ::TBB_runtime_version;
0029
0030 export namespace tbb {
0031 // TODO: In general explicit v1 namespace is not needed because it is inline,
0032 // but for some reason MSVC fails to implicitly insert it, which results in ambiguous symbol errors
0033
0034 // Parallel Algorithms
0035 using tbb::v1::split;
0036 using tbb::v1::proportional_split;
0037
0038 using tbb::v1::blocked_range;
0039 using tbb::v1::blocked_range2d;
0040 using tbb::v1::blocked_range3d;
0041 using tbb::v1::blocked_nd_range;
0042
0043 using tbb::v1::parallel_for;
0044 using tbb::v1::parallel_for_each;
0045 using tbb::v1::feeder;
0046 using tbb::v1::parallel_invoke;
0047 using tbb::v1::parallel_pipeline;
0048 using tbb::v1::filter;
0049 using tbb::v1::make_filter;
0050 using tbb::v1::filter_mode;
0051 using tbb::v1::flow_control;
0052 using tbb::v1::parallel_reduce;
0053 using tbb::v1::parallel_deterministic_reduce;
0054 using tbb::v1::parallel_scan;
0055 using tbb::v1::pre_scan_tag;
0056 using tbb::v1::final_scan_tag;
0057 using tbb::v1::parallel_sort;
0058 using tbb::v1::auto_partitioner;
0059 using tbb::v1::simple_partitioner;
0060 using tbb::v1::static_partitioner;
0061 using tbb::v1::affinity_partitioner;
0062
0063 using tbb::collaborative_call_once;
0064 using tbb::collaborative_once_flag;
0065
0066 // Concurrent Containers
0067 using tbb::v1::tbb_hash_compare;
0068 using tbb::v1::concurrent_hash_map;
0069
0070 #if __TBB_PREVIEW_CONCURRENT_LRU_CACHE
0071 using tbb::v1::concurrent_lru_cache;
0072 #endif
0073
0074 using tbb::v1::concurrent_map;
0075 using tbb::v1::concurrent_multimap;
0076 using tbb::v1::concurrent_set;
0077 using tbb::v1::concurrent_multiset;
0078 using tbb::v1::concurrent_unordered_map;
0079 using tbb::v1::concurrent_unordered_multimap;
0080 using tbb::v1::concurrent_unordered_set;
0081 using tbb::v1::concurrent_unordered_multiset;
0082 using tbb::v1::concurrent_vector;
0083 using tbb::v1::concurrent_priority_queue;
0084 using tbb::v1::concurrent_queue;
0085 using tbb::v1::concurrent_bounded_queue;
0086
0087 // Mutual Exclusion
0088 using tbb::v1::mutex;
0089 using tbb::v1::rw_mutex;
0090 using tbb::v1::null_mutex;
0091 using tbb::v1::null_rw_mutex;
0092 using tbb::v1::queuing_mutex;
0093 using tbb::v1::queuing_rw_mutex;
0094 using tbb::v1::spin_mutex;
0095 using tbb::v1::spin_rw_mutex;
0096 using tbb::v1::speculative_spin_mutex;
0097 using tbb::v1::speculative_spin_rw_mutex;
0098
0099 // Memory Allocation
0100 using tbb::v1::cache_aligned_allocator;
0101 using tbb::v1::cache_aligned_resource;
0102 using tbb::v1::scalable_allocator;
0103 using tbb::v1::scalable_memory_resource;
0104 using tbb::v1::tbb_allocator;
0105 #if __TBB_PREVIEW_MEMORY_POOL
0106 using tbb::v1::memory_pool_allocator;
0107 using tbb::v1::memory_pool;
0108 using tbb::v1::fixed_pool;
0109 #endif
0110 #if __TBB_PREVIEW_NUMA_ALLOCATION
0111 using tbb::v1::allocate_numa_interleaved;
0112 using tbb::v1::deallocate_numa_interleaved;
0113 #endif
0114
0115 // Thread Local Storage
0116 using tbb::v1::combinable;
0117 using tbb::v1::enumerable_thread_specific;
0118 using tbb::v1::flattened2d;
0119 using tbb::v1::flatten2d;
0120 using tbb::v1::ets_key_usage_type;
0121 using tbb::v1::ets_key_per_instance;
0122 using tbb::v1::ets_no_key;
0123 #if __TBB_RESUMABLE_TASKS
0124 using tbb::v1::ets_suspend_aware;
0125 #endif
0126
0127 // Task Scheduler
0128 using tbb::v1::global_control;
0129 using tbb::v1::attach;
0130 using tbb::v1::finalize;
0131 using tbb::v1::task_scheduler_handle;
0132 #if !__TBB_DISABLE_SPEC_EXTENSIONS
0133 namespace ext {
0134 using tbb::ext::v1::assertion_handler_type;
0135 using tbb::ext::v1::set_assertion_handler;
0136 using tbb::ext::v1::get_assertion_handler;
0137 } // namespace ext
0138 #endif
0139
0140 namespace task {
0141 #if __TBB_RESUMABLE_TASKS
0142 using tbb::v1::task::suspend_point;
0143 using tbb::v1::task::resume;
0144 using tbb::v1::task::suspend;
0145 #endif
0146 using tbb::v1::task::current_context;
0147 } // namespace task
0148
0149 using tbb::v1::task_arena;
0150 using tbb::v1::create_numa_task_arenas;
0151 #if __TBB_PREVIEW_TASK_GROUP_EXTENSIONS
0152 using tbb::v1::is_inside_task;
0153 #endif
0154
0155 namespace this_task_arena {
0156 using tbb::v1::this_task_arena::current_thread_index;
0157 using tbb::v1::this_task_arena::max_concurrency;
0158 using tbb::v1::this_task_arena::isolate;
0159 using tbb::v1::this_task_arena::enqueue;
0160 #if __TBB_PREVIEW_PARALLEL_PHASE
0161 using tbb::v1::this_task_arena::start_parallel_phase;
0162 using tbb::v1::this_task_arena::end_parallel_phase;
0163 #endif
0164 } // namespace this_task_arena
0165
0166 using tbb::v1::task_group_context;
0167 using tbb::v1::task_group;
0168 #if __TBB_PREVIEW_ISOLATED_TASK_GROUP
0169 using tbb::v1::isolated_task_group;
0170 #endif
0171 using tbb::v1::task_group_status;
0172 using tbb::v1::not_complete;
0173 using tbb::v1::complete;
0174 using tbb::v1::canceled;
0175 using tbb::v1::is_current_task_group_canceling;
0176 using tbb::v1::task_handle;
0177 #if __TBB_PREVIEW_TASK_GROUP_EXTENSIONS
0178 using tbb::v1::task_completion_handle;
0179 using tbb::v1::task_complete;
0180 #endif
0181 using tbb::v1::task_scheduler_observer;
0182
0183 // info Namespace
0184 using tbb::v1::numa_node_id;
0185 using tbb::v1::core_type_id;
0186
0187 namespace info {
0188 using tbb::v1::info::numa_nodes;
0189 using tbb::v1::info::core_types;
0190 using tbb::v1::info::default_concurrency;
0191 } // namespace info
0192
0193 // Exceptions
0194 using tbb::v1::user_abort;
0195 using tbb::v1::bad_last_alloc;
0196 using tbb::v1::unsafe_wait;
0197 using tbb::v1::missing_wait;
0198
0199 // Timing
0200 using tbb::v1::tick_count;
0201
0202 // Flow Graph
0203 namespace flow {
0204 // TODO: should abstract APIs be part of module
0205 using tbb::flow::v1::receiver;
0206 using tbb::flow::v1::sender;
0207
0208 using tbb::flow::v1::serial;
0209 using tbb::flow::v1::unlimited;
0210
0211 using tbb::flow::v1::reset_flags;
0212 using tbb::flow::v1::rf_reset_protocol;
0213 using tbb::flow::v1::rf_reset_bodies;
0214 using tbb::flow::v1::rf_clear_edges;
0215
0216 using tbb::flow::v1::graph;
0217 using tbb::flow::v1::graph_node;
0218 using tbb::flow::v1::continue_msg;
0219
0220 using tbb::flow::v1::input_node;
0221 using tbb::flow::v1::function_node;
0222 using tbb::flow::v1::multifunction_node;
0223 using tbb::flow::v1::split_node;
0224 using tbb::flow::v1::output_port;
0225 using tbb::flow::v1::indexer_node;
0226 using tbb::flow::v1::tagged_msg;
0227 using tbb::flow::v1::cast_to;
0228 using tbb::flow::v1::is_a;
0229 using tbb::flow::v1::continue_node;
0230 using tbb::flow::v1::overwrite_node;
0231 using tbb::flow::v1::write_once_node;
0232 using tbb::flow::v1::broadcast_node;
0233 using tbb::flow::v1::buffer_node;
0234 using tbb::flow::v1::queue_node;
0235 using tbb::flow::v1::sequencer_node;
0236 using tbb::flow::v1::priority_queue_node;
0237 using tbb::flow::v1::limiter_node;
0238 using tbb::flow::v1::join_node;
0239 using tbb::flow::v1::input_port;
0240 using tbb::flow::v1::copy_body;
0241 using tbb::flow::v1::make_edge;
0242 using tbb::flow::v1::remove_edge;
0243 using tbb::flow::v1::tag_value;
0244 using tbb::flow::v1::composite_node;
0245 using tbb::flow::v1::async_node;
0246 using tbb::flow::v1::node_priority_t;
0247 using tbb::flow::v1::no_priority;
0248 using tbb::flow::v1::rejecting;
0249 using tbb::flow::v1::reserving;
0250 using tbb::flow::v1::queueing;
0251 using tbb::flow::v1::lightweight;
0252 using tbb::flow::v1::key_matching;
0253 using tbb::flow::v1::tag_matching;
0254 using tbb::flow::v1::queueing_lightweight;
0255 using tbb::flow::v1::rejecting_lightweight;
0256
0257 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
0258 using tbb::flow::v1::follows;
0259 using tbb::flow::v1::precedes;
0260 using tbb::flow::v1::make_node_set;
0261 using tbb::flow::v1::make_edges;
0262 #endif
0263
0264 #if __TBB_PREVIEW_FLOW_GRAPH_RESOURCE_LIMITING
0265 using tbb::flow::v1::resource_limiter;
0266 using tbb::flow::v1::resource_limited_node;
0267 #endif
0268 } // namespace flow
0269
0270 namespace profiling {
0271 using tbb::profiling::set_name;
0272 using tbb::profiling::event;
0273 } // namespace profiling
0274 } // export namespace tbb