Last active
August 29, 2015 14:12
-
-
Save jason-s/bc7cf5742de14ab52479 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numba | |
import numba.types | |
src = ''' | |
from __future__ import division | |
import numba.types | |
def f(x): | |
j = numba.types.int32(0) | |
return j+x | |
''' | |
print 'numba %s' % numba.__version__ | |
glo = {} | |
loc = {} | |
exec(src, glo, loc) | |
f_python = loc['f'] | |
f_native = numba.jit('i4(i4)')(f_python) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
import numba.types | |
def f(x): | |
j = numba.types.int32(0) | |
return j+x | |
print numba.__version__ | |
f_python = f | |
f_native = numba.jit('i4(i4)')(f_python) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment