In addition to what someone else has already said (adding cu extension in Tools -> Options -> Text Editor -> File Extension and Microsoft Visual C++ as editor), I also recommend you, in order to avoid the highlighting of CUDA keywords (like threadIdx.x etc), to include: