Skip to content

Commit 0ca50eb

Browse files
authored
Merge pull request #431 from bjodah/lambdify-llvm-by-default
Change lambdify's default for backend to llvm when available
2 parents 560bafb + 721312e commit 0ca50eb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

symengine/lib/symengine_wrapper.pyx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5203,7 +5203,7 @@ def Lambdify(args, *exprs, cppbool real=True, backend=None, order='C',
52035203
Whether datatype is ``double`` (``double complex`` otherwise).
52045204
backend : str
52055205
'llvm' or 'lambda'. When ``None`` the environment variable
5206-
'SYMENGINE_LAMBDIFY_BACKEND' is used (taken as 'lambda' if unset).
5206+
'SYMENGINE_LAMBDIFY_BACKEND' is used (taken as 'llvm' if available, otherwise 'lambda').
52075207
order : 'C' or 'F'
52085208
C- or Fortran-contiguous memory layout. Note that this affects
52095209
broadcasting: e.g. a (m, n) matrix taking 3 arguments and given a
@@ -5235,7 +5235,11 @@ def Lambdify(args, *exprs, cppbool real=True, backend=None, order='C',
52355235
52365236
"""
52375237
if backend is None:
5238-
backend = os.getenv('SYMENGINE_LAMBDIFY_BACKEND', "lambda")
5238+
IF HAVE_SYMENGINE_LLVM:
5239+
backend_default = 'llvm' if real else 'lambda'
5240+
ELSE:
5241+
backend_default = 'lambda'
5242+
backend = os.getenv('SYMENGINE_LAMBDIFY_BACKEND', backend_default)
52395243
if backend == "llvm":
52405244
IF HAVE_SYMENGINE_LLVM:
52415245
if dtype == None:

0 commit comments

Comments
 (0)