Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Change lambdify's default for backend to llvm when available #431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions symengine/lib/symengine_wrapper.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5203,7 +5203,7 @@ def Lambdify(args, *exprs, cppbool real=True, backend=None, order='C',
Whether datatype is ``double`` (``double complex`` otherwise).
backend : str
'llvm' or 'lambda'. When ``None`` the environment variable
'SYMENGINE_LAMBDIFY_BACKEND' is used (taken as 'lambda' if unset).
'SYMENGINE_LAMBDIFY_BACKEND' is used (taken as 'llvm' if available, otherwise 'lambda').
order : 'C' or 'F'
C- or Fortran-contiguous memory layout. Note that this affects
broadcasting: e.g. a (m, n) matrix taking 3 arguments and given a
Expand Down Expand Up @@ -5235,7 +5235,11 @@ def Lambdify(args, *exprs, cppbool real=True, backend=None, order='C',

"""
if backend is None:
backend = os.getenv('SYMENGINE_LAMBDIFY_BACKEND', "lambda")
IF HAVE_SYMENGINE_LLVM:
backend_default = 'llvm' if real else 'lambda'
ELSE:
backend_default = 'lambda'
backend = os.getenv('SYMENGINE_LAMBDIFY_BACKEND', backend_default)
if backend == "llvm":
IF HAVE_SYMENGINE_LLVM:
if dtype == None:
Expand Down