I am trying to rewrite some PyCUDA code in CUDA/C++ and have run into a problem which has stumped me with my first kernel.
I have defined a shared memory array within the kernel code
__shared__ thrust::complex<float> temp_sig;
within a kernel function and it throws the message
warning: dynamic initialization is not supported for a function-scope static shared variable within a device/global function
I also had a constant array defined outside the kernel as follows (and initialised using host code)
__device__ __constant__ thrust::complex<float> wfft_32;
which threw a similar message but as as error. I fixed this by using cuComplex instead of thrust::complex but I’d rather have access to the more intuitive maths notation of the thrust version.
I can’t find any examples of code using this type for arrays on the device. Am I doing something wrong? Can I define thrust::complex arrays on the device? If so how?