Calling a function multiple times (Driver API) Driver API, multiple function calls

Hi,
I am new to CUDA and I would like to ask how calling a kernel function multiple times with different data should be carried out.
Is it enough to just specify new parameters using the cuParamSet functions, then specify the new total parameter size by calling cuParamSetSize and then launch the grid?

For example,

// 1st function call
int offset = 0;
cuParamSeti( myFunction, offset, a);
offset += sizeof(a);
cuParamSeti( myFunction, offset, b);
offset += sizeof(b);
cuParamSetSize( myFunction, offset );
cuLaunchGrid( myFunction, height / block_size, width / block_size );

// do something with the data

//2d function call
offset = 0;
cuParamSeti( myFunction, offset, c);
offset += sizeof©;
cuParamSeti( myFunction, offset, d);
offset += sizeof(d);
cuParamSetSize( myFunction, offset );
cuLaunchGrid( myFunction, height / block_size, width / block_size );

When calling myFunction the second time, will only the “last” [offset] bytes be sent to the kernel functions and the a and b parameters simply disregarded?

Thanks in advance,
Veronica

Yes, you need to specify all parameters (and probably size) before calling each kernel. So, your example seems to be correct.