diff --git a/artiq/compiler/math_fns.py b/artiq/compiler/math_fns.py index e29c3625b..6b1890c1d 100644 --- a/artiq/compiler/math_fns.py +++ b/artiq/compiler/math_fns.py @@ -15,6 +15,7 @@ unary_fp_intrinsics = [(name, "llvm." + name + ".f64") for name in [ "floor", "ceil", "trunc", + "sqrt", ]] + [ # numpy.rint() seems to (NumPy 1.19.0, Python 3.8.5, Linux x86_64) # implement round-to-even, but unfortunately, rust-lang/libm only @@ -36,6 +37,14 @@ unary_fp_runtime_calls = [ ("arcsin", "asin"), ("arccos", "acos"), ("arctan", "atan"), + ("sinh", "sinh"), + ("cosh", "cosh"), + ("tanh", "tanh"), + ("arcsinh", "asinh"), + ("arccosh", "acosh"), + ("arctanh", "atanh"), + ("expm1", "expm1"), + ("cbrt", "cbrt"), ] #: Array handling builtins (special treatment due to allocations). diff --git a/artiq/test/coredevice/test_numpy.py b/artiq/test/coredevice/test_numpy.py index 715aedaea..6fb4ee3dd 100644 --- a/artiq/test/coredevice/test_numpy.py +++ b/artiq/test/coredevice/test_numpy.py @@ -35,7 +35,7 @@ class CompareHostDeviceTest(ExperimentCase): nonlocal checked checked = True self.assertTrue( - numpy.allclose(host, device), + numpy.allclose(host, device, equal_nan=True), "Discrepancy in binop test for '{}': Expexcted ({}, {}) -> {}, got {}" .format(op, a, b, host, device)) @@ -56,7 +56,7 @@ class CompareHostDeviceTest(ExperimentCase): nonlocal checked checked = True self.assertTrue( - numpy.allclose(host, device), + numpy.allclose(host, device, equal_nan=True), "Discrepancy in unaryop test for '{}': Expexcted {} -> {}, got {}" .format(op, a, host, device))