Skip to content
Snippets Groups Projects

Various extensions to the vectorizer

Merged Daniel Bauer requested to merge hyteg/pystencils:bauerd/vec-extensions into v2.0-dev
@@ -61,8 +61,13 @@ def test_type_cast(gen_config, xp, from_type, to_type):
@@ -61,8 +61,13 @@ def test_type_cast(gen_config, xp, from_type, to_type):
kfunc = kernel.compile()
kfunc = kernel.compile()
kfunc(inp=inp, outp=outp)
kfunc(inp=inp, outp=outp)
# rounding mode depends on platform
if np.issubdtype(from_type, np.floating) and not np.issubdtype(
try:
to_type, np.floating
 
):
 
# rounding mode depends on platform
 
try:
 
xp.testing.assert_array_equal(outp, truncated)
 
except AssertionError:
 
xp.testing.assert_array_equal(outp, rounded)
 
else:
xp.testing.assert_array_equal(outp, truncated)
xp.testing.assert_array_equal(outp, truncated)
except AssertionError:
xp.testing.assert_array_equal(outp, rounded)