Skip to content

Commit 1248698

Browse files
authored
[libc] [gpu] Fix Minor Benchmark UI Issues (#102529)
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.
1 parent 2756879 commit 1248698

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

libc/benchmarks/gpu/LibcGpuBenchmark.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,14 @@ void print_header() {
126126
LIBC_NAMESPACE::printf("Running Suite: %-10s\n",
127127
benchmarks[0]->get_suite_name().data());
128128
LIBC_NAMESPACE::printf("%s", RESET);
129-
LIBC_NAMESPACE::printf(
129+
cpp::string titles =
130130
"Benchmark | Cycles | Min | Max | "
131-
"Iterations | Time / Iteration | Stddev | Threads |\n");
132-
LIBC_NAMESPACE::printf(
133-
"---------------------------------------------------------------------"
134-
"--------------------------------\n");
131+
"Iterations | Time / Iteration | Stddev | Threads |\n";
132+
LIBC_NAMESPACE::printf(titles.data());
133+
134+
cpp::string separator(titles.size(), '-');
135+
separator[titles.size() - 1] = '\n';
136+
LIBC_NAMESPACE::printf(separator.data());
135137
}
136138

137139
void Benchmark::run_benchmarks() {

libc/benchmarks/gpu/src/math/sin_benchmark.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ BENCH(NvSinVeryLarge, LIBC_NAMESPACE::__nv_sin, 30, 1000);
4848
#endif
4949

5050
#ifdef AMDGPU_MATH_FOUND
51-
BENCH(AmdgpuSin, LIBC_NAMESPACE::__ocml_sin_f64, -1023, 1023);
52-
BENCH(AmdgpuSinTwoPi, LIBC_NAMESPACE::__ocml_sin_f64, -10, 3);
53-
BENCH(AmdgpuSinTwoPow30, LIBC_NAMESPACE::__ocml_sin_f64, 0, 30);
54-
BENCH(AmdgpuSinVeryLarge, LIBC_NAMESPACE::__ocml_sin_f64, 30, 1000);
51+
BENCH(AmdSin, LIBC_NAMESPACE::__ocml_sin_f64, -1023, 1023);
52+
BENCH(AmdSinTwoPi, LIBC_NAMESPACE::__ocml_sin_f64, -10, 3);
53+
BENCH(AmdSinTwoPow30, LIBC_NAMESPACE::__ocml_sin_f64, 0, 30);
54+
BENCH(AmdSinVeryLarge, LIBC_NAMESPACE::__ocml_sin_f64, 30, 1000);
5555
#endif

0 commit comments

Comments
 (0)