__syncthreads() problem

I’m currently programming cuda in Visual Studio 2019…
I used __syncthreads() within the global function…
It says the identifier is not defined.

Can you tell me why this is?

If your system is set up correctly, it is due to intellisense. This topic is documented in many forum threads which can be found with a google search such as on cuda intellisense

On a properly set-up system, it should not prevent you from compiling and running codes.