[libc-commits] [libc] [libc] [gpu] Fix Minor Benchmark UI Issues (PR #102529)
via libc-commits
libc-commits at lists.llvm.org
Thu Aug 8 13:25:53 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: None (jameshu15869)
<details>
<summary>Changes</summary>
Previously, `AmdgpuSinTwoPow_128` and others were too large for their table cells. This PR shortens the name to `AmdSin...`
There were also some `-` missing in the separator. This PR instead creates the separator string using the length of the headers.
---
Full diff: https://github.com/llvm/llvm-project/pull/102529.diff
2 Files Affected:
- (modified) libc/benchmarks/gpu/LibcGpuBenchmark.cpp (+7-5)
- (modified) libc/benchmarks/gpu/src/math/sin_benchmark.cpp (+4-4)
``````````diff
diff --git a/libc/benchmarks/gpu/LibcGpuBenchmark.cpp b/libc/benchmarks/gpu/LibcGpuBenchmark.cpp
index 28235cf137c18..f237e2ea1b954 100644
--- a/libc/benchmarks/gpu/LibcGpuBenchmark.cpp
+++ b/libc/benchmarks/gpu/LibcGpuBenchmark.cpp
@@ -126,12 +126,14 @@ void print_header() {
LIBC_NAMESPACE::printf("Running Suite: %-10s\n",
benchmarks[0]->get_suite_name().data());
LIBC_NAMESPACE::printf("%s", RESET);
- LIBC_NAMESPACE::printf(
+ cpp::string titles =
"Benchmark | Cycles | Min | Max | "
- "Iterations | Time / Iteration | Stddev | Threads |\n");
- LIBC_NAMESPACE::printf(
- "---------------------------------------------------------------------"
- "--------------------------------\n");
+ "Iterations | Time / Iteration | Stddev | Threads |\n";
+ LIBC_NAMESPACE::printf(titles.data());
+
+ cpp::string separator(titles.size(), '-');
+ separator[titles.size() - 1] = '\n';
+ LIBC_NAMESPACE::printf(separator.data());
}
void Benchmark::run_benchmarks() {
diff --git a/libc/benchmarks/gpu/src/math/sin_benchmark.cpp b/libc/benchmarks/gpu/src/math/sin_benchmark.cpp
index e86961790b943..0dc3eae2a24a0 100644
--- a/libc/benchmarks/gpu/src/math/sin_benchmark.cpp
+++ b/libc/benchmarks/gpu/src/math/sin_benchmark.cpp
@@ -48,8 +48,8 @@ BENCH(NvSinVeryLarge, LIBC_NAMESPACE::__nv_sin, 30, 1000);
#endif
#ifdef AMDGPU_MATH_FOUND
-BENCH(AmdgpuSin, LIBC_NAMESPACE::__ocml_sin_f64, -1023, 1023);
-BENCH(AmdgpuSinTwoPi, LIBC_NAMESPACE::__ocml_sin_f64, -10, 3);
-BENCH(AmdgpuSinTwoPow30, LIBC_NAMESPACE::__ocml_sin_f64, 0, 30);
-BENCH(AmdgpuSinVeryLarge, LIBC_NAMESPACE::__ocml_sin_f64, 30, 1000);
+BENCH(AmdSin, LIBC_NAMESPACE::__ocml_sin_f64, -1023, 1023);
+BENCH(AmdSinTwoPi, LIBC_NAMESPACE::__ocml_sin_f64, -10, 3);
+BENCH(AmdSinTwoPow30, LIBC_NAMESPACE::__ocml_sin_f64, 0, 30);
+BENCH(AmdSinVeryLarge, LIBC_NAMESPACE::__ocml_sin_f64, 30, 1000);
#endif
``````````
</details>
https://github.com/llvm/llvm-project/pull/102529
More information about the libc-commits
mailing list