-
Notifications
You must be signed in to change notification settings - Fork 23
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
Draft: Attempt to specialize matrix_vector_product for parallel_policy #255
base: main
Are you sure you want to change the base?
Changes from all commits
e0673a7
1153577
66b4a33
1e3d13d
83ccaec
35313b7
83de4a8
aa48cf7
682c1a8
e7f64e2
dde3701
85a4b17
0339284
91bb27a
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 |
---|---|---|
|
@@ -121,6 +121,14 @@ option(LINALG_ENABLE_BLAS | |
"Assume that we are linking with a BLAS library." | ||
${BLAS_FOUND}) | ||
|
||
find_package(TBB) | ||
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. PR #256 incorporates the changes in this file. |
||
option(LINALG_ENABLE_TBB | ||
"Enable TBB. Default: autodetect TBB installation." | ||
${TBB_FOUND}) | ||
if(LINALG_ENABLE_TBB) | ||
find_package(TBB REQUIRED) | ||
endif() | ||
|
||
find_package(KokkosKernels) | ||
option(LINALG_ENABLE_KOKKOS | ||
"Enable Kokkos-based implementation. Default: autodetect Kokkos installation." | ||
|
@@ -144,6 +152,10 @@ add_library(std::linalg ALIAS linalg) | |
|
||
target_link_libraries(linalg INTERFACE std::mdspan) | ||
|
||
if(LINALG_ENABLE_TBB) | ||
target_link_libraries(linalg INTERFACE TBB::tbb) | ||
endif() | ||
|
||
if(LINALG_ENABLE_KOKKOS) | ||
target_link_libraries(linalg INTERFACE Kokkos::kokkos) | ||
target_link_libraries(linalg INTERFACE Kokkos::kokkoskernels) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,8 @@ Other compilers, including MSVC 2019, have been tested in the past. | |
- If you want to build examples, set LINALG_ENABLE_EXAMPLES=ON | ||
- If you have a BLAS installation, set LINALG_ENABLE_BLAS=ON. | ||
BLAS support is currently experimental. | ||
- If you have a TBB installation, set LINALG_ENABLE_TBB=ON. | ||
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. PR #256 incorporates the changes in this file. |
||
TBB support is currently experimental. | ||
4. Build and install as usual | ||
5. If you enabled tests, use "ctest" to run them | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,10 @@ | |
|
||
#include <iostream> | ||
|
||
#if (! defined(__GNUC__)) || (__GNUC__ > 9) | ||
# define MDSPAN_EXAMPLES_USE_EXECUTION_POLICIES 1 | ||
#endif | ||
|
||
#ifdef MDSPAN_EXAMPLES_USE_EXECUTION_POLICIES | ||
# include <execution> | ||
#endif | ||
|
||
// Make mdspan less verbose | ||
using std::experimental::mdspan; | ||
using std::experimental::extents; | ||
using std::experimental::dynamic_extent; | ||
using MDSPAN_IMPL_STANDARD_NAMESPACE::mdspan; | ||
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. An equivalent fix is already in the main branch. |
||
using MDSPAN_IMPL_STANDARD_NAMESPACE::extents; | ||
using MDSPAN_IMPL_STANDARD_NAMESPACE::dynamic_extent; | ||
|
||
int main(int argc, char* argv[]) { | ||
std::cout << "Scale" << std::endl; | ||
|
@@ -30,7 +22,7 @@ int main(int argc, char* argv[]) { | |
|
||
// Call linalg::scale x = 2.0*x; | ||
std::experimental::linalg::scale(2.0, x); | ||
#ifdef MDSPAN_EXAMPLES_USE_EXECUTION_POLICIES | ||
#ifdef LINALG_HAS_EXECUTION | ||
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. See PR #256. |
||
std::experimental::linalg::scale(std::execution::par, 2.0, x); | ||
#else | ||
std::experimental::linalg::scale(2.0, x); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#define MDSPAN_USE_PAREN_OPERATOR 1 | ||
|
||
#include "gtest/gtest.h" | ||
#include "gtest_fixtures.hpp" | ||
|
||
|
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.
This change has already been merged into the main branch.