小编yee*_*eha的帖子

STREAM内存带宽基准测试真正衡量了什么?

我对STREAM(http://www.cs.virginia.edu/stream/ref.html#runrules)基准测试有一些疑问。

  1. 以下是来自stream.c的评论。关于数组应为缓存大小的4倍的要求的基本原理是什么?
 *       (a) Each array must be at least 4 times the size of the
 *           available cache memory. I don't worry about the difference
 *           between 10^6 and 2^20, so in practice the minimum array size
 *           is about 3.8 times the cache size.
Run Code Online (Sandbox Code Playgroud)
  1. 我最初假设STREAM测量峰值内存带宽。但是后来我发现,当我添加额外的数组和数组访问权限时,可以获得更大的带宽。因此,在我看来,STREAM无法保证饱和内存带宽。然后我的问题是STREAM真正衡量了什么,您如何使用STREAM报告的数字?

例如,我添加了两个额外的数组,并确保将它们与原始a / b / c数组一起访问。我相应地修改了字节记帐。使用这两个额外的阵列,我的带宽数量增加了约11.5%。

> diff stream.c modified_stream.c
181c181,183
<                       c[STREAM_ARRAY_SIZE+OFFSET];
---
>                       c[STREAM_ARRAY_SIZE+OFFSET],
>                       e[STREAM_ARRAY_SIZE+OFFSET],
>                       d[STREAM_ARRAY_SIZE+OFFSET];
192,193c194,195
<     3 * sizeof(STREAM_TYPE) * STREAM_ARRAY_SIZE,
<     3 * sizeof(STREAM_TYPE) * …
Run Code Online (Sandbox Code Playgroud)

benchmarking cpu-architecture microbenchmark memory-bandwidth

4
推荐指数
2
解决办法
429
查看次数