Skip to content

Commit 8c710a7

Browse files
committed
Build a list of bin counts based on available memory
1 parent 4535367 commit 8c710a7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

dpnp/tests/test_histogram.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@
2222
get_integer_float_dtypes,
2323
has_support_aspect64,
2424
numpy_version,
25+
requires_memory,
2526
)
2627

28+
# Build a list of bin sizes to check the histogram
29+
_bin_counts = [10, 10**2, 10**3, 10**4, 10**5]
30+
if requires_memory(12):
31+
_bin_counts += [10**6]
32+
2733

2834
class TestDigitize:
2935
@pytest.mark.parametrize("dtype", get_integer_float_dtypes())
@@ -488,7 +494,7 @@ def test_weights_another_sycl_queue(self):
488494

489495
@pytest.mark.parametrize(
490496
"bins_count",
491-
[10, 10**2, 10**3, 10**4, 10**5, 10**6],
497+
_bin_counts,
492498
)
493499
def test_different_bins_amount(self, bins_count):
494500
v = numpy.linspace(0, bins_count, bins_count, dtype=numpy.float32)
@@ -586,7 +592,7 @@ def test_weights_unsupported_dtype(self, xp, dt):
586592

587593
@pytest.mark.parametrize(
588594
"bins_count",
589-
[10, 10**2, 10**3, 10**4, 10**5, 10**6],
595+
_bin_counts,
590596
)
591597
def test_different_bins_amount(self, bins_count):
592598
v = numpy.arange(0, bins_count, dtype=int)
@@ -865,7 +871,7 @@ def test_weights_another_sycl_queue(self):
865871

866872
@pytest.mark.parametrize(
867873
"bins_count",
868-
[10, 10**2, 10**3, 10**4, 10**5, 10**6],
874+
_bin_counts,
869875
)
870876
def test_different_bins_amount(self, bins_count):
871877
v = numpy.linspace(0, bins_count, bins_count, dtype=numpy.float32)

0 commit comments

Comments
 (0)