Utility timestamp_ns() fix (#175)

* Update lib/common/utility.*

- fix timestamp_ns()

* Update samples/**/CMakeLists.txt

- fail test if exception thrown

* source formatting (clang-format v11) (#176)

Co-authored-by: jrmadsen <jrmadsen@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

[ROCm/rocprofiler-sdk commit: 7a8931e57f]
Tento commit je obsažen v:
Jonathan R. Madsenagithub-actions[bot] authored and GitHub committed 2023-11-07 01:43:27 -06:00
1 rodič ceb63cfcc5
revize c8bb0520c6
6 files changed
+21 -16

No files matched your search

+2 -4
Zobrazit soubor
@@ -90,7 +90,7 @@ get_accurate_clock_id_impl()
}
uint64_t
get_clock_freq_ns_impl(clockid_t _clk_id)
get_clock_period_ns_impl(clockid_t _clk_id)
{
constexpr auto nanosec = std::nano::den;
@@ -110,9 +110,7 @@ get_clock_freq_ns_impl(clockid_t _clk_id)
<< ") returned very low frequency (<1Hz)";
}
auto&& _period =
(static_cast<uint64_t>(ts.tv_sec) * nanosec) + static_cast<uint64_t>(ts.tv_nsec);
return nanosec / _period;
return (static_cast<uint64_t>(ts.tv_sec) * nanosec) + static_cast<uint64_t>(ts.tv_nsec);
}
std::vector<std::string>