Multiple array inputs to Kernel Formal parameter space overflowed in function Error


I have multiple arrays (say at least 20) of a given size that I am passing to a kernel in a device, where i have already allocated memory and copied the arrays into memory. I know that I don’t run out of memory since I have 512 MB RAM. When I tried building my code, I got the following error:

Formal parameter space overflowed in function

All arrays are passed in as pointers but is there some other way to do that? For example, should I pass in a pointer of pointers? Will that solve my issue?


Yes, if you cudaMemcpyyour pointers into an array-of-pointers, you can pass a pointer to the array. (Just don’t confuse device memory and host memory! You need to cudaMemcpy from you host pointer into your device array, and pass the device array.)

The limit on kernel parameters is supposedly 256 bytes. 20 pointers don’t add up to 256 bytes, but someone else on the forums seemed to have also run into a lower limit.