我正进入(状态
g++ -O3 cache-l1-line.cpp -o cache-l1-line -lrt
cache-l1-line.cpp: In function 'int main()':
cache-l1-line.cpp:33:58: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat]
在我的学校 sunfire 服务器上......但不是我的机器(Arch Linux)。为什么会这样。有问题的行似乎是
printf("%d, %1.2f \n", i * sizeof(int), totalTime/TIMES);
我定义的地方:
for (int i = 4; i <= MAX_STRIDE/sizeof(int); i*=2) {
什么问题:GitHub上的完整源代码(链接到修订)