cuElim/README.md
2024-10-23 15:24:36 +08:00

53 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# cuElim
使用CUDA统一内存实现GF2域GF256域和素域上的矩阵乘法和高斯消元无需考虑显存大小。
## 使用说明
### 加入到现有项目
1.`include`文件夹中的所有头文件添加到现有项目中。
2. 在需要使用gpu函数的地方引用`cuelim.cuh``cuelim_m4ri.cuh`GF2域上高斯消元接口`cuelim_m4rie.cuh`GF256域上高斯消元接口
### 使用当前项目
1. 安装依赖
1. `C++ CUDA CMake ...`
2. [`GoogleTest`](https://github.com/google/googletest)
3. [`GoogleBenchmark`](https://github.com/google/benchmark)
2. 构建项目
```sh
mkdir build && cd build
cmake ..
make -j # 同时编译多个目标
ctest # 或make test 执行所有测试
```
3. 运行可执行文件
```sh
./cuelim # 执行主程序
./test/target # 执行特定测试
./benchmark/target # 执行特定性能测试
```
## 功能简介
- `ElimResult`:存储高斯消元的结果,包含秩、主元行(进行行交换前的位置)、主元列。
- `gf2::MatGF2`储存GF2矩阵每个uint64_t储存64个元素单个uint64_t中元素从低位到高位排列。
- `gf2::ElimResult gf2::MatGF2::gpu_elim()`:高斯消元。
- `gf256::MatGF256`存储GF256矩阵每个uint64_t储存8个元素单个uint64_t中元素从低位到高位排列。
- `gf256::ElimResult gf256::MatGF256::gpu_elim(const gf256::GF256 &gf)`:进行高斯消元
- `gfp::MatGFP`储存GF65521矩阵每个uint32_t储存1个元素
- `gfp::ElimResult gfp::MatGFP::gpu_elim()`:进行高斯消元
- `size_t gpu_mzd_elim(mzd_t *A)`m4ri接口
- `size_t gpu_mzed_elim(mzed_t *A)`m4rie接口