Skip to content
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

Compare TUV-X Tridiagonal Solver Code with LAPACKE's implementation #97

Merged
merged 58 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
0700222
added BLAS library specification in build script
May 22, 2024
6fee119
merged local branch with main
Jun 4, 2024
0db8fa3
Merge branch 'main' of github.com:NCAR/tuv-x
Jun 12, 2024
42d8147
lapacke added in cmake
Jun 13, 2024
c2d6472
added google benchmark
Jun 17, 2024
c74f3f2
run each tridiagonal solver test multiple times and take average of t…
Jun 18, 2024
bdcb3a0
modified plots generated in numerical_analysis
Jun 18, 2024
b1b5ff4
include the correct LAPACK package based on the compiler used
Jun 26, 2024
dee5d7b
Apply suggestions from code review
AdityaDendukuri Jun 26, 2024
830184d
seperated tests and benchmark (used google benchmark)
Jun 26, 2024
5e63955
benchmarking code changes
Jun 28, 2024
3cbb75a
only use diagonally dominant matrices for unit test
Jun 28, 2024
2077a2d
Merge branch 'main' into lapacke_debug
sjsprecious Jun 28, 2024
3acc6e4
update docker files to use lapacke for tridiagonal tests
sjsprecious Jun 28, 2024
e035ad9
Update ubuntu.yml with lapacke
sjsprecious Jun 28, 2024
cc3403b
maybe this will work?
sjsprecious Jun 28, 2024
6433ed0
revert changes to ubuntu.yml
sjsprecious Jun 28, 2024
004a55d
Update Dockerfile for CI test
sjsprecious Jun 29, 2024
7e7f02b
add missing new line
sjsprecious Jun 29, 2024
ec88760
allowing benchmark folder to be copied by dockerg
K20shores Jul 1, 2024
63f1e8c
Update cmake/test_util.cmake
AdityaDendukuri Jul 1, 2024
7c7c4ed
adding lapacke to ubuntu workflow
K20shores Jul 1, 2024
21b65ca
Merge branch 'lapacke_debug' of https://github.com/NCAR/tuv-x into la…
K20shores Jul 1, 2024
feb883f
spelling
K20shores Jul 1, 2024
ab61424
serial build
K20shores Jul 1, 2024
6fc7973
undoing cmake formatting changes
K20shores Jul 1, 2024
783b494
using find lapacke from other open source libraries
K20shores Jul 1, 2024
4dc105f
correcting working directory
K20shores Jul 1, 2024
6621164
adding benchmark cmake variable
K20shores Jul 1, 2024
26fd879
dash
K20shores Jul 1, 2024
874e970
fixing path
K20shores Jul 1, 2024
4994013
removing language thing
K20shores Jul 1, 2024
0e909a0
ignore gtest when running clang tidy
K20shores Jul 1, 2024
9239c15
unit tests operate on one size (1000); formatting changes; use same r…
Jul 2, 2024
a6299bc
re-adding benchmark variable
K20shores Jul 3, 2024
510c956
fixed bug in test_error_function unit test; updated documentation
Jul 3, 2024
9820583
Merge branch 'lapacke_debug' of github.com:NCAR/tuv-x into lapacke_debug
Jul 3, 2024
9f54f5a
uncommented findLAPACKE
Jul 3, 2024
9f983b3
added some more documentation
Jul 3, 2024
c22d41d
fixed a bug that caused the memcheck to fail
Jul 3, 2024
eda38a6
Apply suggestions from code review
AdityaDendukuri Jul 3, 2024
d3b66f7
switched to std::abs instead of ::abs
Jul 3, 2024
9f256bd
Merge branch 'lapacke_debug' of github.com:NCAR/tuv-x into lapacke_debug
Jul 3, 2024
bb1c227
reverted formatting changes in cmake file
Jul 3, 2024
05e2827
re-added lapacke dependency in test_util
Jul 3, 2024
04a9b0f
linked LAPACKE libraries to unit tests
Jul 3, 2024
20e73de
removed typedefs in test_error_function.cpp
Jul 3, 2024
34b529b
updated code documentation
AdityaDendukuri Jul 5, 2024
88fa5a6
documentaion changes
AdityaDendukuri Jul 5, 2024
302fc37
documentation changes
AdityaDendukuri Jul 5, 2024
73ac682
documentation changes
Jul 8, 2024
1d165a8
switched back to version 0.9.0
Jul 8, 2024
23b358e
Documentation Changes
Jul 8, 2024
a572368
Update src/CMakeLists.txt
AdityaDendukuri Jul 9, 2024
38e9903
Update src/CMakeLists.txt
AdityaDendukuri Jul 9, 2024
b6a10f8
rolled back format changes
Jul 9, 2024
766ecf8
Merge branch 'lapacke_debug' of github.com:NCAR/tuv-x into lapacke_debug
Jul 9, 2024
98d29f6
Update src/CMakeLists.txt
AdityaDendukuri Jul 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions include/tuvx/linear_algebra/banded_matrix.hpp
AdityaDendukuri marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <vector>

namespace tuvx
{

template<typename T>
struct BandedMatrix
{
// data fields
std::size_t size_;
std::size_t bandwidth_up_;
std::size_t bandwidth_down_;
std::vector<std::vector<T>> band;
// constructor
BandedMatrix<T>(std::size_t size, std::size_t up, std::size_t down);
};

template<typename T>
std::vector<T> Dot(const BandedMatrix<T>& A, const std::vector<T>&);

} // namespace tuvx
8 changes: 7 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ message(STATUS "lapack libraries: ${LAPACK_LIBRARIES}")
target_link_libraries(tuvx_object PRIVATE PkgConfig::netcdff PkgConfig::netcdfc
yaml-cpp::yaml-cpp)

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "IntelLLVM")
target_compile_definitions(tuvx_object PUBLIC TUVX_COMPILE_WITH_INTEL)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_compile_definitions(tuvx_object PUBLIC TUVX_COMPILE_WITH_GCC)
endif()

if(BLAS_LIBRARIES)
target_link_libraries(tuvx_object PRIVATE ${BLAS_LIBRARIES})
else()
Expand All @@ -44,7 +50,7 @@ set_target_properties(
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR})

target_link_libraries(tuvx PRIVATE tuvx_object)
target_link_libraries(tuvx PUBLIC tuvx_object)

message(
STATUS
Expand Down
7 changes: 6 additions & 1 deletion test/unit/linear_algebra/test_lapacke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@
#include <cstring>
#include <ctime>
#include <fstream>
#include <lapacke.h>
#include <limits>
#include <vector>

#ifdef TUVX_COMPILE_WITH_INTEL
#include <mkl_lapacke.h>
#elif TUVX_COMPILE_WITH_GCC
#include <lapacke.h>
#endif

using namespace tuvx;
using std::chrono::duration;
using std::chrono::duration_cast;
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
3.29913e-17 0.0176367
3.30137e-17 0.175568
3.29986e-17 1.73411
3.29744e-17 17.864
3.29784e-17 188.188
0 0.0312956
0 0.229959
0 2.2255
0 22.7488
0 240.375
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1.63141e-08 0.0319062
1.62981e-08 0.315242
1.63017e-08 3.15343
1.62755e-08 18.4041
1.63076e-08 166.735
0 3.46066
0 0.295798
0 3.97411
0 25.0105
0 238.504
Loading