-
Notifications
You must be signed in to change notification settings - Fork 31
Fix TBB build issue #254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix TBB build issue #254
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| // For GCC 9 (< 10), <execution> unconditionally includes a TBB header file. | ||
| // If GCC < 10 was not built with TBB support, this causes a build error. | ||
| #if (! defined(__GNUC__)) || (__GNUC__ > 9) | ||
| #ifdef LINALG_HAS_EXECUTION | ||
| #include <execution> | ||
| #endif | ||
|
|
||
|
|
@@ -39,7 +39,17 @@ namespace experimental { | |
| inline namespace __p1673_version_0 { | ||
| namespace linalg { | ||
| template<class T> | ||
| auto execpolicy_mapper(T) { return std::experimental::linalg::impl::inline_exec_t(); } | ||
| auto execpolicy_mapper(const T) { | ||
| return std::experimental::linalg::impl::inline_exec_t(); | ||
| } | ||
|
|
||
| #ifdef LINALG_HAS_EXECUTION | ||
| template<> | ||
| auto execpolicy_mapper(const std::execution::parallel_policy) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll need to fix this bit -- the return type of |
||
| return std::execution::par; | ||
| } | ||
| #endif | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,30 @@ | |
| #ifndef LINALG_INCLUDE_EXPERIMENTAL___P1673_BITS_MACROS_HPP_ | ||
| #define LINALG_INCLUDE_EXPERIMENTAL___P1673_BITS_MACROS_HPP_ | ||
|
|
||
| #ifdef _MSVC_LANG | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good idea : - )
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I stole it from Kokkos! |
||
| #define _LINALG_CPLUSPLUS _MSVC_LANG | ||
| #else | ||
| #define _LINALG_CPLUSPLUS __cplusplus | ||
| #endif | ||
|
|
||
| #define LINALG_CXX_STD_14 201402L | ||
| #define LINALG_CXX_STD_17 201703L | ||
| #define LINALG_CXX_STD_20 202002L | ||
|
|
||
| #define LINALG_HAS_CXX_14 (_LINALG_CPLUSPLUS >= LINALG_CXX_STD_14) | ||
| #define LINALG_HAS_CXX_17 (_LINALG_CPLUSPLUS >= LINALG_CXX_STD_17) | ||
| #define LINALG_HAS_CXX_20 (_LINALG_CPLUSPLUS >= LINALG_CXX_STD_20) | ||
|
|
||
| static_assert(_LINALG_CPLUSPLUS >= LINALG_CXX_STD_17, "stdBLAS requires C++17 or later."); | ||
|
|
||
| #if ! defined(__clang__) && ! defined(_MSC_VER) && defined(__GNUC__) | ||
| # if defined(LINALG_ENABLE_TBB) | ||
| # define LINALG_HAS_EXECUTION 1 | ||
| # endif | ||
| #else | ||
| # define LINALG_HAS_EXECUTION 1 | ||
| #endif | ||
|
|
||
| #define P1673_MATRIX_EXTENTS_TEMPLATE_PARAMETERS( MATRIX_NAME ) \ | ||
| class SizeType_ ## MATRIX_NAME , \ | ||
| ::std::size_t numRows_ ## MATRIX_NAME , \ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new macro is nicer; thank you! : - )