Pregunta

This minimal example:

int main() 
{
    struct surfaceReference* surfaceReferencePointer;
    cudaGetSurfaceReference(&surfaceReferencePointer, "surfaceReference"); 
}

Fails when it is compiled like this:

nvcc -g -arch=sm_20 -o foo.out foo.cu

Showing the following error message:

foo.cu(4): warning: argument of type "surfaceReference **" is incompatible with parameter of type "const surfaceReference **"
foo.cu(4): warning: argument of type "surfaceReference **" is incompatible with parameter of type "const surfaceReference **"

foo.cu: In function ‘int main()’:
foo.cu:4: error: invalid conversion from ‘surfaceReference**’ to ‘const surfaceReference**’
foo.cu:4: error:   initializing argument 1 of ‘cudaError_t cudaGetSurfaceReference(const surfaceReference**, const char*)’

I cannot understand what I am doing wrong. I am compiling on a Linux Ubuntu 64-bit machine, using CUDA 3.2.

No hay solución correcta

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top