Problem with function parameters. Wrong values of parameters in function declared in extern "C&#


I use CUDA SDK 3.2, 64 bit environment, Visual Studio 2008 and Win7 x64.

I’ve got function declared as:

extern "C"


  bool prepare_kernels( cudaArray * dInArray, void * dOutData, int nWidth, int nHeight, int nDepth );


I call it in my application with parameters:

prepare_kernels( m_dCudaArray, m_dCudaOut, 100, 100, 100 );

However when I checked by debugger the real values of parameters in a prepare_kernels function, I’ve noticed that it was called as:

run_maper_kernel( something, something, 52364, 0, 100 );

I have no idea why it is happening. Maybe because m_dCudaOut and m_dCudaArray are 64bit pointers.

I will be grateful for yours advice.


I have no experience on Windows, but in general I’d say it is worthwhile double-checking with a printf a the beginning of prepare_kernels() that the debugger actually outputs the real arguments and the problem isn’t just wrong output from the debugger.

Yeah, I’ve hit that so many times, that I now consider the debugger pretty much useless. Out your params to a memory or do a printf.

It’s true, the problem is on the debugger side. I made mistake in different place of code and I thought, that my problem with kernel execution was caused by wrong parameters.
thank you for your help,