Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
|
|
2 months ago | |
|---|---|---|
| .. | ||
| S1 | 2 months ago | |
| cp_template | 2 months ago | |
| README.md | 2 months ago | |
| build_and_run.sh | 2 months ago | |
| build_and_run_reduce_sum.sh | 2 months ago | |
| build_and_run_sort_pair.sh | 2 months ago | |
| build_and_run_topk_pair.sh | 2 months ago | |
| build_common.sh | 2 months ago | |
| competition_parallel_algorithms.md | 2 months ago | |
本竞赛旨在评估参赛者在GPU并行计算领域的算法优化能力。参赛者可选择实现三个核心算法的高性能版本:
# 编译并运行所有算法测试(默认行为)
./build_and_run.sh
# 仅编译所有算法,不运行测试
./build_and_run.sh --build-only
# 编译并运行单个算法测试
./build_and_run.sh --run_reduce # ReduceSum算法
./build_and_run.sh --run_sort # SortPair算法
./build_and_run.sh --run_topk # TopkPair算法
# 编译并运行ReduceSum算法(默认行为)
./build_and_run_reduce_sum.sh
# 仅编译ReduceSum算法,不运行测试
./build_and_run_reduce_sum.sh --build-only
# 编译并运行SortPair正确性测试
./build_and_run_sort_pair.sh --run correctness
# 编译并运行TopkPair性能测试
./build_and_run_topk_pair.sh --run performance
./build/test_reducesum [correctness|performance|all]
./build/test_sortpair [correctness|performance|all]
./build/test_topkpair [correctness|performance|all]
参赛者需要在以下文件中替换Thrust实现:
src/reduce_sum_algorithm.maca - 替换Thrust归约求和src/sort_pair_algorithm.maca - 替换Thrust稳定排序src/topk_pair_algorithm.maca - 替换Thrust TopK选择见competition_parallel_algorithms.md
每个算法会生成详细的YAML性能分析文件:
reduce_sum_performance.yaml - ReduceSum性能数据sort_pair_performance.yaml - SortPair性能数据topk_pair_performance.yaml - TopkPair性能数据这些文件包含:
├── build_and_run.sh # 统一编译和运行脚本(默认编译+运行所有算法)
├── build_common.sh # 公共编译配置和函数
├── build_and_run_reduce_sum.sh # ReduceSum独立编译和运行脚本
├── build_and_run_sort_pair.sh # SortPair独立编译和运行脚本
├── build_and_run_topk_pair.sh # TopkPair独立编译和运行脚本
├── competition_parallel_algorithms.md # 详细题目说明
├── src/ # 算法实现和工具文件
│ ├── reduce_sum_algorithm.maca # 1. ReduceSum测试程序
│ ├── sort_pair_algorithm.maca # 2. SortPair测试程序
│ ├── topk_pair_algorithm.maca # 3. TopkPair测试程序
│ ├── test_utils.h # 测试工具和CPU参考实现
│ ├── yaml_reporter.h # YAML性能报告生成器
│ └── performance_utils.h # 性能测试工具
├── final_results/reduce_sum_results.yaml #ReduceSum性能数据
├── final_results/sort_pair_results.yaml #替换Thrust稳定排序
└── final_results/topk_pair_results.yaml #TopkPair性能数据
# 默认编译命令
mxcc -O3 -std=c++17 --extended-lambda -Isrc
### 自动化测试
```bash
# 查看所有选项
./build.sh --help
# 运行所有测试并生成YAML报告
./build.sh --run_all
### 环境变量配置
| 变量 | 默认值 | 说明 |
|--------|--------|------|
| `COMPILER` | `mxcc` | CUDA编译器路径 |
| `COMPILER_FLAGS` | `-O3 -std=c++17 --extended-lambda` | 编译标志 |
| `INCLUDE_DIR` | `src` | 头文件目录 |
| `BUILD_DIR` | `build` | 构建输出目录 |
### 调试模式
## 📋 提交清单
在提交前请确保:
- [ ] 所有算法通过正确性测试
- [ ] 性能测试可以正常运行
- [ ] 代码注释清晰,说明优化策略
- [ ] 无内存泄漏或运行时错误
- [ ] 生成完整测试报告
- [ ] 在函数实现注释中说明创新点
# 提交时包含以下文件
# - final_results/reduce_sum_results.yaml
# - final_results/sort_pair_results.yaml
# - final_results/topk_pair_results.yaml
如有技术问题,请:
祝您在竞赛中取得优异成绩! 🏆
No Description
C++ Shell Markdown