Skip to content

Commit 1657989

Browse files
committed
Cleanup preview macros
1 parent d3ad09c commit 1657989

File tree

10 files changed

+25
-32
lines changed

10 files changed

+25
-32
lines changed

include/oneapi/tbb/detail/_config.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,11 +513,12 @@
513513
#include <android/api-level.h>
514514
#endif
515515

516+
#ifndef __TBB_CRITICAL_TASKS
517+
#define __TBB_CRITICAL_TASKS 1
518+
#endif
519+
516520
#define __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING (TBB_PREVIEW_FLOW_GRAPH_FEATURES)
517521

518-
#ifndef __TBB_PREVIEW_CRITICAL_TASKS
519-
#define __TBB_PREVIEW_CRITICAL_TASKS 1
520-
#endif
521522

522523
#ifndef __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
523524
#define __TBB_PREVIEW_FLOW_GRAPH_NODE_SET (TBB_PREVIEW_FLOW_GRAPH_FEATURES)

include/oneapi/tbb/detail/_flow_graph_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ inline void spawn_in_graph_arena(graph& g, graph_task& arena_task) {
546546

547547
__TBB_ASSERT(g.my_task_arena && g.my_task_arena->is_active(), nullptr);
548548
submit( *gt, *g.my_task_arena, *g.my_context
549-
#if __TBB_PREVIEW_CRITICAL_TASKS
549+
#if __TBB_CRITICAL_TASKS
550550
, /*as_critical=*/false
551551
#endif
552552
);

python/tbb/api.i

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
%pythonbegin %{
22
#
3-
# Copyright (c) 2016-2021 Intel Corporation
3+
# Copyright (c) 2016-2025 Intel Corporation
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -34,7 +34,6 @@ __all__ = ["task_arena",
3434
#endif
3535

3636
%{
37-
#define TBB_PREVIEW_WAITING_FOR_WORKERS 1
3837
#include "tbb/task_arena.h"
3938
#include "tbb/task_group.h"
4039
#include "tbb/global_control.h"

src/tbb/arena.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ arena::arena(threading_control* control, unsigned num_slots, unsigned num_reserv
277277
}
278278
my_fifo_task_stream.initialize(my_num_slots);
279279
my_resume_task_stream.initialize(my_num_slots);
280-
#if __TBB_PREVIEW_CRITICAL_TASKS
280+
#if __TBB_CRITICAL_TASKS
281281
my_critical_task_stream.initialize(my_num_slots);
282282
#endif
283283
my_mandatory_requests = 0;
@@ -337,7 +337,7 @@ void arena::free_arena () {
337337
my_co_cache.cleanup();
338338
my_default_ctx->~task_group_context();
339339
cache_aligned_deallocate(my_default_ctx);
340-
#if __TBB_PREVIEW_CRITICAL_TASKS
340+
#if __TBB_CRITICAL_TASKS
341341
__TBB_ASSERT( my_critical_task_stream.empty(), "Not all critical tasks were executed");
342342
#endif
343343
// Clear enfources synchronization with observe(false)
@@ -375,7 +375,7 @@ bool arena::has_tasks() {
375375
tasks_are_available = !my_slots[k].is_empty();
376376
}
377377
tasks_are_available = tasks_are_available || has_enqueued_tasks() || !my_resume_task_stream.empty();
378-
#if __TBB_PREVIEW_CRITICAL_TASKS
378+
#if __TBB_CRITICAL_TASKS
379379
tasks_are_available = tasks_are_available || !my_critical_task_stream.empty();
380380
#endif
381381
return tasks_are_available;

src/tbb/arena.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ struct arena_base : padded<intrusive_list_node> {
274274
//! Task pool for the tasks scheduled via tbb::resume() function.
275275
task_stream<front_accessor> my_resume_task_stream; // heavy use in stealing loop
276276

277-
#if __TBB_PREVIEW_CRITICAL_TASKS
277+
#if __TBB_CRITICAL_TASKS
278278
//! Task pool for the tasks with critical property set.
279279
/** Critical tasks are scheduled for execution ahead of other sources (including local task pool
280280
and even bypassed tasks) unless the thread already executes a critical task in an outer
@@ -423,7 +423,7 @@ class arena: public padded<arena_base>
423423
template<task_stream_accessor_type accessor>
424424
d1::task* get_stream_task(task_stream<accessor>& stream, unsigned& hint);
425425

426-
#if __TBB_PREVIEW_CRITICAL_TASKS
426+
#if __TBB_CRITICAL_TASKS
427427
//! Tries to find a critical task in global critical task stream
428428
d1::task* get_critical_task(unsigned& hint, isolation_type isolation);
429429
#endif
@@ -576,7 +576,7 @@ inline d1::task* arena::get_stream_task(task_stream<accessor>& stream, unsigned&
576576
return stream.pop(subsequent_lane_selector(hint));
577577
}
578578

579-
#if __TBB_PREVIEW_CRITICAL_TASKS
579+
#if __TBB_CRITICAL_TASKS
580580
// Retrieves critical task respecting isolation level, if provided. The rule is:
581581
// 1) If no outer critical task and no isolation => take any critical task
582582
// 2) If working on an outer critical task and no isolation => cannot take any critical task
@@ -593,7 +593,7 @@ inline d1::task* arena::get_critical_task(unsigned& hint, isolation_type isolati
593593
return my_critical_task_stream.pop(preceding_lane_selector(hint));
594594
}
595595
}
596-
#endif // __TBB_PREVIEW_CRITICAL_TASKS
596+
#endif // __TBB_CRITICAL_TASKS
597597

598598
} // namespace r1
599599
} // namespace detail

src/tbb/arena_slot.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2005-2023 Intel Corporation
2+
Copyright (c) 2005-2025 Intel Corporation
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -65,7 +65,7 @@ struct alignas(max_nfs_size) arena_slot_private_state {
6565
/** Modified by the owner thread (during these operations). **/
6666
unsigned hint_for_fifo_stream;
6767

68-
#if __TBB_PREVIEW_CRITICAL_TASKS
68+
#if __TBB_CRITICAL_TASKS
6969
//! Similar to 'hint_for_fifo_stream' but for critical tasks.
7070
unsigned hint_for_critical_stream;
7171
#endif
@@ -188,12 +188,12 @@ class arena_slot : private arena_slot_shared_state, private arena_slot_private_s
188188
#if __TBB_RESUMABLE_TASKS
189189
hint_for_resume_stream = h;
190190
#endif
191-
#if __TBB_PREVIEW_CRITICAL_TASKS
191+
#if __TBB_CRITICAL_TASKS
192192
hint_for_critical_stream = h;
193193
#endif
194194
}
195195

196-
#if __TBB_PREVIEW_CRITICAL_TASKS
196+
#if __TBB_CRITICAL_TASKS
197197
unsigned& critical_hint() {
198198
return hint_for_critical_stream;
199199
}

src/tbb/task.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2005-2024 Intel Corporation
2+
Copyright (c) 2005-2025 Intel Corporation
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -59,7 +59,7 @@ void resume(suspend_point_type* sp) {
5959
// The target is not in the process of executing critical task, so the resume task is not critical.
6060
a.my_resume_task_stream.push(&sp->m_resume_task, random_lane_selector(sp->m_random));
6161
} else {
62-
#if __TBB_PREVIEW_CRITICAL_TASKS
62+
#if __TBB_CRITICAL_TASKS
6363
// The target is in the process of executing critical task, so the resume task is critical.
6464
a.my_critical_task_stream.push(&sp->m_resume_task, random_lane_selector(sp->m_random));
6565
#endif

src/tbb/task_dispatcher.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2020-2022 Intel Corporation
2+
Copyright (c) 2020-2025 Intel Corporation
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -89,7 +89,7 @@ void __TBB_EXPORTED_FUNC submit(d1::task& t, d1::task_group_context& ctx, arena*
8989

9090
if ( tls.is_attached_to(a) ) {
9191
arena_slot* slot = tls.my_arena_slot;
92-
#if __TBB_PREVIEW_CRITICAL_TASKS
92+
#if __TBB_CRITICAL_TASKS
9393
if( as_critical ) {
9494
a->my_critical_task_stream.push( &t, subsequent_lane_selector(slot->critical_hint()) );
9595
} else
@@ -99,7 +99,7 @@ void __TBB_EXPORTED_FUNC submit(d1::task& t, d1::task_group_context& ctx, arena*
9999
}
100100
} else {
101101
random_lane_selector lane_selector{tls.my_random};
102-
#if !__TBB_PREVIEW_CRITICAL_TASKS
102+
#if !__TBB_CRITICAL_TASKS
103103
suppress_unused_warning(as_critical);
104104
#else
105105
if ( as_critical ) {

src/tbb/task_dispatcher.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2020-2024 Intel Corporation
2+
Copyright (c) 2020-2025 Intel Corporation
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -403,7 +403,7 @@ inline void task_dispatcher::recall_point() {
403403
}
404404
#endif /* __TBB_RESUMABLE_TASKS */
405405

406-
#if __TBB_PREVIEW_CRITICAL_TASKS
406+
#if __TBB_CRITICAL_TASKS
407407
inline d1::task* task_dispatcher::get_critical_task(d1::task* t, execution_data_ext& ed, isolation_type isolation, bool critical_allowed) {
408408
__TBB_ASSERT( critical_allowed || !m_properties.critical_task_allowed, nullptr );
409409

@@ -476,4 +476,3 @@ d1::task* task_dispatcher::local_wait_for_all(d1::task* t, Waiter& waiter) {
476476
} // namespace tbb
477477

478478
#endif // _TBB_task_dispatcher_H
479-

test/common/config.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@
1818
#define __TBB_test_common_config_H
1919

2020
#if __TBB_CPF_BUILD
21-
#ifndef TBB_PREVIEW_FLOW_GRAPH_FEATURES
21+
#ifndef TBB_PREVIEW_FLOW_GRAPH_FEATURES
2222
#define TBB_PREVIEW_FLOW_GRAPH_FEATURES 1
2323
#endif
24-
#ifndef TBB_PREVIEW_ALGORITHM_TRACE
25-
#define TBB_PREVIEW_ALGORITHM_TRACE 1
26-
#endif
2724
#ifndef TBB_DEPRECATED_LIMITER_NODE_CONSTRUCTOR
2825
#define TBB_DEPRECATED_LIMITER_NODE_CONSTRUCTOR 1
2926
#endif
@@ -33,9 +30,6 @@
3330
#ifndef TBB_PREVIEW_CONCURRENT_LRU_CACHE
3431
#define TBB_PREVIEW_CONCURRENT_LRU_CACHE 1
3532
#endif
36-
#ifndef TBB_PREVIEW_VARIADIC_PARALLEL_INVOKE
37-
#define TBB_PREVIEW_VARIADIC_PARALLEL_INVOKE 1
38-
#endif
3933
#ifndef TBB_PREVIEW_ISOLATED_TASK_GROUP
4034
#define TBB_PREVIEW_ISOLATED_TASK_GROUP 1
4135
#endif

0 commit comments

Comments
 (0)