Pointer as formal parameter in kernel call

Is it possible in CUDA 2.0 to pass a pointer to a structure as formal parameter in a kernel call?
I was passing the whole structure as formal parameter in CUDA 1.1 but now, with CUDA 2.0 BETA, it somehow complains about this (“Error: Formal parameter space overflowed in function…”).
I have changed it so I just pass the pointer but I get the feeling that the structure information is somehow not accessible by the kernel. Is this true?

a pointer to a host memory and a pointer to a device memory location it’s not the same thing, kernel accesses the device memory!

if you have to pass a big dimension of data, you could instantiate the amount of needed memory with cublasAlloc( HOWMANYSTRUCTURES, sizeof(YOURSTRUCTURE), (void**)&devicePointer )
then copy your data with
cudaMemcpy( devicePointer, hostPointer, SIZEINBYTES, cudaMemcpyHostToDevice ) and pass devicePointer as parameter to your kernel call.

With CUDA 1.1 it was okay to pass a structure as formal parameter to a kernel. Why was this changed? If I now need to copy all my parameters with Memcpy to the device, where should I store them, in global memory, constant memory, texture memory? I think that this will suppose a slow down of the memory accesses?

Besides, if I need to do cudaMalloc, wouldn’t it be worth it to use cudaMallocPitch?

You can only put things in global memory. After that you can bind an array to the global memory to access it by means of a texture, or you can copy from global to shared memory in your kernel, after which you can acces it from shared memory in your kernel.

Thank you for your responses. But, can you (or anyone) confirm that in CUDA 2.0 is not possible any more to pass big parameters as parameters in a kernel call? If so, what is the size limit?

How big is big? I have code that passes a 52 byte struct and a 48 byte one along with several other parameters and it works fine in both CUDA 1.1 and 2.0.

The limit is supposed to be 256 bytes total.

My struct has exactly 100 bytes and the error I get is:
“Error: Formal parameter space overflowed in function…”
That is why I suppose that the size of this parameter is somehow restricted.

Do you have other parameters that may result in a total of more than 256 bytes?

May I ask what is the code for sending a struct to a kernel?

Let’s just say I have in my host code

struct example{

vector something;

vector<someType * pointr> pointrToSomething;

}; example1;

How do you send this to the kernel, and how does the kernel receive this structure?

Most importantly, how can I send an array/vector of pointers to the device as I have above in the struct? I don’t need to actually use the data that is being pointed to, but I will need to rearrange/sort their ordering in the vector depending on the computation done on vector something.

I am very confused about sending structures and classes to kernel, I keep getting mixed comments about cuda not working with c++, yet others claim that they have done it. Please help me understand this.

Thanks so much.