[libc-commits] [libc] [libc] DRAFT: Add Generic and NVPTX Sin Benchmark (PR #99795)
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Wed Jul 24 14:07:15 PDT 2024
================
@@ -0,0 +1,55 @@
+#include "benchmarks/gpu/LibcGpuBenchmark.h"
+
+#include "src/__support/CPP/array.h"
+#include "src/__support/CPP/bit.h"
+#include "src/__support/CPP/functional.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/math/sin.h"
+#include "src/stdlib/rand.h"
+#include "src/stdlib/srand.h"
+
+#ifdef NVPTX_MATH_FOUND
+#include "src/math/nvptx/declarations.h"
+#endif
+
+constexpr double M_PI = 3.14159265358979323846;
+uint64_t get_bits(double x) {
+ return LIBC_NAMESPACE::cpp::bit_cast<uint64_t>(x);
+}
+
+constexpr int RANDOM_INPUT_SIZE = 256;
+
+// BENCHMARK() expects a function that with no parameters that returns a
----------------
jhuber6 wrote:
This should be in a utility header, but realisitically we just want to call `rand()` per-lane to give divergent inputs.
https://github.com/llvm/llvm-project/pull/99795
More information about the libc-commits
mailing list