Skip to content
Snippets Groups Projects

Clean up and Bug Fixes

Merged Markus Holzer requested to merge holzer/pystencils:Fixes into master
Compare and Show latest version
1 file
+ 5
1
Preferences
Compare changes
@@ -4,7 +4,7 @@ Default Sympy optimizations applied in pystencils kernels using :func:`sympy.cod
See :func:`sympy.codegen.rewriting.optimize`.
"""
# TODO: These optimisations are not at all used in pystencils... Should be used by default and turned off optionally
import itertools
from pystencils import Assignment
@@ -23,6 +23,10 @@ try:
optims_pystencils_cpu = [evaluate_constant_terms] + list(optims_c99)
optims_pystencils_gpu = [evaluate_constant_terms] + list(optims_c99)
# test if optimisations really work
for i in range(len(optims_pystencils_cpu)):
optims_pystencils_cpu[i](sp.cos(1))
except ImportError:
from warnings import warn
warn("Could not import ReplaceOptim, optims_c99, optimize from sympy.codegen.rewriting."