summaryrefslogtreecommitdiff
path: root/doc/source/reference/simd
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2023-01-03 15:22:40 +0200
committermattip <matti.picus@gmail.com>2023-01-03 15:22:40 +0200
commitf993841e4f2eec28854b726f8d368eade2312b35 (patch)
tree7274ed13805ab66b6c303b455567f1fa16fd84b3 /doc/source/reference/simd
parent196705a2efffe4d0cc24c92c009ce57237a80cb7 (diff)
downloadnumpy-f993841e4f2eec28854b726f8d368eade2312b35.tar.gz
DOC: document NPY_DISABLE_CPU_FEATURES
Diffstat (limited to 'doc/source/reference/simd')
-rw-r--r--doc/source/reference/simd/how-it-works.rst24
1 files changed, 21 insertions, 3 deletions
diff --git a/doc/source/reference/simd/how-it-works.rst b/doc/source/reference/simd/how-it-works.rst
index 19b3dba45..8fe00af89 100644
--- a/doc/source/reference/simd/how-it-works.rst
+++ b/doc/source/reference/simd/how-it-works.rst
@@ -1,6 +1,6 @@
-**********************************
-How does the CPU dispatcher work?
-**********************************
+**********************************************
+How does the CPU dispatcher work (build time)?
+**********************************************
NumPy dispatcher is based on multi-source compiling, which means taking
a certain source and compiling it multiple times with different compiler
@@ -347,3 +347,21 @@ through ``--cpu-dispatch``, but it can also represent other options such as:
// #include "hello2.dispatch.h"
// DISPATCH_CALL_HIGH(another_function, ("the highest interest"))
}
+
+
+.. _runtime-simd-dispatch::
+
+**********************************************
+How does the CPU dispatcher work (run time)?
+**********************************************
+
+Importing NumPy triggers a scan of the available CPU features from the set
+of dispatchable features. This can be further restricted by setting the
+environment variable ``NPY_DISABLE_CPU_FEATURES`` to a comma-, tab-, or
+space-separated list of features to disable. This will raise an error if
+parsing fails or if the feature was not enabled. For instance, on ``x86_64``
+this will disable ``AVX2`` and ``FMA3``::
+
+ NPY_DISABLE_CPU_FEATURES="AVX2,FMA3"
+
+If the feature is not available, a warning will be emitted.