Error with cudaMallocPitch

I keep getting this error in VS2008:

argument of type “int *” is incompatible with parameter of type “size_t *”

all i did was follow the programming guide 2.2

my code is:

[codebox] float* d_2d;

cudaMallocPitch((void**)&d_2d, &pitch, N*sizeof(float), N);[/codebox]

thank you in advance!

I’m guessing you are referring to the following in the programming guide?

[codebox]// Host code

float* devPtr;

int pitch;

cudaMallocPitch((void**)&devPtr, &pitch, width * sizeof(float), height);

myKernel<<<100, 512>>>(devPtr, pitch);[/codebox]

It’s defined as a size_t in the reference manual:

[codebox]cudaError_t cudaMallocPitch( void** devPtr, size_t* pitch, size_t widthInBytes, size_t height)[/codebox]

Try changing int pitch to size_t pitch in your code…

I posted a message on here almost a year ago about this typo (that was when it was v2.0). Looks like they still haven’t corrected it.

oh it’s a typo? so what’s the typo? you mean the “int” part?

edit: nevermind i got it thanks guys!