[libc-commits] [libc] [libc] Add Generic and NVPTX Sin Benchmark (PR #99795)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Mon Jul 29 19:49:10 PDT 2024


jhuber6 wrote:

Pretty much like this.
```diff
diff --git a/libc/benchmarks/gpu/LibcGpuBenchmark.cpp b/libc/benchmarks/gpu/LibcGpuBenchmark.cpp
index a9a912538cd8..2574eb46f160 100644
--- a/libc/benchmarks/gpu/LibcGpuBenchmark.cpp
+++ b/libc/benchmarks/gpu/LibcGpuBenchmark.cpp
@@ -136,8 +136,10 @@ void print_header() {
 void Benchmark::run_benchmarks() {
   uint64_t id = gpu::get_thread_id();
 
-  if (id == 0)
+  if (id == 0) {
+    srand(gpu::processor_clock());
     print_header();
+  }
 
   gpu::sync_threads();
 ```

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


More information about the libc-commits mailing list