| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1156 人关注过本帖
标题:memory, cache bandwidth 的测量问题,跪求c语言高手
只看楼主 加入收藏
momoweiwei
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-10-22
收藏
 问题点数:0 回复次数:6 
memory, cache bandwidth 的测量问题,跪求c语言高手
My laptop takes at least 1 minute to boot up and let me login and another minute before I can do any useful work!!  Let’s find out how much data it can move around in that time!  Write a program to measure the effective memory bandwidth in each processor for different levels of the memory hierarchy
L1 cache
L2 cache
Main memory
Disc
Report results as Mbytes/second or latency in cycles (or both!)
How much data could be moved around in the boot up process?
搜索更多相关主题的帖子: memory cache c语言 bandwidth 
2008-10-22 05:50
momoweiwei
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-10-22
收藏
得分:0 
这是哥们的最后一个作业了,哪位高手帮忙一下啊。
2008-10-22 05:52
momoweiwei
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-10-22
收藏
得分:0 
用c语言写,可是哥们一点idea都没有啊
2008-10-22 05:55
momoweiwei
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-10-22
收藏
得分:0 
老师给了段code,可是我不是很明白。

#include <time.h>

long t1, n; int x, *a, sum;
double dt;
a = malloc( finish*sizeof(int) );
sum = 0;
for(n=start;n+=step;n<=finish) {
  t1 = clock();
   for(k=0;k<n;k++) {
    sum += a[k];   }
  dt = ((double)(clock() – t1))/CLOCKS_PER_SEC;
  printf(“%d %f %f\n”, n, dt, dt/n);
  }
printf(“sum = %d\n”, sum);
}
2008-10-22 06:00
lzhe020
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-10-22
收藏
得分:0 
网上有许多测试结果,可是没有供测试的code
2008-10-22 06:05
momoweiwei
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-10-22
收藏
得分:0 
哪位高手回答一下啊
2008-10-22 12:28
momoweiwei
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-10-22
收藏
得分:0 
谁会啊?
2008-10-22 13:45
快速回复:memory, cache bandwidth 的测量问题,跪求c语言高手
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018546 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved