Skip to content

Commit

Permalink
DOC: Added np.show_runtime (#21468)
Browse files Browse the repository at this point in the history
  • Loading branch information
ganesh-k13 committed Aug 18, 2022
1 parent f1c1d48 commit 73e2245
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions doc/release/upcoming_changes/21468.new_feature.rst
@@ -0,0 +1,60 @@
New function `np.show_runtime`
------------------------------

A new function ``np.show_runtime`` has been added to display the runtime
information of the machine in addition to ``np.show_config`` which displays
the build-related information.
This function returns a list of dictionaries as follows::

>>> np.show_runtime()
[{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
'found': ['SSSE3',
'SSE41',
'POPCNT',
'SSE42',
'AVX',
'F16C',
'FMA3',
'AVX2'],
'not_found': ['AVX512F',
'AVX512CD',
'AVX512_KNL',
'AVX512_KNM',
'AVX512_SKX',
'AVX512_CLX',
'AVX512_CNL',
'AVX512_ICL']}},
{'architecture': 'Zen',
'filepath': '/usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so',
'internal_api': 'openblas',
'num_threads': 12,
'prefix': 'libopenblas',
'threading_layer': 'pthreads',
'user_api': 'blas',
'version': '0.3.20'}]

Note that this function requires `threadpoolctl`_ to function properly.
It would result in the following warning if not installed::

>>> np.show_runtime()
WARNING: `threadpoolctl` not found in system! Install it by `pip install threadpoolctl`. Once installed, try `np.show_runtime` again for more detailed build information
[{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
'found': ['SSSE3',
'SSE41',
'POPCNT',
'SSE42',
'AVX',
'F16C',
'FMA3',
'AVX2'],
'not_found': ['AVX512F',
'AVX512CD',
'AVX512_KNL',
'AVX512_KNM',
'AVX512_SKX',
'AVX512_CLX',
'AVX512_CNL',
'AVX512_ICL']}}]


.. _threadpoolctl: https://pypi.org/project/threadpoolctl/

0 comments on commit 73e2245

Please sign in to comment.