[libc-commits] [PATCH] D154446: [libc] Support timing information in libc tests

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jul 4 07:29:42 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, tianshilei1992, JonChesterfield, lntue, sivachandra, michaelrj.
Herald added subscribers: libc-commits, mattd, asavonic, kerbowa, tpr, jvesely.
Herald added projects: libc-project, All.
jhuber6 requested review of this revision.
Herald added a subscriber: wangpc.

This patch adds the necessary support to provide timing information in
`libc` tests. This is useful for determining which tests look what
amount of time. We also can use this as a test basis for providing more
fine-grained timing when implementing things on the GPU.

The main difficulty with this is the fact that the AMDGPU fixed
frequency clock operates at an unknown frequency. We need to read this
on a per-card basis from the driver and then copy it in. NVPTX on the
other hand has a fixed clock at a resolution of 1ns. I have also
increased the resolution of the print-outs as the majority of these are
below a millisecond for me.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154446

Files:
  libc/src/__support/GPU/amdgpu/utils.h
  libc/src/__support/GPU/generic/utils.h
  libc/src/__support/GPU/nvptx/utils.h
  libc/startup/gpu/amdgpu/start.cpp
  libc/test/UnitTest/LibcTest.cpp
  libc/utils/gpu/loader/amdgpu/Loader.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154446.537093.patch
Type: text/x-patch
Size: 6783 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230704/389fc6b7/attachment.bin>


More information about the libc-commits mailing list