summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2021-04-06 08:38:30 +0300
committerGitHub <noreply@github.com>2021-04-06 08:38:30 +0300
commit914407d51b878bf7bf34dbd8dd72cc2dbc428673 (patch)
treedff3d55b87d9a0d66cbc6fb989b011050f11fc17 /benchmarks
parentada694a9c028d78862b90468bd08f92a59229fd8 (diff)
parent4d2e4847823d3d3c9b7380f8ee7bc1799bd070f9 (diff)
downloadnumpy-914407d51b878bf7bf34dbd8dd72cc2dbc428673.tar.gz
Merge pull request #18075 from ganesh-k13/enh_simd_npyv_floor_div
ENH, SIMD: Dispatch for unsigned floor division
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/benchmarks/bench_ufunc.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/benchmarks/benchmarks/bench_ufunc.py b/benchmarks/benchmarks/bench_ufunc.py
index 13b7382a1..b036581e1 100644
--- a/benchmarks/benchmarks/bench_ufunc.py
+++ b/benchmarks/benchmarks/bench_ufunc.py
@@ -135,18 +135,19 @@ class CustomScalar(Benchmark):
class CustomScalarFloorDivideInt(Benchmark):
- params = ([np.int8, np.int16, np.int32, np.int64], [8, -8, 43, -43, 0])
+ params = (np.sctypes['int'] + np.sctypes['uint'], [8, -8, 43, -43])
param_names = ['dtype', 'divisors']
- max_value = 10**7
- min_value = -10**7
def setup(self, dtype, divisor):
+ if dtype in np.sctypes['uint'] and divisor < 0:
+ raise NotImplementedError(
+ "Skipping test for negative divisor with unsigned type")
+
iinfo = np.iinfo(dtype)
- self.x = np.arange(
- max(iinfo.min, self.min_value),
- min(iinfo.max, self.max_value), dtype=dtype)
+ self.x = np.random.randint(
+ iinfo.min, iinfo.max, size=10000, dtype=dtype)
- def time_floor_divide_int(self, dtpye, divisor):
+ def time_floor_divide_int(self, dtype, divisor):
self.x // divisor