[all-commits] [llvm/llvm-project] 3d0e0e: [flang][runtime] Prefer process time over thread t...

Mats Petersson via All-commits all-commits at lists.llvm.org
Mon Apr 11 02:45:09 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3d0e0e1027203fe5e89104ad81ee7bb53e525f95
      https://github.com/llvm/llvm-project/commit/3d0e0e1027203fe5e89104ad81ee7bb53e525f95
  Author: Mats Petersson <mats.petersson at arm.com>
  Date:   2022-04-11 (Mon, 11 Apr 2022)

  Changed paths:
    M flang/runtime/time-intrinsic.cpp

  Log Message:
  -----------
  [flang][runtime] Prefer process time over thread time in CPU_TIME

Most Fortran compilers appear to return the process time
for calls to CPU_TIME, where the flang implementation
prior to this change was returning the time used by the
current thread. This would cause incorrect time being
reported when for example OpenMP is used to share work
across multiple CPUs.

This patch changes the order so the selection of "what
time to return" so that if there is a process time to
report, that is the reported value, and only if that is
not available, the thread time is considerd instead.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D123416




More information about the All-commits mailing list