Skip to content

Instantly share code, notes, and snippets.

@synapticarbors
Last active January 5, 2016 16:59
Show Gist options
  • Save synapticarbors/22022c166e3776bb3e0b to your computer and use it in GitHub Desktop.
Save synapticarbors/22022c166e3776bb3e0b to your computer and use it in GitHub Desktop.
Numba cache error
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)
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