Skip to content

Commit bfa3d87

Browse files
authored
Merge pull request #163 from bashtage/fastmath
PERF: Enable fastmath for numba
2 parents 9331a88 + 635f439 commit bfa3d87

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

arch/compat/numba.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
from __future__ import absolute_import, division
2+
import functools
23

34
try:
45
from numba import jit
6+
try:
7+
def f(x, y):
8+
return x + y
9+
fjit = jit(f, nopython=True, fastmath=True)
10+
fjit(1.0, 2.0)
11+
jit = functools.partial(jit, nopython=True, fastmath=True)
12+
except KeyError:
13+
jit = functools.partial(jit, nopython=True)
514
except ImportError:
6-
def jit(func):
15+
def jit(func, *args, **kwargs):
716
def wrapper(*args, **kwargs):
817
return func(*args, **kwargs)
918

0 commit comments

Comments
 (0)