复旦大学软件学院计算机系统课件 Memory Hierarchy (IV).pptVIP

  • 5
  • 0
  • 约8.95千字
  • 约 38页
  • 2019-05-06 发布于广东
  • 举报

复旦大学软件学院计算机系统课件 Memory Hierarchy (IV).ppt

* * * * * * * * * * * * * * * Memory mountain test function /* The test function */ void test (int elems, int stride) { int i ; double result = 0.0 ; volatile double sink; for (i = 0; i elems; i += stride) result += data[i]; sink = result; /* So compiler doesnt optimize away the loop */ } * Memory mountain test function /* Run test (elems, stride) and return read throughput (MB/s) */ double run (int size, int stride, double Mhz) { double cycles; int elems = size / sizeof(double); test (elems, stride); /* warm up the cache */ c

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档