每寫一份功課又是學習Makefile的時候=w=
-DBASELINE
等等,其中的-D
指的是#define BASELINE 1
-D
就好了!!make check
結果:make gencsv
==> 輸出至表單$$i
原來除了寫進txt檔之外,還可以寫進libre office的表單裡,好酷!
然後把結果輸出至.csv檔
細節的語法待會查 先highlight
在Makefile中,在執行各檔時前面多加了time
直接執行time ./time_test_baseline
顯示了三種時間:real,user和sys
Real refers to actual elapsed time; User and Sys refer to CPU time used only by the process.
real = user + sys
為上述積分式的實作,最後回傳的值要*4,因為算出來是
time_test.c
中分別傳入2個和4個threads的實驗甚麼是AVX?
prototype:
配上註解與下方的連結終於稍微看懂了~
__attribute__
機制,可以用來設置函數屬性(Function Attribute)、變數屬性(Variable Attribute)和類型屬性(Type Attribute)。aligned
則規定變數或結構的最小對齊格式,以 Byte 為單位。不知道為甚麼沒有highlight@@
__m256d
:存放double,256-bit可用,因此可以存放256/64 = 4 個double(aligned(32))
是因為double有8個byte,又宣告 double tmp[4] ==> 8*4= 32(byte)一直出現錯誤資訊:
應該是link的問題,但是即使加了-lm
還是沒用@@
computepi.c:(.text+0xd80): 未定義參考到 pow
collect2: error: ld returned 1 exit status
make: *** [default] Error 1
computepi.c 有included <math.h>嗎? 或許可以試試,我花很多時間處理這個…SarahYuHanCheng
看了一些資料在搭配原有的程式碼,很快就可以寫出來了~ 覺得開心=w=
using [a:b]
: 以第a column當x座標,第b column當y座標製圖時產生的warning:
warning: Skipping data file with no valid points
查了一段時間,玄機就在副檔名.csv
和gnuplot他吃數據的方式啊!!
csv : comma separated value
所以資料之間是以 逗號 區隔,因此要在gnuplot script裡加一行set datafile separator ","
才讀的到資料
抖的超厲害!
取樣從N=1000~N=250000,間隔1000
隔一天跑出來的結果差好多@@
omp_4沒那麼劇烈了,還不知道為甚麼會這樣
新增Leibniz
Time
OpenMP
AVX
system embedded
HW1-3