Which lib should I include when I use cudaDeviceSynchronize() ?

Hello friends,
When I compile my program ,it occurs the error : identifier “cudaDeviceSynchronize” is undefined .
Expect your answers… thank you

You don’t need to explicitly include or link anything. Just use nvcc to compile and give your source code the .cu extension.

Include cuda.h and cuda_device_runtime_api.h headerfiles to your source file and add cudart.lib lib file to the linker. Note that give path of CUDA include and library to your program. Thats all.

I tried all the above listed options
but none of them worked out
please help
working over cuda with compute capability : 1.1

Problem might be related to the architecture and compute capability that you are building against.

nvcc -arch=sm_52

See what happens if you provide different arch and code versions.