[libc-commits] [PATCH] D153388: [libc] Add basic utility support for timing functions on the GPU

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jun 20 18:24:59 PDT 2023


jhuber6 added a comment.

In D153388#4436410 <https://reviews.llvm.org/D153388#4436410>, @JonChesterfield wrote:

> It's not obvious to me that this is a good thing overall.
>
> First off benchmarking is difficult to do meaningfully and adding easy to access timing functions makes it more likely that they'll be used to make superficial comparisons when changing implementations.
>
> Secondly picking timers that run at different frequencies on different hardware will interact badly with people comparing performance between different machines.
>
> What's the benefit side to this like?

This is internal to `libc` and currently won't be exported as is. We could potentially put some of this into some `time.h` like functionality but that's tangential. The frequencies are different so we could potentially wrap them into different flags. Another option is to get the loader to look up the frequency and write it to some global so we can measure the nanosecond timer consistently between both architectures. It's useful because we want to be able to measure time elapsed on a much finger-grain than `nvprof` or `rocprof` would provide. This makes sure we can embed this analysis into some common tester and check the cycles.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153388/new/

https://reviews.llvm.org/D153388



More information about the libc-commits mailing list