Main memory bandwidth measurement

*爱你&永不变心* 提交于 2019-12-05 21:59:28

I can't comment on the effectiveness of bcopy, but the most straightforward approach is the second method you stated (with a stride of 1). Additionally, you are confusing bits with bytes in your memory bandwidth equation. 32 bits = 4bytes. Modern computers use 64 bit wide memory buses. So your effective transfer rate (assuming DDR3 tech)

1333Mhz * 64bit/(8bits/byte) = 10666MB/s (also classified as PC3-10666)

The 1333Mhz already has the 2 transfer/clock factored in.

Check out the wiki page for more info: http://en.wikipedia.org/wiki/DDR3_SDRAM

Regarding your results, try again with the array access. Malloc 1GB and traverse the entire thing. You can sum each element of the array and print it out so your compiler doesn't think it's dead code.

Something like this:

double time;
int size = 1024*1024*1024;
int sum;
*char *array = (char*)malloc(size);
//start timer here
for(int i=0; i < size; i++)
  sum += array[i];
//end timer
printf("time taken: %f \tsum is %d\n", time, sum);
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!