Skip to content

Commit

Permalink
Add HIP tests for Gram-Schmidt methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
pelesh committed Dec 21, 2023
1 parent f2d97df commit e488643
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions tests/unit/vector/GramSchmidtTests.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ namespace ReSolve {
LinAlgWorkspaceCUDA* workspace = new LinAlgWorkspaceCUDA();
workspace->initializeHandles();
return new VectorHandler(workspace);
#endif
#ifdef RESOLVE_USE_HIP
} else if (memspace_ == "hip") {
LinAlgWorkspaceHIP* workspace = new LinAlgWorkspaceHIP();
workspace->initializeHandles();
return new VectorHandler(workspace);
#endif
} else {
std::cout << "ReSolve not built with support for memory space " << memspace_ << "\n";
Expand Down
16 changes: 15 additions & 1 deletion tests/unit/vector/runGramSchmidtTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,22 @@ int main(int, char**)
}
#endif

#ifdef RESOLVE_USE_HIP
{
std::cout << "Running tests on CPU!:\n";
std::cout << "Running tests with HIP backend:\n";
ReSolve::tests::GramSchmidtTests test("hip");

result += test.GramSchmidtConstructor();
result += test.orthogonalize(5000, ReSolve::GramSchmidt::mgs);
result += test.orthogonalize(5000, ReSolve::GramSchmidt::cgs2);
result += test.orthogonalize(5000, ReSolve::GramSchmidt::mgs_two_synch);
result += test.orthogonalize(5000, ReSolve::GramSchmidt::mgs_pm);
std::cout << "\n";
}
#endif

{
std::cout << "Running tests on the CPU:\n";
ReSolve::tests::GramSchmidtTests test("cpu");

result += test.GramSchmidtConstructor();
Expand Down

0 comments on commit e488643

Please sign in to comment.