日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Xilinx ZYNQ Ultrascale+ 性能测试之 Memory Stream

發(fā)布時(shí)間:2023/12/14 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Xilinx ZYNQ Ultrascale+ 性能测试之 Memory Stream 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

John McCalpin “Memory Bandwidth and Machine Balance in High
Performance Computers”, IEEE TCCA Newsletter, December 1995
http://www.cs.virginia.edu/stream/

Xilinx 4EV 上用自帶LMBENCH測試結(jié)果如下:

# stream STREAM copy latency: 3.84 nanoseconds STREAM copy bandwidth: 4168.29 MB/sec STREAM scale latency: 7.07 nanoseconds STREAM scale bandwidth: 2261.80 MB/sec STREAM add latency: 10.24 nanoseconds STREAM add bandwidth: 2343.75 MB/sec STREAM triad latency: 12.64 nanoseconds STREAM triad bandwidth: 1899.34 MB/sec

意義如下:

STREAM: measure memory bandwidth with the operations:
– Copy: a(i) = b(i)
– Scale: a(i) = s * b(i)
– Add: a(i) = b(i) + c(i)
– Triad: a(i) = b(i) + s * c(i)

LMBENCH 的其他測試結(jié)果如下

# mhz 1199 MHz, 0.8340 nanosec clock # tlb tlb: 10 pages # par_ops integer bit parallelism: 2.65 integer add parallelism: 1.82 integer div parallelism: 1.00 integer mod parallelism: 2.27 int64 bit parallelism: 1.24 int64 add parallelism: 1.82 int64 div parallelism: 1.00 int64 mod parallelism: 1.93 float add parallelism: 7.86 float mul parallelism: 7.90 float div parallelism: 1.30 double add parallelism: 7.86 double mul parallelism: 7.90 double div parallelism: 1.16 #lat_unix AF_UNIX sock stream latency: 16.0409 microseconds

自己下載 stream.c
編譯 aarch64-linux-gnu-gcc -O -fopenmp -DNTIME=20 -DSTREAM_ARRAY_SIZE=120000000 stream.c -o stream
拷貝 libgomp.so.1 到 系統(tǒng)中,系統(tǒng)總內(nèi)存4GByte
運(yùn)行結(jié)果如下

# OMP_NUM_THREADS=4 ./stream ------------------------------------------------------------- STREAM version $Revision: 5.10 $ ------------------------------------------------------------- This system uses 8 bytes per array element. ------------------------------------------------------------- Array size = 120000000 (elements), Offset = 0 (elements) Memory per array = 915.5 MiB (= 0.9 GiB). Total memory required = 2746.6 MiB (= 2.7 GiB). Each kernel will be executed 10 times.The *best* time for each kernel (excluding the first iteration)will be used to compute the reported bandwidth. ------------------------------------------------------------- Number of Threads requested = 4 Number of Threads counted = 4 ------------------------------------------------------------- Your clock granularity/precision appears to be 1 microseconds. Each test below will take on the order of 279443 microseconds.(= 279443 clock ticks) Increase the size of the arrays if this shows that you are not getting at least 20 clock ticks per test. ------------------------------------------------------------- WARNING -- The above is only a rough guideline. For best results, please be sure you know the precision of your system timer. ------------------------------------------------------------- Function Best Rate MB/s Avg time Min time Max time Copy: 8622.3 0.224413 0.222678 0.226238 Scale: 7985.3 0.243725 0.240443 0.249241 Add: 6930.9 0.419123 0.415530 0.424046 Triad: 6526.6 0.442527 0.441268 0.443724 ------------------------------------------------------------- Solution Validates: avg error less than 1.000000e-13 on all three arrays -------------------------------------------------------------

如果編譯的時(shí)候加上 -O2 優(yōu)化,速度會快一點(diǎn)

# OMP_NUM_THREADS=4 ./stream ------------------------------------------------------------- STREAM version $Revision: 5.10 $ ------------------------------------------------------------- This system uses 8 bytes per array element. ------------------------------------------------------------- Array size = 120000000 (elements), Offset = 0 (elements) Memory per array = 915.5 MiB (= 0.9 GiB). Total memory required = 2746.6 MiB (= 2.7 GiB). Each kernel will be executed 10 times.The *best* time for each kernel (excluding the first iteration)will be used to compute the reported bandwidth. ------------------------------------------------------------- Number of Threads requested = 4 Number of Threads counted = 4 ------------------------------------------------------------- Your clock granularity/precision appears to be 1 microseconds. Each test below will take on the order of 278242 microseconds.(= 278242 clock ticks) Increase the size of the arrays if this shows that you are not getting at least 20 clock ticks per test. ------------------------------------------------------------- WARNING -- The above is only a rough guideline. For best results, please be sure you know the precision of your system timer. ------------------------------------------------------------- Function Best Rate MB/s Avg time Min time Max time Copy: 9413.4 0.205417 0.203965 0.207202 Scale: 7896.5 0.248300 0.243145 0.253207 Add: 7482.3 0.385689 0.384909 0.387379 Triad: 6004.8 0.481600 0.479614 0.483516 ------------------------------------------------------------- Solution Validates: avg error less than 1.000000e-13 on all three arrays -------------------------------------------------------------

如果開4個(gè)線程,CPU占 100%,單線程占 25%,速度要下降一半

4K60的每秒數(shù)據(jù)為 3840 * 2160 * 60=497664000=475M
每個(gè)像素按YUV422,占 16bit = 2Byte,拷貝一次帶寬需要 950MByte/s

總結(jié)

以上是生活随笔為你收集整理的Xilinx ZYNQ Ultrascale+ 性能测试之 Memory Stream的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。