New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in Nopython mode during for loop usage #3947
Comments
Hi @MainzKCL , are you using the latest Numba version? I was able to run your reproduction code in v0.43.1 @njit(parallel=True)
def foo(numIter, vals ):
for i in prange(0,numIter): #this is the line where I get the error
print(vals[i])
foo(10,[0,1,2,3,4,5,6,7,8,9])
0
4
5
621
3
7
8
9 |
I can also confirm that the reproducer works fine on current master: b5a7131 |
@MainzKCL thanks for getting back to us with the report. Please don't hesitate to report any issues you have in the future! I'll close this one now. |
the weird thing is that using a tuple instead of a list does not work @njit(parallel=True)
def foo(numIter, vals):
a = 0.
for i in prange(numIter):
a +=vals[i]
return a
foo(10,(0,1,2,3,4,5,6,7,8,9)) with error
|
@esc, what do you think of the example above? Should I open a new issue? |
@luk-f-a probably a good idea, I just had a look and discovered, that this works when not using |
@luk-f-a good catch! |
Here is the error message I am receiving:
LoweringError: Failed in nopython mode pipeline (step: nopython mode backend)
Buffer dtype cannot be buffer
File "", line 10:
def stabilitySelect(lambdaNeed,x,y,numIter,mask):
[1] During: lowering "id=27[LoopNest(index_variable = parfor_index.2067, range = ($const56.2, numIter, 1))]{154: <ir.Block at (10)>}Var(parfor_index.2067, (10))" at (10)
This should not have happened, a problem has occurred in Numba's internals.
The minimum reproduction:
@njit(parallel=True)
def foo(numIter, vals ):
foo(10,[0,1,2,3,4,5,6,7,8,9])
The text was updated successfully, but these errors were encountered: