Last active
January 5, 2016 16:59
-
-
Save synapticarbors/22022c166e3776bb3e0b to your computer and use it in GitHub Desktop.
Numba cache error
This file contains hidden or 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 numpy as np | |
import numba as nb | |
import lib1 | |
@nb.jit(nopython=True) | |
def fcalc(x): | |
s = lib1.func(x) | |
return s * 0.5 - 1.0 | |
def run(N): | |
x = np.linspace(-1.0, 1.0, N) | |
res = fcalc(x) | |
print res | |
if __name__ == '__main__': | |
N = 1000 | |
run(N) |
This file contains hidden or 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 as nb | |
@nb.jit(nopython=True, cache=True) | |
def func(y): | |
s = 0.0 | |
for k in range(y.shape[0]): | |
s += y[k] | |
return s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment