CUDA 以及MPI并行矩阵乘连接服务器运算vscode配置

一、CUDA Vscode配置

(一)扩展安装

本地安装

服务器端安装

(二) CUDA 配置 .vscode

c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/local/bin/clang",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "linux-clang-x64"
        }
    ],
    "version": 4
}

launch.json

{
      "configurations": [
            {
                  "name": "C/C++: g++ 生成和调试活动文件",
                  "type": "cppdbg",
                  "request": "launch",
                  "program": "${fileDirname}/${fileBasenameNoExtension}",
                  "args": [],
                  "stopAtEntry": false,
                  "cwd": "${fileDirname}",
                  "environment": [],
                  "externalConsole": false,
                  "MIMode": "gdb",
                  "setupCommands": [
                        {
                              "description": "为 gdb 启用整齐打印",
                              "text": "-enable-pretty-printing",
                              "ignoreFailures": true
                        },
                        {
                              "description": "将反汇编风格设置为 Intel",
                              "text": "-gdb-set disassembly-flavor intel",
                              "ignoreFailures": true
                        }
                  ],
                  "preLaunchTask": "C/C++: g++ 生成活动文件",
                  "miDebuggerPath": "/usr/bin/gdb"
            }
      ],
      "version": "2.0.0"
}

tasks.json

{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "cppbuild",
			"label": "C/C++: g++ 生成活动文件",
			"command": "/usr/bin/g++",
			"args": [
				"-fdiagnostics-color=always",
				"-g",
				"${file}",
				"-o",
				"${fileDirname}/${fileBasenameNoExtension}"
			],
			"options": {
				"cwd": "${fileDirname}"
			},
			"problemMatcher": [
				"$gcc"
			],
			"group": {
				"kind": "build",
				"isDefault": true
			},
			"detail": "编译器: /usr/bin/g++"
		}
	]
}

 二、MPI

(一)安装扩展

    本地安装和服务器端安装的扩展和CUDA一样

(二)Vscode配置

c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**",
                "/opt/intel/oneapi/mpi/2021.6.0/include" 
            ],
            "defines": [],
            "compilerPath": "/opt/rh/devtoolset-8/root/usr/bin/gcc",
            "cStandard": "c17",
            "cppStandard": "gnu++14",
            "intelliSenseMode": "linux-gcc-x64"
        }
    ],
    "version": 4
}

launch.json

{
      "configurations": [
            {
                  "name": "C/C++: g++ 生成和调试活动文件",
                  "type": "cppdbg",
                  "request": "launch",
                  "program": "${fileDirname}/${fileBasenameNoExtension}",
                  "args": [],
                  "stopAtEntry": false,
                  "cwd": "${fileDirname}",
                  "environment": [],
                  "externalConsole": false,
                  "MIMode": "gdb",
                  "setupCommands": [
                        {
                              "description": "为 gdb 启用整齐打印",
                              "text": "-enable-pretty-printing",
                              "ignoreFailures": true
                        },
                        {
                              "description": "将反汇编风格设置为 Intel",
                              "text": "-gdb-set disassembly-flavor intel",
                              "ignoreFailures": true
                        }
                  ],
                  "preLaunchTask": "C/C++: g++ 生成活动文件",
                  "miDebuggerPath": "/opt/rh/devtoolset-8/root/usr/bin/gdb"
            }
      ],
      "version": "2.0.0"
}

settings.json

{
      "files.associations": {
            "iostream": "cpp",
            "ctime": "cpp",
            "ostream": "cpp"
      }
}

tasks.json

{
      "tasks": [
            {
                  "type": "cppbuild",
                  "label": "C/C++: g++ 生成活动文件",
                  "command": "/opt/rh/devtoolset-8/root/usr/bin/g++",
                  "args": [
                        "-fdiagnostics-color=always",
                        "-g",
                        "${file}",
                        "-o",
                        "${fileDirname}/${fileBasenameNoExtension}"
                  ],
                  /* "run": {
                        "command": "mpirun",
                        "args": [
                            "-np",
                            "4",
                            "./$fileNameWithoutExt"
                        ]
                    }, */
                  "options": {
                        "cwd": "${fileDirname}"
                  },
                  "problemMatcher": [
                        "$gcc"
                  ],
                  "group": "build",
                  "detail": "调试器生成的任务。",
                  
            },
           
      ],
      "version": "2.0.0"
}

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值