Skip to content

Commit 8a86064

Browse files
committed
Trace global memory usage in histogramm tests
1 parent 5670f78 commit 8a86064

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

dpnp/tests/third_party/cupy/statistics_tests/test_histogram.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
22
import unittest
33

4+
import dpctl
45
import numpy
56
import pytest
67

@@ -44,6 +45,20 @@ def for_all_dtypes_combination_bincount(names):
4445
return testing.for_dtypes_combination(_all_types, names=names)
4546

4647

48+
# TODO: comments
49+
_dev = dpctl.select_default_device()
50+
51+
52+
@pytest.fixture(autouse=True)
53+
def setup_each():
54+
print("\n[Setup] Run before each test")
55+
free_mem = dpctl.utils.intel_device_info(_dev).get("free_memory", None)
56+
if free_mem:
57+
print(f"Global memory available: {free_mem}")
58+
yield
59+
print("[Teardown] Run after each test")
60+
61+
4762
class TestHistogram(unittest.TestCase):
4863

4964
@testing.for_all_dtypes(no_bool=True, no_complex=True)

0 commit comments

Comments
 (0)