Commit 576c3871 authored by YdrMaster's avatar YdrMaster
Browse files

issue/189/docs: update README.md


Signed-off-by: default avatarYdrMaster <ydrml@hotmail.com>
parent 439ba32f
# InfiniCore
[![Doc](https://img.shields.io/badge/Document-ready-blue)](https://github.com/InfiniTensor/InfiniCore-Documentation)
[![CI](https://github.com/InfiniTensor/InfiniCore/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/InfiniTensor/InfiniCore/actions)
[![license](https://img.shields.io/github/license/InfiniTensor/InfiniCore)](https://mit-license.org/)
![GitHub repo size](https://img.shields.io/github/repo-size/InfiniTensor/InfiniCore)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/InfiniTensor/InfiniCore)
[![GitHub Issues](https://img.shields.io/github/issues/InfiniTensor/InfiniCore)](https://github.com/InfiniTensor/InfiniCore/issues)
[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/InfiniTensor/InfiniCore)](https://github.com/InfiniTensor/InfiniCore/pulls)
![GitHub contributors](https://img.shields.io/github/contributors/InfiniTensor/InfiniCore)
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/InfiniTensor/InfiniCore)
文档
InfiniCore 是一个跨平台统一编程工具集,为不同芯片平台的功能(包括计算、运行时、通信等)提供统一 C 语言接口。目前支持的硬件和后端包括:
- CPU;
......@@ -15,22 +28,6 @@ InfiniCore 是一个跨平台统一编程工具集,为不同芯片平台的功
## 配置和使用
### 软件依赖
- XMake编译器
XMake配置选项(`XMAKE_CONFIG_FLAGS`)以及含义
- `--omp=[y|n]` 是否使用OpenMP,默认开启
- `--cpu=[y|n]` 是否编译CPU接口实现,默认开启
- `--nv-gpu=[y|n]` 是否编译英伟达GPU接口实现
- `--ascend-npu=[y|n]` 是否编译昇腾NPU接口实现
- `--cambricon-mlu=[y|n]` 是否编译寒武纪MLU接口实现
- `--metax-gpu=[y|n]` 是否编译沐曦GPU接口实现
- `--moore-gpu=[y|n]` 是否编译摩尔线程GPU接口实现
- `--sugon-dcu=[y|n]` 是否编译曙光DCU接口实现
- `--kunlun-xpu=[y|n]` 是否编译昆仑XPU接口实现
### 一键安装
`script/` 目录中提供了 `install.py` 安装脚本。使用方式如下:
......@@ -41,6 +38,20 @@ cd InfiniCore
python scripts/install.py [XMAKE_CONFIG_FLAGS]
```
参数 `XMAKE_CONFIG_FLAGS` 是 xmake 构建配置,可配置下列可选项:
| 选项 | 功能 | 默认值
|--------------------------|-------------------------------|:-:
| `--omp=[y\|n]` | 是否使用 OpenMP | y
| `--cpu=[y\|n]` | 是否编译 CPU 接口实现 | y
| `--nv-gpu=[y\|n]` | 是否编译英伟达 GPU 接口实现 | n
| `--ascend-npu=[y\|n]` | 是否编译昇腾 NPU 接口实现 | n
| `--cambricon-mlu=[y\|n]` | 是否编译寒武纪 MLU 接口实现 | n
| `--metax-gpu=[y\|n]` | 是否编译沐曦 GPU 接口实现 | n
| `--moore-gpu=[y\|n]` | 是否编译摩尔线程 GPU 接口实现 | n
| `--sugon-dcu=[y\|n]` | 是否编译曙光 DCU 接口实现 | n
| `--kunlun-xpu=[y\|n]` | 是否编译昆仑 XPU 接口实现 | n
### 手动安装
1. 项目配置
......@@ -137,3 +148,22 @@ options:
- 若设置 `--check`,将检查代码是否需要修改格式,不修改文件内容;
- 通过 `--c` 指定 c/c++ 格式化器,默认为 `clang-format-16`
- 通过 `--python` 指定 python 格式化器 `black`
### vscode 开发配置
基本配置见 [xmake 官方文档](https://xmake.io/#/zh-cn/plugin/more_plugins?id=%e9%85%8d%e7%bd%ae-intellsence)
- TL;DR
- clangd
打开 *xmake.lua*,保存一次以触发编译命令生成,将在工作路径下自动生成 *.vscode/compile_commands.json* 文件。然后在这个文件夹下创建 *settings.json*,填入:
> .vscode/settings.json
```json
{
"clangd.arguments": [
"--compile-commands-dir=.vscode"
]
}
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment