[libc-commits] [libc] [libc] NVPTX Profiling Draft (PR #92009)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Tue May 14 08:58:58 PDT 2024


================
@@ -0,0 +1,70 @@
+#include "LibcGpuBenchmark.h"
+
+namespace LIBC_NAMESPACE {
+namespace libc_gpu_benchmarks {
+
+Benchmark *Benchmark::Start = nullptr;
+Benchmark *Benchmark::End = nullptr;
+
+void Benchmark::addBenchmark(Benchmark *B) {
+  if (End == nullptr) {
+    Start = B;
+    End = B;
+    return;
+  }
+
+  End->Next = B;
+  End = B;
----------------
jhuber6 wrote:

```suggestion
  FixedVector<<some function pointer>, 4096> benchmarks;
  ...
  Benchmarks.push_back(b);
```

https://github.com/llvm/llvm-project/pull/92009


More information about the libc-commits mailing list