Skip to content
Snippets Groups Projects
Commit e9b5aaa0 authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Add expm1 test

parent 4954fb73
Branches
Tags
No related merge requests found
import sympy as sp
import pystencils
def test_sympy_optimizations():
for target in ('cpu', 'gpu'):
x, y, z = pystencils.fields('x, y, z: float32[2d]')
# Triggers Sympy's expm1 optimization
assignments = pystencils.AssignmentCollection({
x[0, 0]: sp.exp(y[0, 0]) - 1
})
ast = pystencils.create_kernel(assignments, target=target)
code = str(pystencils.show_code(ast))
assert 'expm1(' in code
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment