Strange error with prange (requires)

0 views
Skip to first unread message

Rémi Lehe

unread,
Jul 20, 2017, 1:48:48 AM7/20/17
to Numba Public Discussion - Public
Hi,

First of all, thanks again for bringing back `prange`. This is really a great feature!

When using it, it seems that some functions require the user to return an array, even if it is not actually necessary to the user (e.g. arrays that are modified in place).

For instance, the code below fails when attempting to compile the function. However, replacing the line `return` by `return x` fixes this issue. Is this an intended behavior or bug?

```
import numpy as np
import numba

N = 1000
x = np.random.rand(N)

@numba.njit(parallel=True)
def add_one( x, N ):
    for i in numba.prange(N):
        x[i] = x[i] + 1
    return
#   return x : fixes the compilation                                           

add_one( x, N )
```

stuart

unread,
Jul 20, 2017, 6:00:02 AM7/20/17
to Numba Public Discussion - Public
Thanks for the report and reproducer, I can reproduce! I've added an issue to track here and pinged the main contributors to this feature: https://github.com/numba/numba/issues/2474

-- 
stuart 

Rémi Lehe

unread,
Jul 20, 2017, 10:05:04 AM7/20/17
to Numba Public Discussion - Public
Great! Thanks!
Reply all
Reply to author
Forward
0 new messages