or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing
xxxxxxxxxx
2017q1 Homework1 (raytracing)
contributed by <
stanleytazi
>Reviewed by
rayleigh0407
tags:
stanleytazi
學習目標
未修改版本
以下這數據的解讀有些疑惑,先從 % time 這項討論
the percentage of the total running time of the program used by this function.
ray_color()
orraytracing()
這些是有呼叫到其他function的,這邊的數據是代表什意義呢?根據上面文章,應該是指執行時間扣掉 children 所執行的時間
gprof ( call graph )
clock_gettime()
抓出每個pixel 處理的時間,並繪製成圖:POSIX Thread
thread輪流拿工作來做(in_turn)
住 thread
In
raytracing.c(ray_pixel())
:1.529197 seconds
critical section 改成 atomic 的 operation
把 pixels 按照 height index 分給不同thread
Loop unrolling
dot_product 拆解
assembly code
很好奇這樣的改動對於指令的影響
<before>
<after>
試著去理解兩個assembly code 的作法:
<before>
以下動作在整個dot_product會重複做三次,所以內積運算中,每個方向的相乘結果都跟前一次有關連
<after>
可以看到 <after> 三個方向分量的計算彼此間並沒有相依性,如果是這樣的話有機會作到一些pipeline的效果嘛?
OpenMP