Stream使用教程
现在,计算机CPU运行速度的快速发展已经远远超过了内存的访问速度。越来越多的程序性能被内存带宽所限制,而不是计算机的CPU运行速率。
Stream benchmark是一个简单的合成基准测试程序,衡量内存带宽(MB /秒)和相应的内核向量的计算速度。
Each of the four tests adds independent information to the results:
1. “copy”:在没有算术的衡量传输速率;
2. “Scale”
``Copy'' measures transfer rates in the absence of arithmetic.
``Scale'' adds a 易做图 arithmetic operation.
``Sum'' adds a third operand to allow multiple load/store ports on vector machines to be tested.
``Triad'' allows chained/overlapped/fused multiply/add operations.
[root@RedHat stream]# make
gcc -O2 stream.c -o stream
[root@RedHat stream]# ls
Makefile stream stream.c stream.f
[root@RedHat stream]# ./stream
-------------------------------------------------------------
STREAM version $Revision: 5.9 $
-------------------------------------------------------------
This system uses 8 bytes per DOUBLE PRECISION word.
-------------------------------------------------------------
Array size = 2000000, Offset = 0
Total memory required = 45.8 MB.
Each test is run 10 times, but only
the *best* time for each is used.
-------------------------------------------------------------
Printing one line per active thread....
-------------------------------------------------------------
Your clock granularity/precision appears to be 6 microseconds.
Each test below will take on the order of 17340 microseconds.
(= 2890 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 Rate (MB/s) Avg time Min time Max time
Copy: 2264.0171 0.0154 0.0141 0.0169
Scale: 2212.8422 0.0154 0.0145 0.0164
Add: 2936.3309 0.0196 0.0163 0.0214
Triad: 2673.8123 0.0199 0.0180 0.0216
-------------------------------------------------------------
Solution Validates
-------------------------------------------------------------
[root@RedHat stream]#
补充:综合编程 , 其他综合 ,