vscode CUDA C++配置记录示例(1)

 launch.json

{ 
    "version": "0.2.0",
    "configurations": [
        {
            "name": "CUDA C++: Launch",
            "type": "cuda-gdb",
            "request": "launch",
            "program": "${workspaceFolder}/basis",
            "debuggerPath": "/usr/local/cuda/bin/cuda-gdb",
            "preLaunchTask": "build"
        }
    ]
}

tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "cmake",
            "type": "shell",
            "command": "cmake .",
            "problemMatcher": ["$nvcc"],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },
        {
            "label": "make",
            "type": "shell",
            "command": "make dbg=1",
            "problemMatcher": ["$nvcc"],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },
        {
            "label": "build",
            "type": "shell",
            "dependsOrder": "sequence",
             "dependsOn":[
                "cmake",
                "make",
             ]
            }
        ]
}

c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/local/cuda/bin/nvcc",
            "cStandard": "gnu17",
            "cppStandard": "gnu++14",
            "intelliSenseMode": "linux-gcc-x64",
            "configurationProvider": "ms-vscode.makefile-tools"
        }
    ],
    "version": 4
}

 CMakeLists.txt

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(basis)
FIND_PACKAGE(CUDA REQUIRED)
CUDA_ADD_EXECUTABLE(basis main.cu)
TARGET_LINK_LIBRARIES(basis)

你可能感兴趣的:(环境配置,vscode,c++,ide)