Skip to content

Commit

Permalink
Add timers for Gaussian
Browse files Browse the repository at this point in the history
  • Loading branch information
pghysels committed May 29, 2024
1 parent 95c5f73 commit aa5b61f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/HSS/HSSExtra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#define HSS_EXTRA_HPP

#include "dense/DenseMatrix.hpp"
#include <chrono>

namespace strumpack {
namespace HSS {
Expand Down Expand Up @@ -234,8 +235,18 @@ namespace strumpack {
AFunctor(const DenseM_t& A) : _A(A) {}
const DenseM_t& _A;
void operator()(DenseM_t& Rr, DenseM_t& Rc, DenseM_t& Sr, DenseM_t& Sc) {
using tpoint = std::chrono::steady_clock::time_point;
const auto& tnow = std::chrono::steady_clock::now;
auto dt = [](tpoint begin, tpoint end) {
return std::chrono::duration_cast<std::chrono::milliseconds>
(end - begin).count();
};
auto begin = tnow();
gemm(Trans::N, Trans::N, scalar_t(1.), _A, Rr, scalar_t(0.), Sr);
std::cout << "# A*S time = " << dt(begin, tnow()) << " [10e-3s]" << std::endl;
begin = tnow();
gemm(Trans::C, Trans::N, scalar_t(1.), _A, Rc, scalar_t(0.), Sc);
std::cout << "# AT*S time = " << dt(begin, tnow()) << " [10e-3s]" << std::endl;
}
void operator()(const std::vector<std::size_t>& I,
const std::vector<std::size_t>& J, DenseM_t& B) {
Expand Down
2 changes: 1 addition & 1 deletion src/HSS/HSSMatrix.compress_stable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace strumpack {
AFunctor<scalar_t> afunc(A);
using tpoint = std::chrono::steady_clock::time_point;
const auto& tnow = std::chrono::steady_clock::now;
tpoint end, begin = tnow();
tpoint end, begin;
auto dt = [](tpoint begin, tpoint end) {
return std::chrono::duration_cast<std::chrono::milliseconds>
(end - begin).count();
Expand Down

0 comments on commit aa5b61f

Please sign in to comment.