Home>

Currently we are trying to prepare the environment with CUDA 10.2 in the latest Visual Studio 2019 Community.
By setting $(CUDA_INC_PATH) etc., at least the first simple compilation is passed.
However, there is a problem with syntax highlight.


(Question 1)
It can be done, but

gpu_func ()<<>>();


Function use is recognized as a bit shift operator and gives the errorError (active) E0029 expression required. Is there no way to solve this?


(Question 2)
If i pass$(CUDA_INC_PATH), etc., you can compile without includingcuda_runtime.hordevice_launch_parameters.h. Why If i don't write these headers, the syntax highlight will disappear. There is a lot of unwritten code for linux, but should you not write it?


(Question 3)
Change the source code item type fromC/C ++ compilertoCUDA C/C ++, but put the code mixed with main functions other than CUDA on the CUDA compiler. Is it okay?

Thanks.

Supplemental information

Windows10 Pro
VisualStudio2019 Community

  • Answer # 1

      

    By setting $(CUDA_INC_PATH) etc., at least the first simple compilation can be passed.
      However, there is a problem with syntax highlight.
      ...
      Error (active) E0029 Will throw an error stating that an expression is needed, is there a way to solve this?

    syntax highlight is a C ++ grammar check.

      

    If you pass $(CUDA_INC_PATH) etc., you can compile without including cuda_runtime.h or device_launch_parameters.h. Why?

    CUDA-compiler: nvcc has a default-include header. Thanks to that.

      

    Changing the source code item type from C/C ++ compiler to CUDA C/C ++, isn't it okay to put code mixed with main functions other than CUDA on the CUDA compiler?

    No problem. nvcc separates ~ .cu into GPU-code and CPU-code, and CPU-code is cross-flowed to host-compiler (here VC ++).