Kernel counter with cudaMemcpyFromSymbol and atomicAdd error

I want to make a counter in a kernel.
I have the above code:

device int dev_cEe = 0;
int main (int argc, char **argv)
int cEe = 0;

int callsOfKernel = numberOfBlocks * numberOfThreadsPerBlock;
GPGPUKernel <<<numberOfBlocks, numberOfThreadsPerBlock>>> (const int callsOfKernel);
cudaDeviceSynchronize ();
cudaGetLastError ();
cudaMemcpyFromSymbol (&cEe, dev_cEe, sizeof (int), 0, cudaMemcpyDeviceToHost)

global void GPGPUKernel (const int callsOfKernel)
int id = blockIdx.x * blockDim.x + threadIdx.x;
if (id < callsOfKernel)
atomicAdd (&dev_cEe, 1);

The compiling operation in VS2019 finished with:

========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

but i have error in cudaMemcpyFromSymbol :

|Error (active)|E0167|argument of type int is incompatible with parameter of type const void *

and in atomicAdd:

|Error (active)|E0020|identifier atomicAdd is undefined

  1. Why the compiling operator finished with all done but the VS mark errors?
  2. Does it have errors in cudaMemcpyFromSymbol and atomicAdd?

Thanks to all…

  1. These are Intellisense errors. Intellisense is a syntax-checking built into the Visual Studio environment. It is not 100% compatible with CUDA.
  2. You do not have errors from a compilation perspective. When your code compiles without errors, I often say that intellisense errors related to CUDA constructs can be safely ignored, for the reason given in 1.

You can find many more questions about intellisense and CUDA on various forums.

If you find the intellisense errors to be distracting, you can disable them. Above the log/list where they are reported, there is a dropdown box that you can use to select which kinds of errors to display.

That’s it.
I forgot this options.

Thank you.