如何用stream工具测试内存memory性能?

前言

  Stream是业界主流的内存带宽测试程序,测试行为相对简单可控。该程序对CPU的计算能力要求很小,对CPU内存带宽压力很大。

如何使用 

  1、下载工具 

git clone https://github.com/jeffhammond/STREAM  # 国外镜像
git clone https://github.91chi.fun/https://github.com/jeffhammond/STREAM.git # 国内加速镜像

   2、编译(需要有gcc)

gcc -O3 -mcmodel=medium  -mtune=native -march=native -fopenmp -DSTREAM_ARRAY_SIZE=200000000 -DNTIMES=30 stream.c -o stream

  如果出现下面的error:

...
stream.c:(.text+0x84): relocation truncated to fit: R_X86_64_PC32 against `.bss'
...

  就更换模型参数

-mcmodel=medium #可以选择的参数有large medium small 一般内存大于2G的用medium

   3.执行

./stream

   4.查看结果

 

 

参考资料1:https://www.cnblogs.com/sky-heaven/p/16356702.html

参考资料2 :https://blog.csdn.net/Ivan804638781/article/details/114018317

参数说明-参考资料3:https://www.brinnatt.com/projects/%E7%AC%AC-2-%E7%AB%A0-stream-%E5%86%85%E5%AD%98%E6%B5%8B%E8%AF%95/

posted @ 2022-08-03 10:58  o蹲蹲o  阅读(1476)  评论(0编辑  收藏  举报