[libc-commits] [PATCH] D158320: [libc] Initial support for microbenchmarking GPU code

Matt Arsenault via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Aug 23 16:58:39 PDT 2023


arsenm added inline comments.


================
Comment at: libc/utils/gpu/timing/amdgpu/timing.h:47
+  // The AMDGPU architecture needs to wait on pending results.
+  __builtin_amdgcn_fence(__ATOMIC_ACQUIRE, "workgroup");
+  __builtin_amdgcn_s_waitcnt(0);
----------------
either the fence or the waitcnt, bot hare redundant


================
Comment at: libc/utils/gpu/timing/amdgpu/timing.h:51
+  uint64_t start = gpu::processor_clock();
+  __builtin_amdgcn_s_waitcnt(0);
+
----------------
you shouldn't need this one, the waitcnt insertion has to do this for you to produce the result


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158320



More information about the libc-commits mailing list