Compiling CUDA code from the command line

前端 未结 1 1478
野趣味
野趣味 2021-01-21 17:33

I am trying to compile CUDA code from the command line, using the syntax:

nvcc -c MyFile.cu -ccbin \"C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\b         


        
相关标签:
1条回答
  • 2021-01-21 18:13

    I can't post comments yet and I don't know if this is a correct answer since I don't have 2010 express. So in the interest of helping I'll try with an answer.

    I can supply you with the start of my compile line, which is slightly different from yours:

    set CUDAFE_FLAGS=--sdk_dir "C:\Program Files (x86)\Windows Kits\8.0\"
    "C:\_work\API\CUDA\bin\nvcc.exe" --use-local-env --cl-version 2012 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64"        --keep-dir x64\Prod -maxrregcount=0  --machine 64 
    

    From this I expect you to change the path to yours, and the cl-version as well to

    "C:\_work\API\CUDA\bin\nvcc.exe" --use-local-env --cl-version 2010 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cl.exe" --machine 32
    

    Please note I have tried to change it to 32-bit as well. I assume this is what you are running.

    Cheers

    0 讨论(0)
提交回复
热议问题