Skip to content
Snippets Groups Projects
Commit 490d24f1 authored by Felix Weiglhofer's avatar Felix Weiglhofer
Browse files

algo: Use feature-test macro to check if stl parallel algorithms are available.

parent 74785011
No related branches found
No related tags found
1 merge request!1203algo: Enable parallel sorting when libTBB is available.
......@@ -13,8 +13,8 @@ namespace cbm::algo::BuildInfo
extern const std::string BUILD_TYPE;
extern const bool GPU_DEBUG;
inline constexpr bool HAVE_TBB =
#ifdef WITH_TBB
inline constexpr bool WITH_TBB =
#ifdef HAVE_TBB
true;
#else
false;
......
......@@ -16,7 +16,7 @@
**/
#include <algorithm>
#if __has_include(<execution>)
#ifdef __cpp_lib_execution
#define WITH_EXECUTION
#include <execution>
#endif
......@@ -28,11 +28,11 @@ namespace cbm::algo
{
#ifdef WITH_EXECUTION
inline constexpr auto ExecPolicy =
#ifdef HAVE_TBB
#if defined(__cpp_lib_parallel_algorithm) && defined(HAVE_TBB)
std::execution::par_unseq;
#else
std::execution::seq;
#endif // HAVE_TBB
#endif // __cpp_lib_parallel_algorithm && WITH_TBB
#endif // WITH_EXECUTION
} // namespace detail
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment