forked from kokkos/kokkos-kernels
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wiki examples for BLAS2 functions are added (kokkos#2122)
Some small additional change the the function headers themselves to add some missing header file inclusions. Applying clang-format Removing constexpr since it won't happen before some work in Core.
- Loading branch information
1 parent
17d940f
commit 9b477fd
Showing
8 changed files
with
91 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
ADD_SUBDIRECTORY(blas) | ||
ADD_SUBDIRECTORY(sparse) | ||
ADD_SUBDIRECTORY(graph) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <Kokkos_Core.hpp> | ||
#include <KokkosBlas2_ger.hpp> | ||
|
||
int main(int argc, char* argv[]) { | ||
Kokkos::initialize(argc, argv); | ||
{ | ||
constexpr int M = 5; | ||
constexpr int N = 4; | ||
|
||
Kokkos::View<double**> A("A", M, N); | ||
Kokkos::View<double*> x("X", M); | ||
Kokkos::View<double*> 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<double>::one(); | ||
|
||
KokkosBlas::ger("T", alpha, x, y, A); | ||
} | ||
Kokkos::finalize(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <Kokkos_Core.hpp> | ||
#include <KokkosBlas2_syr.hpp> | ||
|
||
int main(int argc, char* argv[]) { | ||
Kokkos::initialize(argc, argv); | ||
{ | ||
constexpr int M = 5; | ||
|
||
Kokkos::View<double**> A("A", M, M); | ||
Kokkos::View<double*> 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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <Kokkos_Core.hpp> | ||
#include <KokkosBlas2_syr2.hpp> | ||
|
||
int main(int argc, char* argv[]) { | ||
Kokkos::initialize(argc, argv); | ||
{ | ||
constexpr int M = 5; | ||
|
||
Kokkos::View<double**> A("A", M, M); | ||
Kokkos::View<double*> x("X", M); | ||
Kokkos::View<double*> 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(); | ||
} |