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"
}

相关推荐

  1. CUDA算子优化:矩阵GEMM优化(三)

    2024-04-21 08:24:05       9 阅读
  2. 服务器离线配置vscode连接,conda虚拟环境

    2024-04-21 08:24:05       20 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-04-21 08:24:05       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-21 08:24:05       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-21 08:24:05       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-21 08:24:05       20 阅读

热门阅读

  1. 如何排查oracle连接数不足问题

    2024-04-21 08:24:05       14 阅读
  2. ES6的Set与Map

    2024-04-21 08:24:05       13 阅读
  3. Q&A | ZStack替代VMware实问实答

    2024-04-21 08:24:05       17 阅读
  4. 数据结构(data structure)(3)栈和队列

    2024-04-21 08:24:05       12 阅读
  5. Docker安装xxl-job

    2024-04-21 08:24:05       13 阅读
  6. Flink集群部署

    2024-04-21 08:24:05       15 阅读
  7. 成为程序员后你都明白了什么?

    2024-04-21 08:24:05       16 阅读
  8. 为什么需要分布式存储

    2024-04-21 08:24:05       14 阅读
  9. 「Two permutations」Solution

    2024-04-21 08:24:05       14 阅读