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

via libc-commits libc-commits at lists.llvm.org
Tue May 28 19:40:09 PDT 2024


================
@@ -0,0 +1,92 @@
+#include "LibcGpuBenchmark.h"
+#include "src/__support/CPP/algorithm.h"
+#include "src/__support/FPUtil/sqrt.h"
+#include "src/time/gpu/time_utils.h"
+
+namespace LIBC_NAMESPACE {
+namespace benchmarks {
+
+FixedVector<Benchmark *, 64> benchmarks_to_run;
+
+void Benchmark::add_benchmark(Benchmark *benchmark) {
+  benchmarks_to_run.push_back(benchmark);
+}
+
+int Benchmark::run_benchmarks() {
+  for (auto it = benchmarks_to_run.rbegin(), e = benchmarks_to_run.rend();
+       it != e; ++it)
+    (*it)->run();
+  return 0;
----------------
jameshu15869 wrote:

for some reason `fixedvector.h` only seems to export `rbegin()` and `rend()` and I only see a class for `reverse_iterator` in `__support/CPP/iterator.h` - is there something else I'm missing?

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


More information about the libc-commits mailing list