Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computing
cbmroot
Commits
490d24f1
Commit
490d24f1
authored
1 year ago
by
Felix Weiglhofer
Browse files
Options
Downloads
Patches
Plain Diff
algo: Use feature-test macro to check if stl parallel algorithms are available.
parent
74785011
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1203
algo: Enable parallel sorting when libTBB is available.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
algo/base/BuildInfo.h
+2
-2
2 additions, 2 deletions
algo/base/BuildInfo.h
algo/base/compat/Algorithm.h
+3
-3
3 additions, 3 deletions
algo/base/compat/Algorithm.h
with
5 additions
and
5 deletions
algo/base/BuildInfo.h
+
2
−
2
View file @
490d24f1
...
@@ -13,8 +13,8 @@ namespace cbm::algo::BuildInfo
...
@@ -13,8 +13,8 @@ namespace cbm::algo::BuildInfo
extern
const
std
::
string
BUILD_TYPE
;
extern
const
std
::
string
BUILD_TYPE
;
extern
const
bool
GPU_DEBUG
;
extern
const
bool
GPU_DEBUG
;
inline
constexpr
bool
HAVE
_TBB
=
inline
constexpr
bool
WITH
_TBB
=
#ifdef
WITH
_TBB
#ifdef
HAVE
_TBB
true
;
true
;
#else
#else
false
;
false
;
...
...
This diff is collapsed.
Click to expand it.
algo/base/compat/Algorithm.h
+
3
−
3
View file @
490d24f1
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
**/
**/
#include
<algorithm>
#include
<algorithm>
#if
__has_include(<
execution
>)
#if
def __cpp_lib_
execution
#define WITH_EXECUTION
#define WITH_EXECUTION
#include
<execution>
#include
<execution>
#endif
#endif
...
@@ -28,11 +28,11 @@ namespace cbm::algo
...
@@ -28,11 +28,11 @@ namespace cbm::algo
{
{
#ifdef WITH_EXECUTION
#ifdef WITH_EXECUTION
inline
constexpr
auto
ExecPolicy
=
inline
constexpr
auto
ExecPolicy
=
#ifdef
HAVE_TBB
#if
def
ined(__cpp_lib_parallel_algorithm) && defined(
HAVE_TBB
)
std
::
execution
::
par_unseq
;
std
::
execution
::
par_unseq
;
#else
#else
std
::
execution
::
seq
;
std
::
execution
::
seq
;
#endif //
HAVE
_TBB
#endif //
__cpp_lib_parallel_algorithm && WITH
_TBB
#endif // WITH_EXECUTION
#endif // WITH_EXECUTION
}
// namespace detail
}
// namespace detail
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment