Conversation
| #include <oneapi/tbb/version.h> | ||
| #include <oneapi/tbb/parallel_for.h> | ||
|
|
||
| #if TBB_HAS_PARALLEL_PHASE |
There was a problem hiding this comment.
Since parallel_phase is currently a preview feature, it will not be available unless the preview macro is also set, which it isn't in this example. Is that intentional? Unfortunately, there are no feature test macros that currently guard non-preview features; otherwise, I'd suggest demonstrating with one of those.
There was a problem hiding this comment.
Yes, it is missing by accident. I added missing preview macro.
|
|
||
| Each of these macros is defined in the header ``<oneapi/tbb/version.h>`` and in the feature headers | ||
| specified in the table below. | ||
|
|
There was a problem hiding this comment.
Maybe add a paragraph explaining the relationship between preview features and feature test macros. For example, something like, "For preview features, the feature test macro will only be defined if the preview feature macro has been defined. You cannot use a feature test macro to guard the setting of a feature's preview macro."
And then maybe give a counter example like:
#include <oneapi/tbb/version.h>
#if TBB_HAS_FEATURE_X
#define TBB_PREVIEW_FEATURE_X
#include <feature_header.h>
#endif
There was a problem hiding this comment.
Added suggested paragraph and also an example of incorrect/correct usage.
Signed-off-by: Isaev, Ilya <ilya.isaev@intel.com>
Signed-off-by: Isaev, Ilya <ilya.isaev@intel.com>
| parallel_loop2_body{}); | ||
|
|
||
| #if TBB_HAS_PARALLEL_PHASE | ||
| tbb::this_task_arena::end_parallel_phase(/*with_fast_leave=*/true); |
There was a problem hiding this comment.
It turns out that tbb::this_task_arena::end_parallel_phase(bool with_fast_leave) misses the default value for with_fast_leave parameter, which is actually mentioned in reference. I'll fix that in a separate PR and it shouldn't be a blocker for PR also.
Co-authored-by: Alexey Kukanov <alexey.kukanov@intel.com>
Signed-off-by: Isaev, Ilya <ilya.isaev@intel.com>
Description
Add a table illustrating feature-test macros.
WARNING: The PR should be merged only once the PRs with features documentation are merged to avoid broken links
Fixes # - issue number(s) if exists
Type of change
Choose one or multiple, leave empty if none of the other choices apply
Add a respective label(s) to PR if you have permissions
Tests
Documentation
Breaks backward compatibility
Notify the following users
List users with
@to send notificationsOther information