Skip to content

Commit

Permalink
Merge pull request #163 from bashtage/fastmath
Browse files Browse the repository at this point in the history
PERF: Enable fastmath for numba
  • Loading branch information
bashtage committed Feb 23, 2017
2 parents 9331a88 + 635f439 commit bfa3d87
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion arch/compat/numba.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
from __future__ import absolute_import, division
import functools

try:
from numba import jit
try:
def f(x, y):
return x + y
fjit = jit(f, nopython=True, fastmath=True)
fjit(1.0, 2.0)
jit = functools.partial(jit, nopython=True, fastmath=True)
except KeyError:
jit = functools.partial(jit, nopython=True)
except ImportError:
def jit(func):
def jit(func, *args, **kwargs):
def wrapper(*args, **kwargs):
return func(*args, **kwargs)

Expand Down

0 comments on commit bfa3d87

Please sign in to comment.