You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ADDFUNCS.rst
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,6 +171,23 @@ Add clauses to generate the FUNC_CODES from the ``functions.hpp`` header, making
171
171
};
172
172
#endif
173
173
174
+
Some functions (e.g. ``fmod``, ``isnan``) are not available in MKL, and so must be hard-coded here as well:
175
+
176
+
.. code-block:: cpp
177
+
178
+
#ifdef USE_VML
179
+
/* no isnan, isfinite or isinf in VML */
180
+
static void vdIsfinite(MKL_INT n, const double* x1, bool* dest)
181
+
{
182
+
MKL_INT j;
183
+
for (j=0; j<n; j++) {
184
+
dest[j] = isfinited(x1[j]);
185
+
};
186
+
};
187
+
#endif
188
+
189
+
The complex case is slightlñy different (see other examples in the same file).
190
+
174
191
Add case handling to the ``check_program`` function
175
192
176
193
.. code-block:: cpp
@@ -219,4 +236,6 @@ In many cases this process will not be very smooth since one relies on the inter
219
236
220
237
* Depending on the new function signature (above all if the out type is different to the input types), one may have to edit the ``__init__`` function in the ``FuncNode`` class in ``expressions.py``.
221
238
239
+
* Functions which accept and/or return complex arguments must be added to the ``complex_functions.hpp`` file (take care when adding them in ``interpreter.cpp`` and ``interp_body.cpp``, since their signatures are usually a bit different).
240
+
222
241
* Depending on MSVC support, namespace clashes, casting problems, it may be necessary to make various changes to ``numexpr/numexpr_config.hpp`` and ``numexpr/msvc_function_stubs.hpp``. For example, in PR #523, non-clashing wrappers were introduced for ``isnan`` and ``isfinite`` since the float versions ``isnanf, isfinitef`` were inconsistently defined (and output ints) - depending on how strict the platform interpreter is, the implicit cast from int to bool was acceptable or not for example. In addition, the base functions were in different namespaces or had different names across platforms.
0 commit comments