diff --git a/blas/src/KokkosBlas2_ger.hpp b/blas/src/KokkosBlas2_ger.hpp index fbfc9c1f98..8650577faf 100644 --- a/blas/src/KokkosBlas2_ger.hpp +++ b/blas/src/KokkosBlas2_ger.hpp @@ -17,6 +17,8 @@ #ifndef KOKKOSBLAS2_GER_HPP_ #define KOKKOSBLAS2_GER_HPP_ +#include "KokkosKernels_helpers.hpp" + #include namespace KokkosBlas { @@ -42,15 +44,6 @@ template ::assignable, - "AViewType memory space must be assignable from XViewType"); - static_assert( - Kokkos::SpaceAccessibility::assignable, - "AViewType memory space must be assignable from YViewType"); - static_assert( Kokkos::SpaceAccessibility::accessible, diff --git a/blas/src/KokkosBlas2_syr.hpp b/blas/src/KokkosBlas2_syr.hpp index af66767ab4..00d1d8b3de 100644 --- a/blas/src/KokkosBlas2_syr.hpp +++ b/blas/src/KokkosBlas2_syr.hpp @@ -17,6 +17,8 @@ #ifndef KOKKOSBLAS2_SYR_HPP_ #define KOKKOSBLAS2_SYR_HPP_ +#include "KokkosKernels_helpers.hpp" + #include namespace KokkosBlas { @@ -64,11 +66,6 @@ template void syr(const ExecutionSpace& space, const char trans[], const char uplo[], const typename AViewType::const_value_type& alpha, const XViewType& x, const AViewType& A) { - static_assert( - Kokkos::SpaceAccessibility::assignable, - "AViewType memory space must be assignable from XViewType"); - static_assert( Kokkos::SpaceAccessibility::accessible, diff --git a/blas/src/KokkosBlas2_syr2.hpp b/blas/src/KokkosBlas2_syr2.hpp index c9a2f7b2c5..d86abd31c1 100644 --- a/blas/src/KokkosBlas2_syr2.hpp +++ b/blas/src/KokkosBlas2_syr2.hpp @@ -17,6 +17,8 @@ #ifndef KOKKOSBLAS2_SYR2_HPP_ #define KOKKOSBLAS2_SYR2_HPP_ +#include "KokkosKernels_helpers.hpp" + #include #include diff --git a/example/wiki/CMakeLists.txt b/example/wiki/CMakeLists.txt index 11c6e0d97d..1e751f5797 100644 --- a/example/wiki/CMakeLists.txt +++ b/example/wiki/CMakeLists.txt @@ -1,2 +1,3 @@ +ADD_SUBDIRECTORY(blas) ADD_SUBDIRECTORY(sparse) ADD_SUBDIRECTORY(graph) diff --git a/example/wiki/blas/CMakeLists.txt b/example/wiki/blas/CMakeLists.txt new file mode 100644 index 0000000000..245957bc89 --- /dev/null +++ b/example/wiki/blas/CMakeLists.txt @@ -0,0 +1,19 @@ +KOKKOSKERNELS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +KOKKOSKERNELS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) + +KOKKOSKERNELS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../../../test_common) + +KOKKOSKERNELS_ADD_EXECUTABLE_AND_TEST( + wiki_blas2_ger + SOURCES KokkosBlas2_wiki_ger.cpp + ) + +KOKKOSKERNELS_ADD_EXECUTABLE_AND_TEST( + wiki_blas2_syr + SOURCES KokkosBlas2_wiki_syr.cpp + ) + +KOKKOSKERNELS_ADD_EXECUTABLE_AND_TEST( + wiki_blas2_syr2 + SOURCES KokkosBlas2_wiki_syr2.cpp + ) diff --git a/example/wiki/blas/KokkosBlas2_wiki_ger.cpp b/example/wiki/blas/KokkosBlas2_wiki_ger.cpp new file mode 100644 index 0000000000..89eaaf9292 --- /dev/null +++ b/example/wiki/blas/KokkosBlas2_wiki_ger.cpp @@ -0,0 +1,23 @@ +#include +#include + +int main(int argc, char* argv[]) { + Kokkos::initialize(argc, argv); + { + constexpr int M = 5; + constexpr int N = 4; + + Kokkos::View A("A", M, N); + Kokkos::View x("X", M); + Kokkos::View y("Y", N); + + Kokkos::deep_copy(A, 1.0); + Kokkos::deep_copy(x, 3.0); + Kokkos::deep_copy(y, 1.3); + + const double alpha = Kokkos::ArithTraits::one(); + + KokkosBlas::ger("T", alpha, x, y, A); + } + Kokkos::finalize(); +} diff --git a/example/wiki/blas/KokkosBlas2_wiki_syr.cpp b/example/wiki/blas/KokkosBlas2_wiki_syr.cpp new file mode 100644 index 0000000000..26c6a489b8 --- /dev/null +++ b/example/wiki/blas/KokkosBlas2_wiki_syr.cpp @@ -0,0 +1,20 @@ +#include +#include + +int main(int argc, char* argv[]) { + Kokkos::initialize(argc, argv); + { + constexpr int M = 5; + + Kokkos::View A("A", M, M); + Kokkos::View x("X", M); + + Kokkos::deep_copy(A, 1.0); + Kokkos::deep_copy(x, 3.0); + + const double alpha = double(1.0); + + KokkosBlas::syr("T", "U", alpha, x, A); + } + Kokkos::finalize(); +} diff --git a/example/wiki/blas/KokkosBlas2_wiki_syr2.cpp b/example/wiki/blas/KokkosBlas2_wiki_syr2.cpp new file mode 100644 index 0000000000..c1c8e5d0d1 --- /dev/null +++ b/example/wiki/blas/KokkosBlas2_wiki_syr2.cpp @@ -0,0 +1,22 @@ +#include +#include + +int main(int argc, char* argv[]) { + Kokkos::initialize(argc, argv); + { + constexpr int M = 5; + + Kokkos::View A("A", M, M); + Kokkos::View x("X", M); + Kokkos::View y("Y", M); + + Kokkos::deep_copy(A, 1.0); + Kokkos::deep_copy(x, 3.0); + Kokkos::deep_copy(y, 1.3); + + const double alpha = double(1.0); + + KokkosBlas::syr2("T", "U", alpha, x, y, A); + } + Kokkos::finalize(); +}