Skip to content

Commit 711e01e

Browse files
committed
Initial commit
0 parents  commit 711e01e

File tree

6 files changed

+89
-0
lines changed

6 files changed

+89
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build
2+
GNUmakefile

ANSWER.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# 改进前
2+
3+
```
4+
这里贴改进前的运行结果。
5+
matrix_randomize: 100s
6+
```
7+
8+
# 改进后
9+
10+
```
11+
这里贴改进后的运行结果。
12+
matrix_randomize: 0.01s
13+
```
14+
15+
# 加速比
16+
17+
matrix_randomize: 10000x
18+
19+
> 如果记录了多种优化方法,可以做表格比较
20+
21+
# 优化方法
22+
23+
下面这些函数你是如何优化的?是什么思路?用了老师上课的哪个知识点?
24+
25+
> matrix_randomize
26+
27+
请回答。
28+
29+
# 我的创新点
30+
31+
如果有,请说明。

CMakeLists.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
cmake_minimum_required(VERSION 3.12)
2+
project(hellocmake LANGUAGES CXX)
3+
4+
set(CMAKE_CXX_STANDARD 17)
5+
if (NOT CMAKE_BUILD_TYPE)
6+
set(CMAKE_BUILD_TYPE Release)
7+
endif()
8+
9+
add_executable(main main.cpp)

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# 高性能并行编程与优化 - 第0x讲的回家作业
2+
3+
通过 pull request 提交作业。会批分数,但是:
4+
5+
没有结业证书,回家作业仅仅作为评估学习效果和巩固知识的手段,不必为分数感到紧张 :)
6+
量力而行,只要能在本课中,学到昨天的自己不懂的知识,就是胜利,没必要和别人攀比。
7+
注意不要偷看别人的作业哦!
8+
9+
- 课件:https://github.com/parallel101/course
10+
- 录播:https://space.bilibili.com/263032155
11+
12+
作业提交时间不限 :) 即使完结了还想交的话我也会看的~ 不过最好在下一讲开播前完成。
13+
14+
- 如何开 pull request:https://zhuanlan.zhihu.com/p/51199833
15+
- 如何设置 https 代理:https://www.jianshu.com/p/b481d2a42274
16+
17+
## 评分规则
18+
19+
- 完成作业基本要求 50 分(详见下方"作业要求")
20+
- 能够在 ANSWER.md 中用自己的话解释 25 分
21+
- 代码格式规范、能够跨平台 5 分
22+
- 有自己独特的创新点 20 分
23+
- 明显抄袭现象 -100 分
24+
25+
## 作业要求
26+
27+
修改 main.cpp,改良其中的矩阵系列函数,回答注释中的问题,并通过 `main()` 函数中的基本测试。
28+
测试的结果和你的优化思路,请填到 ANSWER.md。
29+
30+
温馨提示:如果用了 IDE,记得统一开启 Release 模式来比较性能。
31+
32+
## 关于内卷
33+
34+
如果你把矩阵转置改成了基于 `_mm_shuffle_ps` 的,或是用了莫顿序存储矩阵:
35+
只要是在 **满足作业要求的基础** 上,这是件好事!
36+
老师会酌情加分,视为“独特的创新点”,但最多不超过 20 分。

main.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <cstdio>
2+
3+
int main() {
4+
printf("Hello, world!\n");
5+
return 0;
6+
}

run.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
set -e
3+
cmake -B build
4+
cmake --build build
5+
build/main

0 commit comments

Comments
 (0)