diff options
author | Sayed Adel <seiko@imavr.com> | 2022-01-18 04:31:01 +0200 |
---|---|---|
committer | Sayed Adel <seiko@imavr.com> | 2022-02-13 14:32:52 +0200 |
commit | 762538cf6c00c02d16c29a0c380fd0a91bc9e96a (patch) | |
tree | ec16884df895514071b5dcd41940a8424e540fcf /benchmarks | |
parent | 211111082d1ee21492a1704699ea4b17c4a64ead (diff) | |
download | numpy-762538cf6c00c02d16c29a0c380fd0a91bc9e96a.tar.gz |
ENH, SIMD: improve argmax/argmin performance
for all integers, f32 and f64 data types on all
supported architectures via universal intrinsics.
Diffstat (limited to 'benchmarks')
-rw-r--r-- | benchmarks/benchmarks/bench_reduce.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/benchmarks/benchmarks/bench_reduce.py b/benchmarks/benchmarks/bench_reduce.py index 81316c492..ca07bd180 100644 --- a/benchmarks/benchmarks/bench_reduce.py +++ b/benchmarks/benchmarks/bench_reduce.py @@ -73,7 +73,8 @@ class FMinMax(Benchmark): np.fmax.reduce(self.d) class ArgMax(Benchmark): - params = [np.float32, np.float64, bool] + params = [np.int8, np.uint8, np.int16, np.uint16, np.int32, np.uint32, + np.int64, np.uint64, np.float32, np.float64, bool] param_names = ['dtype'] def setup(self, dtype): @@ -82,6 +83,17 @@ class ArgMax(Benchmark): def time_argmax(self, dtype): np.argmax(self.d) +class ArgMin(Benchmark): + params = [np.int8, np.uint8, np.int16, np.uint16, np.int32, np.uint32, + np.int64, np.uint64, np.float32, np.float64, bool] + param_names = ['dtype'] + + def setup(self, dtype): + self.d = np.ones(200000, dtype=dtype) + + def time_argmin(self, dtype): + np.argmin(self.d) + class SmallReduction(Benchmark): def setup(self): self.d = np.ones(100, dtype=np.float32) |