python - numbapro cuda constant global array -


i'm using cuda numbapro , use constant global array inside vectorized function. example code here:

import numpy np numbapro import cuda, vectorize  stream1 = cuda.stream() pxy = np.ones((5,5), dtype='complex128') pxy = cuda.to_device(pxy, stream=stream1)  psi = np.ones((5,5), dtype='complex128') psi = cuda.to_device(psi, stream=stream1)  @vectorize(['complex128(complex128)'], target='gpu') def dpsi(psi):     return pxy*psi  dpsi(psi) 

but if tails error:

typingerror: invalid usage of * parameters (readonly array(complex128, 2d, c), complex128) known signatures: * (int64, int64) -> int64 * (int64, uint64) -> int64 * (uint64, int64) -> int64 * (uint64, uint64) -> uint64 * (float32, float32) -> float32 * (float64, float64) -> float64 * (complex64, complex64) -> complex64 * (complex128, complex128) -> complex128 * parameterized file "vector.py", line 13

failed @ nopython (nopython frontend) invalid usage of * parameters (readonly array(complex128, 2d, c), complex12 8) known signatures: * (int64, int64) -> int64 * (int64, uint64) -> int64 * (uint64, int64) -> int64 * (uint64, uint64) -> uint64 * (float32, float32) -> float32 * (float64, float64) -> float64 * (complex64, complex64) -> complex64 * (complex128, complex128) -> complex128 * parameterized file "vector.py", line 13

i understand pass constant array argument, wonder if it's possible use global constant arrays.


Comments