Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from numpy import array
- from numpy import zeros
- from numpy.random import rand
- from numba import njit, prange
- # @njit()
- @njit(parallel=True)
- def prange_test(A):
- s = 0
- z = zeros((3, 3))
- for i in prange(A.shape[0]):
- s += A[i]
- return s
- A = rand(10)
- test = prange_test(A)
- from numpy import array
- from numpy.random import rand
- from numba import njit, prange
- import numpy as np
- @njit(parallel=True)
- def prange_test(A):
- s = 0
- z = np.zeros((3, 3))
- for i in prange(A.shape[0]):
- s += A[i]
- return s
- A = rand(10)
- test = prange_test(A)
Add Comment
Please, Sign In to add comment