diff options
author | Matthew Sterrett <matthew.sterrett@intel.com> | 2022-08-26 16:40:28 +0000 |
---|---|---|
committer | Matthew Sterrett <matthew.sterrett@intel.com> | 2022-09-09 12:36:10 -0700 |
commit | 4d4fc629750882e0bb0c592dd50f8c86c23f4011 (patch) | |
tree | 4cdf0377a56e6d0cb3ad76f225bbcf2e768ccee3 | |
parent | 01c0b76b353ab8451a61461ad213dc99fca5d3c3 (diff) | |
download | numpy-4d4fc629750882e0bb0c592dd50f8c86c23f4011.tar.gz |
BENCH: Adds benchmarks for arctan2 and power
-rw-r--r-- | benchmarks/benchmarks/bench_ufunc.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/benchmarks/benchmarks/bench_ufunc.py b/benchmarks/benchmarks/bench_ufunc.py index 858dcccfc..afe6118b1 100644 --- a/benchmarks/benchmarks/bench_ufunc.py +++ b/benchmarks/benchmarks/bench_ufunc.py @@ -294,3 +294,20 @@ class ArgParsingReduce(Benchmark): def time_add_reduce_arg_parsing(self, arg_pack): np.add.reduce(*arg_pack.args, **arg_pack.kwargs) + +class BinaryBench(Benchmark): + def setup(self): + N = 1000000 + self.a32 = np.random.rand(N).astype(np.float32) + self.b32 = np.random.rand(N).astype(np.float32) + self.a64 = np.random.rand(N).astype(np.float64) + self.b64 = np.random.rand(N).astype(np.float64) + + def time_pow_32(self): + np.power(self.a32, self.b32) + def time_pow_64(self): + np.power(self.a64, self.b64) + def time_atan2_32(self): + np.arctan2(self.a32, self.b32) + def time_atan2_64(self): + np.arctan2(self.a64, self.b64)
\ No newline at end of file |