Skip to content

Commit 8159919

Browse files
committed
Add performance test
1 parent 933cb75 commit 8159919

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

libc/test/src/math/performance_testing/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,17 @@ add_perf_binary(
153153
-fno-builtin
154154
)
155155

156+
add_perf_binary(
157+
exp10f16_perf
158+
SRCS
159+
exp10f16_perf.cpp
160+
DEPENDS
161+
.single_input_single_output_diff
162+
libc.src.math.exp10f16
163+
COMPILE_OPTIONS
164+
-fno-builtin
165+
)
166+
156167
add_perf_binary(
157168
exp2f_perf
158169
SRCS
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===-- Performance test for exp10f16 -------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "SingleInputSingleOutputPerf.h"
10+
11+
#include "src/math/exp10f16.h"
12+
13+
// LLVM libc might be the only libc implementation with support for float16 math
14+
// functions currently. We can't compare our float16 functions against the
15+
// system libc, so we compare them against this placeholder function.
16+
static float16 placeholderf16(float16 x) { return x; }
17+
18+
int main() {
19+
SINGLE_INPUT_SINGLE_OUTPUT_PERF_EX(float16, LIBC_NAMESPACE::exp10f16,
20+
::placeholderf16, 20'000,
21+
"exp10f16_perf.log")
22+
}

0 commit comments

Comments
 (0)