[flang-commits] [flang] [Flang][runtime] Distinguish CPU time and elapsed time for cpu_time and system_clock (PR #96652)
Daniel Chen via flang-commits
flang-commits at lists.llvm.org
Mon Jul 15 08:54:21 PDT 2024
DanielCChen wrote:
> Alrighty then. Let me see if I can remove the `std::chrono` stuff.
>
> > > I am bit worried about the C++ runtime dependency that this could bring if `std::chrono::high_resolution_clock` is not header only in some C++ standard library. Did check that? Could you add a system_clock test in `test/Runtime/no-cpp-dep.c`?
> >
> >
> > Yeah, using chrono related stuff has always ended up with some dependency. Most recently it came in as part of Sleep and it was removed in #84911.
>
> We now have two implementations
>
> * one based on `std::timespec_get` as the fallback
> * one based on `clock_gettime`
>
> I have also done some mild refactoring of the code to slightly reduce duplication due to my changes.
>
> What do y'all think?
Is there a particular reason to go in favor of `std::timespec_get` over POSIX function `clock_gettime`?
I posted PR #98915 to fix the build breakage on AIX because of it.
https://github.com/llvm/llvm-project/pull/96652
More information about the flang-commits
mailing list